From 3551cd32a8df667e1257ae5118873b5d1ef1b631 Mon Sep 17 00:00:00 2001 From: willhan <526786050@qq.com> Date: Tue, 16 Apr 2019 22:10:05 +0800 Subject: MDEV-17508 Fix bug for spider when using "not like" fix bug for spider where using "not like" (#890) test case: t1 is a spider engine table; CREATE TABLE `t1` ( `id` int(11) NOT NULL DEFAULT '0', `name` char(64) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=SPIDER query: "select * from t1 where name not like 'x%' " would dispatch "select xxx name name like 'x%' " to remote mysqld, is wrong --- sql/item_cmpfunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item_cmpfunc.h') diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 0a5abfe6273..613fb75bcd6 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1899,7 +1899,6 @@ class Item_func_like :public Item_bool_func2 bool escape_used_in_parsing; bool use_sampling; - bool negated; DTCollation cmp_collation; String cmp_value1, cmp_value2; @@ -1916,6 +1915,7 @@ protected: Item_func::Functype type, Item *value); public: int escape; + bool negated; Item_func_like(THD *thd, Item *a, Item *b, Item *escape_arg, bool escape_used): Item_bool_func2(thd, a, b), canDoTurboBM(FALSE), pattern(0), pattern_len(0), -- cgit v1.2.1 From 246e2ae12b514ed3010ffcf6473abbfd9f648340 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 4 Dec 2019 20:04:45 +0530 Subject: MDEV-20900: IN predicate to IN subquery conversion causes performance regression Disable the IN predicate to IN subquery conversion when the types on the left and right hand side of the IN predicate are not of comparable type. --- sql/item_cmpfunc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/item_cmpfunc.h') diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 24a9991640a..29c32be1c80 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -2418,6 +2418,7 @@ public: bool to_be_transformed_into_in_subq(THD *thd); bool create_value_list_for_tvc(THD *thd, List< List > *values); Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg); + uint32 max_length_of_left_expr(); }; class cmp_item_row :public cmp_item -- cgit v1.2.1