1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge mysqldev@production.mysql.com:my/mysql-5.0-release

into mysql.com:/Users/kent/mysql/bk/mysql-5.0-release
This commit is contained in:
unknown
2005-09-30 22:01:34 +02:00
11 changed files with 107 additions and 53 deletions

View File

@ -2616,31 +2616,50 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
DROP TABLE t2;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2);
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=0;
checksum table test_checksum;
checksum table t1;
Table Checksum
test.test_checksum 1531596814
insert into test_checksum values(3);
checksum table test_checksum;
test.t1 1531596814
insert into t1 values(3);
checksum table t1;
Table Checksum
test.test_checksum 2605035534
test.t1 2605035534
commit;
checksum table test_checksum;
checksum table t1;
Table Checksum
test.test_checksum 127268899
test.t1 127268899
commit;
drop table test_checksum;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2);
drop table t1;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=1;
checksum table test_checksum;
checksum table t1;
Table Checksum
test.test_checksum 1531596814
test.t1 1531596814
set autocommit=1;
insert into test_checksum values(3);
checksum table test_checksum;
insert into t1 values(3);
checksum table t1;
Table Checksum
test.test_checksum 127268899
drop table test_checksum;
test.t1 127268899
drop table t1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
create function f1 () returns integer begin
declare var1 int;
select col2 into var1 from t1 where col1=1 for update;
return var1;
end|
start transaction;
select f1();
f1()
100
update t1 set col2=0 where col1=1;
select * from t1;
col1 col2
1 100
rollback;
rollback;
drop table t1;
drop function f1;

View File

@ -1571,36 +1571,67 @@ DROP TABLE t2;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2);
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=0;
checksum table test_checksum;
checksum table t1;
connection b;
insert into test_checksum values(3);
insert into t1 values(3);
connection a;
#
# Here checksum should not see insert
#
checksum table test_checksum;
checksum table t1;
connection a;
commit;
checksum table test_checksum;
checksum table t1;
commit;
drop table test_checksum;
drop table t1;
#
# autocommit = 1
#
connection a;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2);
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=1;
checksum table test_checksum;
checksum table t1;
connection b;
set autocommit=1;
insert into test_checksum values(3);
insert into t1 values(3);
connection a;
#
# Here checksum sees insert
#
checksum table test_checksum;
drop table test_checksum;
checksum table t1;
drop table t1;
#
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
# non-blocking SELECT
#
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;
connection default;
drop table t1;
drop function f1;
disconnect a;
disconnect b;