Debian Codegraph @

mysql-test/suite/ndb/t/ndb_multi_row.test

raw
1 -- source include/have_multi_ndb.inc
2
3 --disable_warnings
4 connection server2;
5 drop table if exists t1, t2, t3, t4;
6 flush status;
7 connection server1;
8 drop table if exists t1, t2, t3, t4;
9 flush status;
10 --enable_warnings
11
12
13 # Create test tables on server1
14 create table t1 (a int) engine=ndbcluster;
15 create table t2 (a int) engine=ndbcluster;
16 insert into t1 value (2);
17 insert into t2 value (3);
18 select * from t1;
19 select * from t2;
20 show status like 'handler_discover%';
21
22 # Check dropping and recreating table on same server
23 connect (con1,localhost,root,,test);
24 connect (con2,localhost,root,,test);
25 connection con1;
26 select * from t1;
27 connection con2;
28 drop table t1;
29 create table t1 (a int) engine=ndbcluster;
30 insert into t1 value (2);
31 connection con1;
32 select * from t1;
33
34 # Check dropping and recreating table on different server
35 connection server2;
36 show status like 'handler_discover%';
37 drop table t1;
38 create table t1 (a int) engine=ndbcluster;
39 insert into t1 value (2);
40 connection server1;
41 ## Currently a retry is required remotely
42 #--error 1412
43 #select * from t1;
44 #show warnings;
45 #flush table t1;
46 # Table definition change should be propagated automatically
47 select * from t1;
48
49 # Connect to server2 and use the tables from there
50 connection server2;
51 flush status;
52 select * from t1;
53 update t1 set a=3 where a=2;
54 show status like 'handler_discover%';
55
56 # Create a new table on server2
57 create table t3 (a int not null primary key, b varchar(22),
58 c int, last_col text) engine=ndb;
59 insert into t3 values(1, 'Hi!', 89, 'Longtext column');
60 create table t4 (pk int primary key, b int) engine=ndb;
61
62 # Check that the tables are accessible from server1
63 connection server1;
64 select * from t1;
65 select * from t3;
66 show tables like 't4';
67 show tables;
68
69 drop table t1, t2, t3, t4;
70 connection server2;
71 drop table if exists t1, t3, t4;
72
73 # End of 4.1 tests