Commit b01324d1 authored by unknown's avatar unknown

Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/alexi/mysql-5.0


mysql-test/t/select.test:
  Auto merged
parents 67c4bf97 ab0931d2
...@@ -752,6 +752,7 @@ sub mtr_ping_mysqld_server () { ...@@ -752,6 +752,7 @@ sub mtr_ping_mysqld_server () {
# #
############################################################################## ##############################################################################
# FIXME check that the pidfile contains the expected pid!
sub sleep_until_file_created ($$$) { sub sleep_until_file_created ($$$) {
my $pidfile= shift; my $pidfile= shift;
...@@ -762,7 +763,7 @@ sub sleep_until_file_created ($$$) { ...@@ -762,7 +763,7 @@ sub sleep_until_file_created ($$$) {
{ {
if ( -r $pidfile ) if ( -r $pidfile )
{ {
return 1; return $pid;
} }
# Check if it died after the fork() was successful # Check if it died after the fork() was successful
......
...@@ -2739,3 +2739,14 @@ DROP TABLE t1,t2; ...@@ -2739,3 +2739,14 @@ DROP TABLE t1,t2;
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
16 16 2 2 16 16 2 2
CREATE TABLE BUG_12595(a varchar(100));
INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
a
hakan%
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
ERROR HY000: Incorrect arguments to ESCAPE
SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
a
ha%an
DROP TABLE BUG_12595;
...@@ -2350,3 +2350,14 @@ DROP TABLE t1,t2; ...@@ -2350,3 +2350,14 @@ DROP TABLE t1,t2;
# #
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
#
# BUG #12595
#
CREATE TABLE BUG_12595(a varchar(100));
INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
-- error 1210
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
DROP TABLE BUG_12595;
This diff is collapsed.
...@@ -2792,8 +2792,14 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) ...@@ -2792,8 +2792,14 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
{ {
/* If we are on execution stage */ /* If we are on execution stage */
String *escape_str= escape_item->val_str(&tmp_value1); String *escape_str= escape_item->val_str(&tmp_value1);
/* ESCAPE must be 1 char in length.*/
if (escape_str && escape_str->numchars() != 1)
{
my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE");
return TRUE;
}
escape= escape_str ? *(escape_str->ptr()) : '\\'; escape= escape_str ? *(escape_str->ptr()) : '\\';
/* /*
We could also do boyer-more for non-const items, but as we would have to We could also do boyer-more for non-const items, but as we would have to
recompute the tables for each row it's not worth it. recompute the tables for each row it's not worth it.
......
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