cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
54 stars 23 forks source link

🐛 Select / Columns alias bug with prefix #99

Closed WebCimes closed 1 year ago

WebCimes commented 1 year ago

No duplicates 🥲.

Database

MySQL

What happened?

I have a bug when I try to use alias on select or column, the "prefix" is added wrongly to the field. I have try with select and column and the same bug happend, but it's works well with alias on form.

Example : $select = $dbal->database('default')->select()->from('col as c')->columns(['id_col as id']); $sqlStatement = $select->sqlStatement();

Result: SELECT myprefix_id_col AS id FROM myprefix_col AS c

So I don't know why the query get "myprefix_id_col" instead of "id_col" in the SELECT.

Thanks

Version

database 2.4
PHP 8.0.13
roxblnfk commented 1 year ago

Fixed in v2.4.1 Thanks.