mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
dd07a90d61
mysql-test/r/ndb_autodiscover.result: Update test result, number of rows is 1 mysql-test/t/ndb_autodiscover.test: Dont run the test where table is dropped in NDb with ndb_drop_table sql/ha_ndbcluster.cc: Implement function ndbcluster_find_files which will discover new tables and delete old tables sql/ha_ndbcluster.h: Implement function ndbcluster_find_files Remove function ndbcluster_list_tables and ndbcluster_can_discover sql/handler.cc: Add ha_find_files called from mysql_find_files Remove ha_can_discover and ha_list_tables sql/handler.h: Add ha_find_files called from mysql_find_files Remove ha_can_discover and ha_list_tables sql/sql_show.cc: Revert to original version of sql_show.cc Only changes to this version is that ha_find_files is called from mysql_find_files in order to give the handlers a possibility to find new files in engine
215 lines
4.9 KiB
Text
215 lines
4.9 KiB
Text
drop table if exists t1,t2,t3,t4,t5,t6,t7,t9;
|
|
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 name
|
|
1 Autodiscover
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 1
|
|
flush tables;
|
|
insert into t1 values (2, "Auto 2");
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 2
|
|
insert into t1 values (3, "Discover 3");
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 2
|
|
flush tables;
|
|
select * from t1 order by id;
|
|
id name
|
|
1 Autodiscover
|
|
2 Auto 2
|
|
3 Discover 3
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 3
|
|
flush tables;
|
|
update t1 set name="Autodiscover" where id = 2;
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 4
|
|
select * from t1 order by id;
|
|
id name
|
|
1 Autodiscover
|
|
2 Autodiscover
|
|
3 Discover 3
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 4
|
|
flush tables;
|
|
delete from t1 where id = 3;
|
|
select * from t1 order by id;
|
|
id name
|
|
1 Autodiscover
|
|
2 Autodiscover
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 5
|
|
drop 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 name
|
|
1 Discoverer
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
flush tables;
|
|
select * from t2;
|
|
id name
|
|
1 Discoverer
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 1
|
|
drop 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 name
|
|
1 Explorer
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
flush 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 exists
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 1
|
|
create table IF NOT EXISTS t3(
|
|
id int not null primary key,
|
|
id2 int not null,
|
|
name char(20)
|
|
) engine=ndb;
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 2
|
|
SHOW CREATE TABLE t3;
|
|
Table Create Table
|
|
t3 CREATE TABLE `t3` (
|
|
`id` int(11) NOT NULL default '0',
|
|
`name` char(255) default NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
select * from t3;
|
|
id name
|
|
1 Explorer
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 2
|
|
drop 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 name
|
|
1 Explorer
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
flush tables;
|
|
show tables from test;
|
|
Tables_in_test
|
|
t6
|
|
t7
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 1
|
|
flush 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 Comment
|
|
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL
|
|
t7 ndbcluster 9 Fixed 1 0 # # # 0 NULL # # NULL # NULL
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 2
|
|
drop table t6, t7;
|
|
flush status;
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
create table t5(
|
|
id int not null primary key,
|
|
name char(200)
|
|
) engine=ndb;
|
|
insert into t5 values (1, "Magnus");
|
|
select * from t5;
|
|
id name
|
|
1 Magnus
|
|
ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
|
|
select * from t5;
|
|
adress id name
|
|
NULL 1 Magnus
|
|
insert 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 name
|
|
NULL 1 Magnus
|
|
Adress for record 2 2 Bertil
|
|
Adress for record 3 3 Karl-Emil
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
drop table t5;
|
|
flush status;
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
create table t6(
|
|
id int not null primary key,
|
|
name char(20)
|
|
) engine=ndb;
|
|
insert into t6 values (1, "Magnus");
|
|
select * from t6;
|
|
id name
|
|
1 Magnus
|
|
ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
|
|
select * from t6;
|
|
adress id name
|
|
NULL 1 Magnus
|
|
insert 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 name
|
|
NULL 1 Magnus
|
|
Adress for record 2 2 Bertil
|
|
Adress for record 3 3 Karl-Emil
|
|
show status like 'handler_discover%';
|
|
Variable_name Value
|
|
Handler_discover 0
|
|
drop table t6;
|
|
CREATE TABLE t9 (
|
|
a int NOT NULL PRIMARY KEY,
|
|
b int
|
|
) engine=ndb;
|
|
insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
|