Open planegood opened 10 months ago
This is MSSQL related, pls?
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