Commit d518f871 authored by unknown's avatar unknown

Added support for a CREATE TABLE...AUTO_INCREMENT = x in InnoDB.


sql/ha_innodb.cc:
  Added support for a CREATE TABLE...AUTO_INCREMENT = x; Note that the new
  value for auto increment field is set if the new values is creater than
  the maximum value in the column.
parent 7845f99a
...@@ -4001,15 +4001,15 @@ ha_innobase::create( ...@@ -4001,15 +4001,15 @@ ha_innobase::create(
DBUG_ASSERT(innobase_table != 0); DBUG_ASSERT(innobase_table != 0);
if (thd->lex->sql_command == SQLCOM_ALTER_TABLE && if ((thd->lex->create_info.used_fields & HA_CREATE_USED_AUTO) &&
(thd->lex->create_info.used_fields & HA_CREATE_USED_AUTO) &&
(thd->lex->create_info.auto_increment_value != 0)) { (thd->lex->create_info.auto_increment_value != 0)) {
/* Query was ALTER TABLE...AUTO_INC = x; Find out a table /* Query was ALTER TABLE...AUTO_INCREMENT = x; or
CREATE TABLE ...AUTO_INCREMENT = x; Find out a table
definition from the dictionary and get the current value definition from the dictionary and get the current value
of the auto increment field. Set a new value to the of the auto increment field. Set a new value to the
auto increment field if the new value is creater than auto increment field if the value is greater than the
the current value. */ maximum value in the column. */
auto_inc_value = thd->lex->create_info.auto_increment_value; auto_inc_value = thd->lex->create_info.auto_increment_value;
dict_table_autoinc_initialize(innobase_table, auto_inc_value); dict_table_autoinc_initialize(innobase_table, auto_inc_value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment