mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG21310/mysql-5.0-engines
This commit is contained in:
37
mysql-test/include/innodb_rollback_on_timeout.inc
Normal file
37
mysql-test/include/innodb_rollback_on_timeout.inc
Normal file
@ -0,0 +1,37 @@
|
||||
#
|
||||
# Bug #24200: Provide backwards compatibility mode for 4.x "rollback on
|
||||
# transaction timeout"
|
||||
#
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con2;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
# Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this
|
||||
# statement will time out; in 5.0.13+, it will not roll back transaction.
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into t1 values (2);
|
||||
# On 5.0.13+, this should give ==> 1, 5
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
@ -58,6 +58,7 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff
|
||||
use File::Path;
|
||||
use File::Basename;
|
||||
use File::Copy;
|
||||
use File::Temp qw / tempdir /;
|
||||
use Cwd;
|
||||
use Getopt::Long;
|
||||
use Sys::Hostname;
|
||||
@ -1020,6 +1021,11 @@ sub command_line_setup () {
|
||||
my $sockdir = $opt_tmpdir;
|
||||
$sockdir =~ s|/+$||;
|
||||
|
||||
# On some operating systems, there is a limit to the length of a
|
||||
# UNIX domain socket's path far below PATH_MAX, so try to avoid long
|
||||
# socket path names.
|
||||
$sockdir = tempdir(CLEANUP => 1) if ( length($sockdir) > 80 );
|
||||
|
||||
# Put this into a hash, will be a C struct
|
||||
|
||||
$master->[0]=
|
||||
|
@ -1916,4 +1916,16 @@ CHAR(0xff,0x8f USING utf8) IS NULL
|
||||
Warnings:
|
||||
Error 1300 Invalid utf8 character string: 'FF8F'
|
||||
SET SQL_MODE=@orig_sql_mode;
|
||||
select substring('abc', cast(2 as unsigned int));
|
||||
substring('abc', cast(2 as unsigned int))
|
||||
bc
|
||||
select repeat('a', cast(2 as unsigned int));
|
||||
repeat('a', cast(2 as unsigned int))
|
||||
aa
|
||||
select rpad('abc', cast(5 as unsigned integer), 'x');
|
||||
rpad('abc', cast(5 as unsigned integer), 'x')
|
||||
abcxx
|
||||
select lpad('abc', cast(5 as unsigned integer), 'x');
|
||||
lpad('abc', cast(5 as unsigned integer), 'x')
|
||||
xxabc
|
||||
End of 5.0 tests
|
||||
|
@ -284,7 +284,7 @@ NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
|
||||
explain select * from (select * from t1 where key1 = 3 or key2 =3) as Z where key8 >5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where
|
||||
2 DERIVED t1 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where; Using index
|
||||
create table t3 like t0;
|
||||
insert into t3 select * from t0;
|
||||
alter table t3 add key9 int not null, add index i9(key9);
|
||||
|
@ -194,3 +194,14 @@ explain select a from t2 where a='ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref a a 6 const 1 Using where
|
||||
drop table t2;
|
||||
CREATE TABLE t1(c1 INT, c2 INT DEFAULT 0, c3 CHAR(255) DEFAULT '',
|
||||
KEY(c1), KEY(c2), KEY(c3));
|
||||
INSERT INTO t1(c1) VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),
|
||||
(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0);
|
||||
INSERT INTO t1 VALUES(0,0,0);
|
||||
CREATE TABLE t2(c1 int);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
DELETE t1 FROM t1,t2 WHERE t1.c1=0 AND t1.c2=0;
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -383,4 +383,40 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
|
||||
DROP TABLE t1;
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
Variable_name Value
|
||||
innodb_rollback_on_timeout OFF
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
5
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
35
mysql-test/r/innodb_timeout_rollback.result
Normal file
35
mysql-test/r/innodb_timeout_rollback.result
Normal file
@ -0,0 +1,35 @@
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
Variable_name Value
|
||||
innodb_rollback_on_timeout ON
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
@ -10,6 +10,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
im_daemon_life_cycle : Bug#24415 see note: [19 Dec 23:17] Trudy Pelzer
|
||||
ndb_load : Bug#17233
|
||||
user_limits : Bug#23921 random failure of user_limits.test
|
||||
flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin
|
||||
|
@ -991,5 +991,13 @@ SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
|
||||
|
||||
SET SQL_MODE=@orig_sql_mode;
|
||||
|
||||
#
|
||||
# Bug #24947: problem with some string function with unsigned int parameters
|
||||
#
|
||||
|
||||
select substring('abc', cast(2 as unsigned int));
|
||||
select repeat('a', cast(2 as unsigned int));
|
||||
select rpad('abc', cast(5 as unsigned integer), 'x');
|
||||
select lpad('abc', cast(5 as unsigned integer), 'x');
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -250,3 +250,18 @@ select count(a) from t2 ignore index(a,b) where a='AAAAAAAA' and b='AAAAAAAA';
|
||||
insert into t2 values ('ab', 'ab', 'uh', 'oh');
|
||||
explain select a from t2 where a='ab';
|
||||
drop table t2;
|
||||
|
||||
#
|
||||
# BUG#25048 - ERROR 126 : Incorrect key file for table '.XXXX.MYI'; try to
|
||||
# repair it
|
||||
#
|
||||
CREATE TABLE t1(c1 INT, c2 INT DEFAULT 0, c3 CHAR(255) DEFAULT '',
|
||||
KEY(c1), KEY(c2), KEY(c3));
|
||||
INSERT INTO t1(c1) VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),
|
||||
(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0);
|
||||
INSERT INTO t1 VALUES(0,0,0);
|
||||
CREATE TABLE t2(c1 int);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
DELETE t1 FROM t1,t2 WHERE t1.c1=0 AND t1.c2=0;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1,t2;
|
||||
|
1
mysql-test/t/innodb_mysql-master.opt
Normal file
1
mysql-test/t/innodb_mysql-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb-lock-wait-timeout=2
|
@ -384,4 +384,6 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--source include/innodb_rollback_on_timeout.inc
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
1
mysql-test/t/innodb_timeout_rollback-master.opt
Normal file
1
mysql-test/t/innodb_timeout_rollback-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout
|
5
mysql-test/t/innodb_timeout_rollback.test
Normal file
5
mysql-test/t/innodb_timeout_rollback.test
Normal file
@ -0,0 +1,5 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--source include/innodb_rollback_on_timeout.inc
|
||||
|
||||
--echo End of 5.0 tests
|
Reference in New Issue
Block a user