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

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

dict0dict.c	Put back code inadvertently removed in previous bk commit
parent a16f3360
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -322,6 +322,32 @@ dict_table_autoinc_decrement(
	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
increment the counter. The read not protected by any mutex! */
+9 −0
Original line number Diff line number Diff line
@@ -121,6 +121,15 @@ dict_table_autoinc_decrement(
/*=========================*/
	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
increment the counter. The read not protected by any mutex! */