diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-07-21 13:09:57 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-07-21 13:09:57 +0300 |
commit | 0a7ea55507ebb402d9265932fd2158fed3f07ab0 (patch) | |
tree | b7d3ac8fa29f1f39615b1d45e78f076963dcb973 /innobase | |
parent | f263c130ebe9c17a31e3dfa96d9e37114b06df27 (diff) | |
download | mariadb-git-0a7ea55507ebb402d9265932fd2158fed3f07ab0.tar.gz |
dict0dict.c:
Revert the test changes to wait for a full push of new auto-inc algorithm
innobase/dict/dict0dict.c:
Revert the test changes to wait for a full push of new auto-inc algorithm
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/dict/dict0dict.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 65f40d345d8..9ed1d088290 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -261,7 +261,7 @@ dict_table_get_index_noninline( { return(dict_table_get_index(table, name)); } - + /************************************************************************ Initializes the autoinc counter. It is not an error to initialize an already initialized counter. */ @@ -270,7 +270,7 @@ void dict_table_autoinc_initialize( /*==========================*/ dict_table_t* table, /* in: table */ - ib_longlong value) /* in: next value to assign to a row */ + ib_longlong value) /* in: value which was assigned to a row */ { mutex_enter(&(table->autoinc_mutex)); @@ -281,8 +281,8 @@ dict_table_autoinc_initialize( } /************************************************************************ -Gets the next autoinc value (== autoinc counter value), 0 if not yet -initialized. If initialized, increments the counter by 1. */ +Gets the next autoinc value, 0 if not yet initialized. If initialized, +increments the counter by 1. */ ib_longlong dict_table_autoinc_get( @@ -298,8 +298,8 @@ dict_table_autoinc_get( value = 0; } else { - value = table->autoinc; table->autoinc = table->autoinc + 1; + value = table->autoinc; } mutex_exit(&(table->autoinc_mutex)); @@ -334,43 +334,20 @@ dict_table_autoinc_read( } /************************************************************************ -Peeks the autoinc counter value, 0 if not yet initialized. Does not -increment the counter. The read not protected by any mutex! */ - -ib_longlong -dict_table_autoinc_peek( -/*====================*/ - /* out: value of the counter */ - dict_table_t* table) /* in: table */ -{ - ib_longlong value; - - if (!table->autoinc_inited) { - - value = 0; - } else { - value = table->autoinc; - } - - return(value); -} - -/************************************************************************ -Updates the autoinc counter if the value supplied is equal or bigger than the +Updates the autoinc counter if the value supplied is bigger than the current value. If not inited, does nothing. */ void dict_table_autoinc_update( /*======================*/ - dict_table_t* table, /* in: table */ ib_longlong value) /* in: value which was assigned to a row */ { mutex_enter(&(table->autoinc_mutex)); if (table->autoinc_inited) { - if (value >= table->autoinc) { - table->autoinc = value + 1; + if (value > table->autoinc) { + table->autoinc = value; } } |