Commit 35f2d831 authored by monty@work.mysql.com's avatar monty@work.mysql.com

merge

parents 52270d32 0f25a1a0
......@@ -48849,6 +48849,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
......@@ -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;
......@@ -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;
......@@ -2937,13 +2937,21 @@ struct show_var_st init_vars[]= {
{"have_openssl", (char*) &have_openssl, 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},
......
......@@ -5084,15 +5084,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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment