List:Bugs« Previous MessageNext Message »
From:sasha Date:November 21 2000 11:37pm
Subject:Re: SHOW CREATE TABLE bug ..
View as plain text  
Weslee Bilodeau wrote:
> 
> Running 3.23.27-beta-log ..
> 
> Two bugs, first is that it doesn't return the tables 'comment', second
> is its default value for set types is wrong.
> 
> mysql> create table test ( test_set set( 'val1', 'val2', 'val3' ) not
> null default '' ) comment = 'Comment here' ;
> Query OK, 0 rows affected (0.00 sec)
> 
> mysql> show create table test ;
>
> +-------+-------------------------------------------------------------------------------------------------------------------------+
> | Table | Create
> Table
> |
>
> +-------+-------------------------------------------------------------------------------------------------------------------------+
> | test  | CREATE TABLE `test` (
>   `test_set` set('val1','val2','val3') NOT NULL default
> 'set('val1','val2','val3')'
> ) TYPE=MyISAM |
>
> +-------+-------------------------------------------------------------------------------------------------------------------------+
> 1 row in set (0.00 sec)

Thanks for the bug report. Fix:

--- 1.30/sql/sql_show.cc        Mon Oct 23 17:39:54 2000
+++ edited/sql_show.cc  Tue Nov 21 16:29:35 2000
@@ -732,7 +732,8 @@
         type.set(tmp,sizeof(tmp));
         field->val_str(&type,&type);
         packet->append('\'');
-        packet->append(type.ptr(),type.length());
+       if(type.length())
+          append_unescaped(packet, type.c_ptr());
         packet->append('\'');
       }
       else if (field->maybe_null())
@@ -818,6 +819,12 @@
     packet->append(" CHECKSUM=1", 11);
   if (table->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
     packet->append(" DELAY_KEY_WRITE=1",18);
+  if(table->comment)
+    {
+      packet->append(" COMMENT='", 10);
+      append_unescaped(packet, table->comment);
+      packet->append('\'');
+    }


   DBUG_RETURN(0);

The fix of course will be in 3.23.28...

-- 
MySQL Development Team
   __  ___     ___ ____  __ 
  /  |/  /_ __/ __/ __ \/ /   Sasha Pachev <sasha@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Provo, Utah, USA
       <___/
Thread
SHOW CREATE TABLE bug ..Weslee Bilodeau17 Nov
  • Re: SHOW CREATE TABLE bug ..sasha22 Nov