diff options
-rw-r--r-- | Docs/manual.texi | 3 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 10 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 7 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/sql_show.cc | 10 |
5 files changed, 30 insertions, 4 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 64d80a61f94..2193cdab4ad 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46425,6 +46425,9 @@ not yet 100% confident in this code. Added option @code{--warnings} to @code{mysqld}. Now @code{mysqld} only prints the error @code{Aborted connection} if this option is used. @item +Fixed problem with @code{SHOW CREATE TABLE} when you didn't have a +@code{PRIMARY KEY}. +@item Fixed properly the rename of @code{innodb_unix_file_flush_method} to @code{innodb_flush_method}. @item diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index ce2e5d4f58d..099ea2fa109 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -80,3 +80,13 @@ t1 CREATE TABLE `t1` ( `test_set` set('val1','val2','val3') NOT NULL default '', `name` char(20) default 'O''Brien' ) TYPE=MyISAM COMMENT='it''s a table' +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + UNIQUE KEY `aa` (`a`) +) TYPE=MyISAM +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + PRIMARY KEY (`a`) +) TYPE=MyISAM diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index f4f58c8c885..476d8dcdf0d 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -65,3 +65,10 @@ create table t1 ( ) comment = 'it\'s a table' ; show create table t1 ; drop table t1; + +create table t1 (a int not null, unique aa (a)); +show create table t1; +drop table t1; +create table t1 (a int not null, primary key (a)); +show create table t1; +drop table t1; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 177d4ab1ab4..e11da82f43f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1190,7 +1190,7 @@ Some pointers may be invalid and cause the dump to abort...\n"); fprintf(stderr, "\n Successfully dumped variables, if you ran with --log, take a look at the\n\ details of what thread %ld did to cause the crash. In some cases of really\n\ -bad corruption, the above values may be invalid\n\n", +bad corruption, the values shown above may be invalid\n\n", thd->thread_id); } fprintf(stderr, "\ @@ -3011,6 +3011,8 @@ static void usage(void) Start without grant tables. This gives all users\n\ FULL ACCESS to all tables!\n\ --safe-mode Skip some optimize stages (for testing)\n\ + --safe-show-database Don't show databases for which the user has no\n\ + privileges\n\ --skip-concurrent-insert\n\ Don't use concurrent insert with MyISAM\n\ --skip-delay-key-write\n\ diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 39ddb79e9de..6f99495d94d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -839,18 +839,22 @@ store_create_info(THD *thd, TABLE *table, String *packet) for (uint i=0 ; i < table->keys ; i++,key_info++) { + KEY_PART_INFO *key_part= key_info->key_part; + bool found_primary=0; packet->append(",\n ", 4); - KEY_PART_INFO *key_part= key_info->key_part; - if (i == primary_key) + if (i == primary_key && !strcmp(key_info->name,"PRIMARY")) + { + found_primary=1; packet->append("PRIMARY ", 8); + } else if (key_info->flags & HA_NOSAME) packet->append("UNIQUE ", 7); else if (key_info->flags & HA_FULLTEXT) packet->append("FULLTEXT ", 9); packet->append("KEY ", 4); - if (i != primary_key) + if (!found_primary) append_identifier(thd,packet,key_info->name); packet->append(" (", 2); |