MDEV-5445 Server crashes in Item_func_like::fix_fields on LIKE ExtractValue(..)
backporting from the main 10.0 modified: mysql-test/r/func_like.result mysql-test/t/func_like.test sql/item_cmpfunc.cc
This commit is contained in:
parent
6bf10fac44
commit
074455105c
@ -188,3 +188,15 @@ DROP TABLE t1, t2;
|
|||||||
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
||||||
ERROR HY000: Incorrect arguments to ESCAPE
|
ERROR HY000: Incorrect arguments to ESCAPE
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
#
|
||||||
|
# Start of 10.0 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-5445 Server crashes in Item_func_like::fix_fields on LIKE ExtractValue(..)
|
||||||
|
#
|
||||||
|
SELECT 'a' LIKE REPEAT('',0);
|
||||||
|
'a' LIKE REPEAT('',0)
|
||||||
|
0
|
||||||
|
SELECT 'a' LIKE EXTRACTVALUE('bar','qux');
|
||||||
|
'a' LIKE EXTRACTVALUE('bar','qux')
|
||||||
|
0
|
||||||
|
@ -133,3 +133,13 @@ DROP TABLE t1, t2;
|
|||||||
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 10.0 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-5445 Server crashes in Item_func_like::fix_fields on LIKE ExtractValue(..)
|
||||||
|
--echo #
|
||||||
|
SELECT 'a' LIKE REPEAT('',0);
|
||||||
|
SELECT 'a' LIKE EXTRACTVALUE('bar','qux');
|
||||||
|
@ -5020,7 +5020,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
|
|||||||
turboBM_compute_bad_character_shifts();
|
turboBM_compute_bad_character_shifts();
|
||||||
DBUG_PRINT("info",("done"));
|
DBUG_PRINT("info",("done"));
|
||||||
}
|
}
|
||||||
use_sampling= ((*first == wild_many || *first == wild_one) && len > 2);
|
use_sampling= (len > 2 && (*first == wild_many || *first == wild_one));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user