Repository navigation
bugfix: table alias failed for update & delete if SQLA's quote_char was set - #25
Merged
Merged
Conversation
…as set. Prior to version 1.44 of SQL::Abstract::More, specifying a table alias as "$table_name|$table_alias" was supported only for select, not for delete or update. DBIx::Lite worked around this by calling SQLA::M's table_alias method, which returns a string of "$table_name as $table_alias" If SQLA's quote_char option is set, this entire construct is quoted, rather than just $table_name, leading to illegal SQL. This commit will use the "$name|$alias" form if SQLA::M is version 1.44 or higher.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to version 1.44 of
SQL::Abstract::More,specifying a table alias as"$table_name|$table_alias"was supported only forselect,not fordeleteorupdate.DBIx::Liteworked around this by calling SQLA::M'stable_aliasmethod, which returns a string of"$table_name as $table_alias"
If SQLA's
quote_charoption is set, this entire construct is quoted, rather than just$table_name,leading to illegal SQL.This commit will use the
"$name|$alias"form if SQLA::M is version 1.44 or higher.Please Note, this fix will not completely fix issues with quoting; there are fixes to
SQL::Abstract::Morethat need to be applied as well. So far, this commit seems to be the only changed required toDBIx::Lite, but I haven't performed exhaustive testing.