summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2006-06-02 23:23:02 +0200
committerunknown <serg@serg.mylan>2006-06-02 23:23:02 +0200
commitb9d7249dc304e6f8d1d67b6d26f77ae02d3560e4 (patch)
tree2571a2ef1ff736e093d7f8cc2f5376e2b8a22063 /sql/ha_innodb.cc
parent202c3fae0881979062998a2340fafc4a53ba6f3a (diff)
parent78e288b4a7efc9fc4bfd0cc8949e265be48f1ee7 (diff)
downloadmariadb-git-b9d7249dc304e6f8d1d67b6d26f77ae02d3560e4.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into serg.mylan:/usr/home/serg/Abk/mysql-5.1 sql/ha_innodb.cc: Auto merged
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 0e909c83238..5607c025d63 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -6948,17 +6948,21 @@ func_exit_early:
return(error);
}
-/***********************************************************************
+/*******************************************************************************
This function initializes the auto-inc counter if it has not been
initialized yet. This function does not change the value of the auto-inc
counter if it already has been initialized. Returns the value of the
-auto-inc counter. */
+auto-inc counter in *first_value, and ULONGLONG_MAX in *nb_reserved_values (as
+we have a table-level lock). offset, increment, nb_desired_values are ignored.
+*first_value is set to -1 if error (deadlock or lock wait timeout) */
-ulonglong
-ha_innobase::get_auto_increment()
-/*=============================*/
- /* out: auto-increment column value, -1 if error
- (deadlock or lock wait timeout) */
+void ha_innobase::get_auto_increment(
+/*=================================*/
+ ulonglong offset, /* in */
+ ulonglong increment, /* in */
+ ulonglong nb_desired_values, /* in */
+ ulonglong *first_value, /* out */
+ ulonglong *nb_reserved_values) /* out */
{
longlong nr;
int error;
@@ -6973,10 +6977,13 @@ ha_innobase::get_auto_increment()
ut_print_timestamp(stderr);
sql_print_error("Error %lu in ::get_auto_increment()",
(ulong) error);
- return(~(ulonglong) 0);
+ *first_value= (~(ulonglong) 0);
+ return;
}
- return((ulonglong) nr);
+ *first_value= (ulonglong) nr;
+ /* table-level autoinc lock reserves up to +inf */
+ *nb_reserved_values= ULONGLONG_MAX;
}
/* See comment in handler.h */