summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <jani@hundin.mysql.fi>2006-05-04 13:17:16 +0300
committerunknown <jani@hundin.mysql.fi>2006-05-04 13:17:16 +0300
commitac94170069e4de0447fa5b76a1e38a437a66a197 (patch)
treef95ded980fb145e0769ba2413665e1c2cfaa4c88 /sql/sql_show.cc
parent29a3343e6bb419110d936d18cf929430bd329682 (diff)
parent66d4b40ceefa447d3cf24f56f4095c6f9799ecb2 (diff)
downloadmariadb-git-ac94170069e4de0447fa5b76a1e38a437a66a197.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/jani/mysql-4.1 sql/sql_show.cc: Auto merged
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ecdf74a1fef..41e145790e9 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1479,6 +1479,24 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(" ENGINE=", 8);
packet->append(file->table_type());
+ /*
+ Add AUTO_INCREMENT=... if there is an AUTO_INCREMENT column,
+ and NEXT_ID > 1 (the default). We must not print the clause
+ for engines that do not support this as it would break the
+ import of dumps, but as of this writing, the test for whether
+ AUTO_INCREMENT columns are allowed and wether AUTO_INCREMENT=...
+ is supported is identical, !(file->table_flags() & HA_NO_AUTO_INCREMENT))
+ Because of that, we do not explicitly test for the feature,
+ but may extrapolate its existence from that of an AUTO_INCREMENT column.
+ */
+
+ if(create_info.auto_increment_value > 1)
+ {
+ packet->append(" AUTO_INCREMENT=", 16);
+ end= longlong10_to_str(create_info.auto_increment_value, buff,10);
+ packet->append(buff, (uint) (end - buff));
+ }
+
if (table->table_charset &&
!(thd->variables.sql_mode & MODE_MYSQL323) &&
!(thd->variables.sql_mode & MODE_MYSQL40))