218 lines
4.3 KiB
Plaintext
218 lines
4.3 KiB
Plaintext
flush status;
|
|
flush status;
|
|
create table t1 (a int) engine=ndbcluster;
|
|
create table t2 (a int) engine=ndbcluster;
|
|
insert into t1 value (2);
|
|
insert into t2 value (3);
|
|
select * from t1;
|
|
a
|
|
2
|
|
select * from t2;
|
|
a
|
|
3
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
select * from t1;
|
|
a
|
|
2
|
|
drop table t1;
|
|
create table t1 (a int) engine=ndbcluster;
|
|
insert into t1 value (2);
|
|
select * from t1;
|
|
a
|
|
2
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
drop table t1;
|
|
create table t1 (a int) engine=ndbcluster;
|
|
insert into t1 value (2);
|
|
select * from t1;
|
|
a
|
|
2
|
|
select * from t1;
|
|
a
|
|
2
|
|
flush status;
|
|
select * from t1;
|
|
a
|
|
2
|
|
update t1 set a=3 where a=2;
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
create table t3 (a int not null primary key, b varchar(22),
|
|
c int, last_col text) engine=ndb;
|
|
insert into t3 values(1, 'Hi!', 89, 'Longtext column');
|
|
create table t4 (pk int primary key, b int) engine=ndb;
|
|
select * from t1;
|
|
a
|
|
3
|
|
select * from t3;
|
|
a b c last_col
|
|
1 Hi! 89 Longtext column
|
|
show tables like 't4';
|
|
Tables_in_test (t4)
|
|
t4
|
|
show tables;
|
|
Tables_in_test
|
|
t1
|
|
t2
|
|
t3
|
|
t4
|
|
drop table t1, t2, t3, t4;
|
|
create table t1(c1 int key) ENGINE=InnoDB;
|
|
insert into t1 values(1),(3),(5);
|
|
select * from t1 order by c1;
|
|
c1
|
|
1
|
|
3
|
|
5
|
|
show tables;
|
|
Tables_in_test
|
|
create table t1(c1 int key) ENGINE=InnoDB;
|
|
insert into t1 values(100),(344),(533);
|
|
select * from t1 order by c1;
|
|
c1
|
|
100
|
|
344
|
|
533
|
|
alter table t1 engine=ndb;
|
|
Warnings:
|
|
Warning 1296 Node <nodeid> 'Distribution of ALTER TABLE 't1' failed'
|
|
show tables;
|
|
Tables_in_test
|
|
t1
|
|
select * from t1 order by c1;
|
|
c1
|
|
100
|
|
344
|
|
533
|
|
drop table t1 /* engine = InnoDB */;
|
|
select * from t1 order by c1;
|
|
c1
|
|
1
|
|
3
|
|
5
|
|
drop table t1 /* engine = NDB */;
|
|
create database db;
|
|
use db;
|
|
create table t1(x int) engine=ndb;
|
|
use db;
|
|
show tables;
|
|
Tables_in_db
|
|
t1
|
|
drop database db;
|
|
show tables;
|
|
ERROR 42000: Unknown database 'db'
|
|
create database db;
|
|
use db;
|
|
create table t1(x int) engine=ndb;
|
|
use db;
|
|
create table t2(x int) engine=innodb;
|
|
show tables;
|
|
Tables_in_db
|
|
t1
|
|
t2
|
|
drop database db;
|
|
Warnings:
|
|
Warning 1296 Node <nodeid> 'Distribution of DROP DATABASE 'db' failed'
|
|
show tables;
|
|
Tables_in_db
|
|
t2
|
|
drop database db;
|
|
use test;
|
|
create table `test`.`t1$EX`
|
|
(server_id int unsigned,
|
|
master_server_id int unsigned,
|
|
master_epoch bigint unsigned,
|
|
count int unsigned,
|
|
primary key(server_id, master_server_id,
|
|
master_epoch, count))
|
|
engine ndb;
|
|
show tables like '%$%';
|
|
Tables_in_test (%$%)
|
|
t1$ex
|
|
use test;
|
|
show tables like '%$%';
|
|
Tables_in_test (%$%)
|
|
t1$ex
|
|
drop table `test`.`t1$EX`;
|
|
show tables like '%$%';
|
|
Tables_in_test (%$%)
|
|
show tables like '%$%';
|
|
Tables_in_test (%$%)
|
|
create table t1(s char(1)) engine = innodb;
|
|
insert into t1 values ("a"),("b"),("c");
|
|
create table t1(s char(1)) engine = ndb;
|
|
Warnings:
|
|
Warning 1296 Node <nodeid> 'Distribution of CREATE TABLE 't1' failed'
|
|
insert into t1 values ("d"),("e"),("f");
|
|
Restarting mysqld
|
|
# restart
|
|
use test;
|
|
select * from t1 order by s;
|
|
s
|
|
a
|
|
b
|
|
c
|
|
select * from t1 order by s;
|
|
s
|
|
d
|
|
e
|
|
f
|
|
drop table t1;
|
|
Warnings:
|
|
Warning 1296 Node <nodeid> 'Distribution of DROP TABLE 't1' failed'
|
|
select * from t1 order by s;
|
|
s
|
|
a
|
|
b
|
|
c
|
|
create table t1(s char(1)) engine = ndb;
|
|
Warnings:
|
|
Warning 1296 Node <nodeid> 'Distribution of CREATE TABLE 't1' failed'
|
|
insert into t1 values ("g"),("h"),("i");
|
|
show tables;
|
|
Tables_in_test
|
|
t1
|
|
select * from t1 order by s;
|
|
s
|
|
a
|
|
b
|
|
c
|
|
drop table t1;
|
|
drop table t1;
|
|
Bug 11894966 - second mysqld does not have table after non
|
|
distributed table alter to ndb
|
|
create table t1(a int) engine innodb;
|
|
insert into t1 values(37);
|
|
alter table t1 engine ndb;
|
|
truncate t1;
|
|
drop table t1;
|
|
create table mysql.dummy(a int primary key, b int) engine=innodb;
|
|
create table mysql.dummy(a int primary key, b int) engine=innodb;
|
|
drop table mysql.dummy;
|
|
show create table mysql.dummy;
|
|
Table Create Table
|
|
dummy CREATE TABLE `dummy` (
|
|
`a` int(11) NOT NULL,
|
|
`b` int(11) DEFAULT NULL,
|
|
PRIMARY KEY (`a`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
|
|
drop table mysql.dummy;
|
|
CREATE DATABASE tmp_db;
|
|
Let server2 create the table tmp_db.t1 in the background.
|
|
CREATE TABLE tmp_db.t1 (k int primary key) ENGINE NDB;
|
|
Attempt to recreate 'tmp_db', expect 'EXISTS' failure - Not MDL deadlocks
|
|
CREATE DATABASE IF NOT EXISTS tmp_db;
|
|
Warnings:
|
|
Note 1007 Can't create database 'tmp_db'; database exists
|
|
Wait for server2 table creation to complete.
|
|
Select count(*) from tmp_db.t1;
|
|
count(*)
|
|
0
|
|
DROP TABLE tmp_db.t1;
|
|
DROP DATABASE tmp_db;
|