1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00
This commit is contained in:
tulin@dl145c.mysql.com
2005-05-17 10:17:53 +02:00
155 changed files with 2990 additions and 991 deletions

View File

@@ -1522,6 +1522,7 @@ void handler::update_auto_increment()
ulonglong nr;
THD *thd= table->in_use;
struct system_variables *variables= &thd->variables;
bool auto_increment_field_not_null;
DBUG_ENTER("handler::update_auto_increment");
/*
@@ -1529,13 +1530,14 @@ void handler::update_auto_increment()
row was not inserted
*/
thd->prev_insert_id= thd->next_insert_id;
auto_increment_field_not_null= table->auto_increment_field_not_null;
table->auto_increment_field_not_null= FALSE;
if ((nr= table->next_number_field->val_int()) != 0 ||
table->auto_increment_field_not_null &&
auto_increment_field_not_null &&
thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
{
/* Clear flag for next row */
table->auto_increment_field_not_null= FALSE;
/* Mark that we didn't generate a new value **/
auto_increment_column_changed=0;
@@ -1551,7 +1553,6 @@ void handler::update_auto_increment()
}
DBUG_VOID_RETURN;
}
table->auto_increment_field_not_null= FALSE;
if (!(nr= thd->next_insert_id))
{
nr= get_auto_increment();