summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <mskold/marty@mysql.com/linux.site>2007-05-28 15:23:28 +0200
committerunknown <mskold/marty@mysql.com/linux.site>2007-05-28 15:23:28 +0200
commit8046747c62197d6eea236bc5d6ec5e9c23b8416a (patch)
tree26257d6d2974a0cdf3b2ca154840df9c41b48b7b /sql/handler.cc
parentb1a5f427bccba48c4d4d0fce24c60f89045a07c1 (diff)
parent10e329ffd489d5cac4678b5beb08cbc61bc074a9 (diff)
downloadmariadb-git-8046747c62197d6eea236bc5d6ec5e9c23b8416a.tar.gz
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb sql/handler.cc: Auto merged sql/ha_ndbcluster.cc: Merge
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 867ac7ff778..37b81b58cfe 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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