diff options
-rw-r--r-- | Docs/manual.texi | 8 | ||||
-rw-r--r-- | libmysql/libmysql.c | 4 | ||||
-rw-r--r-- | mysql-test/r/join_outer.result | 2 | ||||
-rw-r--r-- | mysql-test/r/null.result | 7 | ||||
-rw-r--r-- | mysql-test/t/join_outer.test | 10 | ||||
-rw-r--r-- | mysql-test/t/null.test | 15 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/sql_select.cc | 9 |
8 files changed, 58 insertions, 7 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index e69d08148ee..eafca54b6e1 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46845,6 +46845,14 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.44 @itemize @bullet @item +Don't use @code{signal()} on windows because this appears to not be +100 % reliable. +@item +Fixed bug when doing @code{WHERE column_name=NULL} on an indexed column +that had @code{NULL} values. +@item +Fixed bug when doing @code{LEFT JOIN ... ON (column_name = constant) WHERE column_name = constant}. +@item When using replications, aborted queries that contained @code{%} could cause a core dum. @item diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 0e202a4fc08..be0c01df000 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1002,7 +1002,7 @@ mysql_init(MYSQL *mysql) else bzero((char*) (mysql),sizeof(*(mysql))); mysql->options.connect_timeout=CONNECT_TIMEOUT; -#if defined(SIGPIPE) && defined(THREAD) +#if defined(SIGPIPE) && defined(THREAD) && !defined(__WIN__) if (!((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE)) (void) signal(SIGPIPE,pipe_sig_handler); #endif @@ -1043,7 +1043,7 @@ static void mysql_once_init() mysql_unix_port = env; } mysql_debug(NullS); -#if defined(SIGPIPE) && !defined(THREAD) +#if defined(SIGPIPE) && !defined(THREAD) && !defined(__WIN__) (void) signal(SIGPIPE,SIG_IGN); #endif } diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 65b4c2ec73a..38f2f44f6ce 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -318,3 +318,5 @@ t1 ALL NULL NULL NULL NULL 2 t2 index id id 8 NULL 1 where used; Using index; Not exists id name id idx 2 no NULL NULL +bug_id reporter bug_id who +1 1 1 2 diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 6109456b8c0..9f0bdb07973 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -23,3 +23,10 @@ NULL 0 inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("") NULL NULL NULL NULL NULL x +indexed_field +indexed_field +NULL +NULL +indexed_field +NULL +NULL diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index a6da5fd577c..774f35ae38e 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -394,3 +394,13 @@ INSERT INTO t2 VALUES (1,1); explain SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL; SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL; drop table t1,t2; + +# +# Test problem with using key_column= constant in ON and WHERE +# +create table t1 (bug_id mediumint, reporter mediumint); +create table t2 (bug_id mediumint, who mediumint, index(who)); +insert into t2 values (1,1),(1,2); +insert into t1 values (1,1),(2,1); +SELECT * FROM t1 LEFT JOIN t2 ON (t1.bug_id = t2.bug_id AND t2.who = 2) WHERE (t1.reporter = 2 OR t2.who = 2); +drop table t1,t2; diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index f1fe2cf2c9f..a010ab38e07 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -20,3 +20,18 @@ create table t1 (x int); insert into t1 values (null); select * from t1 where x != 0; drop table t1; + +# +# Test problem med index on NULL columns and testing with =NULL; +# + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + indexed_field int default NULL, + KEY indexed_field (indexed_field) +); +INSERT INTO t1 VALUES (NULL),(NULL); +SELECT * FROM t1 WHERE indexed_field=NULL; +SELECT * FROM t1 WHERE indexed_field IS NULL; +SELECT * FROM t1 WHERE indexed_field<=>NULL; +DROP TABLE t1; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2207fe81e94..abcfbd0d457 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2901,13 +2901,21 @@ struct show_var_st init_vars[]= { {"have_openssl", (char*) &have_ssl, SHOW_HAVE}, {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, #ifdef HAVE_INNOBASE_DB + {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG }, + {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, + {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_MY_BOOL}, + {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, + {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, + {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG }, + {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONG}, + {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG}, {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, - {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, + {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, #endif {"interactive_timeout", (char*) &net_interactive_timeout, SHOW_LONG}, {"join_buffer_size", (char*) &join_buff_size, SHOW_LONG}, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e97fa3b0abf..ef3cacf114c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4963,15 +4963,16 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), static bool test_if_ref(Item_field *left_item,Item *right_item) { Field *field=left_item->field; - if (!field->table->const_table) // No need to change const test + // No need to change const test. We also have to keep tests on LEFT JOIN + if (!field->table->const_table && !field->table->maybe_null) { Item *ref_item=part_of_refkey(field->table,field); if (ref_item && ref_item->eq(right_item)) { if (right_item->type() == Item::FIELD_ITEM) - return (field->eq_def(((Item_field *) right_item)->field) && - !field->table->maybe_null); - if (right_item->const_item()) + return (field->eq_def(((Item_field *) right_item)->field)); + if (right_item->const_item() && + (right_item->val_int() || !right_item->null_value)) { // We can remove binary fields and numerical fields except float, // as float comparison isn't 100 % secure |