Commit 002d1c69 authored by heikki@work.mysql.com's avatar heikki@work.mysql.com

dict0dict.h Put back code inadvertently removed in previous bk commit

dict0dict.c	Put back code inadvertently removed in previous bk commit
parent a16f3360
...@@ -322,6 +322,32 @@ dict_table_autoinc_decrement( ...@@ -322,6 +322,32 @@ dict_table_autoinc_decrement(
mutex_exit(&(table->autoinc_mutex)); mutex_exit(&(table->autoinc_mutex));
} }
/************************************************************************
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized. */
ib_longlong
dict_table_autoinc_read(
/*====================*/
/* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */
{
ib_longlong value;
mutex_enter(&(table->autoinc_mutex));
if (!table->autoinc_inited) {
value = 0;
} else {
value = table->autoinc;
}
mutex_exit(&(table->autoinc_mutex));
return(value);
}
/************************************************************************ /************************************************************************
Peeks the autoinc counter value, 0 if not yet initialized. Does not Peeks the autoinc counter value, 0 if not yet initialized. Does not
increment the counter. The read not protected by any mutex! */ increment the counter. The read not protected by any mutex! */
......
...@@ -121,6 +121,15 @@ dict_table_autoinc_decrement( ...@@ -121,6 +121,15 @@ dict_table_autoinc_decrement(
/*=========================*/ /*=========================*/
dict_table_t* table); /* in: table */ dict_table_t* table); /* in: table */
/************************************************************************ /************************************************************************
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized. */
ib_longlong
dict_table_autoinc_read(
/*====================*/
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
Peeks the autoinc counter value, 0 if not yet initialized. Does not Peeks the autoinc counter value, 0 if not yet initialized. Does not
increment the counter. The read not protected by any mutex! */ increment the counter. The read not protected by any mutex! */
......
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