-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #6792, use a simpler composite in condition implementation #7055
fixes #6792, use a simpler composite in condition implementation #7055
Conversation
…on on dbs other than pgsql
It works well for MySQL 5.1 and above. See http://sqlfiddle.com/#!2/72132/4/0 |
Right, somehow I didn't find it in the docs before and didn't actually run the query. Should we test other databases before deciding which implementation should be default? For reference, it's the Now it occured to me that maybe a more verbose |
Yes, we should test other DBMS (sqlfiddle should allow us to try different DBMS, but I didn't have time to try them). |
…omposite in condition with a subquery
After some research, I've updated the PR and here are my findings. Only MSSQL and SQLite doesn't support this notation. References:
The composite The solution would be to build a |
@@ -1067,22 +1067,7 @@ public function buildInCondition($operator, $operands, &$params) | |||
} | |||
|
|||
if ($values instanceof Query) { | |||
// sub-query | |||
list($sql, $params) = $this->build($values, $params); | |||
$column = (array) $column; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug, making the else
part below never to execute. I've removed this cast.
Good job! |
Thank you for your excellent work! |
Changes Unknown when pulling d87f636 on nineinchnick:composite-in-condition-fix-6792 into * on yiisoft:master*. |
The
(a,b) IN ((1,2))
notation is not supported by MySQL/MariaDB and SQLite, only PostgreSQL.fixes #6792