sql-parser
sql-parser copied to clipboard
Parser does not recognize single character table name or alias
When using a single character as a table alias or name, the table.column names are not properly recognized
For example, this SQL:
SELECT x.asset_id FROM
(SELECT evt.asset_id FROM evt) x
is incorrectly parsed into:
(
[0] => PhpMyAdmin\SqlParser\Components\Expression Object
(
[database] =>
[table] =>
[column] =>
[expr] => x.asset_id
[alias] =>
[function] =>
[subquery] =>
)
)
But this works:
SELECT xx.asset_id FROM
(SELECT evt.asset_id FROM evt) xx
parser result:
(
[0] => PhpMyAdmin\SqlParser\Components\Expression Object
(
[database] =>
[table] => xx
[column] => asset_id
[expr] => xx.asset_id
[alias] =>
[function] =>
[subquery] =>
)
)
Thank you for reporting this issue !
Fixed by #385 Similar to #378