Commit 1e692580 authored by tomas@poseidon.(none)'s avatar tomas@poseidon.(none)

fixed wrong initial auto increment value bug#5369

parent 72083ff6
......@@ -18,7 +18,7 @@ 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 100 0 0 NULL 0 0 0 NULL NULL NULL latin1_swedish_ci NULL
t1 ndbcluster 9 Dynamic 100 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;
......
......@@ -242,7 +242,7 @@ select * from t1 where cv = 'test';
cid cv
select * from t2 where cap = 'another dummy';
cid cap
0 another dummy
1 another dummy
select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
uid gid rid cid
1 1 2 4
......
......@@ -27,17 +27,17 @@
#include <NDBT.hpp>
int
waitClusterStatus(const char* _addr,
ndb_mgm_node_status _status= NDB_MGM_NODE_STATUS_STARTED,
unsigned int _timeout= 120);
waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout);
int main(int argc, const char** argv){
const char* _hostName = NULL;
int _no_contact = 0;
int _help = 0;
int _timeout = 120;
struct getargs args[] = {
{ "timeout", 0, arg_integer, &_timeout, "Timeout to wait", "#" },
{ "no-contact", 0, arg_flag, &_no_contact, "Wait for cluster no contact", "" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
};
......@@ -92,9 +92,9 @@ int main(int argc, const char** argv){
}
if (_no_contact) {
if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT) != 0)
if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
} else if (waitClusterStatus(_hostName) != 0)
} else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
return NDBT_ProgramExit(NDBT_OK);
......
......@@ -2845,7 +2845,7 @@ static int create_ndb_column(NDBCOL &col,
{
col.setAutoIncrement(TRUE);
ulonglong value= info->auto_increment_value ?
info->auto_increment_value -1 : (ulonglong) 0;
info->auto_increment_value : (ulonglong) 1;
DBUG_PRINT("info", ("Autoincrement key, initial: %llu", value));
col.setAutoIncrementInitialValue(value);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment