summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-12-16 08:34:03 +0200
committerunknown <jan@hundin.mysql.fi>2004-12-16 08:34:03 +0200
commitd518f87171980101b84a66a67d420286a3449ee8 (patch)
tree5927a88c3ae131be846e7b2812d0ab2de46a0ed9 /sql
parent7845f99abf1d36e972970c0fc9431956a8f4b63a (diff)
downloadmariadb-git-d518f87171980101b84a66a67d420286a3449ee8.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 3e535385ed0..3418f82ee39 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -4001,15 +4001,15 @@ 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) &&
+ if ((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
+ /* 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
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 increment field if the value is greater than the
+ maximum value in the column. */
auto_inc_value = thd->lex->create_info.auto_increment_value;
dict_table_autoinc_initialize(innobase_table, auto_inc_value);