Syntax error on Load if column is a reserved word (on more recent MariaDB)
herbdool opened this issue · 5 comments
Earlier versions of MariaDB were more forgiving, but now I'm getting a syntax error because I have a column that is a reserved word. Oops. The quick fix is to change the column name, but I thought I'd bring it up here so that php-etl could put backticks around columns when creating the queries. This may avoid the error.
Thank you for your feedback. Indeed that something we should consider.
I add it to the todo list.
Which version of MariaDB are you using?
MariaDB 10.6
I think the following changes solve this issue:
-
php-etl/src/Database/Statement.php
Line 73 in 9ea73da
$columns = $this->implode($columns, '`{column}`');
-
php-etl/src/Database/Statement.php
Line 89 in 9ea73da
$columns = $this->implode($columns, '`{column}`');`
-
php-etl/src/Database/Statement.php
Line 103 in 9ea73da
$columns = $this->implode($columns, '`{column}` = :{column}');`