database icon indicating copy to clipboard operation
database copied to clipboard

Columns use quote parsing to cause SQL error

Open zaishui15 opened this issue 3 years ago • 0 comments

No duplicates 🥲.

  • [X] I have searched for a similar issue in our bug tracker and didn't find any solutions.

Database

MySQL

What happened?

I have the query columns a bug happened!

$result = $database
    ->select([
        'table1.id as t.id'
    ])
    ->from('table1')
    ->fetchAll();

I need this result

select `table1`.`id` as `t.id` from `table1`;

The actual result is

select `table1`.`id` as `t`.`id` from `table1`;

Result in query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

Version

database 2.0
PHP 8.1

zaishui15 avatar Sep 29 '22 09:09 zaishui15