Commit b53548fe authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge bk-internal:/home/bk/mysql-5.1-new

into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
parents b5f3a2ef 49e23937
...@@ -326,3 +326,20 @@ deallocate prepare s; ...@@ -326,3 +326,20 @@ deallocate prepare s;
set @str=NULL; set @str=NULL;
drop table t2; drop table t2;
drop table t1; drop table t1;
create table t1 (
some_id smallint(5) unsigned,
key (some_id)
);
insert into t1 values (1),(2);
select some_id from t1 where some_id not in(2,-1);
some_id
1
select some_id from t1 where some_id not in(-4,-1,-4);
some_id
1
2
select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
some_id
1
2
drop table t1;
...@@ -189,4 +189,5 @@ HEX(f) ...@@ -189,4 +189,5 @@ HEX(f)
select HEX(f) from t4; select HEX(f) from t4;
HEX(f) HEX(f)
835C 835C
flush logs;
drop table t1, t2, t03, t04, t3, t4; drop table t1, t2, t03, t04, t3, t4;
...@@ -19,9 +19,40 @@ n ...@@ -19,9 +19,40 @@ n
2 2
3 3
4 4
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-bin.000001 323 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 323
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 323
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n
...@@ -29,23 +60,116 @@ n ...@@ -29,23 +60,116 @@ n
2 2
3 3
4 4
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-no-such-bin.000001 291 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 323
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-no-such-bin.000001
Until_Log_Pos 291
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2; select * from t2;
n n
1 1
2 2
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 612 # Relay slave-relay-bin.000004 746 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 612
Relay_Log_Space #
Until_Condition Relay
Until_Log_File slave-relay-bin.000004
Until_Log_Pos 746
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=776; start slave until master_log_file='master-bin.000001', master_log_pos=776;
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 780 # Master master-bin.000001 776 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 780
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 776
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
......
...@@ -88,15 +88,23 @@ f ...@@ -88,15 +88,23 @@ f
1 1
drop temporary table t4; drop temporary table t4;
drop table t5; drop table t5;
set @session.pseudo_thread_id=100; set @@session.pseudo_thread_id=100;
create temporary table t101 (id int); create temporary table t101 (id int);
create temporary table t102 (id int); create temporary table t102 (id int);
set @session.pseudo_thread_id=200; set @@session.pseudo_thread_id=200;
create temporary table t201 (id int); create temporary table t201 (id int);
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); create temporary table `#sql_not_user_table202` (id int);
set @@session.pseudo_thread_id=300;
create temporary table t301 (id int);
create temporary table t302 (id int);
create temporary table `#sql_not_user_table303` (id int);
create table t1(f int); create table t1(f int);
insert into t1 values (1); insert into t1 values (1);
select * from t1 /* must be 1 */; select * from t1 /* must be 1 */;
f f
1 1
drop table t1; drop table t1;
select * from t1;
a
1
drop table t1;
...@@ -220,3 +220,15 @@ set @str=NULL; ...@@ -220,3 +220,15 @@ set @str=NULL;
drop table t2; drop table t2;
drop table t1; drop table t1;
# BUG#19618: Crash in range optimizer for
# "unsigned_keypart NOT IN(negative_number,...)"
# (introduced in fix BUG#15872)
create table t1 (
some_id smallint(5) unsigned,
key (some_id)
);
insert into t1 values (1),(2);
select some_id from t1 where some_id not in(2,-1);
select some_id from t1 where some_id not in(-4,-1,-4);
select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
drop table t1;
...@@ -124,9 +124,22 @@ select HEX(f) from t3; ...@@ -124,9 +124,22 @@ select HEX(f) from t3;
select HEX(f) from t04; select HEX(f) from t04;
select HEX(f) from t4; select HEX(f) from t4;
#
# BUG#14157: utf8 encoding in binlog without set character_set_client
#
# BUG:
# This test only works on the MySQL-internal rpl machines.
# Needs to be fixed. Problem is that koi8r is not installed
# on many machines.
#
flush logs;
# --exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table if not exists t5 (a int); set names koi8r; create temporary table `` (a int); insert into `` values (1); insert into t5 select * from ``'
# resulted log is client charset insensitive (latin1 not koi8r) as it must be
# --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000006 | $MYSQL --default-character-set=latin1
#select * from t5 /* must be (1),(1) */;
# clean up # clean up
drop table t1, t2, t03, t04, t3, t4; drop table t1, t2, t03, t04, t3, t4;
# End of 4.1 tests # End of 5.0 tests
...@@ -32,7 +32,7 @@ wait_for_slave_to_stop; ...@@ -32,7 +32,7 @@ wait_for_slave_to_stop;
select * from t1; select * from t1;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# this should fail right after start # this should fail right after start
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
...@@ -42,7 +42,7 @@ sleep 2; ...@@ -42,7 +42,7 @@ sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# try replicate all up to and not including the second insert to t2; # try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
...@@ -51,7 +51,7 @@ wait_for_slave_to_stop; ...@@ -51,7 +51,7 @@ wait_for_slave_to_stop;
select * from t2; select * from t2;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# clean up # clean up
start slave; start slave;
...@@ -68,7 +68,7 @@ wait_for_slave_to_stop; ...@@ -68,7 +68,7 @@ wait_for_slave_to_stop;
# here the sql slave thread should be stopped # here the sql slave thread should be stopped
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 --replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
--replace_column 1 # 9 # 23 # 33 # --replace_column 1 # 9 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
#testing various error conditions #testing various error conditions
--error 1277 --error 1277
......
...@@ -165,24 +165,19 @@ drop table t5; ...@@ -165,24 +165,19 @@ drop table t5;
# value was set up at the moment of temp table creation # value was set up at the moment of temp table creation
# #
connection con1; connection con1;
set @session.pseudo_thread_id=100; set @@session.pseudo_thread_id=100;
create temporary table t101 (id int); create temporary table t101 (id int);
create temporary table t102 (id int); create temporary table t102 (id int);
set @session.pseudo_thread_id=200; set @@session.pseudo_thread_id=200;
create temporary table t201 (id int); create temporary table t201 (id int);
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); #create temporary table `t``201` (id int);
# emulate internal temp table not to come to binlog
# create temporary table `#sql_not_user_table202` (id int);
# Don't kill our own connection to the server as set @@session.pseudo_thread_id=300;
# the result code differs depending on platform. create temporary table t301 (id int);
# create temporary table t302 (id int);
# Select the id to kill into a variable of mysqltest create temporary table `#sql_not_user_table303` (id int);
let $con1_id= `select connection_id()`; disconnect con1;
# Switch connection to avoid killing our own connection
connection master;
--disable_query_log
eval kill $con1_id;
--enable_query_log
#now do something to show that slave is ok after DROP temp tables #now do something to show that slave is ok after DROP temp tables
connection master; connection master;
...@@ -195,4 +190,17 @@ select * from t1 /* must be 1 */; ...@@ -195,4 +190,17 @@ select * from t1 /* must be 1 */;
connection master; connection master;
drop table t1; drop table t1;
# End of 5.1 tests
#
#14157: utf8 encoding in binlog without set character_set_client
#
--exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table t1 (a int); set names koi8r; create temporary table `ÑÝÉË` (a int); insert into `ÑÝÉË` values (1); insert into t1 select * from `ÑÝÉË`'
sync_slave_with_master;
#connection slave;
select * from t1;
connection master;
drop table t1;
# End of 5.0 tests
...@@ -1936,7 +1936,6 @@ inline int hexchar_to_int(char c) ...@@ -1936,7 +1936,6 @@ inline int hexchar_to_int(char c)
return -1; return -1;
} }
/* /*
Some functions that are different in the embedded library and the normal Some functions that are different in the embedded library and the normal
server server
......
...@@ -4698,17 +4698,46 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, ...@@ -4698,17 +4698,46 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
if (inv) if (inv)
{ {
/*
We get here for conditions like "t.keypart NOT IN (....)".
If the IN-list contains only constants (and func->array is an ordered
array of them), we construct the appropriate SEL_ARG tree manually,
because constructing it using the range analyzer (as
AND_i( t.keypart != c_i)) will cause lots of memory to be consumed
(see BUG#15872).
*/
if (func->array && func->cmp_type != ROW_RESULT) if (func->array && func->cmp_type != ROW_RESULT)
{ {
/*
We get here for conditions in form "t.key NOT IN (c1, c2, ...)"
(where c{i} are constants).
Our goal is to produce a SEL_ARG graph that represents intervals:
($MIN<t.key<c1) OR (c1<t.key<c2) OR (c2<t.key<c3) OR ... (*)
where $MIN is either "-inf" or NULL.
The most straightforward way to handle NOT IN would be to convert
it to "(t.key != c1) AND (t.key != c2) AND ..." and let the range
optimizer to build SEL_ARG graph from that. However that will cause
the range optimizer to use O(N^2) memory (it's a bug, not filed),
and people do use big NOT IN lists (see BUG#15872). Also, for big
NOT IN lists constructing/using graph (*) does not make the query
faster.
So, we will handle NOT IN manually in the following way:
* if the number of entries in the NOT IN list is less then
NOT_IN_IGNORE_THRESHOLD, we will construct SEL_ARG graph (*)
manually.
* Otherwise, we will construct a smaller graph: for
"t.key NOT IN (c1,...cN)" we construct a graph representing
($MIN < t.key) OR (cN < t.key) // here sequence of c_i is
// ordered.
A note about partially-covering indexes: for those (e.g. for
"a CHAR(10), KEY(a(5))") the handling is correct (albeit not very
efficient):
Instead of "t.key < c1" we get "t.key <= prefix-val(c1)".
Combining the intervals in (*) together, we get:
(-inf<=t.key<=c1) OR (c1<=t.key<=c2) OR (c2<=t.key<=c3) OR ...
i.e. actually we get intervals combined into one interval:
(-inf<=t.key<=+inf). This doesn't make much sense but it doesn't
cause any problems.
*/
MEM_ROOT *tmp_root= param->mem_root;
param->thd->mem_root= param->old_root;
/* /*
Create one Item_type constant object. We'll need it as Create one Item_type constant object. We'll need it as
get_mm_parts only accepts constant values wrapped in Item_Type get_mm_parts only accepts constant values wrapped in Item_Type
...@@ -4717,25 +4746,35 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, ...@@ -4717,25 +4746,35 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
per-statement mem_root (while thd->mem_root is currently pointing per-statement mem_root (while thd->mem_root is currently pointing
to mem_root local to range optimizer). to mem_root local to range optimizer).
*/ */
MEM_ROOT *tmp_root= param->mem_root;
param->thd->mem_root= param->old_root;
Item *value_item= func->array->create_item(); Item *value_item= func->array->create_item();
param->thd->mem_root= tmp_root; param->thd->mem_root= tmp_root;
if (!value_item) if (!value_item)
break; break;
/* Get a SEL_TREE for "-inf < X < c_0" interval */ /* Get a SEL_TREE for "(-inf|NULL) < X < c_0" interval. */
func->array->value_to_item(0, value_item); uint i=0;
do
{
func->array->value_to_item(i, value_item);
tree= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC, tree= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC,
value_item, cmp_type); value_item, cmp_type);
if (!tree) if (!tree)
break; break;
i++;
} while (i < func->array->count && tree->type == SEL_TREE::IMPOSSIBLE);
if (!tree || tree->type == SEL_TREE::IMPOSSIBLE)
{
/* We get here in cases like "t.unsigned NOT IN (-1,-2,-3) */
tree= NULL;
break;
}
#define NOT_IN_IGNORE_THRESHOLD 1000 #define NOT_IN_IGNORE_THRESHOLD 1000
SEL_TREE *tree2; SEL_TREE *tree2;
if (func->array->count < NOT_IN_IGNORE_THRESHOLD) if (func->array->count < NOT_IN_IGNORE_THRESHOLD)
{ {
for (uint i=1; i < func->array->count; i++) for (; i < func->array->count; i++)
{ {
if (func->array->compare_elems(i, i-1)) if (func->array->compare_elems(i, i-1))
{ {
...@@ -4743,18 +4782,27 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, ...@@ -4743,18 +4782,27 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
func->array->value_to_item(i, value_item); func->array->value_to_item(i, value_item);
tree2= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC, tree2= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC,
value_item, cmp_type); value_item, cmp_type);
if (!tree2)
{
tree= NULL;
break;
}
/* Change all intervals to be "c_{i-1} < X < c_i" */ /* Change all intervals to be "c_{i-1} < X < c_i" */
for (uint idx= 0; idx < param->keys; idx++) for (uint idx= 0; idx < param->keys; idx++)
{ {
SEL_ARG *new_interval; SEL_ARG *new_interval, *last_val;
if ((new_interval= tree2->keys[idx])) if (((new_interval= tree2->keys[idx])) &&
((last_val= tree->keys[idx]->last())))
{ {
SEL_ARG *last_val= tree->keys[idx]->last();
new_interval->min_value= last_val->max_value; new_interval->min_value= last_val->max_value;
new_interval->min_flag= NEAR_MIN; new_interval->min_flag= NEAR_MIN;
} }
} }
/*
The following doesn't try to allocate memory so no need to
check for NULL.
*/
tree= tree_or(param, tree, tree2); tree= tree_or(param, tree, tree2);
} }
} }
...@@ -4762,6 +4810,8 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, ...@@ -4762,6 +4810,8 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
else else
func->array->value_to_item(func->array->count - 1, value_item); func->array->value_to_item(func->array->count - 1, value_item);
if (tree && tree->type != SEL_TREE::IMPOSSIBLE)
{
/* /*
Get the SEL_TREE for the last "c_last < X < +inf" interval Get the SEL_TREE for the last "c_last < X < +inf" interval
(value_item cotains c_last already) (value_item cotains c_last already)
...@@ -4770,6 +4820,7 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, ...@@ -4770,6 +4820,7 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
value_item, cmp_type); value_item, cmp_type);
tree= tree_or(param, tree, tree2); tree= tree_or(param, tree, tree2);
} }
}
else else
{ {
tree= get_ne_mm_tree(param, cond_func, field, tree= get_ne_mm_tree(param, cond_func, field,
......
...@@ -1317,7 +1317,6 @@ void close_temporary_tables(THD *thd) ...@@ -1317,7 +1317,6 @@ void close_temporary_tables(THD *thd)
thd->temporary_tables=0; thd->temporary_tables=0;
} }
/* /*
Find table in list. Find table in list.
......
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