diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-24 21:39:22 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-24 21:39:22 +0200 |
commit | 79cdd8773c365d80e6ed528668dfb03eda7406b3 (patch) | |
tree | 9b28e48e8d0ca0adf65597e0f97497a4d34c0673 | |
parent | 18ca5c4dbc890684316df6c29e5b34c018849126 (diff) | |
download | mariadb-git-79cdd8773c365d80e6ed528668dfb03eda7406b3.tar.gz |
Updated results after merge from 3.23
-rw-r--r-- | mysql-test/r/innodb-deadlock.result | 20 | ||||
-rw-r--r-- | mysql-test/r/null_key.result | 16 | ||||
-rw-r--r-- | mysql-test/t/innodb-deadlock.test | 38 |
3 files changed, 74 insertions, 0 deletions
diff --git a/mysql-test/r/innodb-deadlock.result b/mysql-test/r/innodb-deadlock.result new file mode 100644 index 00000000000..121bfa8c6cb --- /dev/null +++ b/mysql-test/r/innodb-deadlock.result @@ -0,0 +1,20 @@ +drop table if exists t1; +create table t1 (id integer, x integer) type=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; +id x +0 0 +set autocommit=0; +update t1 set x=2 where id = 0; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +commit; +commit; +select * from t1; +id x +0 2 +commit; +drop table t1; diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index b737f9254b0..236def64b5e 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -228,20 +228,36 @@ alter table t1 add key id (id); select * from t1, t2 where t1.id = t2.id; id id drop table t1,t2; +create table t1 ( +id integer, +id2 integer not null, +index (id), +index (id2) +); +insert into t1 values(null,null),(1,1); +select * from t1; id id2 NULL 0 1 1 +select * from t1 where id <=> null; id id2 NULL 0 +select * from t1 where id <=> null or id > 0; id id2 NULL 0 1 1 +select * from t1 where id is null or id > 0; id id2 NULL 0 1 1 +select * from t1 where id2 <=> null or id2 > 0; id id2 1 1 +select * from t1 where id2 is null or id2 > 0; id id2 1 1 +delete from t1 where id <=> NULL; +select * from t1; id id2 1 1 +drop table t1; diff --git a/mysql-test/t/innodb-deadlock.test b/mysql-test/t/innodb-deadlock.test new file mode 100644 index 00000000000..bc2839bfb3a --- /dev/null +++ b/mysql-test/t/innodb-deadlock.test @@ -0,0 +1,38 @@ +-- source include/have_innodb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +drop table if exists t1; + +# +# Testing of FOR UPDATE +# + +connection con1; +create table t1 (id integer, x integer) type=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; + +connection con2; +set autocommit=0; + +# The following query should hang because con1 is locking the page +--send +update t1 set x=2 where id = 0; +--sleep 2; + +connection con1; +update t1 set x=1 where id = 0; +select * from t1; +commit; + +connection con2; +reap; +commit; + +connection con1; +select * from t1; +commit; + +drop table t1; |