Loading mysql-test/r/ndb_auto_increment.result +3 −3 Original line number Diff line number Diff line Loading @@ -421,10 +421,10 @@ select * from t1 order by a; a 1 20 21 33 34 35 65 insert into t1 values (100); insert into t1 values (NULL); insert into t1 values (NULL); Loading @@ -432,11 +432,11 @@ select * from t1 order by a; a 1 20 21 22 33 34 35 65 66 100 101 set auto_increment_offset = @old_auto_increment_offset; Loading mysql-test/r/ndb_restore.result +35 −15 Original line number Diff line number Diff line Loading @@ -266,21 +266,41 @@ a 2000 3000 10000 show table status like 't1_c'; 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 X X X X X X X X X X 3001 X X X X X X X show table status like 't2_c'; 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 X X X X X X X X X X 501 X X X X X X X show table status like 't4_c'; 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 X X X X X X X X X X 290000001 X X X X X X X show table status like 't7_c'; 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 X X X X X X X X X X 29 X X X X X X X show table status like 't10_c'; 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 X X X X X X X X X X 10001 X X X X X X X select max(capgoaledatta) from t1_c; max(capgoaledatta) 3000 select auto_increment from information_schema.tables where table_name = 't1_c'; auto_increment 3001 select max(capgotod) from t2_c; max(capgotod) 500 select auto_increment from information_schema.tables where table_name = 't2_c'; auto_increment 501 select max(capfa) from t4_c; max(capfa) 290000000 select auto_increment from information_schema.tables where table_name = 't4_c'; auto_increment 290000001 select max(dardtestard) from t7_c; max(dardtestard) 28 select auto_increment from information_schema.tables where table_name = 't7_c'; auto_increment 29 select max(a) from t10_c; max(a) 10000 select auto_increment from information_schema.tables where table_name = 't10_c'; auto_increment 10001 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; 520093696,<the_backup_id> mysql-test/t/ndb_restore.test +15 −10 Original line number Diff line number Diff line Loading @@ -231,16 +231,21 @@ select count(*) select * from t10_c order by a; # Bug #27775 cont'd # - auto inc info should be correct --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't1_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't2_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't4_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't7_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't10_c'; select max(capgoaledatta) from t1_c; select auto_increment from information_schema.tables where table_name = 't1_c'; select max(capgotod) from t2_c; select auto_increment from information_schema.tables where table_name = 't2_c'; select max(capfa) from t4_c; select auto_increment from information_schema.tables where table_name = 't4_c'; select max(dardtestard) from t7_c; select auto_increment from information_schema.tables where table_name = 't7_c'; select max(a) from t10_c; select auto_increment from information_schema.tables where table_name = 't10_c'; --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; Loading ndb/include/ndbapi/Ndb.hpp +10 −8 Original line number Diff line number Diff line Loading @@ -1386,22 +1386,22 @@ public: * * @param cacheSize number of values to cache in this Ndb object * * @return 0 or -1 on error, and tupleId in out parameter * @return 0 or -1 on error, and autoValue in out parameter */ int getAutoIncrementValue(const char* aTableName, Uint64 & tupleId, Uint32 cacheSize, Uint64 & autoValue, Uint32 cacheSize, Uint64 step = 1, Uint64 start = 1); int getAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId, Uint32 cacheSize, Uint64 & autoValue, Uint32 cacheSize, Uint64 step = 1, Uint64 start = 1); int readAutoIncrementValue(const char* aTableName, Uint64 & tupleId); Uint64 & autoValue); int readAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId); Uint64 & autoValue); int setAutoIncrementValue(const char* aTableName, Uint64 tupleId, bool increase); Uint64 autoValue, bool modify); int setAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 tupleId, bool increase); Uint64 autoValue, bool modify); private: int getTupleIdFromNdb(Ndb_local_table_info* info, Uint64 & tupleId, Uint32 cacheSize, Loading @@ -1409,7 +1409,9 @@ private: int readTupleIdFromNdb(Ndb_local_table_info* info, Uint64 & tupleId); int setTupleIdInNdb(Ndb_local_table_info* info, Uint64 tupleId, bool increase); Uint64 tupleId, bool modify); int checkTupleIdInNdb(Ndb_local_table_info* info, Uint64 tupleId); int opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op); public: Loading ndb/src/ndbapi/DictCache.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ Ndb_local_table_info::Ndb_local_table_info(NdbTableImpl *table_impl) m_table_impl= table_impl; m_first_tuple_id = ~(Uint64)0; m_last_tuple_id = ~(Uint64)0; m_highest_seen = 0; } Ndb_local_table_info::~Ndb_local_table_info() Loading Loading
mysql-test/r/ndb_auto_increment.result +3 −3 Original line number Diff line number Diff line Loading @@ -421,10 +421,10 @@ select * from t1 order by a; a 1 20 21 33 34 35 65 insert into t1 values (100); insert into t1 values (NULL); insert into t1 values (NULL); Loading @@ -432,11 +432,11 @@ select * from t1 order by a; a 1 20 21 22 33 34 35 65 66 100 101 set auto_increment_offset = @old_auto_increment_offset; Loading
mysql-test/r/ndb_restore.result +35 −15 Original line number Diff line number Diff line Loading @@ -266,21 +266,41 @@ a 2000 3000 10000 show table status like 't1_c'; 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 X X X X X X X X X X 3001 X X X X X X X show table status like 't2_c'; 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 X X X X X X X X X X 501 X X X X X X X show table status like 't4_c'; 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 X X X X X X X X X X 290000001 X X X X X X X show table status like 't7_c'; 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 X X X X X X X X X X 29 X X X X X X X show table status like 't10_c'; 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 X X X X X X X X X X 10001 X X X X X X X select max(capgoaledatta) from t1_c; max(capgoaledatta) 3000 select auto_increment from information_schema.tables where table_name = 't1_c'; auto_increment 3001 select max(capgotod) from t2_c; max(capgotod) 500 select auto_increment from information_schema.tables where table_name = 't2_c'; auto_increment 501 select max(capfa) from t4_c; max(capfa) 290000000 select auto_increment from information_schema.tables where table_name = 't4_c'; auto_increment 290000001 select max(dardtestard) from t7_c; max(dardtestard) 28 select auto_increment from information_schema.tables where table_name = 't7_c'; auto_increment 29 select max(a) from t10_c; max(a) 10000 select auto_increment from information_schema.tables where table_name = 't10_c'; auto_increment 10001 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; 520093696,<the_backup_id>
mysql-test/t/ndb_restore.test +15 −10 Original line number Diff line number Diff line Loading @@ -231,16 +231,21 @@ select count(*) select * from t10_c order by a; # Bug #27775 cont'd # - auto inc info should be correct --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't1_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't2_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't4_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't7_c'; --replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X show table status like 't10_c'; select max(capgoaledatta) from t1_c; select auto_increment from information_schema.tables where table_name = 't1_c'; select max(capgotod) from t2_c; select auto_increment from information_schema.tables where table_name = 't2_c'; select max(capfa) from t4_c; select auto_increment from information_schema.tables where table_name = 't4_c'; select max(dardtestard) from t7_c; select auto_increment from information_schema.tables where table_name = 't7_c'; select max(a) from t10_c; select auto_increment from information_schema.tables where table_name = 't10_c'; --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; Loading
ndb/include/ndbapi/Ndb.hpp +10 −8 Original line number Diff line number Diff line Loading @@ -1386,22 +1386,22 @@ public: * * @param cacheSize number of values to cache in this Ndb object * * @return 0 or -1 on error, and tupleId in out parameter * @return 0 or -1 on error, and autoValue in out parameter */ int getAutoIncrementValue(const char* aTableName, Uint64 & tupleId, Uint32 cacheSize, Uint64 & autoValue, Uint32 cacheSize, Uint64 step = 1, Uint64 start = 1); int getAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId, Uint32 cacheSize, Uint64 & autoValue, Uint32 cacheSize, Uint64 step = 1, Uint64 start = 1); int readAutoIncrementValue(const char* aTableName, Uint64 & tupleId); Uint64 & autoValue); int readAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId); Uint64 & autoValue); int setAutoIncrementValue(const char* aTableName, Uint64 tupleId, bool increase); Uint64 autoValue, bool modify); int setAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 tupleId, bool increase); Uint64 autoValue, bool modify); private: int getTupleIdFromNdb(Ndb_local_table_info* info, Uint64 & tupleId, Uint32 cacheSize, Loading @@ -1409,7 +1409,9 @@ private: int readTupleIdFromNdb(Ndb_local_table_info* info, Uint64 & tupleId); int setTupleIdInNdb(Ndb_local_table_info* info, Uint64 tupleId, bool increase); Uint64 tupleId, bool modify); int checkTupleIdInNdb(Ndb_local_table_info* info, Uint64 tupleId); int opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op); public: Loading
ndb/src/ndbapi/DictCache.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ Ndb_local_table_info::Ndb_local_table_info(NdbTableImpl *table_impl) m_table_impl= table_impl; m_first_tuple_id = ~(Uint64)0; m_last_tuple_id = ~(Uint64)0; m_highest_seen = 0; } Ndb_local_table_info::~Ndb_local_table_info() Loading