ARRAY[...] expression raises syntax error because of Translation
groupnet opened this issue · comments
Jürgen Kurzmann commented
Version: 4.1.3
Bug Description
An Uncaught Dibi\\DriverException: syntax error ...
is raised, when selecting a simple ARRAY[...]
in Postgresql.
The expression ARRAY[1,2]
is translated to ARRAY "1,2"
I guess by this regex:
Line 109 in ff1c9fa
Steps To Reproduce
$database->query('SELECT ARRAY[1,2]');
Expected Behavior
No translation of ARRAY[...]
expressions
Possible Solution
Couldn't solve it. Quick'n'dirty workaround is to remove the square bracket [
from line 89, to skip translation:
Line 89 in ff1c9fa
Jan Pecha commented
Try use %SQL
modifier or $connection->literal('ARRAY[1,2]')
.
Jürgen Kurzmann commented
Works - thanks for the help!