List:Internals« Previous MessageNext Message »
From:ramil Date:March 10 2005 4:04pm
Subject:bk commit into 5.0 tree (ramil:1.1796) BUG#8296
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1796 05/03/10 19:04:06 ramil@stripped +5 -0
  A fix (bug #8295: VARCHAR: Silent data type change when size too large
         bug #8296: VARBINARY: Silent data type change when size too large).

  sql/sql_table.cc
    1.224 05/03/10 19:04:01 ramil@stripped +3 -16
    A fix (bug #8295: VARCHAR: Silent data type change when size too large
           bug #8296: VARBINARY: Silent data type change when size too large).
    
    Don't convert fields to blob if field size is too large.

  mysql-test/t/type_blob.test
    1.26 05/03/10 19:04:01 ramil@stripped +3 -3
    A fix (bug #8295: VARCHAR: Silent data type change when size too large
           bug #8296: VARBINARY: Silent data type change when size too large).

  mysql-test/r/type_blob.result
    1.45 05/03/10 19:04:01 ramil@stripped +3 -16
    A fix (bug #8295: VARCHAR: Silent data type change when size too large
           bug #8296: VARBINARY: Silent data type change when size too large).

  mysql-test/r/myisam.result
    1.58 05/03/10 19:04:01 ramil@stripped +2 -16
    A fix (bug #8295: VARCHAR: Silent data type change when size too large
           bug #8296: VARBINARY: Silent data type change when size too large).

  mysql-test/include/varchar.inc
    1.6 05/03/10 19:04:01 ramil@stripped +2 -4
    A fix (bug #8295: VARCHAR: Silent data type change when size too large
           bug #8296: VARBINARY: Silent data type change when size too large).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/5.0.b8296

--- 1.223/sql/sql_table.cc	2005-03-08 22:53:02 +04:00
+++ 1.224/sql/sql_table.cc	2005-03-10 19:04:01 +04:00
@@ -763,22 +763,9 @@
     if (sql_field->length > MAX_FIELD_VARCHARLENGTH &&
         !(sql_field->flags & BLOB_FLAG))
     {
-      /* Convert long VARCHAR columns to TEXT or BLOB */
-      char warn_buff[MYSQL_ERRMSG_SIZE];
-
-      if (sql_field->def)
-      {
-        my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name,
-                 MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
-        DBUG_RETURN(-1);
-      }
-      sql_field->sql_type= FIELD_TYPE_BLOB;
-      sql_field->flags|= BLOB_FLAG;
-      sprintf(warn_buff, ER(ER_AUTO_CONVERT), sql_field->field_name,
-              "VARCHAR",
-              (sql_field->charset == &my_charset_bin) ? "BLOB" : "TEXT");
-      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_AUTO_CONVERT,
-                   warn_buff);
+      my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name,
+               MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
+      DBUG_RETURN(-1);
     }
     
     if ((sql_field->flags & BLOB_FLAG) && sql_field->length)

--- 1.44/mysql-test/r/type_blob.result	2005-03-05 18:12:28 +04:00
+++ 1.45/mysql-test/r/type_blob.result	2005-03-10 19:04:01 +04:00
@@ -8,17 +8,9 @@
 d	mediumtext	YES		NULL	
 e	longtext	YES		NULL	
 CREATE TABLE t2 (a char(255), b varbinary(70000), c varchar(70000000));
-Warnings:
-Note	1246	Converting column 'b' from VARCHAR to BLOB
-Note	1246	Converting column 'c' from VARCHAR to TEXT
+ERROR 42000: Column length too big for column 'b' (max = 65535); use BLOB instead
 CREATE TABLE t4 (c varchar(65530) character set utf8 not null);
-Warnings:
-Note	1246	Converting column 'c' from VARCHAR to TEXT
-show columns from t2;
-Field	Type	Null	Key	Default	Extra
-a	char(255)	YES		NULL	
-b	mediumblob	YES		NULL	
-c	longtext	YES		NULL	
+ERROR 42000: Column length too big for column 'c' (max = 21845); use BLOB instead
 create table t3 (a long, b long byte);
 show create TABLE t3;
 Table	Create Table
@@ -26,12 +18,7 @@
   `a` mediumtext,
   `b` mediumblob
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
-show create TABLE t4;
-Table	Create Table
-t4	CREATE TABLE `t4` (
-  `c` mediumtext character set utf8 NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1,t2,t3,t4;
+drop table t1, t3;
 CREATE TABLE t1 (a char(257) default "hello");
 ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead
 CREATE TABLE t2 (a char(256));

--- 1.25/mysql-test/t/type_blob.test	2005-01-04 15:46:43 +04:00
+++ 1.26/mysql-test/t/type_blob.test	2005-03-10 19:04:01 +04:00
@@ -17,13 +17,13 @@
 CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
 show columns from t1;
 # PS doesn't give errors on prepare yet
+--error 1074
 CREATE TABLE t2 (a char(255), b varbinary(70000), c varchar(70000000));
+--error 1074
 CREATE TABLE t4 (c varchar(65530) character set utf8 not null);
-show columns from t2;
 create table t3 (a long, b long byte);
 show create TABLE t3;
-show create TABLE t4;
-drop table t1,t2,t3,t4;
+drop table t1, t3;
 
 #
 # Check errors with blob

--- 1.57/mysql-test/r/myisam.result	2005-03-02 13:56:12 +04:00
+++ 1.58/mysql-test/r/myisam.result	2005-03-10 19:04:01 +04:00
@@ -1154,23 +1154,9 @@
 Warning	1071	Specified key was too long; max key length is 1000 bytes
 drop table if exists t1;
 create table t1 (v varchar(65536));
-Warnings:
-Note	1246	Converting column 'v' from VARCHAR to TEXT
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `v` mediumtext
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
+ERROR 42000: Column length too big for column 'v' (max = 65535); use BLOB instead
 create table t1 (v varchar(65530) character set utf8);
-Warnings:
-Note	1246	Converting column 'v' from VARCHAR to TEXT
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `v` mediumtext character set utf8
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
+ERROR 42000: Column length too big for column 'v' (max = 21845); use BLOB instead
 set storage_engine=MyISAM;
 create table t1 (v varchar(65535));
 ERROR 42000: Row size too large. The maximum row size for the used table type, not
counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs

--- 1.5/mysql-test/include/varchar.inc	2005-02-14 21:45:24 +04:00
+++ 1.6/mysql-test/include/varchar.inc	2005-03-10 19:04:01 +04:00
@@ -233,9 +233,7 @@
 
 create table t1 (v varchar(65530), key(v));
 drop table if exists t1;
+--error 1074
 create table t1 (v varchar(65536));
-show create table t1;
-drop table t1;
+--error 1074
 create table t1 (v varchar(65530) character set utf8);
-show create table t1;
-drop table t1;
Thread
bk commit into 5.0 tree (ramil:1.1796) BUG#8296ramil10 Mar