diff options
author | unknown <jan@hundin.mysql.fi> | 2004-12-15 15:36:37 +0200 |
---|---|---|
committer | unknown <jan@hundin.mysql.fi> | 2004-12-15 15:36:37 +0200 |
commit | 18150150804e5f572ad546368ac95cdd94a66e23 (patch) | |
tree | 1da1b4a15045a32146cb6bae036ec390e59b5c27 | |
parent | 9a3de9447460e33a9f318c9b33bc96558eabe5d1 (diff) | |
parent | 08973f5c93d9f70da97a00a54b0c676c5eb6def2 (diff) | |
download | mariadb-git-18150150804e5f572ad546368ac95cdd94a66e23.tar.gz |
Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into hundin.mysql.fi:/home/jan/new/mysql-5.0
-rw-r--r-- | sql/ha_innodb.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 0c7fc23ee49..3e535385ed0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1326,7 +1326,7 @@ innobase_commit( &innodb_dummy_stmt_trx_handle: the latter means that the current SQL statement ended */ { - trx_t* trx; + trx_t* trx; DBUG_ENTER("innobase_commit"); DBUG_PRINT("trans", ("ending transaction")); @@ -3830,6 +3830,7 @@ ha_innobase::create( char name2[FN_REFLEN]; char norm_name[FN_REFLEN]; THD *thd= current_thd; + ib_longlong auto_inc_value; DBUG_ENTER("ha_innobase::create"); @@ -4000,6 +4001,20 @@ ha_innobase::create( DBUG_ASSERT(innobase_table != 0); + if (thd->lex->sql_command == SQLCOM_ALTER_TABLE && + (thd->lex->create_info.used_fields & HA_CREATE_USED_AUTO) && + (thd->lex->create_info.auto_increment_value != 0)) { + + /* Query was ALTER TABLE...AUTO_INC = x; Find out a table + definition from the dictionary and get the current value + of the auto increment field. Set a new value to the + auto increment field if the new value is creater than + the current value. */ + + auto_inc_value = thd->lex->create_info.auto_increment_value; + dict_table_autoinc_initialize(innobase_table, auto_inc_value); + } + /* Tell the InnoDB server that there might be work for utility threads: */ |