📄 ndb_autodiscover.result
字号:
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;flush status;create table t1(id int not null primary key,name char(20)) engine=ndb;insert into t1 values(1, "Autodiscover");flush tables;select * from t1;id name1 Autodiscovershow status like 'handler_discover%';Variable_name ValueHandler_discover 1flush tables;insert into t1 values (2, "Auto 2");show status like 'handler_discover%';Variable_name ValueHandler_discover 2insert into t1 values (3, "Discover 3");show status like 'handler_discover%';Variable_name ValueHandler_discover 2flush tables;select * from t1 order by id;id name1 Autodiscover2 Auto 23 Discover 3show status like 'handler_discover%';Variable_name ValueHandler_discover 3flush tables;update t1 set name="Autodiscover" where id = 2;show status like 'handler_discover%';Variable_name ValueHandler_discover 4select * from t1 order by id;id name1 Autodiscover2 Autodiscover3 Discover 3show status like 'handler_discover%';Variable_name ValueHandler_discover 4flush tables;delete from t1 where id = 3;select * from t1 order by id;id name1 Autodiscover2 Autodiscovershow status like 'handler_discover%';Variable_name ValueHandler_discover 5drop table t1;flush status;create table t2(id int not null primary key,name char(22)) engine=ndb;insert into t2 values (1, "Discoverer");select * from t2;id name1 Discoverershow status like 'handler_discover%';Variable_name ValueHandler_discover 0flush tables;select * from t2;id name1 Discoverershow status like 'handler_discover%';Variable_name ValueHandler_discover 1drop table t2;flush status;create table t3(id int not null primary key,name char(255)) engine=ndb;insert into t3 values (1, "Explorer");select * from t3;id name1 Explorershow status like 'handler_discover%';Variable_name ValueHandler_discover 0flush tables;create table t3(id int not null primary key,name char(20), a int, b float, c char(24)) engine=ndb;ERROR 42S01: Table 't3' already existsshow status like 'handler_discover%';Variable_name ValueHandler_discover 0create table IF NOT EXISTS t3(id int not null primary key,id2 int not null,name char(20)) engine=ndb;Warnings:Note 1050 Table 't3' already existsshow status like 'handler_discover%';Variable_name ValueHandler_discover 0SHOW CREATE TABLE t3;Table Create Tablet3 CREATE TABLE `t3` ( `id` int(11) NOT NULL, `name` char(255) default NULL, PRIMARY KEY (`id`)) ENGINE=ndbcluster DEFAULT CHARSET=latin1select * from t3;id name1 Explorershow status like 'handler_discover%';Variable_name ValueHandler_discover 1drop table t3;flush status;create table t7(id int not null primary key,name char(255)) engine=ndb;create table t6(id int not null primary key,name char(255)) engine=MyISAM;insert into t7 values (1, "Explorer");insert into t6 values (2, "MyISAM table");select * from t7;id name1 Explorershow status like 'handler_discover%';Variable_name ValueHandler_discover 0flush tables;show tables from test;Tables_in_testt6t7show status like 'handler_discover%';Variable_name ValueHandler_discover 1flush tables;show table status;Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Commentt6 MyISAM 10 Fixed 1 260 # # # 0 NULL # # NULL # NULL #t7 ndbcluster 10 Fixed 1 276 # # # 0 NULL # # NULL # NULL #show status like 'handler_discover%';Variable_name ValueHandler_discover 2drop table t6, t7;flush status;create table t4(id int not null primary key,name char(27)) engine=ndb;insert into t4 values (1, "Automatic");select * from t4;id name1 Automaticselect * from t4;ERROR 42S02: Table 'test.t4' doesn't existselect * from t4;ERROR 42S02: Table 'test.t4' doesn't existshow status like 'handler_discover%';Variable_name ValueHandler_discover 0drop table t4;ERROR 42S02: Unknown table 't4'create table t4(id int not null primary key,name char(27)) engine=ndb;insert into t4 values (1, "Automatic");select * from t4;id name1 Automaticselect * from t4;ERROR 42S02: Table 'test.t4' doesn't existdrop table if exists t4;Warnings:Error 155 Table 'test.t4' doesn't existdrop table t5;ERROR 42S02: Unknown table 't5'drop table if exists t5;Warnings:Note 1051 Unknown table 't5'flush status;create table t4(id int not null primary key,id2 int,name char(27)) engine=ndb;insert into t4 values (1, 76, "Automatic2");select * from t4;id id2 name1 76 Automatic2flush tables;SHOW TABLES;Tables_in_testselect * from t4;ERROR 42S02: Table 'test.t4' doesn't existflush status;create table t1(id int) engine=ndbcluster;create table t2(id int, b char(255)) engine=myisam;create table t3(id int, c char(255)) engine=ndbcluster;create table t4(id int) engine=myisam;create table t5(id int, d char(56)) engine=ndbcluster;create table t6(id int) engine=ndbcluster;create table t7(id int) engine=ndbcluster;create table t8(id int, e char(34)) engine=myisam;create table t9(id int) engine=myisam;insert into t2 values (2, "myisam table 2");insert into t3 values (3, "ndb table 3");insert into t5 values (5, "ndb table 5");insert into t6 values (6);insert into t8 values (8, "myisam table 8");insert into t9 values (9);SHOW TABLES;Tables_in_testt1t2t4t8t9t7t6select * from t6;id6select * from t7;idshow status like 'handler_discover%';Variable_name ValueHandler_discover 2drop table t1, t2, t4, t6, t7, t8, t9;flush status;create table t1(id int) engine=ndbcluster;create table t2(id int, b char(255)) engine=myisam;create table t3(id int, c char(255)) engine=ndbcluster;create table t4(id int) engine=myisam;create table t5(id int, d char(56)) engine=ndbcluster;create table t6(id int) engine=ndbcluster;create table t7(id int) engine=ndbcluster;create table t8(id int, e char(34)) engine=myisam;create table t9(id int) engine=myisam;insert into t2 values (2, "myisam table 2");insert into t3 values (3, "ndb table 3");insert into t5 values (5, "ndb table 5");insert into t6 values (6);insert into t8 values (8, "myisam table 8");insert into t9 values (9);SHOW TABLES LIKE 't6';Tables_in_test (t6)t6show status like 'handler_discover%';Variable_name ValueHandler_discover 1create table t3(a int);ERROR 42S01: Table 't3' already existscreate table t5(a int);ERROR 42S01: Table 't5' already existsSHOW TABLES LIKE 't%';Tables_in_test (t%)t1t2t4t6t8t9t7show status like 'handler_discover%';Variable_name ValueHandler_discover 2drop table t1, t2, t4, t6, t7, t8, t9;flush status;create table t1(id int) engine=ndbcluster;create table t2(id int, b char(255)) engine=ndbcluster;create table t3(id int, c char(255)) engine=ndbcluster;create table t4(id int) engine=myisam;insert into t1 values (1);insert into t2 values (2, "table 2");insert into t3 values (3, "ndb table 3");insert into t4 values (4);flush tables;select * from t1, t2, t3, t4;id id b id c id1 2 table 2 3 ndb table 3 4show status like 'handler_discover%';Variable_name ValueHandler_discover 3drop table t1, t2, t3, t4;flush status;show status like 'handler_discover%';Variable_name ValueHandler_discover 0create table t5(id int not null primary key,name char(200)) engine=ndb;insert into t5 values (1, "Magnus");select * from t5;id name1 MagnusALTER TABLE t5 ADD COLUMN adress char(255) FIRST;select * from t5;adress id nameNULL 1 Magnusinsert into t5 values ("Adress for record 2", 2, "Carl-Gustav"), ("Adress for record 3", 3, "Karl-Emil");update t5 set name="Bertil" where id = 2;select * from t5 order by id;adress id nameNULL 1 MagnusAdress for record 2 2 BertilAdress for record 3 3 Karl-Emilshow status like 'handler_discover%';Variable_name ValueHandler_discover 0drop table t5;flush status;show status like 'handler_discover%';Variable_name ValueHandler_discover 0create table t6(id int not null primary key,name char(20)) engine=ndb;insert into t6 values (1, "Magnus");select * from t6;id name1 MagnusALTER TABLE t6 ADD COLUMN adress char(255) FIRST;select * from t6;adress id nameNULL 1 Magnusinsert into t6 values ("Adress for record 2", 2, "Carl-Gustav"), ("Adress for record 3", 3, "Karl-Emil");update t6 set name="Bertil" where id = 2;select * from t6 order by id;adress id nameNULL 1 MagnusAdress for record 2 2 BertilAdress for record 3 3 Karl-Emilshow status like 'handler_discover%';Variable_name ValueHandler_discover 0drop table t6;show tables;Tables_in_testcreate table t1 (a int,b longblob) engine=ndb;show tables;Tables_in_testt1create database test2;use test2;show tables;Tables_in_test2select * from t1;ERROR 42S02: Table 'test2.t1' doesn't existcreate table t2 (b int,c longblob) engine=ndb;use test;select * from t1;a bshow tables;Tables_in_testt1drop table t1;use test2;drop table t2;drop database test2;use test;drop database if exists test_only_ndb_tables;create database test_only_ndb_tables;use test_only_ndb_tables;create table t1 (a int primary key) engine=ndb;select * from t1;aselect * from t1;ERROR HY000: Can't lock file (errno: 4009)use test;drop database test_only_ndb_tables;CREATE TABLE t9 (a int NOT NULL PRIMARY KEY,b int) engine=ndb;insert t9 values(1, 2), (2,3), (3, 4), (4, 5);create table t10 (a int not null primary key,b blob) engine=ndb;insert into t10 values (1, 'kalle');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -