List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:August 11 2007 12:14am
Subject:bk commit into 5.0 tree (cmiller:1.2500) BUG#15776
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller 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@stripped, 2007-08-10 18:14:54-04:00, cmiller@stripped +8 -0
  Bug#15776: 32-bit signed int used for length of blob
  
  Contributed patch from Martin Friebe, CLA from 2007-02-24.
  
  The parser lacked support for field sizes after signed long,
  when it should extend to 2**32-1.
  
  Now, we correct that limitation, and also make the error handling
  consistent for casts.

  mysql-test/r/type_blob.result@stripped, 2007-08-10 18:14:50-04:00,
cmiller@stripped +93 -0
    Verify that blobs may be created with the size that is already
    documented.

  mysql-test/t/type_blob.test@stripped, 2007-08-10 18:14:50-04:00, cmiller@stripped
+89 -0
    Verify that blobs may be created with the size that is already
    documented.

  sql/field.cc@stripped, 2007-08-10 18:14:50-04:00, cmiller@stripped +14 -2
    atoi() insufficient to gauge the length of some fields.  Change
    it to strtoul().
    
    Add a new status variable to track whether a field is too long.

  sql/item_create.cc@stripped, 2007-08-10 18:14:50-04:00, cmiller@stripped +9 -2
    atoi() insufficient to gauge the length of some fields.  Change
    it to strtoul().
    
    If a casted length is too long, raise an error.

  sql/item_timefunc.h@stripped, 2007-08-10 18:14:50-04:00, cmiller@stripped +3 -2
    Make casts accept lengths greater than mere int -- longlong.

  sql/share/errmsg.txt@stripped, 2007-08-10 18:14:51-04:00, cmiller@stripped +24 -24
    Change ER_TOO_BIG_FIELDLENGTH so that it can accept sizes larger
    than 2**15 -- instead, 2**32.

  sql/sql_yacc.yy@stripped, 2007-08-10 18:14:50-04:00, cmiller@stripped +5 -2
    Make lengths take, in addition to NUM, LONG_NUM, ULONGLONG_NUM,
    and DECIMAL_NUM.

  sql/unireg.h@stripped, 2007-08-10 18:14:51-04:00, cmiller@stripped +1 -0
    Define new constant.

diff -Nrup a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
--- a/mysql-test/r/type_blob.result	2007-03-01 11:59:52 -05:00
+++ b/mysql-test/r/type_blob.result	2007-08-10 18:14:50 -04:00
@@ -807,4 +807,97 @@ set @@sql_mode='TRADITIONAL';
 create table t1 (a text default '');
 ERROR 42000: BLOB/TEXT column 'a' can't have a default value
 set @@sql_mode='';
+create table b15776 (data blob(2147483647));
+drop table b15776;
+create table b15776 (data blob(-1));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '-1))' at line 1
+create table b15776 (data blob(2147483648));
+drop table b15776;
+create table b15776 (data blob(4294967294));
+drop table b15776;
+create table b15776 (data blob(4294967295));
+create table b15776 (data blob(4294967296));
+ERROR 42000: Column length too big for column 'data' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a blob(2147483647), b blob(2147483648), c blob(4294967295), a1
text(2147483647), b1 text(2147483648), c1 text(4294967295) );
+show columns from t1;
+Field	Type	Null	Key	Default	Extra
+a	longblob	YES		NULL	
+b	longblob	YES		NULL	
+c	longblob	YES		NULL	
+a1	longtext	YES		NULL	
+b1	longtext	YES		NULL	
+c1	longtext	YES		NULL	
+drop table t1;
+CREATE TABLE t1 (a blob(4294967296));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a text(4294967296));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a
blob(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a
text(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a int(4294967296));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a char(4294967296));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '4294967296))' at line 1
+CREATE TABLE t1 (a year(4294967296));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a timestamp(4294967296));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a
int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
'99999999999999999999999999999999999999999999999999999999999999999999999999999999' at
line 1
+CREATE TABLE t1 (a
year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 (a
timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'a' (max = 4294967295); use BLOB or TEXT
instead
+CREATE TABLE t1 select cast(null as char(4294967295));
+show columns from t1;
+Field	Type	Null	Key	Default	Extra
+cast(null as char(4294967295))	longtext	YES		NULL	
+drop table t1;
+CREATE TABLE t1 select cast(null as nchar(4294967295));
+show columns from t1;
+Field	Type	Null	Key	Default	Extra
+cast(null as nchar(4294967295))	longtext	YES		NULL	
+drop table t1;
+CREATE TABLE t1 select cast(null as binary(4294967295));
+show columns from t1;
+Field	Type	Null	Key	Default	Extra
+cast(null as binary(4294967295))	longblob	YES		NULL	
+drop table t1;
+explain select cast(1 as char(4294967295));
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+explain select cast(1 as nchar(4294967295));
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+explain select cast(1 as binary(4294967295));
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+explain select cast(1 as char(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select cast(1 as
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select cast(1 as nchar(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select cast(1 as
nchar(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select cast(1 as binary(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select cast(1 as
binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1, char(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1,
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1, nchar(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1,
nchar(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1, binary(4294967296));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
+explain select convert(1,
binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+ERROR 42000: Column length too big for column 'cast as char' (max = 4294967295); use BLOB
or TEXT instead
 End of 5.0 tests
diff -Nrup a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
--- a/mysql-test/t/type_blob.test	2007-02-14 08:44:31 -05:00
+++ b/mysql-test/t/type_blob.test	2007-08-10 18:14:50 -04:00
@@ -436,4 +436,93 @@ set @@sql_mode='TRADITIONAL';
 create table t1 (a text default '');
 set @@sql_mode='';
 
+#
+# Bug#15776: 32-bit signed int used for length of blob
+# """LONGBLOB:  A BLOB column with a maximum length of 4,294,967,295 or 4GB."""
+#
+create table b15776 (data blob(2147483647));
+drop table b15776;
+--error ER_PARSE_ERROR
+create table b15776 (data blob(-1));
+create table b15776 (data blob(2147483648));
+drop table b15776;
+create table b15776 (data blob(4294967294));
+drop table b15776;
+create table b15776 (data blob(4294967295));
+--error ER_TOO_BIG_FIELDLENGTH
+create table b15776 (data blob(4294967296));
+
+CREATE TABLE t1 (a blob(2147483647), b blob(2147483648), c blob(4294967295), a1
text(2147483647), b1 text(2147483648), c1 text(4294967295) );
+show columns from t1;
+drop table t1;
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a blob(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a text(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a
blob(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a
text(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+
+# Bug#15776: additional test, affecting other functions
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a int(4294967296));
+--error ER_PARSE_ERROR
+CREATE TABLE t1 (a char(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+# It's probably okay if this fails for other than 2**31 overflow.
+CREATE TABLE t1 (a year(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a timestamp(4294967296));
+
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a
int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_PARSE_ERROR
+CREATE TABLE t1 (a
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a
year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+CREATE TABLE t1 (a
timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+
+# do not select, too much memory needed
+CREATE TABLE t1 select cast(null as char(4294967295));
+show columns from t1;
+drop table t1;
+CREATE TABLE t1 select cast(null as nchar(4294967295));
+show columns from t1;
+drop table t1;
+CREATE TABLE t1 select cast(null as binary(4294967295));
+show columns from t1;
+drop table t1;
+
+explain select cast(1 as char(4294967295));
+explain select cast(1 as nchar(4294967295));
+explain select cast(1 as binary(4294967295));
+
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as char(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as nchar(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as
nchar(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as binary(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select cast(1 as
binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1, char(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1,
char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1, nchar(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1,
nchar(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1, binary(4294967296));
+--error ER_TOO_BIG_FIELDLENGTH
+explain select convert(1,
binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
+
 --echo End of 5.0 tests
diff -Nrup a/sql/field.cc b/sql/field.cc
--- a/sql/field.cc	2007-07-25 18:28:50 -04:00
+++ b/sql/field.cc	2007-08-10 18:14:50 -04:00
@@ -8395,8 +8395,20 @@ bool create_field::init(THD *thd, char *
       (fld_type_modifier & NOT_NULL_FLAG) && fld_type !=
FIELD_TYPE_TIMESTAMP)
     flags|= NO_DEFAULT_VALUE_FLAG;
 
-  if (fld_length && !(length= (uint) atoi(fld_length)))
-    fld_length= 0; /* purecov: inspected */
+  if (fld_length != 0)
+  {
+    errno= 0;
+    length= strtoul(fld_length, NULL, 10);
+    if (errno != 0)
+    {
+      my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), fld_name, MAX_FIELD_BLOBLENGTH);
+      DBUG_RETURN(TRUE);
+    }
+
+    if (length == 0)
+      fld_length= 0; /* purecov: inspected */
+  }
+
   sign_len= fld_type_modifier & UNSIGNED_FLAG ? 0 : 1;
 
   switch (fld_type) {
diff -Nrup a/sql/item_create.cc b/sql/item_create.cc
--- a/sql/item_create.cc	2007-08-02 05:51:00 -04:00
+++ b/sql/item_create.cc	2007-08-10 18:14:50 -04:00
@@ -487,9 +487,16 @@ Item *create_func_cast(Item *a, Cast_tar
     res= new Item_decimal_typecast(a, len, dec);
     break;
   case ITEM_CAST_CHAR:
-    len= c_len ? atoi(c_len) : -1;
+    errno= 0;
+    longlong len= c_len ? strtoul(c_len, NULL, 10) : LL(-1);
+    if (errno != 0)
+    {
+      my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), "cast as char", MAX_FIELD_BLOBLENGTH);
+      return 0;
+    }
+
     res= new Item_char_typecast(a, len, cs ? cs : 
-				current_thd->variables.collation_connection);
+                                current_thd->variables.collation_connection);
     break;
   }
   return res;
diff -Nrup a/sql/item_timefunc.h b/sql/item_timefunc.h
--- a/sql/item_timefunc.h	2007-05-16 04:44:40 -04:00
+++ b/sql/item_timefunc.h	2007-08-10 18:14:50 -04:00
@@ -755,12 +755,13 @@ public:
 
 class Item_char_typecast :public Item_typecast
 {
-  int cast_length;
+  // cast_length supports up to 4294967295, but also -1 
+  longlong cast_length;
   CHARSET_INFO *cast_cs, *from_cs;
   bool charset_conversion;
   String tmp_value;
 public:
-  Item_char_typecast(Item *a, int length_arg, CHARSET_INFO *cs_arg)
+  Item_char_typecast(Item *a, longlong length_arg, CHARSET_INFO *cs_arg)
     :Item_typecast(a), cast_length(length_arg), cast_cs(cs_arg) {}
   enum Functype functype() const { return CHAR_TYPECAST_FUNC; }
   bool eq(const Item *item, bool binary_cmp) const;
diff -Nrup a/sql/share/errmsg.txt b/sql/share/errmsg.txt
--- a/sql/share/errmsg.txt	2007-06-05 19:42:39 -04:00
+++ b/sql/share/errmsg.txt	2007-08-10 18:14:51 -04:00
@@ -1771,30 +1771,30 @@ ER_BLOB_USED_AS_KEY 42000 S1009
 	swe "En BLOB '%-.64s' kan inte vara nyckel med den anvnda tabelltypen"
 	ukr "BLOB  '%-.64s'      Φ    Ц
æ"
 ER_TOO_BIG_FIELDLENGTH 42000 S1009
-	cze "P-Bli¹ velk dlka sloupce '%-.64s' (nejvce %d). Pou¾ijte BLOB"
-	dan "For stor feltlngde for kolonne '%-.64s' (maks = %d). Brug BLOB i stedet"
-	nla "Te grote kolomlengte voor '%-.64s' (max = %d). Maak hiervoor gebruik van het type
BLOB"
-	eng "Column length too big for column '%-.64s' (max = %d); use BLOB or TEXT instead"
-	jps "column '%-.64s' ,mۂ· column
̑傫³ª½·¬܂·. (ő %d ܂). BLOB
ɎgpµĂ­¾³¢.",
-	est "Tulba '%-.64s' pikkus on liiga pikk (maksimaalne pikkus: %d). Kasuta BLOB
vljatpi"
-	fre "Champ '%-.64s' trop long (max = %d). Utilisez un BLOB"
-	ger "Feldlnge fr Feld '%-.64s' zu gro (maximal %d). BLOB- oder TEXT-Spaltentyp
verwenden!"
-	greek "      '%-.64s' (max = %d). þ 
 BLOB"
-	hun "A(z) '%-.64s' oszlop tul hosszu. (maximum = %d). Hasznaljon BLOB tipust inkabb."
-	ita "La colonna '%-.64s' e` troppo grande (max=%d). Utilizza un BLOB."
-	jpn "column '%-.64s' ¤,³ݤ¹¤ column
¤礭¤µ¤¬¿¤¹¤®¤ޤ¹.
(º %d ¤ޤ). BLOB
¤򤫤˻Ѥ·¤Ƥ¯¤µ¤¤."
-	kor "Į·³ '%-.64s' Į·³ ±̰¡ ³ʹ«
±ϴ (ִ = %d). ´ſ¡ BLOB¸¦
»ϼ¼¿."
-	nor "For stor nkkellengde for kolonne '%-.64s' (maks = %d). Bruk BLOB istedenfor"
-	norwegian-ny "For stor nykkellengde for felt '%-.64s' (maks = %d). Bruk BLOB istadenfor"
-	pol "Zbyt du¿a d³ugo? kolumny '%-.64s' (maks. = %d). W zamian u¿yj
typu BLOB"
-	por "Comprimento da coluna '%-.64s' grande demais (max = %d); use BLOB em seu lugar"
-	rum "Lungimea coloanei '%-.64s' este prea lunga (maximum = %d). Foloseste BLOB mai bine"
-	rus "    '%-.64s' ( = %d).   BLOB 
TEXT  "
-	serbian "Previe podataka za kolonu '%-.64s' (maksimum je %d). Upotrebite BLOB polje"
-	slo "Prli¹ veµk dka pre pole '%-.64s' (maximum = %d). Pou¾ite
BLOB"
-	spa "Longitud de columna demasiado grande para la columna '%-.64s' (maximo = %d).Usar
BLOB en su lugar"
-	swe "Fr stor kolumnlngd angiven fr '%-.64s' (max= %d). Anvnd en BLOB instllet"
-	ukr "   '%-.64s' (max = %d).   BLOB"
+	cze "P-Bli¹ velk dlka sloupce '%-.64s' (nejvce %lu). Pou¾ijte BLOB"
+	dan "For stor feltlngde for kolonne '%-.64s' (maks = %lu). Brug BLOB i stedet"
+	nla "Te grote kolomlengte voor '%-.64s' (max = %lu). Maak hiervoor gebruik van het type
BLOB"
+	eng "Column length too big for column '%-.64s' (max = %lu); use BLOB or TEXT instead"
+	jps "column '%-.64s' ,mۂ· column
̑傫³ª½·¬܂·. (ő %lu ܂). BLOB
ɎgpµĂ­¾³¢.",
+	est "Tulba '%-.64s' pikkus on liiga pikk (maksimaalne pikkus: %lu). Kasuta BLOB
vljatpi"
+	fre "Champ '%-.64s' trop long (max = %lu). Utilisez un BLOB"
+	ger "Feldlnge fr Feld '%-.64s' zu gro (maximal %lu). BLOB- oder TEXT-Spaltentyp
verwenden!"
+	greek "      '%-.64s' (max = %lu). þ 
 BLOB"
+	hun "A(z) '%-.64s' oszlop tul hosszu. (maximum = %lu). Hasznaljon BLOB tipust inkabb."
+	ita "La colonna '%-.64s' e` troppo grande (max=%lu). Utilizza un BLOB."
+	jpn "column '%-.64s' ¤,³ݤ¹¤ column
¤礭¤µ¤¬¿¤¹¤®¤ޤ¹.
(º %lu ¤ޤ). BLOB
¤򤫤˻Ѥ·¤Ƥ¯¤µ¤¤."
+	kor "Į·³ '%-.64s' Į·³ ±̰¡ ³ʹ«
±ϴ (ִ = %lu). ´ſ¡ BLOB¸¦
»ϼ¼¿."
+	nor "For stor nkkellengde for kolonne '%-.64s' (maks = %lu). Bruk BLOB istedenfor"
+	norwegian-ny "For stor nykkellengde for felt '%-.64s' (maks = %lu). Bruk BLOB
istadenfor"
+	pol "Zbyt du¿a d³ugo? kolumny '%-.64s' (maks. = %lu). W zamian u¿yj
typu BLOB"
+	por "Comprimento da coluna '%-.64s' grande demais (max = %lu); use BLOB em seu lugar"
+	rum "Lungimea coloanei '%-.64s' este prea lunga (maximum = %lu). Foloseste BLOB mai
bine"
+	rus "    '%-.64s' ( = %lu).   BLOB 
TEXT  "
+	serbian "Previe podataka za kolonu '%-.64s' (maksimum je %lu). Upotrebite BLOB polje"
+	slo "Prli¹ veµk dka pre pole '%-.64s' (maximum = %lu). Pou¾ite
BLOB"
+	spa "Longitud de columna demasiado grande para la columna '%-.64s' (maximo = %lu).Usar
BLOB en su lugar"
+	swe "Fr stor kolumnlngd angiven fr '%-.64s' (max= %lu). Anvnd en BLOB instllet"
+	ukr "   '%-.64s' (max = %lu).   BLOB"
 ER_WRONG_AUTO_KEY 42000 S1009
 	cze "M-Bete mt pouze jedno AUTO pole a to mus bt definovno jako kl"
 	dan "Der kan kun specificeres eet AUTO_INCREMENT-felt, og det skal vre indekseret"
diff -Nrup a/sql/sql_yacc.yy b/sql/sql_yacc.yy
--- a/sql/sql_yacc.yy	2007-08-01 20:39:11 -04:00
+++ b/sql/sql_yacc.yy	2007-08-10 18:14:50 -04:00
@@ -3284,8 +3284,11 @@ field_option:
 	| ZEROFILL	{ Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; };
 
 opt_len:
-	/* empty */	{ Lex->length=(char*) 0; } /* use default length */
-	| '(' NUM ')'	{ Lex->length= $2.str; };
+        /* empty */             { Lex->length=(char*) 0; } /* use default length */
+        | '(' NUM ')'           { Lex->length= $2.str; }
+        | '(' LONG_NUM ')'      { Lex->length= $2.str; }
+        | '(' ULONGLONG_NUM ')' { Lex->length= $2.str; }
+        | '(' DECIMAL_NUM ')'   { Lex->length= $2.str; };
 
 opt_precision:
 	/* empty */	{}
diff -Nrup a/sql/unireg.h b/sql/unireg.h
--- a/sql/unireg.h	2007-07-05 06:34:11 -04:00
+++ b/sql/unireg.h	2007-08-10 18:14:51 -04:00
@@ -60,6 +60,7 @@
 #define MAX_MBWIDTH		3		/* Max multibyte sequence */
 #define MAX_FIELD_CHARLENGTH	255
 #define MAX_FIELD_VARCHARLENGTH	65535
+#define MAX_FIELD_BLOBLENGTH    UINT_MAX
 #define CONVERT_IF_BIGGER_TO_BLOB 512		/* Used for CREATE ... SELECT */
 
 /* Max column width +1 */
Thread
bk commit into 5.0 tree (cmiller:1.2500) BUG#15776Chad MILLER11 Aug
Re: bk commit into 5.0 tree (cmiller:1.2500) BUG#15776Timothy Smith11 Aug