Skip to content

bugfix: table alias failed for update & delete if SQLA's quote_char was set - #25

Merged
alranel merged 1 commit into
alranel:masterfrom
djerius:table_alias
May 4, 2026
Merged

alranel merged 1 commit into
alranel:masterfrom
djerius:table_alias

Conversation

@djerius

@djerius djerius commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

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.

Please Note, this fix will not completely fix issues with quoting; there are fixes to SQL::Abstract::More that need to be applied as well. So far, this commit seems to be the only changed required to DBIx::Lite, but I haven't performed exhaustive testing.

…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.
@alranel
alranel merged commit 5228110 into alranel:master May 4, 2026
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