Skip to content

Conversation

@endelwar
Copy link

@endelwar endelwar commented Feb 17, 2025

This PR fixes an issue in the generateSqlTableAlias function where table names that are reserved words in MySQL (e.g., group or user) or simply enclosed in backticks were not properly handled.

Table names that are reserved words must be enclosed in backticks (e.g., $this->setTableName('`group`'); in the model definition). However, this backtick was incorrectly used as the initial letter for the alias (e.g., SELECT Group g), causing unexpected behavior.

This PR ensures that reserved table names can be correctly enclosed in backticks without affecting alias generation.

@jaydiablo
Copy link
Member

I pulled this into #381 which added a test case for this behavior and merged that.

Thanks!

@jaydiablo jaydiablo closed this May 27, 2025
@endelwar
Copy link
Author

Thanks to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants