mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge trunk-bugfixing -> trunk-runtime
This commit is contained in:
@ -31,7 +31,9 @@ create table t2 (i int);
|
||||
# statement execution, so we don't need many rows in 't1' to make
|
||||
# this test repeatable.
|
||||
alter table t1 disable keys;
|
||||
--disable_warnings
|
||||
insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000);
|
||||
--enable_warnings
|
||||
|
||||
# Later we use binlog to check the order in which statements are
|
||||
# executed so let us reset it first.
|
||||
@ -50,8 +52,7 @@ connection default;
|
||||
--reap
|
||||
set session debug="-d,sleep_alter_enable_indexes";
|
||||
# Check that statements were executed/binlogged in correct order.
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Clean up
|
||||
drop tables t1, t2;
|
||||
@ -111,8 +112,7 @@ drop table t3;
|
||||
set session debug="-d,sleep_alter_before_main_binlog";
|
||||
|
||||
# Check that all statements were logged in correct order
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -305,8 +305,7 @@ connection default;
|
||||
show create table t2;
|
||||
drop table t2;
|
||||
# Let us check that statements were executed/binlogged in correct order
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Now let us check the gap between check for target table
|
||||
# existance and copying of .frm file.
|
||||
@ -330,8 +329,7 @@ drop table t1;
|
||||
connection default;
|
||||
--reap
|
||||
drop table t2;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# And now he gap between copying of .frm file and ha_create_table() call.
|
||||
create table t1 (i int);
|
||||
@ -359,8 +357,7 @@ drop table t1;
|
||||
connection default;
|
||||
--reap
|
||||
drop table t2;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Finally we check the gap between ha_create_table() and binlogging
|
||||
create table t1 (i int);
|
||||
@ -386,7 +383,6 @@ drop table t1;
|
||||
connection default;
|
||||
--reap
|
||||
drop table t2;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
set session debug="-d,sleep_create_like_before_binlogging";
|
||||
|
@ -12,6 +12,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state
|
||||
#
|
||||
# Bug#18293: Values in stored procedure written to binlog unescaped
|
||||
#
|
||||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
|
||||
delimiter |;
|
||||
CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
@ -27,7 +28,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
|
||||
SELECT HEX(s1),HEX(s2),d FROM t4|
|
||||
DROP PROCEDURE bug18293|
|
||||
DROP TABLE t4|
|
||||
SHOW BINLOG EVENTS FROM 514|
|
||||
source include/show_binlog_events.inc|
|
||||
delimiter ;|
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -13,5 +13,6 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution
|
||||
plugin_load : Bug#42144 2009-12-21 alik plugin_load fails
|
||||
partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings
|
||||
mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst
|
||||
mysqlhotcopy_archive : bug#54129 2010-06-04 Horst
|
||||
|
@ -46,6 +46,20 @@ SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a BLOB);
|
||||
|
||||
SET SESSION debug="+d,bug42064_simulate_oom";
|
||||
# May fail with either ER_OUT_OF_RESOURCES or EE_OUTOFMEMORY
|
||||
--error ER_OUT_OF_RESOURCES, 5
|
||||
INSERT INTO t1 VALUES("");
|
||||
SET SESSION debug=DEFAULT;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
@ -223,4 +223,19 @@ EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #48573: difference of index selection between rpm binary and
|
||||
--echo # .tar.gz, windows vs linux..
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(c1 INT, c2 INT, c4 INT, c5 INT, KEY(c2, c5), KEY(c2, c4, c5));
|
||||
INSERT INTO t1 VALUES(4, 1, 1, 1);
|
||||
INSERT INTO t1 VALUES(3, 1, 1, 1);
|
||||
INSERT INTO t1 VALUES(2, 1, 1, 1);
|
||||
INSERT INTO t1 VALUES(1, 1, 1, 1);
|
||||
|
||||
EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
@ -28,14 +28,14 @@ SELECT 1;
|
||||
--echo # Switch to connection con2
|
||||
connection con2;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
SHOW MASTER STATUS;
|
||||
--source include/show_binlog_events.inc
|
||||
--echo # Switch to connection con1
|
||||
connection con1;
|
||||
send INSERT INTO t1 VALUES (1);
|
||||
--echo # Switch to connection con2
|
||||
connection con2;
|
||||
sleep 1;
|
||||
SHOW MASTER STATUS;
|
||||
--source include/show_binlog_events.inc
|
||||
UNLOCK TABLES;
|
||||
--echo # Switch to connection con1
|
||||
connection con1;
|
||||
|
@ -14,6 +14,21 @@ drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#53933 crash when using uncacheable subquery in the having clause of outer query
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
INSERT INTO t1 VALUES (0),(0);
|
||||
|
||||
SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2
|
||||
FROM t1 GROUP BY f1 HAVING f2 = f2;
|
||||
SELECT RELEASE_LOCK('Bug#53933');
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #41371 Select returns 1 row with condition "col is not null and col is null"
|
||||
#
|
||||
|
@ -1085,6 +1085,21 @@ INSERT INTO t1 VALUES (1), (2), (3);
|
||||
--source include/min_null_cond.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List<Item>&, Item*) at
|
||||
--echo # opt_sum.cc:305
|
||||
--echo #
|
||||
CREATE TABLE t1 ( a INT, KEY (a) );
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
SELECT MIN( a ) AS min_a
|
||||
FROM t1
|
||||
WHERE a > 1 AND a IS NULL
|
||||
ORDER BY min_a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
|
@ -48,4 +48,53 @@ HANDLER t1 READ a NEXT;
|
||||
HANDLER t1 CLOSE;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #54007: assert in ha_myisam::index_next , HANDLER
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
|
||||
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
HANDLER t1 READ `PRIMARY` NEXT;
|
||||
HANDLER t1 READ ab NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 CLOSE;
|
||||
|
||||
INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 READ `PRIMARY` NEXT;
|
||||
HANDLER t1 READ `PRIMARY` NEXT;
|
||||
HANDLER t1 READ ab NEXT;
|
||||
HANDLER t1 READ ab NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ b NEXT;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 READ NEXT;
|
||||
HANDLER t1 CLOSE;
|
||||
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
HANDLER t1 READ `PRIMARY` PREV;
|
||||
HANDLER t1 READ `PRIMARY` PREV;
|
||||
HANDLER t1 READ b PREV;
|
||||
HANDLER t1 READ b PREV;
|
||||
HANDLER t1 CLOSE;
|
||||
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ FIRST;
|
||||
HANDLER t1 READ `PRIMARY` PREV LIMIT 3;
|
||||
HANDLER t1 READ b NEXT LIMIT 5;
|
||||
HANDLER t1 CLOSE;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -1,19 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
# embedded server ignores 'delayed', so skip this
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug 34286
|
||||
#
|
||||
create table t1(a int not null auto_increment primary key) engine=innodb;
|
||||
insert into t1 set a = -1;
|
||||
# NOTE: The database needs to be shutdown and restarted (here) for
|
||||
# the test to work. It's included for reference only.
|
||||
optimize table t1;
|
||||
|
||||
--echo ==== clean up ====
|
||||
DROP TABLE t1;
|
@ -1,230 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_ucs2.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
|
||||
#
|
||||
|
||||
create table t1 (
|
||||
a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set utf8 engine = innodb;
|
||||
create table t2 (
|
||||
a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set ucs2 engine = innodb;
|
||||
insert into t1 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t1 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t1 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
|
||||
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
|
||||
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
|
||||
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
|
||||
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
|
||||
insert into t2 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t2 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
|
||||
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
|
||||
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
|
||||
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
|
||||
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
|
||||
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
|
||||
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
|
||||
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
|
||||
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
|
||||
update t1 set filler = 'boo' where a = 1;
|
||||
update t2 set filler ='email' where a = 4;
|
||||
select a,hex(b),hex(c),filler from t1 order by filler;
|
||||
select a,hex(b),hex(c),filler from t2 order by filler;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
create table t1 (
|
||||
a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set utf8 engine = innodb;
|
||||
create table t2 (
|
||||
a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set ucs2 engine = innodb;
|
||||
insert into t1 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t1 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t1 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
|
||||
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
|
||||
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
|
||||
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
|
||||
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
|
||||
insert into t2 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t2 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
|
||||
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
|
||||
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
|
||||
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
|
||||
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
|
||||
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
|
||||
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
|
||||
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
|
||||
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
|
||||
update t1 set filler = 'boo' where a = 1;
|
||||
update t2 set filler ='email' where a = 4;
|
||||
select a,hex(b),hex(c),filler from t1 order by filler;
|
||||
select a,hex(b),hex(c),filler from t2 order by filler;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
create table t1 (
|
||||
a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set utf8 engine = innodb;
|
||||
create table t2 (
|
||||
a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set ucs2 engine = innodb;
|
||||
insert into t1 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t1 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t1 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
|
||||
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
|
||||
insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
|
||||
insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
|
||||
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
|
||||
insert into t2 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t2 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
|
||||
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
|
||||
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
|
||||
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
|
||||
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
|
||||
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
|
||||
insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
|
||||
insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
|
||||
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
|
||||
update t1 set filler = 'boo' where a = 1;
|
||||
update t2 set filler ='email' where a = 4;
|
||||
select a,hex(b),hex(c),filler from t1 order by filler;
|
||||
select a,hex(b),hex(c),filler from t2 order by filler;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
create table t1 (
|
||||
a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set utf8 engine = innodb;
|
||||
create table t2 (
|
||||
a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set ucs2 engine = innodb;
|
||||
insert into t1 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t1 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t1 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
|
||||
insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
|
||||
insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
|
||||
insert into t2 values (1,'abcdefg','abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','ijkilmn','two');
|
||||
insert into t2 values (3,'qrstuvw','qrstuvw','three');
|
||||
insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
|
||||
insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
|
||||
insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
|
||||
insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
|
||||
insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
|
||||
insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
|
||||
insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
|
||||
update t1 set filler = 'boo' where a = 1;
|
||||
update t2 set filler ='email' where a = 4;
|
||||
select a,hex(b),hex(c),filler from t1 order by filler;
|
||||
select a,hex(b),hex(c),filler from t2 order by filler;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
commit;
|
||||
|
||||
#
|
||||
# Test cases for bug #15308 Problem of Order with Enum Column in Primary Key
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
ind enum('0','1','2') NOT NULL default '0',
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t2 (
|
||||
ind enum('0','1','2') NOT NULL default '0',
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
|
||||
|
||||
INSERT INTO t1 VALUES ('1', ''),('2', '');
|
||||
INSERT INTO t2 VALUES ('1', ''),('2', '');
|
||||
SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
|
||||
SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
|
||||
drop table t1,t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ind set('0','1','2') NOT NULL default '0',
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t2 (
|
||||
ind set('0','1','2') NOT NULL default '0',
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
|
||||
|
||||
INSERT INTO t1 VALUES ('1', ''),('2', '');
|
||||
INSERT INTO t2 VALUES ('1', ''),('2', '');
|
||||
SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
|
||||
SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
|
||||
drop table t1,t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ind bit not null,
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t2 (
|
||||
ind bit not null,
|
||||
string1 varchar(250) NOT NULL,
|
||||
PRIMARY KEY (ind)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
|
||||
insert into t1 values(0,''),(1,'');
|
||||
insert into t2 values(0,''),(1,'');
|
||||
select hex(ind),hex(string1) from t1 order by string1;
|
||||
select hex(ind),hex(string1) from t2 order by string1;
|
||||
drop table t1,t2;
|
||||
|
||||
# tests for bug #14056 Column prefix index on UTF-8 primary key column causes 'Can't find record..'
|
||||
|
||||
create table t2 (
|
||||
a int, b char(10), filler char(10), primary key(a, b(2))
|
||||
) character set utf8 engine = innodb;
|
||||
|
||||
insert into t2 values (1,'abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','two');
|
||||
insert into t2 values (3, 'qrstuvw','three');
|
||||
update t2 set a=5, filler='booo' where a=1;
|
||||
drop table t2;
|
||||
create table t2 (
|
||||
a int, b char(10), filler char(10), primary key(a, b(2))
|
||||
) character set ucs2 engine = innodb;
|
||||
|
||||
insert into t2 values (1,'abcdefg','one');
|
||||
insert into t2 values (2,'ijkilmn','two');
|
||||
insert into t2 values (3, 'qrstuvw','three');
|
||||
update t2 set a=5, filler='booo' where a=1;
|
||||
drop table t2;
|
||||
|
||||
create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
|
||||
insert into t1 values(1,'abcdefg'),(2,'defghijk');
|
||||
insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
|
||||
insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
|
||||
select a,hex(b) from t1 order by b;
|
||||
update t1 set b = 'three' where a = 6;
|
||||
drop table t1;
|
||||
create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
|
||||
insert into t1 values(1,'abcdefg'),(2,'defghijk');
|
||||
insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
|
||||
insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
|
||||
select a,hex(b) from t1 order by b;
|
||||
update t1 set b = 'three' where a = 6;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
@ -1 +0,0 @@
|
||||
--innodb-autoinc-lock-mode=0
|
@ -1,44 +0,0 @@
|
||||
# This test runs with old-style locking, as:
|
||||
# --innodb-autoinc-lock-mode=0
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
#
|
||||
# Search on unique key
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
ggid varchar(32) binary DEFAULT '' NOT NULL,
|
||||
email varchar(64) DEFAULT '' NOT NULL,
|
||||
passwd varchar(32) binary DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE ggid (ggid)
|
||||
) ENGINE=innodb;
|
||||
|
||||
insert into t1 (ggid,passwd) values ('test1','xxx');
|
||||
insert into t1 (ggid,passwd) values ('test2','yyy');
|
||||
-- error ER_DUP_ENTRY
|
||||
insert into t1 (ggid,passwd) values ('test2','this will fail');
|
||||
-- error ER_DUP_ENTRY
|
||||
insert into t1 (ggid,id) values ('this will fail',1);
|
||||
|
||||
select * from t1 where ggid='test1';
|
||||
select * from t1 where passwd='xxx';
|
||||
select * from t1 where id=2;
|
||||
|
||||
replace into t1 (ggid,id) values ('this will work',1);
|
||||
replace into t1 (ggid,passwd) values ('test2','this will work');
|
||||
-- error ER_DUP_ENTRY
|
||||
update t1 set id=100,ggid='test2' where id=1;
|
||||
select * from t1;
|
||||
select * from t1 where id=1;
|
||||
select * from t1 where id=999;
|
||||
drop table t1;
|
||||
|
||||
--echo End of tests
|
@ -1 +0,0 @@
|
||||
--innodb --innodb_autoinc_lock_mode=0
|
@ -1,68 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
--vertical_results
|
||||
let $engine_type= 'innodb';
|
||||
|
||||
######## Creat Table Section #########
|
||||
use test;
|
||||
|
||||
eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
||||
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
|
||||
fkid MEDIUMINT, filler VARCHAR(255),
|
||||
PRIMARY KEY(id)) ENGINE=$engine_type
|
||||
PARTITION BY RANGE(id)
|
||||
SUBPARTITION BY hash(id) subpartitions 2
|
||||
(PARTITION pa3 values less than (42),
|
||||
PARTITION pa6 values less than (60),
|
||||
PARTITION pa7 values less than (70),
|
||||
PARTITION pa8 values less than (80),
|
||||
PARTITION pa9 values less than (90),
|
||||
PARTITION pa10 values less than (100),
|
||||
PARTITION pa11 values less than MAXVALUE);
|
||||
|
||||
######## Create SPs, Functions, Views and Triggers Section ##############
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE PROCEDURE test.proc_part()
|
||||
BEGIN
|
||||
DECLARE ins_count INT DEFAULT 1000;
|
||||
DECLARE del_count INT;
|
||||
DECLARE cur_user VARCHAR(255);
|
||||
DECLARE local_uuid VARCHAR(255);
|
||||
DECLARE local_time TIMESTAMP;
|
||||
|
||||
SET local_time= NOW();
|
||||
SET cur_user= CURRENT_USER();
|
||||
SET local_uuid= UUID();
|
||||
|
||||
WHILE ins_count > 0 DO
|
||||
INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
|
||||
ins_count,'Going to test MBR for MySQL');
|
||||
SET ins_count = ins_count - 1;
|
||||
END WHILE;
|
||||
SELECT MAX(id) FROM test.part_tbl INTO del_count;
|
||||
WHILE del_count > 0 DO
|
||||
DELETE FROM test.part_tbl WHERE id = del_count;
|
||||
select count(*) as internal_count, del_count -- these two lines are for
|
||||
FROM test.part_tbl; -- debug to show the problem
|
||||
SET del_count = del_count - 2;
|
||||
END WHILE;
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
############ Finish Setup Section ###################
|
||||
|
||||
############ Test Section ###################
|
||||
--horizontal_results
|
||||
|
||||
CALL test.proc_part();
|
||||
|
||||
select count(*) as Part from test.part_tbl;
|
||||
|
||||
###### CLEAN UP SECTION ##############
|
||||
|
||||
DROP PROCEDURE test.proc_part;
|
||||
DROP TABLE test.part_tbl;
|
||||
|
@ -1,78 +0,0 @@
|
||||
#
|
||||
# Testcase for InnoDB
|
||||
# Bug#42419 Server crash with "Pure virtual method called" on two concurrent connections
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1);
|
||||
if (`SELECT $innodb_lock_wait_timeout < 10`)
|
||||
{
|
||||
--echo # innodb_lock_wait_timeout must be >= 10 seconds
|
||||
--echo # so that this test can work all time fine on an overloaded testing box
|
||||
SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';
|
||||
exit;
|
||||
}
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
# First session
|
||||
connection default;
|
||||
|
||||
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT = 0;
|
||||
|
||||
CREATE TEMPORARY TABLE t1_tmp ( b INT );
|
||||
|
||||
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
|
||||
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
|
||||
|
||||
# Second session
|
||||
connect (user2,localhost,root,,,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
|
||||
SET AUTOCOMMIT = 0;
|
||||
|
||||
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
|
||||
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
|
||||
|
||||
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
|
||||
send
|
||||
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
|
||||
|
||||
# The last update will wait for a lock held by the first session
|
||||
|
||||
# First session
|
||||
connection default;
|
||||
|
||||
# Poll till the UPDATE of the second session waits for lock
|
||||
let $show_statement= SHOW PROCESSLIST;
|
||||
let $field= State;
|
||||
let $condition= = 'Updating';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# If the testing box is overloadeded and innodb_lock_wait_timeout is too small
|
||||
# we might get here ER_LOCK_WAIT_TIMEOUT.
|
||||
--error ER_LOCK_DEADLOCK
|
||||
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
|
||||
|
||||
# Second session
|
||||
connection user2;
|
||||
--echo Reap the server message for connection user2 UPDATE t1 ...
|
||||
reap;
|
||||
|
||||
# The server crashed when executing this UPDATE or the succeeding SQL command.
|
||||
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
|
||||
|
||||
connection default;
|
||||
disconnect user2;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Wait till all disconnects are completed
|
||||
--source include/wait_until_count_sessions.inc
|
@ -1,10 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
SET storage_engine=innodb;
|
||||
--source include/gis_generic.inc
|
||||
--source include/gis_keys.inc
|
||||
|
||||
#
|
||||
# Bug #15680 (SPATIAL key in innodb)
|
||||
#
|
||||
--error ER_TABLE_CANT_HANDLE_SPKEYS
|
||||
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
|
@ -1 +0,0 @@
|
||||
--innodb_lock_wait_timeout=1
|
@ -1,264 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
||||
--echo # without error
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
||||
|
||||
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
BEGIN;
|
||||
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
|
||||
CONNECT (addconroot, localhost, root,,);
|
||||
CONNECTION addconroot;
|
||||
|
||||
BEGIN;
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
CONNECTION default;
|
||||
DISCONNECT addconroot;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
--echo # End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46539 Various crashes on INSERT IGNORE SELECT + SELECT
|
||||
--echo # FOR UPDATE
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a int primary key auto_increment,
|
||||
b int, index(b)) engine=innodb;
|
||||
insert into t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
set autocommit=0;
|
||||
begin;
|
||||
select * from t1 where b=5 for update;
|
||||
connect (con1, localhost, root,,);
|
||||
connection con1;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert ignore into t1 (b) select a as b from t1;
|
||||
connection default;
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
disconnect con1;
|
||||
commit;
|
||||
set autocommit=default;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #37183 insert ignore into .. select ... hangs
|
||||
--echo # after deadlock was encountered
|
||||
--echo #
|
||||
connect (con1,localhost,root,,);
|
||||
create table t1(id int primary key,v int)engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
|
||||
create table t2 like t1;
|
||||
|
||||
--connection con1
|
||||
begin;
|
||||
update t1 set v=id*2 where id=1;
|
||||
|
||||
--connection default
|
||||
begin;
|
||||
update t1 set v=id*2 where id=2;
|
||||
|
||||
--connection con1
|
||||
--error 1205
|
||||
update t1 set v=id*2 where id=2;
|
||||
|
||||
--connection default
|
||||
--error 1205
|
||||
insert ignore into t2 select * from t1 where id=1;
|
||||
rollback;
|
||||
|
||||
--connection con1
|
||||
rollback;
|
||||
|
||||
--connection default
|
||||
disconnect con1;
|
||||
drop table t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#41756 Strange error messages about locks from InnoDB
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
--echo # In the default transaction isolation mode, and/or with
|
||||
--echo # innodb_locks_unsafe_for_binlog=OFF, handler::unlock_row()
|
||||
--echo # in InnoDB does nothing.
|
||||
--echo # Thus in order to reproduce the condition that led to the
|
||||
--echo # warning, one needs to relax isolation by either
|
||||
--echo # setting a weaker tx_isolation value, or by turning on
|
||||
--echo # the unsafe replication switch.
|
||||
--echo # For testing purposes, choose to tweak the isolation level,
|
||||
--echo # since it's settable at runtime, unlike
|
||||
--echo # innodb_locks_unsafe_for_binlog, which is
|
||||
--echo # only a command-line switch.
|
||||
--echo #
|
||||
set @@session.tx_isolation="read-committed";
|
||||
|
||||
--echo # Prepare data. We need a table with a unique index,
|
||||
--echo # for join_read_key to be used. The other column
|
||||
--echo # allows to control what passes WHERE clause filter.
|
||||
create table t1 (a int primary key, b int) engine=innodb;
|
||||
--echo # Let's make sure t1 has sufficient amount of rows
|
||||
--echo # to exclude JT_ALL access method when reading it,
|
||||
--echo # i.e. make sure that JT_EQ_REF(a) is always preferred.
|
||||
insert into t1 values (1,1), (2,null), (3,1), (4,1),
|
||||
(5,1), (6,1), (7,1), (8,1), (9,1), (10,1),
|
||||
(11,1), (12,1), (13,1), (14,1), (15,1),
|
||||
(16,1), (17,1), (18,1), (19,1), (20,1);
|
||||
--echo #
|
||||
--echo # Demonstrate that for the SELECT statement
|
||||
--echo # used later in the test JT_EQ_REF access method is used.
|
||||
--echo #
|
||||
--vertical_results
|
||||
explain
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
--horizontal_results
|
||||
--echo #
|
||||
--echo # Demonstrate that the reported SELECT statement
|
||||
--echo # no longer produces warnings.
|
||||
--echo #
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
commit;
|
||||
--echo #
|
||||
--echo # Demonstrate that due to lack of inter-sweep "reset" function,
|
||||
--echo # we keep some non-matching records locked, even though we know
|
||||
--echo # we could unlock them.
|
||||
--echo # To do that, show that if there is only one distinct value
|
||||
--echo # for a in t2 (a=2), we will keep record (2,null) in t1 locked.
|
||||
--echo # But if we add another value for "a" to t2, say 6,
|
||||
--echo # join_read_key cache will be pruned at least once,
|
||||
--echo # and thus record (2, null) in t1 will get unlocked.
|
||||
--echo #
|
||||
begin;
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
connect (con1,localhost,root,,);
|
||||
--echo #
|
||||
--echo # Switching to connection con1
|
||||
connection con1;
|
||||
--echo # We should be able to delete all records from t1 except (2, null),
|
||||
--echo # since they were not locked.
|
||||
begin;
|
||||
--echo # Delete in series of 3 records so that full scan
|
||||
--echo # is not used and we're not blocked on record (2,null)
|
||||
delete from t1 where a in (1,3,4);
|
||||
delete from t1 where a in (5,6,7);
|
||||
delete from t1 where a in (8,9,10);
|
||||
delete from t1 where a in (11,12,13);
|
||||
delete from t1 where a in (14,15,16);
|
||||
delete from t1 where a in (17,18);
|
||||
delete from t1 where a in (19,20);
|
||||
--echo #
|
||||
--echo # Record (2, null) is locked. This is actually unnecessary,
|
||||
--echo # because the previous select returned no rows.
|
||||
--echo # Just demonstrate the effect.
|
||||
--echo #
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
delete from t1;
|
||||
rollback;
|
||||
--echo #
|
||||
--echo # Switching to connection default
|
||||
connection default;
|
||||
--echo #
|
||||
--echo # Show that the original contents of t1 is intact:
|
||||
select * from t1;
|
||||
commit;
|
||||
--echo #
|
||||
--echo # Have a one more record in t2 to show that
|
||||
--echo # if join_read_key cache is purned, the current
|
||||
--echo # row under the cursor is unlocked (provided, this row didn't
|
||||
--echo # match the partial WHERE clause, of course).
|
||||
--echo # Sic: the result of this test dependent on the order of retrieval
|
||||
--echo # of records --echo # from the derived table, if !
|
||||
--echo # We use DELETE to disable the JOIN CACHE. This DELETE modifies no
|
||||
--echo # records. It also should leave no InnoDB row locks.
|
||||
--echo #
|
||||
begin;
|
||||
delete t1.* from t1 natural join (select 2 as a, 2 as b union all
|
||||
select 0 as a, 0 as b) as t2;
|
||||
--echo # Demonstrate that nothing was deleted form t1
|
||||
select * from t1;
|
||||
--echo #
|
||||
--echo # Switching to connection con1
|
||||
connection con1;
|
||||
begin;
|
||||
--echo # Since there is another distinct record in the derived table
|
||||
--echo # the previous matching record in t1 -- (2,null) -- was unlocked.
|
||||
delete from t1;
|
||||
--echo # We will need the contents of the table again.
|
||||
rollback;
|
||||
select * from t1;
|
||||
commit;
|
||||
--echo #
|
||||
--echo # Switching to connection default
|
||||
connection default;
|
||||
rollback;
|
||||
begin;
|
||||
--echo #
|
||||
--echo # Before this patch, we could wrongly unlock a record
|
||||
--echo # that was cached and later used in a join. Demonstrate that
|
||||
--echo # this is no longer the case.
|
||||
--echo # Sic: this test is also order-dependent (i.e. the
|
||||
--echo # the bug would show up only if the first record in the union
|
||||
--echo # is retreived and processed first.
|
||||
--echo #
|
||||
--echo # Verify that JT_EQ_REF is used.
|
||||
--vertical_results
|
||||
explain
|
||||
select 1 from t1 natural join (select 3 as a, 2 as b union all
|
||||
select 3 as a, 1 as b) as t2 for update;
|
||||
--horizontal_results
|
||||
--echo # Lock the record.
|
||||
select 1 from t1 natural join (select 3 as a, 2 as b union all
|
||||
select 3 as a, 1 as b) as t2 for update;
|
||||
--echo # Switching to connection con1
|
||||
connection con1;
|
||||
--echo #
|
||||
--echo # We should not be able to delete record (3,1) from t1,
|
||||
--echo # (previously it was possible).
|
||||
--echo #
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
delete from t1 where a=3;
|
||||
--echo # Switching to connection default
|
||||
connection default;
|
||||
commit;
|
||||
|
||||
disconnect con1;
|
||||
set @@session.tx_isolation=default;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
@ -1 +0,0 @@
|
||||
--innodb-lock-wait-timeout=2
|
@ -1,709 +0,0 @@
|
||||
# t/innodb_mysql.test
|
||||
#
|
||||
# Last update:
|
||||
# 2006-07-26 ML test refactored (MySQL 5.1)
|
||||
# main testing code t/innodb_mysql.test -> include/mix1.inc
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
let $engine_type= InnoDB;
|
||||
let $other_engine_type= MEMORY;
|
||||
# InnoDB does support FOREIGN KEYFOREIGN KEYs
|
||||
let $test_foreign_keys= 1;
|
||||
set global innodb_support_xa=default;
|
||||
set session innodb_support_xa=default;
|
||||
--source include/mix1.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3;
|
||||
--enable_warnings
|
||||
#
|
||||
# BUG#35850: Performance regression in 5.1.23/5.1.24
|
||||
#
|
||||
create table t1(a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (a int, b int, pk int, key(a,b), primary key(pk)) engine=innodb;
|
||||
insert into t2 select @a:=A.a+10*(B.a + 10*C.a),@a, @a from t1 A, t1 B, t1 C;
|
||||
--echo this must use key 'a', not PRIMARY:
|
||||
--replace_column 9 #
|
||||
explain select a from t2 where a=b;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #40360: Binlog related errors with binlog off
|
||||
#
|
||||
# This bug is triggered when the binlog format is STATEMENT and the
|
||||
# binary log is turned off. In this case, no error should be shown for
|
||||
# the statement since there are no replication issues.
|
||||
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
query_vertical select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
|
||||
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#37284 Crash in Field_string::type()
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
|
||||
CREATE INDEX i1 on t1 (a(3));
|
||||
SELECT * FROM t1 WHERE a = 'abcde';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of
|
||||
# requested column
|
||||
#
|
||||
|
||||
CREATE TABLE foo (a int, b int, c char(10),
|
||||
PRIMARY KEY (c(3)),
|
||||
KEY b (b)
|
||||
) engine=innodb;
|
||||
|
||||
CREATE TABLE foo2 (a int, b int, c char(10),
|
||||
PRIMARY KEY (c),
|
||||
KEY b (b)
|
||||
) engine=innodb;
|
||||
|
||||
CREATE TABLE bar (a int, b int, c char(10),
|
||||
PRIMARY KEY (c(3)),
|
||||
KEY b (b)
|
||||
) engine=myisam;
|
||||
|
||||
INSERT INTO foo VALUES
|
||||
(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
|
||||
(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
|
||||
|
||||
INSERT INTO bar SELECT * FROM foo;
|
||||
INSERT INTO foo2 SELECT * FROM foo;
|
||||
|
||||
--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2;
|
||||
--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2;
|
||||
--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2;
|
||||
|
||||
--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2;
|
||||
--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2;
|
||||
--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2;
|
||||
|
||||
DROP TABLE foo, bar, foo2;
|
||||
|
||||
|
||||
#
|
||||
# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t3,t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
|
||||
DELIMITER |;
|
||||
CREATE FUNCTION f1() RETURNS VARCHAR(250)
|
||||
BEGIN
|
||||
return 'hhhhhhh' ;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB;
|
||||
|
||||
BEGIN WORK;
|
||||
|
||||
CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB;
|
||||
CREATE TEMPORARY TABLE t3 LIKE t2;
|
||||
|
||||
INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL);
|
||||
|
||||
SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl');
|
||||
PREPARE stmt1 FROM @stmt;
|
||||
|
||||
SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2');
|
||||
PREPARE stmt3 FROM @stmt;
|
||||
|
||||
EXECUTE stmt1;
|
||||
|
||||
COMMIT;
|
||||
|
||||
DEALLOCATE PREPARE stmt1;
|
||||
DEALLOCATE PREPARE stmt3;
|
||||
|
||||
DROP TABLE t1,t3,t2;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
#
|
||||
# Bug#37016: TRUNCATE TABLE removes some rows but not all
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY,
|
||||
t1_id INT, INDEX par_ind (t1_id),
|
||||
FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
INSERT INTO t2 VALUES (3,2);
|
||||
|
||||
SET AUTOCOMMIT = 0;
|
||||
|
||||
START TRANSACTION;
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
|
||||
START TRANSACTION;
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
|
||||
SET AUTOCOMMIT = 1;
|
||||
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t2 WHERE id = 3;
|
||||
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
TRUNCATE TABLE t1;
|
||||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
TRUNCATE TABLE t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#40127 Multiple table DELETE IGNORE hangs on foreign key constraint violation on 5.0
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
aid INT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
FOREIGN KEY (aid) REFERENCES t1 (id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
bid INT UNSIGNED NOT NULL,
|
||||
FOREIGN KEY (bid) REFERENCES t2 (id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
a INT
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE t5 (
|
||||
a INT
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id, aid) VALUES (1, 1),(2,1),(3,1),(4,1);
|
||||
INSERT INTO t3 (bid) VALUES (1);
|
||||
|
||||
INSERT INTO t4 VALUES (1),(2),(3),(4),(5);
|
||||
INSERT INTO t5 VALUES (1);
|
||||
|
||||
DELETE t5 FROM t4 LEFT JOIN t5 ON t4.a= t5.a;
|
||||
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
DELETE t2, t1 FROM t2 INNER JOIN t1 ON (t2.aid = t1.id) WHERE t2.id = 1;
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
DELETE t2, t1 FROM t2 INNER JOIN t1 ON (t2.aid = t1.id) WHERE t2.id = 1;
|
||||
|
||||
DELETE IGNORE t2, t1 FROM t2 INNER JOIN t1 ON (t2.aid = t1.id) WHERE t2.id = 1;
|
||||
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
DROP TABLES t4,t5;
|
||||
|
||||
--echo # Bug#40127 Multiple table DELETE IGNORE hangs on foreign key constraint violation on 5.0
|
||||
--echo # Testing for any side effects of IGNORE on AFTER DELETE triggers used with
|
||||
--echo # transactional tables.
|
||||
--echo #
|
||||
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a VARCHAR(100)) ENGINE=InnoDB;
|
||||
CREATE TABLE t3 (i INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t4 (i INT NOT NULL PRIMARY KEY, t1i INT,
|
||||
FOREIGN KEY (t1i) REFERENCES t1(i))
|
||||
ENGINE=InnoDB;
|
||||
delimiter ||;
|
||||
CREATE TRIGGER trg AFTER DELETE ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
SET @b:='EXECUTED TRIGGER';
|
||||
INSERT INTO t2 VALUES (@b);
|
||||
SET @a:= error_happens_here;
|
||||
END||
|
||||
delimiter ;||
|
||||
|
||||
SET @b:="";
|
||||
SET @a:="";
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
INSERT INTO t3 SELECT * FROM t1;
|
||||
--echo ** An error in a trigger causes rollback of the statement.
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
DELETE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
|
||||
SELECT @a,@b;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;
|
||||
|
||||
--echo ** Same happens with the IGNORE option
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
DELETE IGNORE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;
|
||||
|
||||
--echo **
|
||||
--echo ** The following is an attempt to demonstrate
|
||||
--echo ** error handling inside a row iteration.
|
||||
--echo **
|
||||
DROP TRIGGER trg;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
TRUNCATE TABLE t3;
|
||||
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
INSERT INTO t3 VALUES (1),(2),(3),(4);
|
||||
INSERT INTO t4 VALUES (3,3),(4,4);
|
||||
|
||||
delimiter ||;
|
||||
CREATE TRIGGER trg AFTER DELETE ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
SET @b:= CONCAT('EXECUTED TRIGGER FOR ROW ',CAST(OLD.i AS CHAR));
|
||||
INSERT INTO t2 VALUES (@b);
|
||||
END||
|
||||
delimiter ;||
|
||||
|
||||
--echo ** DELETE is prevented by foreign key constrains but errors are silenced.
|
||||
--echo ** The AFTER trigger isn't fired.
|
||||
DELETE IGNORE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
|
||||
--echo ** Tables are modified by best effort:
|
||||
SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;
|
||||
--echo ** The AFTER trigger was only executed on successful rows:
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TRIGGER trg;
|
||||
|
||||
--echo **
|
||||
--echo ** Induce an error midway through an AFTER-trigger
|
||||
--echo **
|
||||
TRUNCATE TABLE t4;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t3;
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
INSERT INTO t3 VALUES (1),(2),(3),(4);
|
||||
delimiter ||;
|
||||
CREATE TRIGGER trg AFTER DELETE ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
SET @a:= @a+1;
|
||||
IF @a > 2 THEN
|
||||
INSERT INTO t4 VALUES (5,5);
|
||||
END IF;
|
||||
END||
|
||||
delimiter ;||
|
||||
|
||||
SET @a:=0;
|
||||
--echo ** Errors in the trigger causes the statement to abort.
|
||||
--error ER_NO_REFERENCED_ROW_2
|
||||
DELETE IGNORE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
|
||||
SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;
|
||||
SELECT * FROM t4;
|
||||
|
||||
DROP TRIGGER trg;
|
||||
DROP TABLE t4;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
||||
#
|
||||
# Bug#43580: Issue with Innodb on multi-table update
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, KEY (a)) ENGINE = INNODB;
|
||||
CREATE TABLE t2 (a INT KEY, b INT, KEY (b)) ENGINE = INNODB;
|
||||
|
||||
CREATE TABLE t3 (a INT, b INT KEY, KEY (a)) ENGINE = INNODB;
|
||||
CREATE TABLE t4 (a INT KEY, b INT, KEY (b)) ENGINE = INNODB;
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6);
|
||||
INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
|
||||
|
||||
INSERT INTO t3 VALUES (1, 101), (2, 102), (3, 103), (4, 104), (5, 105), (6, 106);
|
||||
INSERT INTO t4 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
|
||||
|
||||
UPDATE t1, t2 SET t1.a = t1.a + 100, t2.b = t1.a + 10
|
||||
WHERE t1.a BETWEEN 2 AND 4 AND t2.a = t1.b;
|
||||
--sorted_result
|
||||
SELECT * FROM t2;
|
||||
|
||||
UPDATE t3, t4 SET t3.a = t3.a + 100, t4.b = t3.a + 10
|
||||
WHERE t3.a BETWEEN 2 AND 4 AND t4.a = t3.b - 100;
|
||||
--sorted_result
|
||||
SELECT * FROM t4;
|
||||
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44886: SIGSEGV in test_if_skip_sort_order() -
|
||||
--echo # uninitialized variable used as subscript
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT, c INT, d INT, PRIMARY KEY (b), KEY (a,c))
|
||||
ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,1,1,0);
|
||||
|
||||
CREATE TABLE t2 (a INT, b INT, e INT, KEY (e)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,1,2);
|
||||
|
||||
CREATE TABLE t3 (a INT, b INT) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (1, 1);
|
||||
|
||||
SELECT * FROM t1, t2, t3
|
||||
WHERE t1.a = t3.a AND (t1.b = t3.b OR t1.d) AND t2.b = t1.b AND t2.e = 2
|
||||
GROUP BY t1.b;
|
||||
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #45828: Optimizer won't use partial primary key if another
|
||||
--echo # index can prevent filesort
|
||||
--echo #
|
||||
|
||||
# Create the table
|
||||
CREATE TABLE `t1` (
|
||||
c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 int NOT NULL,
|
||||
PRIMARY KEY (c1,c2),
|
||||
KEY (c3)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# populate with data
|
||||
INSERT INTO t1 VALUES (5,2,1246276747);
|
||||
INSERT INTO t1 VALUES (2,1,1246281721);
|
||||
INSERT INTO t1 VALUES (7,3,1246281756);
|
||||
INSERT INTO t1 VALUES (4,2,1246282139);
|
||||
INSERT INTO t1 VALUES (3,1,1246282230);
|
||||
INSERT INTO t1 VALUES (1,0,1246282712);
|
||||
INSERT INTO t1 VALUES (8,3,1246282765);
|
||||
INSERT INTO t1 SELECT c1+10,c2+10,c3+10 FROM t1;
|
||||
INSERT INTO t1 SELECT c1+100,c2+100,c3+100 from t1;
|
||||
INSERT INTO t1 SELECT c1+1000,c2+1000,c3+1000 from t1;
|
||||
INSERT INTO t1 SELECT c1+10000,c2+10000,c3+10000 from t1;
|
||||
INSERT INTO t1 SELECT c1+100000,c2+100000,c3+100000 from t1;
|
||||
INSERT INTO t1 SELECT c1+1000000,c2+1000000,c3+1000000 from t1;
|
||||
|
||||
# query and no rows will match the c1 condition, whereas all will match c3
|
||||
SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
|
||||
|
||||
# SHOULD use the pk.
|
||||
# index on c3 will be used instead of primary key
|
||||
EXPLAIN SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
|
||||
|
||||
# if we force the primary key, we can see the estimate is 1
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
|
||||
|
||||
|
||||
CREATE TABLE t2 (
|
||||
c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 int NOT NULL,
|
||||
KEY (c1,c2),
|
||||
KEY (c3)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# SHOULD use the pk.
|
||||
# if we switch it from a primary key to a regular index, it works correctly as well
|
||||
explain SELECT * FROM t2 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # 36259: Optimizing with ORDER BY
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL,
|
||||
d VARCHAR(5),
|
||||
e INT NOT NULL,
|
||||
PRIMARY KEY (a), KEY i2 (b,c,d)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 (b,c,d,e) VALUES (1,1,'a',1), (2,2,'b',2);
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
|
||||
EXPLAIN SELECT * FROM t1 WHERE b=1 AND c=1 ORDER BY a;
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(i2) WHERE b=1 and c=1 ORDER BY a;
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(PRIMARY) WHERE b=1 AND c=1 ORDER BY a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #47963: Wrong results when index is used
|
||||
--echo #
|
||||
CREATE TABLE t1(
|
||||
a VARCHAR(5) NOT NULL,
|
||||
b VARCHAR(5) NOT NULL,
|
||||
c DATETIME NOT NULL,
|
||||
KEY (c)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES('TEST', 'TEST', '2009-10-09 00:00:00');
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00' AND c <= '2009-10-09 00:00:00';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.0' AND c <= '2009-10-09 00:00:00.0';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.0' AND c <= '2009-10-09 00:00:00';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00' AND c <= '2009-10-09 00:00:00.0';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.000' AND c <= '2009-10-09 00:00:00.000';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.00' AND c <= '2009-10-09 00:00:00.001';
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.001' AND c <= '2009-10-09 00:00:00.00';
|
||||
EXPLAIN SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.001' AND c <= '2009-10-09 00:00:00.00';
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #46175: NULL read_view and consistent read assertion
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a CHAR(13),KEY(a)) ENGINE=innodb;
|
||||
CREATE TABLE t2(b DATETIME,KEY(b)) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (),();
|
||||
INSERT INTO t2 VALUES (),();
|
||||
CREATE OR REPLACE VIEW v1 AS SELECT 1 FROM t2
|
||||
WHERE b =(SELECT a FROM t1 LIMIT 1);
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
CONNECT (con1, localhost, root,,);
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
CONNECTION default;
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1(num INT)
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 0;
|
||||
REPEAT
|
||||
SHOW CREATE VIEW v1;
|
||||
SET i:=i+1;
|
||||
UNTIL i>num END REPEAT;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
--echo # Should not crash
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--send CALL p1(1000)
|
||||
CONNECTION con1;
|
||||
--echo # Should not crash
|
||||
CALL p1(1000);
|
||||
|
||||
CONNECTION default;
|
||||
--reap
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
|
||||
DISCONNECT con1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49324: more valgrind errors in test_if_skip_sort_order
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
|
||||
--echo #should not cause valgrind warnings
|
||||
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50843: Filesort used instead of clustered index led to
|
||||
--echo # performance degradation.
|
||||
--echo #
|
||||
create table t1(f1 int not null primary key, f2 int) engine=innodb;
|
||||
create table t2(f1 int not null, key (f1)) engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
insert into t2 values (1),(2),(3);
|
||||
explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
|
||||
drop table t1,t2;
|
||||
--echo #
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #39653: find_shortest_key in sql_select.cc does not consider
|
||||
--echo # clustered primary keys
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, d INT, e INT, f INT,
|
||||
KEY (b,c)) ENGINE=INNODB;
|
||||
|
||||
INSERT INTO t1 VALUES (1,1,1,1,1,1), (2,2,2,2,2,2), (3,3,3,3,3,3),
|
||||
(4,4,4,4,4,4), (5,5,5,5,5,5), (6,6,6,6,6,6),
|
||||
(7,7,7,7,7,7), (8,8,8,8,8,8), (9,9,9,9,9,9),
|
||||
(11,11,11,11,11,11);
|
||||
|
||||
--query_vertical EXPLAIN SELECT COUNT(*) FROM t1
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may
|
||||
--echo # corrupt definition at engine
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, KEY k (a,b))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
ALTER TABLE t1 DROP INDEX k, ADD UNIQUE INDEX k (a,b);
|
||||
|
||||
--query_vertical SHOW INDEXES FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #47453: InnoDB incorrectly changes TIMESTAMP columns when
|
||||
--echo # JOINed during an UPDATE
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (d INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT, b INT,
|
||||
c TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB;
|
||||
|
||||
--echo set up our data elements
|
||||
INSERT INTO t1 (d) VALUES (1);
|
||||
INSERT INTO t2 (a,b) VALUES (1,1);
|
||||
SELECT SECOND(c) INTO @bug47453 FROM t2;
|
||||
|
||||
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
|
||||
UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1;
|
||||
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
|
||||
|
||||
SELECT SLEEP(1);
|
||||
|
||||
UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1;
|
||||
|
||||
--echo #should be 0
|
||||
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #53334: wrong result for outer join with impossible ON condition
|
||||
--echo # (see the same test case for MyISAM in join.test)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY);
|
||||
CREATE TABLE t2 (id INT);
|
||||
|
||||
INSERT INTO t1 VALUES (75);
|
||||
INSERT INTO t1 VALUES (79);
|
||||
INSERT INTO t1 VALUES (78);
|
||||
INSERT INTO t1 VALUES (77);
|
||||
REPLACE INTO t1 VALUES (76);
|
||||
REPLACE INTO t1 VALUES (76);
|
||||
INSERT INTO t1 VALUES (104);
|
||||
INSERT INTO t1 VALUES (103);
|
||||
INSERT INTO t1 VALUES (102);
|
||||
INSERT INTO t1 VALUES (101);
|
||||
INSERT INTO t1 VALUES (105);
|
||||
INSERT INTO t1 VALUES (106);
|
||||
INSERT INTO t1 VALUES (107);
|
||||
|
||||
INSERT INTO t2 VALUES (107),(75),(1000);
|
||||
|
||||
SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
|
||||
WHERE t2.id=75 AND t1.id IS NULL;
|
||||
EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
|
||||
WHERE t2.id=75 AND t1.id IS NULL;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test for bug #39932 "create table fails if column for FK is in different
|
||||
--echo # case than in corr index".
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop tables if exists t1, t2;
|
||||
--enable_warnings
|
||||
create table t1 (pk int primary key) engine=InnoDB;
|
||||
--echo # Even although the below statement uses uppercased field names in
|
||||
--echo # foreign key definition it still should be able to find explicitly
|
||||
--echo # created supporting index. So it should succeed and should not
|
||||
--echo # create any additional supporting indexes.
|
||||
create table t2 (fk int, key x (fk),
|
||||
constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
|
||||
show create table t2;
|
||||
drop table t2, t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44613 SELECT statement inside FUNCTION takes a shared lock
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(x INT PRIMARY KEY, y INT) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (1, 0), (2, 0);
|
||||
|
||||
CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA
|
||||
RETURN (SELECT x FROM t1 WHERE x = z);
|
||||
|
||||
--echo # Connection default
|
||||
START TRANSACTION;
|
||||
SELECT f1(1);
|
||||
|
||||
--echo # Connection con2
|
||||
--disable_query_log
|
||||
connect (con2, localhost, root);
|
||||
--enable_query_log
|
||||
START TRANSACTION;
|
||||
SELECT f1(1);
|
||||
# This next statement used to block.
|
||||
UPDATE t1 SET y = 1 WHERE x = 1;
|
||||
|
||||
COMMIT;
|
||||
|
||||
disconnect con2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
@ -1 +0,0 @@
|
||||
--innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1
|
@ -1,35 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# Bug #41453: Assertion `m_status == DA_ERROR' failed in
|
||||
# Diagnostics_area::sql_errno
|
||||
#
|
||||
|
||||
CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
|
||||
DEFAULT CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
|
||||
CONNECT (con1,localhost,root,,);
|
||||
CONNECT (con2,localhost,root,,);
|
||||
|
||||
CONNECTION con1;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
|
||||
CONNECTION con2;
|
||||
START TRANSACTION;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
|
||||
ROLLBACK;
|
||||
|
||||
CONNECTION con1;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
|
||||
CONNECTION con2;
|
||||
START TRANSACTION;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
|
||||
SELECT * FROM t1 WHERE b = 10;
|
||||
|
||||
CONNECTION default;
|
||||
DISCONNECT con1;
|
||||
DISCONNECT con2;
|
||||
DROP TABLE t1;
|
@ -1,50 +0,0 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
|
||||
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
|
||||
|
||||
#
|
||||
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
|
||||
# non-blocking SELECT
|
||||
#
|
||||
SET GLOBAL log_bin_trust_function_creators = 1;
|
||||
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
|
||||
insert t1 values (1,100);
|
||||
delimiter |;
|
||||
create function f1 () returns integer begin
|
||||
declare var1 int;
|
||||
select col2 into var1 from t1 where col1=1 for update;
|
||||
return var1;
|
||||
end|
|
||||
delimiter ;|
|
||||
start transaction;
|
||||
select f1();
|
||||
connection b;
|
||||
send update t1 set col2=0 where col1=1;
|
||||
connection default;
|
||||
select * from t1;
|
||||
connection a;
|
||||
rollback;
|
||||
connection b;
|
||||
reap;
|
||||
rollback;
|
||||
|
||||
# Cleanup
|
||||
connection a;
|
||||
disconnect a;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection b;
|
||||
disconnect b;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
|
@ -1 +0,0 @@
|
||||
--innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout
|
@ -1,5 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--source include/innodb_rollback_on_timeout.inc
|
||||
|
||||
--echo End of 5.0 tests
|
@ -936,4 +936,49 @@ FROM t1 tt3 LEFT OUTER JOIN t1 tt4 ON 1
|
||||
|
||||
SET optimizer_search_depth = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46091 STRAIGHT_JOIN + RIGHT JOIN returns different result
|
||||
--echo #
|
||||
CREATE TABLE t1 (f1 INT NOT NULL);
|
||||
INSERT INTO t1 VALUES (9),(0);
|
||||
|
||||
CREATE TABLE t2 (f1 INT NOT NULL);
|
||||
INSERT INTO t2 VALUES
|
||||
(5),(3),(0),(3),(1),(0),(1),(7),(1),(0),(0),(8),(4),(9),(0),(2),(0),(8),(5),(1);
|
||||
|
||||
SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
|
||||
RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
|
||||
|
||||
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
|
||||
RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990
|
||||
--echo #
|
||||
CREATE TABLE t1(f1 INT, PRIMARY KEY (f1));
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
|
||||
LEFT JOIN t1 AS jt2
|
||||
RIGHT JOIN t1 AS jt3
|
||||
JOIN t1 AS jt4 ON 1
|
||||
LEFT JOIN t1 AS jt5 ON 1
|
||||
ON 1
|
||||
RIGHT JOIN t1 AS jt6 ON jt6.f1
|
||||
ON 1;
|
||||
|
||||
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
|
||||
RIGHT JOIN t1 AS jt2
|
||||
RIGHT JOIN t1 AS jt3
|
||||
JOIN t1 AS jt4 ON 1
|
||||
LEFT JOIN t1 AS jt5 ON 1
|
||||
ON 1
|
||||
RIGHT JOIN t1 AS jt6 ON jt6.f1
|
||||
ON 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -550,4 +550,24 @@ let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/t1.txt;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #52512 : Assertion `! is_set()' in
|
||||
--echo # Diagnostics_area::set_ok_status on LOAD DATA
|
||||
--echo #
|
||||
|
||||
connect (con1,localhost,root,,test);
|
||||
|
||||
CREATE TABLE t1 (id INT NOT NULL);
|
||||
--send LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1
|
||||
# please keep this is a spearate test file : it's important to have no
|
||||
# commands after this one
|
||||
|
||||
connection default;
|
||||
dirty_close con1;
|
||||
|
||||
connect (con1,localhost,root,,test);
|
||||
DROP TABLE t1;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -586,7 +586,7 @@ reset master;
|
||||
UPDATE t2,t1 SET t2.a=t1.a+2;
|
||||
# check
|
||||
select * from t2 /* must be (3,1), (4,4) */;
|
||||
show master status /* there must be the UPDATE query event */;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# B. testing multi_update::send_error() ineffective update
|
||||
# (as there is a policy described at mysql_update() still go to binlog)
|
||||
@ -597,7 +597,7 @@ insert into t2 values (1,2),(3,4),(4,4);
|
||||
reset master;
|
||||
--error ER_DUP_ENTRY
|
||||
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
|
||||
show master status /* there must be the UPDATE query event */;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# cleanup
|
||||
drop table t1, t2;
|
||||
|
@ -8,6 +8,34 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
|
||||
FLUSH TABLES;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.par
|
||||
--replace_result $MYSQLD_DATADIR ./
|
||||
CHECK TABLE t1;
|
||||
--error ER_FAILED_READ_FROM_PAR_FILE
|
||||
SELECT * FROM t1;
|
||||
--echo # Note that it is currently impossible to drop a partitioned table
|
||||
--echo # without the .par file
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
DROP TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.frm
|
||||
--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI
|
||||
--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
|
||||
--echo # with temporary table and partitions
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
|
||||
--error ER_PARTITION_NO_TEMPORARY
|
||||
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with
|
||||
--echo # subpartitions
|
||||
@ -191,7 +219,6 @@ partitions 3
|
||||
partition x2 tablespace ts2,
|
||||
partition x3 tablespace ts3);
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
||||
#
|
||||
# Partition by hash, invalid field in function
|
||||
|
@ -34,7 +34,6 @@ end|
|
||||
reset master|
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug23333(),1)|
|
||||
--replace_column 2 # 5 # 6 #
|
||||
# the following must show there is (are) events after the query */
|
||||
source include/show_binlog_events.inc|
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
|
@ -88,9 +88,18 @@ INSERT INTO t1 VALUES ('0:00:00');
|
||||
SELECT CAST(c AS TIME) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(f1 TIME);
|
||||
INSERT INTO t1 VALUES ('23:38:57');
|
||||
SELECT TIMESTAMP(f1,'1') FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
#
|
||||
# Bug#42664 - Sign ignored for TIME types when not comparing as longlong
|
||||
|
@ -773,6 +773,21 @@ show variables like 'hostname';
|
||||
--echo # Test 'myisam_mmap_size' option is not dynamic
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@myisam_mmap_size= 500M;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #52315: utc_date() crashes when system time > year 2037
|
||||
--echo #
|
||||
|
||||
--error 0, ER_UNKNOWN_ERROR
|
||||
SET TIMESTAMP=2*1024*1024*1024;
|
||||
--echo #Should not crash
|
||||
--disable_result_log
|
||||
SELECT UTC_DATE();
|
||||
--enable_result_log
|
||||
SET TIMESTAMP=DEFAULT;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user