1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#26342 auto_increment_increment AND auto_increment_offset REALLY REALLY anger NDB cluster, implemented support for auto_increment_offset and auto_increment_increment for Ndb

This commit is contained in:
unknown
2007-05-09 14:14:27 +02:00
parent 0db0e2699d
commit 10e329ffd4
7 changed files with 401 additions and 36 deletions

View File

@@ -1598,6 +1598,8 @@ int handler::update_auto_increment()
ulonglong nr;
THD *thd= table->in_use;
struct system_variables *variables= &thd->variables;
bool external_auto_increment=
table->file->table_flags() & HA_EXTERNAL_AUTO_INCREMENT;
DBUG_ENTER("handler::update_auto_increment");
/*
@@ -1615,12 +1617,12 @@ int handler::update_auto_increment()
adjust_next_insert_id_after_explicit_value(nr);
DBUG_RETURN(0);
}
if (!(nr= thd->next_insert_id))
if (external_auto_increment || !(nr= thd->next_insert_id))
{
if ((nr= get_auto_increment()) == ~(ulonglong) 0)
DBUG_RETURN(HA_ERR_AUTOINC_READ_FAILED); // Mark failure
if (variables->auto_increment_increment != 1)
if (!external_auto_increment && variables->auto_increment_increment != 1)
nr= next_insert_id(nr-1, variables);
/*
Update next row based on the found value. This way we don't have to