• unknown's avatar
    moved all ndb thread specific data into new placeholder · 81e97da3
    unknown authored
    new methods to keep "records" up to date
    unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization
    new methods to keep "records" up to datecorrect record field in ndbcluster handler
    new method for ndbcluster handler to store/retrieve table and thread specific data
    changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
    hanged deleteKey to return ponter to deleted object
    moved heavy global cache fetch from inline to separate method
    
    
    mysql-test/r/ndb_alter_table.result:
      correct record field in ndbcluster handler
    mysql-test/r/ndb_blob.result:
      correct record field in ndbcluster handler
    ndb/include/ndbapi/NdbDictionary.hpp:
      new method for ndbcluster handler to store/retrieve table and thread specific data
    ndb/src/ndbapi/DictCache.cpp:
      changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
    ndb/src/ndbapi/DictCache.hpp:
      changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
    ndb/src/ndbapi/Ndb.cpp:
      replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info
    ndb/src/ndbapi/NdbDictionary.cpp:
      new method for ndbcluster handler to store/retrieve table and thread specific data
    ndb/src/ndbapi/NdbDictionaryImpl.cpp:
      changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
      moved heavy global cache fetch from inline to separate method
    ndb/src/ndbapi/NdbDictionaryImpl.hpp:
      replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info
    ndb/src/ndbapi/NdbLinHash.hpp:
      changed deleteKey to return ponter to deleted object
    sql/ha_ndbcluster.cc:
      moved all ndb thread specific data into new placeholder
      new methods to keep "records" up to date
      unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization
    sql/ha_ndbcluster.h:
      new methods to keep "records" up to date
    sql/sql_class.h:
      moved all ndb thread specific data into new placeholder
    81e97da3
ndb_alter_table.result 3.42 KB
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT NOT NULL,
b INT NOT NULL
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (9410,9412);
ALTER TABLE t1 ADD COLUMN c int not null;
SELECT * FROM t1;
a	b	c
9410	9412	0
DROP TABLE t1;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int)  ENGINE=ndbcluster;
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
t1	ndbcluster	9	Dynamic	0	0	0	NULL	0	0	1	NULL	NULL	NULL	latin1_swedish_ci	NULL		
insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
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
t1	ndbcluster	9	Dynamic	9	0	0	NULL	0	0	102	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col1	col2	col3	col4	col5	col6	to_be_deleted
0	4	3	5	PENDING	1	7
1	4	3	5	PENDING	1	7
7	4	3	5	PENDING	1	7
8	4	3	5	PENDING	1	7
31	4	3	5	PENDING	1	7
32	4	3	5	PENDING	1	7
99	4	3	5	PENDING	1	7
100	4	3	5	PENDING	1	7
101	4	3	5	PENDING	1	7
alter table t1
add column col4_5 varchar(20) not null after col4,
add column col7 varchar(30) not null after col5,
add column col8 datetime not null, drop column to_be_deleted,
change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first;
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
t1	ndbcluster	9	Dynamic	9	0	0	NULL	0	0	102	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col6	col1	col3	fourth	col4	col4_5	col5	col7	col8
1	0	3	4	5		PENDING		0000-00-00 00:00:00
1	1	3	4	5		PENDING		0000-00-00 00:00:00
1	7	3	4	5		PENDING		0000-00-00 00:00:00
1	8	3	4	5		PENDING		0000-00-00 00:00:00
1	31	3	4	5		PENDING		0000-00-00 00:00:00
1	32	3	4	5		PENDING		0000-00-00 00:00:00
1	99	3	4	5		PENDING		0000-00-00 00:00:00
1	100	3	4	5		PENDING		0000-00-00 00:00:00
1	101	3	4	5		PENDING		0000-00-00 00:00:00
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
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
t1	ndbcluster	9	Dynamic	10	0	0	NULL	0	0	103	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col6	col1	col3	fourth	col4	col4_5	col5	col7	col8
1	0	3	4	5		PENDING		0000-00-00 00:00:00
1	1	3	4	5		PENDING		0000-00-00 00:00:00
1	7	3	4	5		PENDING		0000-00-00 00:00:00
1	8	3	4	5		PENDING		0000-00-00 00:00:00
1	31	3	4	5		PENDING		0000-00-00 00:00:00
1	32	3	4	5		PENDING		0000-00-00 00:00:00
1	99	3	4	5		PENDING		0000-00-00 00:00:00
1	100	3	4	5		PENDING		0000-00-00 00:00:00
1	101	3	4	5		PENDING		0000-00-00 00:00:00
2	102	4	3	5	99	PENDING	EXTRA	2004-01-01 00:00:00
drop table t1;