summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-07-21 12:58:14 +0300
committerunknown <heikki@hundin.mysql.fi>2002-07-21 12:58:14 +0300
commitb6b2546c18faf4d72a879e5ef756a241144c7018 (patch)
tree81c39a68aa307f4493fbb83c4e27f12460766943 /innobase/dict
parenta9c52ff7172308af72f062a1cae86671cbb1ed7a (diff)
downloadmariadb-git-b6b2546c18faf4d72a879e5ef756a241144c7018.tar.gz
row0ins.c:
Do not perform ON DELETE action for a FOREIGN KEY constraint if we are doing an UPDATE, not a DELETE dict0dict.c: test innobase/dict/dict0dict.c: test innobase/row/row0ins.c: Do not perform ON DELETE action for a FOREIGN KEY constraint if we are doing an UPDATE, not a DELETE
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0dict.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 7c166ecd068..65f40d345d8 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -270,7 +270,7 @@ void
dict_table_autoinc_initialize(
/*==========================*/
dict_table_t* table, /* in: table */
- ib_longlong value) /* in: value which was assigned to a row */
+ ib_longlong value) /* in: next value to assign to a row */
{
mutex_enter(&(table->autoinc_mutex));
@@ -281,8 +281,8 @@ dict_table_autoinc_initialize(
}
/************************************************************************
-Gets the next autoinc value, 0 if not yet initialized. If initialized,
-increments the counter by 1. */
+Gets the next autoinc value (== autoinc counter 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 {
- table->autoinc = table->autoinc + 1;
value = table->autoinc;
+ table->autoinc = table->autoinc + 1;
}
mutex_exit(&(table->autoinc_mutex));
@@ -334,20 +334,43 @@ dict_table_autoinc_read(
}
/************************************************************************
-Updates the autoinc counter if the value supplied is bigger than the
+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
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;
+ if (value >= table->autoinc) {
+ table->autoinc = value + 1;
}
}