Commit b959c57a authored by unknown's avatar unknown

Remove extra space in SHOW CREATE TABLE output. (Bug #13883)


mysql-test/r/alter_table.result:
  Update test results
mysql-test/r/archive_bitfield.result:
  Update test results
mysql-test/r/create.result:
  Update test results
mysql-test/r/ctype_tis620.result:
  Update test results
mysql-test/r/gis-rtree.result:
  Update test results
mysql-test/r/index_merge_innodb.result:
  Update test results
mysql-test/r/information_schema.result:
  Update test results
mysql-test/r/innodb.result:
  Update test results
mysql-test/r/key.result:
  Update test results
mysql-test/r/merge.result:
  Update test results
mysql-test/r/partition.result:
  Update test results
mysql-test/r/partition_range.result:
  Update test results
mysql-test/r/rpl000002.result:
  Update test results
mysql-test/r/rpl_multi_engine.result:
  Update test results
mysql-test/r/show_check.result:
  Update test results
mysql-test/r/sql_mode.result:
  Update test results
mysql-test/r/strict.result:
  Update test results
mysql-test/r/symlink.result:
  Update test results
mysql-test/r/system_mysql_db.result:
  Update test results
mysql-test/r/type_blob.result:
  Update test results
sql/sql_show.cc:
  Avoid adding extra space between 'PRIMARY KEY' and key fields in
  SHOW CREATE TABLE output.
parent 5499e422
......@@ -46,6 +46,7 @@ db CREATE TABLE `db` (
`Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Event_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Trigger_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
......@@ -71,6 +72,7 @@ host CREATE TABLE `host` (
`Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Trigger_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
show create table user;
......@@ -106,6 +108,7 @@ user CREATE TABLE `user` (
`Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Create_user_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Event_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Trigger_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL default '',
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
......@@ -134,7 +137,7 @@ tables_priv CREATE TABLE `tables_priv` (
`Table_name` char(64) collate utf8_bin NOT NULL default '',
`Grantor` char(77) collate utf8_bin NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') character set utf8 NOT NULL default '',
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') character set utf8 NOT NULL default '',
`Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
KEY `Grantor` (`Grantor`)
......
......@@ -1058,14 +1058,19 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
if (i == primary_key && !strcmp(key_info->name, primary_key_name))
{
found_primary=1;
packet->append(STRING_WITH_LEN("PRIMARY "));
/*
No space at end, because a space will be added after where the
identifier would go, but that is not added for primary key.
*/
packet->append(STRING_WITH_LEN("PRIMARY KEY"));
}
else if (key_info->flags & HA_NOSAME)
packet->append(STRING_WITH_LEN("UNIQUE "));
packet->append(STRING_WITH_LEN("UNIQUE KEY "));
else if (key_info->flags & HA_FULLTEXT)
packet->append(STRING_WITH_LEN("FULLTEXT "));
packet->append(STRING_WITH_LEN("FULLTEXT KEY "));
else if (key_info->flags & HA_SPATIAL)
packet->append(STRING_WITH_LEN("SPATIAL "));
packet->append(STRING_WITH_LEN("SPATIAL KEY "));
else
packet->append(STRING_WITH_LEN("KEY "));
if (!found_primary)
......
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