mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into perch.ndb.mysql.com:/home/jonas/src/51-ndb
This commit is contained in:
@ -5,10 +5,6 @@ connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
|
||||
# Check that server1 has NDB support
|
||||
connection server1;
|
||||
disable_query_log;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
flush tables;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
@ -17,14 +13,32 @@ enable_query_log;
|
||||
# Check that server2 has NDB support
|
||||
connection server2;
|
||||
disable_query_log;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
flush tables;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
enable_query_log;
|
||||
|
||||
# Set the default connection to 'server1'
|
||||
# cleanup
|
||||
|
||||
connection server1;
|
||||
disable_query_log;
|
||||
disable_warnings;
|
||||
--error 0,1051
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
|
||||
flush tables;
|
||||
flush status;
|
||||
enable_warnings;
|
||||
enable_query_log;
|
||||
|
||||
connection server2;
|
||||
disable_query_log;
|
||||
disable_warnings;
|
||||
--error 0,1051
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
|
||||
flush tables;
|
||||
flush status;
|
||||
enable_warnings;
|
||||
enable_query_log;
|
||||
|
||||
# Set the default connection
|
||||
connection server1;
|
||||
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
@ -132,11 +133,11 @@ master_epoch, count))
|
||||
engine ndb;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
t1$EX
|
||||
t1$ex
|
||||
use test;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
t1$EX
|
||||
t1$ex
|
||||
drop table `test`.`t1$EX`;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
75
mysql-test/suite/ndb/r/ndb_update_no_read.result
Normal file
75
mysql-test/suite/ndb/r/ndb_update_no_read.result
Normal file
@ -0,0 +1,75 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1 (a int not null primary key, b int not null, c int,
|
||||
unique index_b (b) using hash)
|
||||
engine ndb;
|
||||
insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
|
||||
(9,2,2),(10,1,2);
|
||||
update t1 set c = 111, b = 20 where a = 1;
|
||||
select * from t1 where a = 1 order by a;
|
||||
a b c
|
||||
1 20 111
|
||||
delete from t1 where a = 1;
|
||||
select * from t1 where a = 1 order by a;
|
||||
a b c
|
||||
update t1 set c = 12, b = 19 where b = 2;
|
||||
select * from t1 where b = 2 order by a;
|
||||
a b c
|
||||
delete from t1 where b = 19;
|
||||
select * from t1 where b = 19 order by a;
|
||||
a b c
|
||||
update t1 set c = 22 where a = 10 or a >= 10;
|
||||
select * from t1 order by a;
|
||||
a b c
|
||||
2 9 1
|
||||
3 8 1
|
||||
4 7 1
|
||||
5 6 1
|
||||
6 5 2
|
||||
7 4 2
|
||||
8 3 2
|
||||
10 1 22
|
||||
update t1 set c = 23 where a in (8,10);
|
||||
select * from t1 order by a;
|
||||
a b c
|
||||
2 9 1
|
||||
3 8 1
|
||||
4 7 1
|
||||
5 6 1
|
||||
6 5 2
|
||||
7 4 2
|
||||
8 3 23
|
||||
10 1 23
|
||||
update t1 set c = 23 where a in (7,8) or a >= 10;
|
||||
select * from t1 order by a;
|
||||
a b c
|
||||
2 9 1
|
||||
3 8 1
|
||||
4 7 1
|
||||
5 6 1
|
||||
6 5 2
|
||||
7 4 23
|
||||
8 3 23
|
||||
10 1 23
|
||||
update t1 set c = 11 where a = 3 or b = 7;
|
||||
select * from t1 where a = 3 or b = 7 order by a;
|
||||
a b c
|
||||
3 8 11
|
||||
4 7 11
|
||||
update t1 set a = 13, b = 20 where a = 3;
|
||||
select * from t1 where a = 13 order by a;
|
||||
a b c
|
||||
13 20 11
|
||||
update t1 set a = 12, b = 19 where b = 7;
|
||||
select * from t1 where b = 19 order by a;
|
||||
a b c
|
||||
12 19 11
|
||||
select * from t1 where b = 7 order by a;
|
||||
a b c
|
||||
update t1 set c = 12, b = 29 where a = 5 and b = 6;
|
||||
select * from t1 where b = 19 order by a;
|
||||
a b c
|
||||
12 19 11
|
||||
delete from t1 where b = 6 and c = 12;
|
||||
select * from t1 where b = 6 order by a;
|
||||
a b c
|
||||
drop table t1;
|
@ -4,11 +4,11 @@
|
||||
--disable_warnings
|
||||
connection server2;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
connection server1;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
--enable_warnings
|
||||
|
||||
flush status;
|
||||
--enable_warnings
|
||||
|
||||
# Create test tables on server1
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
@ -139,9 +139,11 @@ create table `test`.`t1$EX`
|
||||
|
||||
# check that table shows up ok on both servers
|
||||
# before bugfix table would not show up on server2
|
||||
--replace_regex /EX/ex/
|
||||
show tables like '%$%';
|
||||
connection server2;
|
||||
use test;
|
||||
--replace_regex /EX/ex/
|
||||
show tables like '%$%';
|
||||
|
||||
# check cleanup
|
||||
|
@ -6,11 +6,12 @@
|
||||
--disable_warnings
|
||||
connection server2;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
connection server1;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
--enable_warnings
|
||||
|
||||
flush status;
|
||||
|
||||
# Create test tables on server1
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
79
mysql-test/suite/ndb/t/ndb_update_no_read.test
Normal file
79
mysql-test/suite/ndb/t/ndb_update_no_read.test
Normal file
@ -0,0 +1,79 @@
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# New test case for WL 3686 (which is not until CGE-6.3)
|
||||
# but test is committed in 5.1 to verify consistant results.
|
||||
#
|
||||
# When only constant expressions in update statements and
|
||||
# only PK or UK in WHERE clause. No extra WHERE parts are
|
||||
# allowed. WL #3687 takes of more advanced variants of
|
||||
# avoiding the read before the update/delete
|
||||
|
||||
create table t1 (a int not null primary key, b int not null, c int,
|
||||
unique index_b (b) using hash)
|
||||
engine ndb;
|
||||
|
||||
insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
|
||||
(9,2,2),(10,1,2);
|
||||
|
||||
# These ones should use optimisation
|
||||
|
||||
update t1 set c = 111, b = 20 where a = 1;
|
||||
|
||||
select * from t1 where a = 1 order by a;
|
||||
|
||||
delete from t1 where a = 1;
|
||||
|
||||
select * from t1 where a = 1 order by a;
|
||||
|
||||
update t1 set c = 12, b = 19 where b = 2;
|
||||
|
||||
select * from t1 where b = 2 order by a;
|
||||
|
||||
delete from t1 where b = 19;
|
||||
|
||||
select * from t1 where b = 19 order by a;
|
||||
|
||||
update t1 set c = 22 where a = 10 or a >= 10;
|
||||
|
||||
select * from t1 order by a;
|
||||
|
||||
update t1 set c = 23 where a in (8,10);
|
||||
|
||||
select * from t1 order by a;
|
||||
|
||||
update t1 set c = 23 where a in (7,8) or a >= 10;
|
||||
|
||||
select * from t1 order by a;
|
||||
|
||||
# These ones should not use optimisation
|
||||
|
||||
update t1 set c = 11 where a = 3 or b = 7;
|
||||
|
||||
select * from t1 where a = 3 or b = 7 order by a;
|
||||
|
||||
update t1 set a = 13, b = 20 where a = 3;
|
||||
|
||||
select * from t1 where a = 13 order by a;
|
||||
|
||||
update t1 set a = 12, b = 19 where b = 7;
|
||||
|
||||
select * from t1 where b = 19 order by a;
|
||||
|
||||
select * from t1 where b = 7 order by a;
|
||||
|
||||
update t1 set c = 12, b = 29 where a = 5 and b = 6;
|
||||
|
||||
select * from t1 where b = 19 order by a;
|
||||
|
||||
delete from t1 where b = 6 and c = 12;
|
||||
|
||||
select * from t1 where b = 6 order by a;
|
||||
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user