List:Commits« Previous MessageNext Message »
From:Abhishek Ranjan Date:July 15 2013 6:24am
Subject:bzr push into mysql-trunk branch (abhishek.ar.ranjan:6122 to 6123)
Bug#16358989
View as plain text  
 6123 Abhishek Ranjan	2013-07-15 [merge]
      BUG#16358989 - BIT(0): ILLEGAL, BUT PRODUCES NO ERROR OR WARNING
      
      DESCRIPTION:
      
      If the size for the BIT data type is specified as zero, MySQL
      accepts it without any error or warning. It implicitly converts
      size to one. The range of the size for BIT data type is 1 to
      64. Default value for the size of BIT data type is 1.
      
      FIX:
      
      Changed the behavior to give an error if size for the BIT data
      type is specified as zero.

    modified:
      mysql-test/r/type_bit.result
      mysql-test/r/type_bit_innodb.result
      mysql-test/suite/parts/inc/partition_bit.inc
      mysql-test/suite/parts/r/partition_bit_innodb.result
      mysql-test/suite/parts/r/partition_bit_myisam.result
      mysql-test/t/type_bit.test
      mysql-test/t/type_bit_innodb.test
      sql/field.cc
      sql/share/errmsg-utf8.txt
 6122 Krunal Bauskar	2013-07-15
      - bug#17077597: INNODB TRUNCATE TABLE SPAMS ERROR LOG
      
        For each truncate, there use to be a informational message
        printed in log file indicating truncate of table.
        This would lead to over-messaging given that each statement
        is printing a message in log file.
      
        Removed the message as the same info is available through
        information_schema.
      
        Approved by: Sunny (over IM)

    modified:
      storage/innobase/row/row0trunc.cc
=== modified file 'mysql-test/r/type_bit.result'
--- a/mysql-test/r/type_bit.result	2013-01-08 15:23:49 +0000
+++ b/mysql-test/r/type_bit.result	2013-07-08 18:45:56 +0000
@@ -38,12 +38,7 @@ drop table if exists t1,t2;
 create table t1 (a bit(65));
 ERROR 42000: Display width out of range for column 'a' (max = 64)
 create table t1 (a bit(0));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(64));
 insert into t1 values 
 (b'1111111111111111111111111111111111111111111111111111111111111111'),

=== modified file 'mysql-test/r/type_bit_innodb.result'
--- a/mysql-test/r/type_bit_innodb.result	2012-05-30 04:12:50 +0000
+++ b/mysql-test/r/type_bit_innodb.result	2013-07-08 18:45:56 +0000
@@ -38,12 +38,7 @@ drop table if exists t1;
 create table t1 (a bit(65)) engine=innodb;
 ERROR 42000: Display width out of range for column 'a' (max = 64)
 create table t1 (a bit(0)) engine=innodb;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(64)) engine=innodb;
 insert into t1 values 
 (b'1111111111111111111111111111111111111111111111111111111111111111'),

=== modified file 'mysql-test/suite/parts/inc/partition_bit.inc'
--- a/mysql-test/suite/parts/inc/partition_bit.inc	2008-02-07 15:26:22 +0000
+++ b/mysql-test/suite/parts/inc/partition_bit.inc	2013-07-08 18:45:56 +0000
@@ -5,16 +5,14 @@ drop table if exists t1;
 --error ER_TOO_BIG_DISPLAYWIDTH
 eval create table t1 (a bit(65), primary key (a)) engine=$engine partition by key (a);
 
+--error ER_INVALID_FIELD_SIZE
 eval create table t1 (a bit(0), primary key (a)) engine=$engine partition by key (a);
-show create table t1;
-drop table t1;
 
+--error ER_INVALID_FIELD_SIZE
 eval create table t1 (a bit(0), primary key (a)) engine=$engine 
 partition by key (a) (
 partition pa1,
 partition pa2);
-show create table t1;
-drop table t1;
 
 eval create table t1 (a bit(64), primary key (a)) engine=$engine 
 partition by key (a) partitions 2;

=== modified file 'mysql-test/suite/parts/r/partition_bit_innodb.result'
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result	2013-02-14 16:08:56 +0000
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result	2013-07-08 18:45:56 +0000
@@ -3,28 +3,12 @@ drop table if exists t1;
 create table t1 (a bit(65), primary key (a)) engine='INNODB' partition by key (a);
 ERROR 42000: Display width out of range for column 'a' (max = 64)
 create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT b'0',
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(0), primary key (a)) engine='INNODB' 
 partition by key (a) (
 partition pa1,
 partition pa2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT b'0',
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 ENGINE = InnoDB,
- PARTITION pa2 ENGINE = InnoDB) */
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(64), primary key (a)) engine='INNODB' 
 partition by key (a) partitions 2;
 show create table t1;

=== modified file 'mysql-test/suite/parts/r/partition_bit_myisam.result'
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result	2013-02-14 16:08:56 +0000
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result	2013-07-08 18:45:56 +0000
@@ -3,28 +3,12 @@ drop table if exists t1;
 create table t1 (a bit(65), primary key (a)) engine='MyISAM' partition by key (a);
 ERROR 42000: Display width out of range for column 'a' (max = 64)
 create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT b'0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(0), primary key (a)) engine='MyISAM' 
 partition by key (a) (
 partition pa1,
 partition pa2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT b'0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 ENGINE = MyISAM,
- PARTITION pa2 ENGINE = MyISAM) */
-drop table t1;
+ERROR HY000: Invalid size for column 'a'.
 create table t1 (a bit(64), primary key (a)) engine='MyISAM' 
 partition by key (a) partitions 2;
 show create table t1;

=== modified file 'mysql-test/t/type_bit.test'
--- a/mysql-test/t/type_bit.test	2013-03-15 06:58:58 +0000
+++ b/mysql-test/t/type_bit.test	2013-07-08 18:45:56 +0000
@@ -27,9 +27,8 @@ drop table if exists t1,t2;
 --error 1439
 create table t1 (a bit(65));
 
+--error ER_INVALID_FIELD_SIZE
 create table t1 (a bit(0));
-show create table t1;
-drop table t1;
 
 create table t1 (a bit(64));
 insert into t1 values 

=== modified file 'mysql-test/t/type_bit_innodb.test'
--- a/mysql-test/t/type_bit_innodb.test	2012-05-30 04:12:50 +0000
+++ b/mysql-test/t/type_bit_innodb.test	2013-07-08 18:45:56 +0000
@@ -23,9 +23,8 @@ drop table if exists t1;
 --error 1439
 create table t1 (a bit(65)) engine=innodb;
 
+--error ER_INVALID_FIELD_SIZE
 create table t1 (a bit(0)) engine=innodb;
-show create table t1;
-drop table t1;
 
 create table t1 (a bit(64)) engine=innodb;
 insert into t1 values 

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2013-06-14 16:23:24 +0000
+++ b/sql/field.cc	2013-07-08 18:45:56 +0000
@@ -10147,7 +10147,10 @@ bool Create_field::init(THD *thd, char *
   case MYSQL_TYPE_BIT:
     {
       if (!fld_length)
-        length= 1;
+      {
+        my_error(ER_INVALID_FIELD_SIZE, MYF(0), fld_name);
+        DBUG_RETURN(TRUE);
+      }
       if (length > MAX_BIT_FIELD_LENGTH)
       {
         my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), fld_name,

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2013-07-03 11:30:56 +0000
+++ b/sql/share/errmsg-utf8.txt	2013-07-08 18:45:56 +0000
@@ -7070,6 +7070,10 @@ ER_REFERENCED_TRG_DOES_NOT_EXIST
 
 ER_EXPLAIN_NOT_SUPPORTED
         eng "EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACE"
+
+ER_INVALID_FIELD_SIZE
+        eng "Invalid size for column '%-.192s'."
+
 #
 #  End of 5.7 error messages.
 #

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (abhishek.ar.ranjan:6122 to 6123)Bug#16358989Abhishek Ranjan20 Aug