Loading client/mysql.cc +31 −0 Original line number Diff line number Diff line Loading @@ -2101,6 +2101,37 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } else if (!*ml_comment && !*in_string && (end_of_line - pos) >= 10 && !my_strnncoll(charset_info, (uchar*) pos, 10, (const uchar*) "delimiter ", 10)) { // Flush previously accepted characters if (out != line) { buffer.append(line, (uint32) (out - line)); out= line; } // Flush possible comments in the buffer if (!buffer.is_empty()) { if (com_go(&buffer, 0) > 0) // < 0 is not fatal DBUG_RETURN(1); buffer.length(0); } /* Delimiter wants the get rest of the given line as argument to allow one to change ';' to ';;' and back */ buffer.append(pos); if (com_delimiter(&buffer, pos) > 0) DBUG_RETURN(1); buffer.length(0); break; } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter Loading mysql-test/include/mix1.inc +18 −0 Original line number Diff line number Diff line Loading @@ -1103,6 +1103,24 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; # # Bug #37830: ORDER BY ASC/DESC - no difference # CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) ENGINE=InnoDB; INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; # should be range access EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; # should produce '8 7 6 5 4' for a SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; DROP TABLE t1; --echo End of 5.0 tests # Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY Loading mysql-test/r/client_xml.result +1 −0 Original line number Diff line number Diff line set @old_concurrent_insert= @@global.concurrent_insert; set @@global.concurrent_insert= 0; drop table if exists t1; create table t1 ( `a&b` int, `a<b` int, Loading mysql-test/r/innodb_mysql.result +15 −0 Original line number Diff line number Diff line Loading @@ -1362,6 +1362,21 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment; set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) ENGINE=InnoDB; INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index t1_b PRIMARY 4 NULL 8 Using where SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; a b c 8 1 1 7 1 1 6 1 1 5 1 1 4 1 1 DROP TABLE t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, Loading mysql-test/r/mysql.result +0 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ t2 t3 Tables_in_test t1 delimiter 1 _ Test delimiter : from command line a Loading Loading
client/mysql.cc +31 −0 Original line number Diff line number Diff line Loading @@ -2101,6 +2101,37 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } else if (!*ml_comment && !*in_string && (end_of_line - pos) >= 10 && !my_strnncoll(charset_info, (uchar*) pos, 10, (const uchar*) "delimiter ", 10)) { // Flush previously accepted characters if (out != line) { buffer.append(line, (uint32) (out - line)); out= line; } // Flush possible comments in the buffer if (!buffer.is_empty()) { if (com_go(&buffer, 0) > 0) // < 0 is not fatal DBUG_RETURN(1); buffer.length(0); } /* Delimiter wants the get rest of the given line as argument to allow one to change ';' to ';;' and back */ buffer.append(pos); if (com_delimiter(&buffer, pos) > 0) DBUG_RETURN(1); buffer.length(0); break; } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter Loading
mysql-test/include/mix1.inc +18 −0 Original line number Diff line number Diff line Loading @@ -1103,6 +1103,24 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; # # Bug #37830: ORDER BY ASC/DESC - no difference # CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) ENGINE=InnoDB; INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; # should be range access EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; # should produce '8 7 6 5 4' for a SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; DROP TABLE t1; --echo End of 5.0 tests # Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY Loading
mysql-test/r/client_xml.result +1 −0 Original line number Diff line number Diff line set @old_concurrent_insert= @@global.concurrent_insert; set @@global.concurrent_insert= 0; drop table if exists t1; create table t1 ( `a&b` int, `a<b` int, Loading
mysql-test/r/innodb_mysql.result +15 −0 Original line number Diff line number Diff line Loading @@ -1362,6 +1362,21 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment; set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) ENGINE=InnoDB; INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index t1_b PRIMARY 4 NULL 8 Using where SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; a b c 8 1 1 7 1 1 6 1 1 5 1 1 4 1 1 DROP TABLE t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, Loading
mysql-test/r/mysql.result +0 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ t2 t3 Tables_in_test t1 delimiter 1 _ Test delimiter : from command line a Loading