Mysql> select * from (select c1, := 1) as r from t1, (select := 0) as b) as q where q. Type '\c' to clear the current input statement.ĮRROR 1231 (42000): Variable 'optimizer_switch' can't be set to the value of 'derived_condition_pushdown=off' Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and/or itsĪffiliates. How to repeat: mysql> create table t1 (c1 int) Query OK, 0 rows affected (0.01 sec) mysql> insert into t1 values (100), (200), (300), (400), (500) Query OK, 5 rows affected (0.00 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> select from (select c1, (rownumr : rownumr 1) as r from t1, (select rownumr : 0) as b) as q where q.c1. Server version: 8.0.11 MySQL Community Server - GPLĬopyright (c) 2000, 2018, Oracle and/or its affiliates. MySQL Verification Team - Lowest version checked 8.0.11īin/mysql -uroot -S /tmp/mysql_ushastry.sock -local-infile Variable 'optimizer_switch' can't be set to the value of 'derived_condition_pushdown=off' 5.7/5.6 - Not repro and even can't set derived_condition_pushdown=off ', or 'SELECT expression(s) INTO variables(s)'. Consider alternatives: 'SET variable=expression. Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Set optimizer_switch="derived_condition_pushdown=off" Select * from (select c1, := 1) as r from t1, (select := 0) as b) as q where q.c1 = 300 In `TABLE_LIST::can_push_condition_to_derived(THD *thd)`, we can check the whether `Query_block` has user variables, add a member variables `has_user_vars` to `Query_block`. Mysql> set optimizer_switch="derived_condition_pushdown=off" When turns off the derived_condition_pushdown switch in optimzier_switch, it got the right result. Mysql> select * from (select c1, := 1) as r from t1, (select := 0) as b) as q where q.c1 = 300 Derived condition pushdown rewrite seems like it ignores the situation query block has user variables.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |