You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried these 2 tests and each one makes a different SQL.
The only difference on the source code is one blank space on the second row, after the DECODE statement.
Based on classic ZF1, the result should be the same as TEST1 on both cases.
SELECT "ABC"."FIRST_INFO" AS "first_info", "ABC"."DECODE(TEST_COLUMN,'0','VAR_0','1','VAR_1','2','VAR_2',NULL) " AS "second_info" FROM "TEST_TABLE" "ABC"
The text was updated successfully, but these errors were encountered:
This happened using OracleSQL so actually it's not a MSSQL only problem.
I have been doing some research of the source code and it seems that the problem lies in this part of the Zend\Db\Select.php _tableCols() method.
// Check for columns that look like functions and convert to Zend_Db_Expr
if (preg_match(self::REGEX_COLUMN_EXPR, (string) $col)) {
Changing self:REGEX_COLUMN_EXPR to the same pattern as classic ZF1 seems to fix the problem.
// Check for columns that look like functions and convert to Zend_Db_Expr
//if (preg_match('/\(.*\)/', (string) $col)) {
But I believe the new pattern is used to prevent SQL injections so returning to the old pattern is not a good solution.
Hello, I hope that someone can help with this.
I have tried these 2 tests and each one makes a different SQL.
The only difference on the source code is one blank space on the second row, after the DECODE statement.
Based on classic ZF1, the result should be the same as TEST1 on both cases.
TEST1
TEST2
The text was updated successfully, but these errors were encountered: