diff options
-rw-r--r-- | client/Makefile.am | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | extra/yassl/include/openssl/generate_prefix_files.pl | 0 | ||||
-rw-r--r-- | mysql-test/r/partition_pruning.result | 27 | ||||
-rw-r--r-- | mysql-test/r/select.result | 10 | ||||
-rw-r--r-- | mysql-test/t/disabled.def | 1 | ||||
-rw-r--r-- | mysql-test/t/partition_pruning.test | 26 | ||||
-rw-r--r-- | mysql-test/t/select.test | 19 | ||||
-rw-r--r-- | mysql-test/t/view.test | 2 | ||||
-rw-r--r-- | scripts/make_sharedlib_distribution.sh | 6 | ||||
-rw-r--r-- | scripts/make_win_src_distribution.sh | 1 | ||||
-rw-r--r-- | sql/opt_range.cc | 11 | ||||
-rw-r--r-- | sql/sql_base.cc | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 3 | ||||
-rw-r--r-- | sql/sql_select.cc | 12 |
14 files changed, 113 insertions, 22 deletions
diff --git a/client/Makefile.am b/client/Makefile.am index 4d8d95d19ed..ff97243815a 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -83,13 +83,13 @@ link_sources: for f in $(sql_src) ; do \ rm -f $$f; \ @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \ - done; - for f in $(strings_src) ; do \ - rm -f $(srcdir)/$$f; \ - @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \ - done; - -rm -f $(srcdir)/my_user.c; - @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c + done; \ + for f in $(strings_src) ; do \ + rm -f $(srcdir)/$$f; \ + @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \ + done; \ + rm -f $(srcdir)/my_user.c; \ + @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c; # Don't update the files from bitkeeper diff --git a/extra/yassl/include/openssl/generate_prefix_files.pl b/extra/yassl/include/openssl/generate_prefix_files.pl index b921ee11e9a..b921ee11e9a 100644..100755 --- a/extra/yassl/include/openssl/generate_prefix_files.pl +++ b/extra/yassl/include/openssl/generate_prefix_files.pl diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 405cc3e6e25..950a83c6d4f 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -670,3 +670,30 @@ select * from t1 where a like 'n%'; a na drop table t1; +create table t1 (s1 varchar(15)) partition by key (s1); +select * from t1 where s1 = 0 or s1 is null; +s1 +insert into t1 values ('aa'),('bb'),('0'); +explain partitions select * from t1 where s1 = 0 or s1 is null; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where +drop table t1; +create table t2 (a int, b int) +partition by LIST(a) +subpartition by HASH(b) subpartitions 40 +( partition p_0_long_partition_name values in(1), +partition p_1_long_partition_name values in(2)); +insert into t2 values (1,1),(2,2); +explain partitions select * from t2; +id 1 +select_type SIMPLE +table t2 +partitions p_0_long_partition_name_p_0_long_partition_namesp0,p_0_long_partition_name_p_0_long_partition_namesp1,p_0_long_partition_name_p_0_long_partition_namesp2,p_0_long_partition_name_p_0_long_partition_namesp3,p_0_long_partition_name_p_0_long_partition_namesp4,p_0_long_partition_name_p_0_long_partition_namesp5,p_0_long_partition_name_p_0_long_partition_namesp6,p_0_long_partition_name_p_0_long_partition_namesp7,p_0_long_partition_name_p_0_long_partition_namesp8,p_0_long_partition_name_p_0_long_partition_namesp9,p_0_long_partition_name_p_0_long_partition_namesp10,p_0_long_partition_name_p_0_long_partition_namesp11,p_0_long_partition_name_p_0_long_partition_namesp12,p_0_long_partition_name_p_0_long_partition_namesp13,p_0_long_partition_name_p_0_long_partition_namesp14,p_0_long_partition_name_p_0_long_partition_namesp15,p_0_long_partition_name_p_0_long_partition_namesp16,p_0_long_partition_name_p_0_long_partition_namesp17,p_0_long_partition_name_p_0_long_partition_namesp18,p_0_long_partition_name_p_0_long_partition_namesp19,p_0_long_partition_name_p_0_long_partition_namesp20,p_0_long_partition_name_p_0_long_partition_namesp21,p_0_long_partition_name_p_0_long_partition_namesp22,p_0_long_partition_name_p_0_long_partition_namesp23,p_0_long_partition_name_p_0_long_partition_namesp24,p_0_long_partition_name_p_0_long_partition_namesp25,p_0_long_partition_name_p_0_long_partition_namesp26,p_0_long_partition_name_p_0_long_partition_namesp27,p_0_long_partition_name_p_0_long_partition_namesp28,p_0_long_partition_name_p_0_long_partition_namesp29,p_0_long_partition_name_p_0_long_partition_namesp30,p_0_long_partition_name_p_0_long_partition_namesp31,p_0_long_partition_name_p_0_long_partition_namesp32,p_0_long_partition_name_p_0_long_partition_namesp33,p_0_long_partition_name_p_0_long_partition_namesp34,p_0_long_partition_name_p_0_long_partition_namesp35,p_0_long_partition_name_p_0_long_partition_namesp36,p_0_long_partition_name_p_0_long_partition_namesp37,p_0_long_partition_name_p_0_long_partition_namesp38,p_0_long_partition_name_p_0_long_partition_namesp39,p_1_long_partition_name_p_1_long_partition_namesp0,p_1_long_partition_name_p_1_long_partition_namesp1,p_1_long_partition_name_p_1_long_partition_namesp2,p_1_long_partition_name_p_1_long_partition_namesp3,p_1_long_partition_name_p_1_long_partition_namesp4,p_1_long_partition_name_p_1_long_partition_namesp5,p_1_long_partition_name_p_1_long_partition_namesp6,p_1_long_partition_name_p_1_long_partition_namesp7,p_1_long_partition_name_p_1_long_partition_namesp8,p_1_long_partition_name_p_1_long_partition_namesp9,p_1_long_partition_name_p_1_long_partition_namesp10,p_1_long_partition_name_p_1_long_partition_namesp11,p_1_long_partition_name_p_1_long_partition_namesp12,p_1_long_partition_name_p_1_long_partition_namesp13,p_1_long_partition_name_p_1_long_partition_namesp14,p_1_long_partition_name_p_1_long_partition_namesp15,p_1_long_partition_name_p_1_long_partition_namesp16,p_1_long_partition_name_p_1_long_partition_namesp17,p_1_long_partition_name_p_1_long_partition_namesp18,p_1_long_partition_name_p_1_long_partition_namesp19,p_1_long_partition_name_p_1_long_partition_namesp20,p_1_long_partition_name_p_1_long_partition_namesp21,p_1_long_partition_name_p_1_long_partition_namesp22,p_1_long_partition_name_p_1_long_partition_namesp23,p_1_long_partition_name_p_1_long_partition_namesp24,p_1_long_partition_name_p_1_long_partition_namesp25,p_1_long_partition_name_p_1_long_partition_namesp26,p_1_long_partition_name_p_1_long_partition_namesp27,p_1_long_partition_name_p_1_long_partition_namesp28,p_1_long_partition_name_p_1_long_partition_namesp29,p_1_long_partition_name_p_1_long_partition_namesp30,p_1_long_partition_name_p_1_long_partition_namesp31,p_1_long_partition_name_p_1_long_partition_namesp32,p_1_long_partition_name_p_1_long_partition_namesp33,p_1_long_partition_name_p_1_long_partition_namesp34,p_1_long_partition_name_p_1_long_partition_namesp35,p_1_long_partition_name_p_1_long_partition_namesp36,p_1_long_partition_name_p_1_long_partition_namesp37,p_1_long_partition_name_p_1_long_partition_namesp38,p_1_long_partition_name_p_1_long_partition_namesp39 +type ALL +possible_keys NULL +key NULL +key_len NULL +ref NULL +rows 2 +Extra +drop table t2; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 63693db56aa..d47d49b5298 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2716,6 +2716,16 @@ select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 fro f1 f2 1 1 drop table t1,t2; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 203471ba370..96f31133e65 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -15,6 +15,7 @@ #events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked. im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly +im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog #ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index 0c922392d32..976466e1578 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -556,7 +556,7 @@ drop table t1; # being fixed. # -#BUG 17946 Like searches fail with partitioning +# BUG#17946 Like searches fail with partitioning # create table t1 (a char(32) primary key) partition by key() @@ -566,3 +566,27 @@ select * from t1; select * from t1 where a like 'n%'; drop table t1; + +# BUG#19055 Crashes for varchar_col=NUMBER or varchar_col IS NULL +create table t1 (s1 varchar(15)) partition by key (s1); +select * from t1 where s1 = 0 or s1 is null; +insert into t1 values ('aa'),('bb'),('0'); +explain partitions select * from t1 where s1 = 0 or s1 is null; +drop table t1; + +# +# BUG#19684: EXPLAIN PARTITIONS produces garbage in 'partitions' column when +# the length of string to be displayed exceeds some limit. +create table t2 (a int, b int) + partition by LIST(a) + subpartition by HASH(b) subpartitions 40 +( partition p_0_long_partition_name values in(1), + partition p_1_long_partition_name values in(2)); + +insert into t2 values (1,1),(2,2); + +--vertical_results +explain partitions select * from t2; +--horizontal_results +drop table t2; + diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 69b80bf0243..8cd15463c62 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1296,9 +1296,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; # The next should give an error # ---error 1176 +-- error 1176 explain select fld3 from t2 ignore index (fld3,not_used); ---error 1176 +-- error 1176 explain select fld3 from t2 use index (not_used); # @@ -2264,6 +2264,21 @@ insert into t2 values(1,1); select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); drop table t1,t2; +# +# Bug #17873: confusing error message when IGNORE INDEX refers a column name +# + +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); + +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +--error 1176 +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +--error 1176 +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); + +DROP TABLE t1; + # End of 4.1 tests # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index e1b4e6067db..0db97f6d4af 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -516,7 +516,7 @@ drop table t1; # create table t1 (a int, b int); create view v1 as select a, sum(b) from t1 group by a; ---error 1176 +-- error 1176 select b from v1 use index (some_index) where b=1; drop view v1; drop table t1; diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh index fbc945e445a..c475d0e14a4 100644 --- a/scripts/make_sharedlib_distribution.sh +++ b/scripts/make_sharedlib_distribution.sh @@ -45,9 +45,11 @@ fi mkdir -p $BASE/lib for i in \ - libmysql/.libs/libmysqlclient.s{l,o}* \ + libmysql/.libs/libmysqlclient.so* \ + libmysql/.libs/libmysqlclient.sl* \ libmysql/.libs/libmysqlclient*.dylib \ - libmysql_r/.libs/libmysqlclient_r.s{l,o}* \ + libmysql_r/.libs/libmysqlclient_r.so* \ + libmysql_r/.libs/libmysqlclient_r.sl* \ libmysql_r/.libs/libmysqlclient_r*.dylib do if [ -f $i ] diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b070e30c5c7..6883719cbe4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -343,6 +343,7 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp find $BASE \( -name "*.cnf" -o -name "*.ini" \ -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.dsp" -o -name "*.dsw" \ -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c905d8aada7..7fa47b0b005 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -374,6 +374,12 @@ public: keys_map.clear_all(); bzero((char*) keys,sizeof(keys)); } + /* + Note: there may exist SEL_TREE objects with sel_tree->type=KEY and + keys[i]=0 for all i. (SergeyP: it is not clear whether there is any + merit in range analyzer functions (e.g. get_mm_parts) returning a + pointer to such SEL_TREE instead of NULL) + */ SEL_ARG *keys[MAX_KEY]; key_map keys_map; /* bitmask of non-NULL elements in keys */ @@ -2622,7 +2628,8 @@ int find_used_partitions_imerge(PART_PRUNE_PARAM *ppar, SEL_IMERGE *imerge) ppar->cur_part_fields= 0; ppar->cur_subpart_fields= 0; init_all_partitions_iterator(ppar->part_info, &ppar->part_iter); - if (-1 == (res |= find_used_partitions(ppar, (*ptree)->keys[0]))) + SEL_ARG *key_tree= (*ptree)->keys[0]; + if (!key_tree || (-1 == (res |= find_used_partitions(ppar, key_tree)))) return -1; } return res; @@ -5151,7 +5158,7 @@ get_mm_parts(RANGE_OPT_PARAM *param, COND *cond_func, Field *field, tree->keys_map.set_bit(key_part->key); } } - + DBUG_RETURN(tree); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 47c55228adc..2298de7eeb5 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5343,6 +5343,7 @@ bool setup_tables(THD *thd, Name_resolution_context *context, table_list= table_list->next_leaf, tablenr++) { TABLE *table= table_list->table; + table->pos_in_table_list= table_list; if (first_select_table && table_list->top_table() == first_select_table) { @@ -5488,7 +5489,7 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table, 0) { my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), name->c_ptr(), - table->alias); + table->pos_in_table_list->alias); map->set_all(); return 1; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a055a8df82d..14847a9906d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2020,7 +2020,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, uptime, (int) thread_count, (ulong) thd->query_id, current_global_status_var.long_query_count, - current_global_status_var.opened_tables, refresh_version, cached_open_tables(), + current_global_status_var.opened_tables, refresh_version, + cached_open_tables(), (uptime ? (ulonglong2double(thd->query_id) / (double) uptime) : (double) 0)); #ifdef SAFEMALLOC diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 229afb6a60d..2cd14c3f5e6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13878,6 +13878,10 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, thd->server_status&= ~(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED); join->unit->offset_limit_cnt= 0; + /* + NOTE: the number/types of items pushed into item_list must be in sync with + EXPLAIN column types as they're "defined" in THD::send_explain_fields() + */ if (message) { item_list.push_back(new Item_int((int32) @@ -14017,11 +14021,9 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, if (!table->derived_select_number && (part_info= table->part_info)) { - char parts_buff[128]; - String parts_str(parts_buff,sizeof(parts_buff),cs); - make_used_partitions_str(part_info, &parts_str); - item_list.push_back(new Item_string(parts_str.ptr(), - parts_str.length(), cs)); + Item_string *item_str= new Item_string(cs); + make_used_partitions_str(part_info, &item_str->str_value); + item_list.push_back(item_str); } else item_list.push_back(item_null); |