MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Brian Aker Date:December 3 2006 8:19pm
Subject:bk commit into 5.1 tree (baker:1.2344)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of baker. When baker 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, 2006-12-03 21:19:35+01:00, baker@stripped +22 -0
  Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
  into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
  MERGE: 1.2303.127.1

  client/mysql.cc@stripped, 2006-12-03 21:19:24+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.244.1.1

  client/mysqldump.c@stripped, 2006-12-03 21:19:24+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.252.4.1

  sql/field.cc@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.355.3.1

  sql/field.h@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.195.1.1

  sql/handler.cc@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.283.1.1

  sql/item.cc@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.220.2.1

  sql/item_func.cc@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.335.1.1

  sql/item_subselect.h@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.82.1.1

  sql/item_sum.h@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.108.1.1

  sql/item_timefunc.cc@stripped, 2006-12-03 21:19:25+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.142.1.1

  sql/log_event.cc@stripped, 2006-12-03 21:19:26+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.258.1.1

  sql/opt_range.cc@stripped, 2006-12-03 21:19:26+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.248.2.1

  sql/sp.cc@stripped, 2006-12-03 21:19:26+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.131.1.1

  sql/sql_acl.cc@stripped, 2006-12-03 21:19:26+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.223.1.1

  sql/sql_insert.cc@stripped, 2006-12-03 21:19:26+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.234.1.1

  sql/sql_parse.cc@stripped, 2006-12-03 21:19:27+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.600.1.1

  sql/sql_select.cc@stripped, 2006-12-03 21:19:27+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.470.1.1

  sql/sql_show.cc@stripped, 2006-12-03 21:19:27+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.376.2.1

  sql/sql_table.cc@stripped, 2006-12-03 21:19:28+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.372.4.1

  sql/sql_yacc.yy@stripped, 2006-12-03 21:19:28+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.519.1.1

  sql/table.cc@stripped, 2006-12-03 21:19:28+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.257.4.1

  storage/innobase/handler/ha_innodb.cc@stripped, 2006-12-03 21:19:29+01:00, baker@stripped +0 -0
    Auto merged
    MERGE: 1.312.1.1

# 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:	baker
# Host:	bk-internal.mysql.com
# Root:	/data0/bk/mysql-5.1-arch/RESYNC

--- 1.246/client/mysql.cc	2006-12-03 21:19:44 +01:00
+++ 1.247/client/mysql.cc	2006-12-03 21:19:44 +01:00
@@ -2230,32 +2230,32 @@
 static const char *fieldtype2str(enum enum_field_types type)
 {
   switch (type) {
-    case FIELD_TYPE_BIT:         return "BIT";
-    case FIELD_TYPE_BLOB:        return "BLOB";
-    case FIELD_TYPE_DATE:        return "DATE";
-    case FIELD_TYPE_DATETIME:    return "DATETIME";
-    case FIELD_TYPE_NEWDECIMAL:  return "NEWDECIMAL";
-    case FIELD_TYPE_DECIMAL:     return "DECIMAL";
-    case FIELD_TYPE_DOUBLE:      return "DOUBLE";
-    case FIELD_TYPE_ENUM:        return "ENUM";
-    case FIELD_TYPE_FLOAT:       return "FLOAT";
-    case FIELD_TYPE_GEOMETRY:    return "GEOMETRY";
-    case FIELD_TYPE_INT24:       return "INT24";
-    case FIELD_TYPE_LONG:        return "LONG";
-    case FIELD_TYPE_LONGLONG:    return "LONGLONG";
-    case FIELD_TYPE_LONG_BLOB:   return "LONG_BLOB";
-    case FIELD_TYPE_MEDIUM_BLOB: return "MEDIUM_BLOB";
-    case FIELD_TYPE_NEWDATE:     return "NEWDATE";
-    case FIELD_TYPE_NULL:        return "NULL";
-    case FIELD_TYPE_SET:         return "SET";
-    case FIELD_TYPE_SHORT:       return "SHORT";
-    case FIELD_TYPE_STRING:      return "STRING";
-    case FIELD_TYPE_TIME:        return "TIME";
-    case FIELD_TYPE_TIMESTAMP:   return "TIMESTAMP";
-    case FIELD_TYPE_TINY:        return "TINY";
-    case FIELD_TYPE_TINY_BLOB:   return "TINY_BLOB";
-    case FIELD_TYPE_VAR_STRING:  return "VAR_STRING";
-    case FIELD_TYPE_YEAR:        return "YEAR";
+    case MYSQL_TYPE_BIT:         return "BIT";
+    case MYSQL_TYPE_BLOB:        return "BLOB";
+    case MYSQL_TYPE_DATE:        return "DATE";
+    case MYSQL_TYPE_DATETIME:    return "DATETIME";
+    case MYSQL_TYPE_NEWDECIMAL:  return "NEWDECIMAL";
+    case MYSQL_TYPE_DECIMAL:     return "DECIMAL";
+    case MYSQL_TYPE_DOUBLE:      return "DOUBLE";
+    case MYSQL_TYPE_ENUM:        return "ENUM";
+    case MYSQL_TYPE_FLOAT:       return "FLOAT";
+    case MYSQL_TYPE_GEOMETRY:    return "GEOMETRY";
+    case MYSQL_TYPE_INT24:       return "INT24";
+    case MYSQL_TYPE_LONG:        return "LONG";
+    case MYSQL_TYPE_LONGLONG:    return "LONGLONG";
+    case MYSQL_TYPE_LONG_BLOB:   return "LONG_BLOB";
+    case MYSQL_TYPE_MEDIUM_BLOB: return "MEDIUM_BLOB";
+    case MYSQL_TYPE_NEWDATE:     return "NEWDATE";
+    case MYSQL_TYPE_NULL:        return "NULL";
+    case MYSQL_TYPE_SET:         return "SET";
+    case MYSQL_TYPE_SHORT:       return "SHORT";
+    case MYSQL_TYPE_STRING:      return "STRING";
+    case MYSQL_TYPE_TIME:        return "TIME";
+    case MYSQL_TYPE_TIMESTAMP:   return "TIMESTAMP";
+    case MYSQL_TYPE_TINY:        return "TINY";
+    case MYSQL_TYPE_TINY_BLOB:   return "TINY_BLOB";
+    case MYSQL_TYPE_VAR_STRING:  return "VAR_STRING";
+    case MYSQL_TYPE_YEAR:        return "YEAR";
     default:                     return "?-unknown-?";
   }
 }

--- 1.260/client/mysqldump.c	2006-12-03 21:19:44 +01:00
+++ 1.261/client/mysqldump.c	2006-12-03 21:19:44 +01:00
@@ -2630,7 +2630,7 @@
                   dynstr_append(&extended_row, "NULL");
                 else
                 {
-                  if (field->type == FIELD_TYPE_DECIMAL)
+                  if (field->type == MYSQL_TYPE_DECIMAL)
                   {
                     /* add " signs around */
                     dynstr_append(&extended_row, "'");
@@ -2703,7 +2703,7 @@
               else if (my_isalpha(charset_info, *ptr) ||
                        (*ptr == '-' && my_isalpha(charset_info, ptr[1])))
                 fputs("NULL", md_result_file);
-              else if (field->type == FIELD_TYPE_DECIMAL)
+              else if (field->type == MYSQL_TYPE_DECIMAL)
               {
                 /* add " signs around */
                 fputc('\'', md_result_file);

--- 1.359/sql/field.cc	2006-12-03 21:19:44 +01:00
+++ 1.360/sql/field.cc	2006-12-03 21:19:44 +01:00
@@ -8725,7 +8725,7 @@
     it is NOT NULL, not an AUTO_INCREMENT field and not a TIMESTAMP.
   */
   if (!fld_default_value && !(fld_type_modifier & AUTO_INCREMENT_FLAG) &&
-      (fld_type_modifier & NOT_NULL_FLAG) && fld_type != FIELD_TYPE_TIMESTAMP)
+      (fld_type_modifier & NOT_NULL_FLAG) && fld_type != MYSQL_TYPE_TIMESTAMP)
     flags|= NO_DEFAULT_VALUE_FLAG;
 
   if (fld_length && !(length= (uint) atoi(fld_length)))
@@ -8733,34 +8733,34 @@
   sign_len= fld_type_modifier & UNSIGNED_FLAG ? 0 : 1;
 
   switch (fld_type) {
-  case FIELD_TYPE_TINY:
+  case MYSQL_TYPE_TINY:
     if (!fld_length)
       length= MAX_TINYINT_WIDTH+sign_len;
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     break;
-  case FIELD_TYPE_SHORT:
+  case MYSQL_TYPE_SHORT:
     if (!fld_length)
       length= MAX_SMALLINT_WIDTH+sign_len;
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     break;
-  case FIELD_TYPE_INT24:
+  case MYSQL_TYPE_INT24:
     if (!fld_length)
       length= MAX_MEDIUMINT_WIDTH+sign_len;
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     break;
-  case FIELD_TYPE_LONG:
+  case MYSQL_TYPE_LONG:
     if (!fld_length)
       length= MAX_INT_WIDTH+sign_len;
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     break;
-  case FIELD_TYPE_LONGLONG:
+  case MYSQL_TYPE_LONGLONG:
     if (!fld_length)
       length= MAX_BIGINT_WIDTH;
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     break;
-  case FIELD_TYPE_NULL:
+  case MYSQL_TYPE_NULL:
     break;
-  case FIELD_TYPE_NEWDECIMAL:
+  case MYSQL_TYPE_NEWDECIMAL:
     if (!fld_length && !decimals)
       length= 10;
     if (length > DECIMAL_MAX_PRECISION)
@@ -8789,11 +8789,11 @@
     break;
   case MYSQL_TYPE_STRING:
     break;
-  case FIELD_TYPE_BLOB:
-  case FIELD_TYPE_TINY_BLOB:
-  case FIELD_TYPE_LONG_BLOB:
-  case FIELD_TYPE_MEDIUM_BLOB:
-  case FIELD_TYPE_GEOMETRY:
+  case MYSQL_TYPE_BLOB:
+  case MYSQL_TYPE_TINY_BLOB:
+  case MYSQL_TYPE_LONG_BLOB:
+  case MYSQL_TYPE_MEDIUM_BLOB:
+  case MYSQL_TYPE_GEOMETRY:
     if (fld_default_value)
     {
       /* Allow empty as default value. */
@@ -8825,12 +8825,12 @@
     }
     flags|= BLOB_FLAG;
     break;
-  case FIELD_TYPE_YEAR:
+  case MYSQL_TYPE_YEAR:
     if (!fld_length || length != 2)
       length= 4; /* Default length */
     flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
     break;
-  case FIELD_TYPE_FLOAT:
+  case MYSQL_TYPE_FLOAT:
     /* change FLOAT(precision) to FLOAT or DOUBLE */
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     if (fld_length && !fld_decimals)
@@ -8843,7 +8843,7 @@
       }
       else if (tmp_length > PRECISION_FOR_FLOAT)
       {
-        sql_type= FIELD_TYPE_DOUBLE;
+        sql_type= MYSQL_TYPE_DOUBLE;
         length= DBL_DIG+7; /* -[digits].E+### */
       }
       else
@@ -8863,7 +8863,7 @@
       DBUG_RETURN(TRUE);
     }
     break;
-  case FIELD_TYPE_DOUBLE:
+  case MYSQL_TYPE_DOUBLE:
     allowed_type_modifier= AUTO_INCREMENT_FLAG;
     if (!fld_length && !fld_decimals)
     {
@@ -8877,7 +8877,7 @@
       DBUG_RETURN(TRUE);
     }
     break;
-  case FIELD_TYPE_TIMESTAMP:
+  case MYSQL_TYPE_TIMESTAMP:
     if (!fld_length)
       length= 14;  /* Full date YYYYMMDDHHMMSS */
     else if (length != 19)
@@ -8928,21 +8928,21 @@
                                               Field::NONE));
     }
     break;
-  case FIELD_TYPE_DATE:
+  case MYSQL_TYPE_DATE:
     /* Old date type. */
     if (protocol_version != PROTOCOL_VERSION-1)
-      sql_type= FIELD_TYPE_NEWDATE;
+      sql_type= MYSQL_TYPE_NEWDATE;
     /* fall trough */
-  case FIELD_TYPE_NEWDATE:
+  case MYSQL_TYPE_NEWDATE:
     length= 10;
     break;
-  case FIELD_TYPE_TIME:
+  case MYSQL_TYPE_TIME:
     length= 10;
     break;
-  case FIELD_TYPE_DATETIME:
+  case MYSQL_TYPE_DATETIME:
     length= 19;
     break;
-  case FIELD_TYPE_SET:
+  case MYSQL_TYPE_SET:
     {
       if (fld_interval_list->elements > sizeof(longlong)*8)
       {
@@ -8963,7 +8963,7 @@
       length= 1;
       break;
     }
-  case FIELD_TYPE_ENUM:
+  case MYSQL_TYPE_ENUM:
     {
       /* Should be safe. */
       pack_length= get_enum_pack_length(fld_interval_list->elements);
@@ -8972,7 +8972,7 @@
       String *tmp;
       while ((tmp= it++))
         interval_list.push_back(tmp);
-      length= 1; /* See comment for FIELD_TYPE_SET above. */
+      length= 1; /* See comment for MYSQL_TYPE_SET above. */
       break;
    }
   case MYSQL_TYPE_VAR_STRING:
@@ -8991,19 +8991,19 @@
       pack_length= (length + 7) / 8;
       break;
     }
-  case FIELD_TYPE_DECIMAL:
+  case MYSQL_TYPE_DECIMAL:
     DBUG_ASSERT(0); /* Was obsolete */
   }
   /* Remember the value of length */
   char_length= length;
 
   if (!(flags & BLOB_FLAG) &&
-      ((length > max_field_charlength && fld_type != FIELD_TYPE_SET &&
-        fld_type != FIELD_TYPE_ENUM &&
+      ((length > max_field_charlength && fld_type != MYSQL_TYPE_SET &&
+        fld_type != MYSQL_TYPE_ENUM &&
         (fld_type != MYSQL_TYPE_VARCHAR || fld_default_value)) ||
        (!length &&
         fld_type != MYSQL_TYPE_STRING &&
-        fld_type != MYSQL_TYPE_VARCHAR && fld_type != FIELD_TYPE_GEOMETRY)))
+        fld_type != MYSQL_TYPE_VARCHAR && fld_type != MYSQL_TYPE_GEOMETRY)))
   {
     my_error((fld_type == MYSQL_TYPE_VAR_STRING ||
               fld_type == MYSQL_TYPE_VARCHAR ||
@@ -9028,13 +9028,13 @@
 {
   enum_field_types type;
   if (length < 256)
-    type= FIELD_TYPE_TINY_BLOB;
+    type= MYSQL_TYPE_TINY_BLOB;
   else if (length < 65536)
-    type= FIELD_TYPE_BLOB;
+    type= MYSQL_TYPE_BLOB;
   else if (length < 256L*256L*256L)
-    type= FIELD_TYPE_MEDIUM_BLOB;
+    type= MYSQL_TYPE_MEDIUM_BLOB;
   else
-    type= FIELD_TYPE_LONG_BLOB;
+    type= MYSQL_TYPE_LONG_BLOB;
   return type;
 }
 
@@ -9048,32 +9048,32 @@
   switch (type) {
   case MYSQL_TYPE_VAR_STRING:
   case MYSQL_TYPE_STRING:
-  case FIELD_TYPE_DECIMAL:     return (length);
+  case MYSQL_TYPE_DECIMAL:     return (length);
   case MYSQL_TYPE_VARCHAR:     return (length + (length < 256 ? 1: 2));
-  case FIELD_TYPE_YEAR:
-  case FIELD_TYPE_TINY	: return 1;
-  case FIELD_TYPE_SHORT : return 2;
-  case FIELD_TYPE_INT24:
-  case FIELD_TYPE_NEWDATE:
-  case FIELD_TYPE_TIME:   return 3;
-  case FIELD_TYPE_TIMESTAMP:
-  case FIELD_TYPE_DATE:
-  case FIELD_TYPE_LONG	: return 4;
-  case FIELD_TYPE_FLOAT : return sizeof(float);
-  case FIELD_TYPE_DOUBLE: return sizeof(double);
-  case FIELD_TYPE_DATETIME:
-  case FIELD_TYPE_LONGLONG: return 8;	/* Don't crash if no longlong */
-  case FIELD_TYPE_NULL	: return 0;
-  case FIELD_TYPE_TINY_BLOB:	return 1+portable_sizeof_char_ptr;
-  case FIELD_TYPE_BLOB:		return 2+portable_sizeof_char_ptr;
-  case FIELD_TYPE_MEDIUM_BLOB:	return 3+portable_sizeof_char_ptr;
-  case FIELD_TYPE_LONG_BLOB:	return 4+portable_sizeof_char_ptr;
-  case FIELD_TYPE_GEOMETRY:	return 4+portable_sizeof_char_ptr;
-  case FIELD_TYPE_SET:
-  case FIELD_TYPE_ENUM:
-  case FIELD_TYPE_NEWDECIMAL:
+  case MYSQL_TYPE_YEAR:
+  case MYSQL_TYPE_TINY	: return 1;
+  case MYSQL_TYPE_SHORT : return 2;
+  case MYSQL_TYPE_INT24:
+  case MYSQL_TYPE_NEWDATE:
+  case MYSQL_TYPE_TIME:   return 3;
+  case MYSQL_TYPE_TIMESTAMP:
+  case MYSQL_TYPE_DATE:
+  case MYSQL_TYPE_LONG	: return 4;
+  case MYSQL_TYPE_FLOAT : return sizeof(float);
+  case MYSQL_TYPE_DOUBLE: return sizeof(double);
+  case MYSQL_TYPE_DATETIME:
+  case MYSQL_TYPE_LONGLONG: return 8;	/* Don't crash if no longlong */
+  case MYSQL_TYPE_NULL	: return 0;
+  case MYSQL_TYPE_TINY_BLOB:	return 1+portable_sizeof_char_ptr;
+  case MYSQL_TYPE_BLOB:		return 2+portable_sizeof_char_ptr;
+  case MYSQL_TYPE_MEDIUM_BLOB:	return 3+portable_sizeof_char_ptr;
+  case MYSQL_TYPE_LONG_BLOB:	return 4+portable_sizeof_char_ptr;
+  case MYSQL_TYPE_GEOMETRY:	return 4+portable_sizeof_char_ptr;
+  case MYSQL_TYPE_SET:
+  case MYSQL_TYPE_ENUM:
+  case MYSQL_TYPE_NEWDECIMAL:
     abort(); return 0;                          // This shouldn't happen
-  case FIELD_TYPE_BIT: return length / 8;
+  case MYSQL_TYPE_BIT: return length / 8;
   default:
     return 0;
   }
@@ -9083,11 +9083,11 @@
 uint pack_length_to_packflag(uint type)
 {
   switch (type) {
-    case 1: return f_settype((uint) FIELD_TYPE_TINY);
-    case 2: return f_settype((uint) FIELD_TYPE_SHORT);
-    case 3: return f_settype((uint) FIELD_TYPE_INT24);
-    case 4: return f_settype((uint) FIELD_TYPE_LONG);
-    case 8: return f_settype((uint) FIELD_TYPE_LONGLONG);
+    case 1: return f_settype((uint) MYSQL_TYPE_TINY);
+    case 2: return f_settype((uint) MYSQL_TYPE_SHORT);
+    case 3: return f_settype((uint) MYSQL_TYPE_INT24);
+    case 4: return f_settype((uint) MYSQL_TYPE_LONG);
+    case 8: return f_settype((uint) MYSQL_TYPE_LONGLONG);
   }
   return 0;					// This shouldn't happen
 }
@@ -9107,7 +9107,7 @@
   uchar bit_offset;
   LINT_INIT(bit_ptr);
   LINT_INIT(bit_offset);
-  if (field_type == FIELD_TYPE_BIT && !f_bit_as_char(pack_flag))
+  if (field_type == MYSQL_TYPE_BIT && !f_bit_as_char(pack_flag))
   {
     bit_ptr= null_pos;
     bit_offset= null_bit;
@@ -9129,11 +9129,11 @@
   }
 
   switch (field_type) {
-  case FIELD_TYPE_DATE:
-  case FIELD_TYPE_NEWDATE:
-  case FIELD_TYPE_TIME:
-  case FIELD_TYPE_DATETIME:
-  case FIELD_TYPE_TIMESTAMP:
+  case MYSQL_TYPE_DATE:
+  case MYSQL_TYPE_NEWDATE:
+  case MYSQL_TYPE_TIME:
+  case MYSQL_TYPE_DATETIME:
+  case MYSQL_TYPE_TIMESTAMP:
     field_charset= &my_charset_bin;
   default: break;
   }
@@ -9143,7 +9143,7 @@
     if (!f_is_packed(pack_flag))
     {
       if (field_type == MYSQL_TYPE_STRING ||
-          field_type == FIELD_TYPE_DECIMAL ||   // 3.23 or 4.0 string
+          field_type == MYSQL_TYPE_DECIMAL ||   // 3.23 or 4.0 string
           field_type == MYSQL_TYPE_VAR_STRING)
         return new Field_string(ptr,field_length,null_pos,null_bit,
                                 unireg_check, field_name,
@@ -9186,78 +9186,78 @@
   }
 
   switch (field_type) {
-  case FIELD_TYPE_DECIMAL:
+  case MYSQL_TYPE_DECIMAL:
     return new Field_decimal(ptr,field_length,null_pos,null_bit,
 			     unireg_check, field_name,
 			     f_decimals(pack_flag),
 			     f_is_zerofill(pack_flag) != 0,
 			     f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_NEWDECIMAL:
+  case MYSQL_TYPE_NEWDECIMAL:
     return new Field_new_decimal(ptr,field_length,null_pos,null_bit,
                                  unireg_check, field_name,
                                  f_decimals(pack_flag),
                                  f_is_zerofill(pack_flag) != 0,
                                  f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_FLOAT:
+  case MYSQL_TYPE_FLOAT:
     return new Field_float(ptr,field_length,null_pos,null_bit,
 			   unireg_check, field_name,
 			   f_decimals(pack_flag),
 			   f_is_zerofill(pack_flag) != 0,
 			   f_is_dec(pack_flag)== 0);
-  case FIELD_TYPE_DOUBLE:
+  case MYSQL_TYPE_DOUBLE:
     return new Field_double(ptr,field_length,null_pos,null_bit,
 			    unireg_check, field_name,
 			    f_decimals(pack_flag),
 			    f_is_zerofill(pack_flag) != 0,
 			    f_is_dec(pack_flag)== 0);
-  case FIELD_TYPE_TINY:
+  case MYSQL_TYPE_TINY:
     return new Field_tiny(ptr,field_length,null_pos,null_bit,
 			  unireg_check, field_name,
 			  f_is_zerofill(pack_flag) != 0,
 			  f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_SHORT:
+  case MYSQL_TYPE_SHORT:
     return new Field_short(ptr,field_length,null_pos,null_bit,
 			   unireg_check, field_name,
 			   f_is_zerofill(pack_flag) != 0,
 			   f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_INT24:
+  case MYSQL_TYPE_INT24:
     return new Field_medium(ptr,field_length,null_pos,null_bit,
 			    unireg_check, field_name,
 			    f_is_zerofill(pack_flag) != 0,
 			    f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_LONG:
+  case MYSQL_TYPE_LONG:
     return new Field_long(ptr,field_length,null_pos,null_bit,
 			   unireg_check, field_name,
 			   f_is_zerofill(pack_flag) != 0,
 			   f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_LONGLONG:
+  case MYSQL_TYPE_LONGLONG:
     return new Field_longlong(ptr,field_length,null_pos,null_bit,
 			      unireg_check, field_name,
 			      f_is_zerofill(pack_flag) != 0,
 			      f_is_dec(pack_flag) == 0);
-  case FIELD_TYPE_TIMESTAMP:
+  case MYSQL_TYPE_TIMESTAMP:
     return new Field_timestamp(ptr,field_length, null_pos, null_bit,
                                unireg_check, field_name, share,
                                field_charset);
-  case FIELD_TYPE_YEAR:
+  case MYSQL_TYPE_YEAR:
     return new Field_year(ptr,field_length,null_pos,null_bit,
 			  unireg_check, field_name);
-  case FIELD_TYPE_DATE:
+  case MYSQL_TYPE_DATE:
     return new Field_date(ptr,null_pos,null_bit,
 			  unireg_check, field_name, field_charset);
-  case FIELD_TYPE_NEWDATE:
+  case MYSQL_TYPE_NEWDATE:
     return new Field_newdate(ptr,null_pos,null_bit,
 			     unireg_check, field_name, field_charset);
-  case FIELD_TYPE_TIME:
+  case MYSQL_TYPE_TIME:
     return new Field_time(ptr,null_pos,null_bit,
 			  unireg_check, field_name, field_charset);
-  case FIELD_TYPE_DATETIME:
+  case MYSQL_TYPE_DATETIME:
     return new Field_datetime(ptr,null_pos,null_bit,
 			      unireg_check, field_name, field_charset);
-  case FIELD_TYPE_NULL:
+  case MYSQL_TYPE_NULL:
     return new Field_null(ptr, field_length, unireg_check, field_name,
                           field_charset);
-  case FIELD_TYPE_BIT:
+  case MYSQL_TYPE_BIT:
     return f_bit_as_char(pack_flag) ?
            new Field_bit_as_char(ptr, field_length, null_pos, null_bit,
                                  unireg_check, field_name) :
@@ -9293,12 +9293,12 @@
 		  portable_sizeof_char_ptr);
 
   switch (sql_type) {
-  case FIELD_TYPE_BLOB:
+  case MYSQL_TYPE_BLOB:
     switch (pack_length - portable_sizeof_char_ptr) {
-    case  1: sql_type= FIELD_TYPE_TINY_BLOB; break;
-    case  2: sql_type= FIELD_TYPE_BLOB; break;
-    case  3: sql_type= FIELD_TYPE_MEDIUM_BLOB; break;
-    default: sql_type= FIELD_TYPE_LONG_BLOB; break;
+    case  1: sql_type= MYSQL_TYPE_TINY_BLOB; break;
+    case  2: sql_type= MYSQL_TYPE_BLOB; break;
+    case  3: sql_type= MYSQL_TYPE_MEDIUM_BLOB; break;
+    default: sql_type= MYSQL_TYPE_LONG_BLOB; break;
     }
     length/= charset->mbmaxlen;
     key_length/= charset->mbmaxlen;
@@ -9317,7 +9317,7 @@
     length= (length+charset->mbmaxlen-1) / charset->mbmaxlen;
     break;
 #ifdef HAVE_SPATIAL
-  case FIELD_TYPE_GEOMETRY:
+  case MYSQL_TYPE_GEOMETRY:
     geom_type= ((Field_geom*)old_field)->geom_type;
     break;
 #endif
@@ -9334,7 +9334,7 @@
 
   if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) &&
       old_field->ptr && orig_field &&
-      (sql_type != FIELD_TYPE_TIMESTAMP ||                /* set def only if */
+      (sql_type != MYSQL_TYPE_TIMESTAMP ||                /* set def only if */
        old_field->table->timestamp_field != old_field ||  /* timestamp field */ 
        unireg_check == Field::TIMESTAMP_UN_FIELD))        /* has default val */
   {

--- 1.196/sql/field.h	2006-12-03 21:19:44 +01:00
+++ 1.197/sql/field.h	2006-12-03 21:19:44 +01:00
@@ -518,7 +518,7 @@
                 unireg_check_arg, field_name_arg,
                 dec_arg, zero_arg, unsigned_arg)
     {}
-  enum_field_types type() const { return FIELD_TYPE_DECIMAL;}
+  enum_field_types type() const { return MYSQL_TYPE_DECIMAL;}
   enum ha_base_keytype key_type() const
   { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
   void reset(void);
@@ -556,7 +556,7 @@
   Field_new_decimal(uint32 len_arg, bool maybe_null_arg,
                     const char *field_name_arg, uint8 dec_arg,
                     bool unsigned_arg);
-  enum_field_types type() const { return FIELD_TYPE_NEWDECIMAL;}
+  enum_field_types type() const { return MYSQL_TYPE_NEWDECIMAL;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
   Item_result result_type () const { return DECIMAL_RESULT; }
   void reset(void);
@@ -593,7 +593,7 @@
 	       0, zero_arg,unsigned_arg)
     {}
   enum Item_result result_type () const { return INT_RESULT; }
-  enum_field_types type() const { return FIELD_TYPE_TINY;}
+  enum_field_types type() const { return MYSQL_TYPE_TINY;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -628,7 +628,7 @@
 	       NONE, field_name_arg, 0, 0, unsigned_arg)
     {}
   enum Item_result result_type () const { return INT_RESULT; }
-  enum_field_types type() const { return FIELD_TYPE_SHORT;}
+  enum_field_types type() const { return MYSQL_TYPE_SHORT;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;}
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -658,7 +658,7 @@
 	       0, zero_arg,unsigned_arg)
     {}
   enum Item_result result_type () const { return INT_RESULT; }
-  enum_field_types type() const { return FIELD_TYPE_INT24;}
+  enum_field_types type() const { return MYSQL_TYPE_INT24;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -693,7 +693,7 @@
 	       NONE, field_name_arg,0,0,unsigned_arg)
     {}
   enum Item_result result_type () const { return INT_RESULT; }
-  enum_field_types type() const { return FIELD_TYPE_LONG;}
+  enum_field_types type() const { return MYSQL_TYPE_LONG;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -730,7 +730,7 @@
 	       NONE, field_name_arg,0,0,unsigned_arg)
     {}
   enum Item_result result_type () const { return INT_RESULT; }
-  enum_field_types type() const { return FIELD_TYPE_LONGLONG;}
+  enum_field_types type() const { return MYSQL_TYPE_LONGLONG;}
   enum ha_base_keytype key_type() const
     { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -766,7 +766,7 @@
     :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
                 NONE, field_name_arg, dec_arg, 0, 0)
     {}
-  enum_field_types type() const { return FIELD_TYPE_FLOAT;}
+  enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
   int  store(double nr);
@@ -799,7 +799,7 @@
     :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
                 NONE, field_name_arg, dec_arg, 0, 0)
     {}
-  enum_field_types type() const { return FIELD_TYPE_DOUBLE;}
+  enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
   int  store(double nr);
@@ -828,7 +828,7 @@
     :Field_str(ptr_arg, len_arg, null, 1,
 	       unireg_check_arg, field_name_arg, cs)
     {}
-  enum_field_types type() const { return FIELD_TYPE_NULL;}
+  enum_field_types type() const { return MYSQL_TYPE_NULL;}
   int  store(const char *to, uint length, CHARSET_INFO *cs)
   { null[0]=1; return 0; }
   int  store(double nr)   { null[0]=1; return 0; }
@@ -857,7 +857,7 @@
 		  TABLE_SHARE *share, CHARSET_INFO *cs);
   Field_timestamp(bool maybe_null_arg, const char *field_name_arg,
 		  CHARSET_INFO *cs);
-  enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;}
+  enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -910,7 +910,7 @@
     :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 		unireg_check_arg, field_name_arg, 1, 1)
     {}
-  enum_field_types type() const { return FIELD_TYPE_YEAR;}
+  enum_field_types type() const { return MYSQL_TYPE_YEAR;}
   int  store(const char *to,uint length,CHARSET_INFO *charset);
   int  store(double nr);
   int  store(longlong nr, bool unsigned_val);
@@ -935,7 +935,7 @@
              CHARSET_INFO *cs)
     :Field_str((char*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
 	       NONE, field_name_arg, cs) {}
-  enum_field_types type() const { return FIELD_TYPE_DATE;}
+  enum_field_types type() const { return MYSQL_TYPE_DATE;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -963,8 +963,8 @@
     :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
 	       unireg_check_arg, field_name_arg, cs)
     {}
-  enum_field_types type() const { return FIELD_TYPE_DATE;}
-  enum_field_types real_type() const { return FIELD_TYPE_NEWDATE; }
+  enum_field_types type() const { return MYSQL_TYPE_DATE;}
+  enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -999,7 +999,7 @@
              CHARSET_INFO *cs)
     :Field_str((char*) 0,8, maybe_null_arg ? (uchar*) "": 0,0,
 	       NONE, field_name_arg, cs) {}
-  enum_field_types type() const { return FIELD_TYPE_TIME;}
+  enum_field_types type() const { return MYSQL_TYPE_TIME;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   int store_time(TIME *ltime, timestamp_type type);
@@ -1034,7 +1034,7 @@
 		 CHARSET_INFO *cs)
     :Field_str((char*) 0,19, maybe_null_arg ? (uchar*) "": 0,0,
 	       NONE, field_name_arg, cs) {}
-  enum_field_types type() const { return FIELD_TYPE_DATETIME;}
+  enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
 #ifdef HAVE_LONG_LONG
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
 #endif
@@ -1106,7 +1106,7 @@
   uint packed_col_length(const char *to, uint length);
   uint max_packed_col_length(uint max_length);
   uint size_of() const { return sizeof(*this); }
-  enum_field_types real_type() const { return FIELD_TYPE_STRING; }
+  enum_field_types real_type() const { return MYSQL_TYPE_STRING; }
   bool has_charset(void) const
   { return charset() == &my_charset_bin ? FALSE : TRUE; }
   Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
@@ -1223,7 +1223,7 @@
                   char_length <= 16777215 ? 3 : 4;
     }
   }
-  enum_field_types type() const { return FIELD_TYPE_BLOB;}
+  enum_field_types type() const { return MYSQL_TYPE_BLOB;}
   enum ha_base_keytype key_type() const
     { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
@@ -1325,7 +1325,7 @@
     :Field_blob(len_arg, maybe_null_arg, field_name_arg, &my_charset_bin)
   { geom_type= geom_type_arg; }
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; }
-  enum_field_types type() const { return FIELD_TYPE_GEOMETRY; }
+  enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; }
   void sql_type(String &str) const;
   int  store(const char *to, uint length, CHARSET_INFO *charset);
   int  store(double nr);
@@ -1354,7 +1354,7 @@
   {
       flags|=ENUM_FLAG;
   }
-  enum_field_types type() const { return FIELD_TYPE_STRING; }
+  enum_field_types type() const { return MYSQL_TYPE_STRING; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   enum Item_result cast_to_int_type () const { return INT_RESULT; }
   enum ha_base_keytype key_type() const;
@@ -1370,7 +1370,7 @@
   void store_type(ulonglong value);
   void sql_type(String &str) const;
   uint size_of() const { return sizeof(*this); }
-  enum_field_types real_type() const { return FIELD_TYPE_ENUM; }
+  enum_field_types real_type() const { return MYSQL_TYPE_ENUM; }
   virtual bool zero_pack() const { return 0; }
   bool optimize_range(uint idx, uint part) { return 0; }
   bool eq_def(Field *field);
@@ -1400,7 +1400,7 @@
   virtual bool zero_pack() const { return 1; }
   String *val_str(String*,String *);
   void sql_type(String &str) const;
-  enum_field_types real_type() const { return FIELD_TYPE_SET; }
+  enum_field_types real_type() const { return MYSQL_TYPE_SET; }
   bool has_charset(void) const { return TRUE; }
 };
 
@@ -1428,7 +1428,7 @@
   Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
             uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
             enum utype unireg_check_arg, const char *field_name_arg);
-  enum_field_types type() const { return FIELD_TYPE_BIT; }
+  enum_field_types type() const { return MYSQL_TYPE_BIT; }
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; }
   uint32 key_length() const { return (uint32) (field_length + 7) / 8; }
   uint32 max_length() { return field_length; }

--- 1.285/sql/handler.cc	2006-12-03 21:19:44 +01:00
+++ 1.286/sql/handler.cc	2006-12-03 21:19:44 +01:00
@@ -2278,7 +2278,7 @@
         if (!keypart->fieldnr)
           continue;
         Field *field= table->field[keypart->fieldnr-1];
-        if (field->type() == FIELD_TYPE_BLOB)
+        if (field->type() == MYSQL_TYPE_BLOB)
         {
           if (check_opt->sql_flags & TT_FOR_UPGRADE)
             check_opt->flags= T_MEDIUM;
@@ -2300,7 +2300,7 @@
     /* check for bad DECIMAL field */
     for (field= table->field; (*field); field++)
     {
-      if ((*field)->type() == FIELD_TYPE_NEWDECIMAL)
+      if ((*field)->type() == MYSQL_TYPE_NEWDECIMAL)
       {
         return HA_ADMIN_NEEDS_ALTER;
       }

--- 1.223/sql/item.cc	2006-12-03 21:19:44 +01:00
+++ 1.224/sql/item.cc	2006-12-03 21:19:44 +01:00
@@ -4092,11 +4092,11 @@
 
 enum_field_types Item::string_field_type() const
 {
-  enum_field_types type= FIELD_TYPE_VAR_STRING;
+  enum_field_types type= MYSQL_TYPE_VAR_STRING;
   if (max_length >= 16777216)
-    type= FIELD_TYPE_LONG_BLOB;
+    type= MYSQL_TYPE_LONG_BLOB;
   else if (max_length >= 65536)
-    type= FIELD_TYPE_MEDIUM_BLOB;
+    type= MYSQL_TYPE_MEDIUM_BLOB;
   return type;
 }
 
@@ -4111,9 +4111,9 @@
 {
   switch (result_type()) {
   case STRING_RESULT:  return string_field_type();
-  case INT_RESULT:     return FIELD_TYPE_LONGLONG;
-  case DECIMAL_RESULT: return FIELD_TYPE_NEWDECIMAL;
-  case REAL_RESULT:    return FIELD_TYPE_DOUBLE;
+  case INT_RESULT:     return MYSQL_TYPE_LONGLONG;
+  case DECIMAL_RESULT: return MYSQL_TYPE_NEWDECIMAL;
+  case REAL_RESULT:    return MYSQL_TYPE_DOUBLE;
   case ROW_RESULT:
   default:
     DBUG_ASSERT(0);

--- 1.337/sql/item_func.cc	2006-12-03 21:19:44 +01:00
+++ 1.338/sql/item_func.cc	2006-12-03 21:19:44 +01:00
@@ -2500,7 +2500,7 @@
   if (args[0]->const_item() && args[1]->type() == FIELD_ITEM)
   {
     Field *field= ((Item_field*) args[1])->field;
-    if (field->real_type() == FIELD_TYPE_SET)
+    if (field->real_type() == MYSQL_TYPE_SET)
     {
       String *find=args[0]->val_str(&value);
       if (find)

--- 1.109/sql/item_sum.h	2006-12-03 21:19:44 +01:00
+++ 1.110/sql/item_sum.h	2006-12-03 21:19:44 +01:00
@@ -804,7 +804,7 @@
   public:
   Item_sum_hybrid(Item *item_par,int sign)
     :Item_sum(item_par), sum(0.0), sum_int(0),
-    hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG),
+    hybrid_type(INT_RESULT), hybrid_field_type(MYSQL_TYPE_LONGLONG),
     cmp_sign(sign), used_table_cache(~(table_map) 0),
     was_values(TRUE)
   { collation.set(&my_charset_bin); }
@@ -1187,7 +1187,7 @@
   enum_field_types field_type() const
   {
     if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB )
-      return FIELD_TYPE_BLOB;
+      return MYSQL_TYPE_BLOB;
     else
       return MYSQL_TYPE_VARCHAR;
   }

--- 1.144/sql/item_timefunc.cc	2006-12-03 21:19:44 +01:00
+++ 1.145/sql/item_timefunc.cc	2006-12-03 21:19:44 +01:00
@@ -1184,7 +1184,7 @@
   if (args[0]->type() == FIELD_ITEM)
   {						// Optimize timestamp field
     Field *field=((Item_field*) args[0])->field;
-    if (field->type() == FIELD_TYPE_TIMESTAMP)
+    if (field->type() == MYSQL_TYPE_TIMESTAMP)
       return ((Field_timestamp*) field)->get_timestamp(&null_value);
   }
   

--- 1.259/sql/log_event.cc	2006-12-03 21:19:45 +01:00
+++ 1.260/sql/log_event.cc	2006-12-03 21:19:45 +01:00
@@ -6581,7 +6581,7 @@
         /* Nothing to do */
         break;
 
-      case FIELD_TYPE_BIT:
+      case MYSQL_TYPE_BIT:
         Field_bit *f= static_cast<Field_bit*>(*field_ptr);
         my_ptrdiff_t const offset= table->record[1] - table->record[0];
         uchar const bits=

--- 1.252/sql/opt_range.cc	2006-12-03 21:19:45 +01:00
+++ 1.253/sql/opt_range.cc	2006-12-03 21:19:45 +01:00
@@ -3132,7 +3132,7 @@
   for (; (*pfield); pfield++)
   {
     enum_field_types ftype= (*pfield)->real_type();
-    if (ftype == FIELD_TYPE_ENUM || ftype == FIELD_TYPE_GEOMETRY)
+    if (ftype == MYSQL_TYPE_ENUM || ftype == MYSQL_TYPE_GEOMETRY)
       return FALSE;
   }
   return TRUE;
@@ -3231,7 +3231,7 @@
     key_part->store_length= (uint16) (*field)->pack_length();
     if ((*field)->real_maybe_null())
       key_part->store_length+= HA_KEY_NULL_LENGTH;
-    if ((*field)->type() == FIELD_TYPE_BLOB || 
+    if ((*field)->type() == MYSQL_TYPE_BLOB || 
         (*field)->real_type() == MYSQL_TYPE_VARCHAR)
       key_part->store_length+= HA_KEY_BLOB_LENGTH;
 
@@ -5589,8 +5589,8 @@
   /* For comparison purposes allow invalid dates like 2000-01-32 */
   orig_sql_mode= field->table->in_use->variables.sql_mode;
   if (value->real_item()->type() == Item::STRING_ITEM &&
-      (field->type() == FIELD_TYPE_DATE ||
-       field->type() == FIELD_TYPE_DATETIME))
+      (field->type() == MYSQL_TYPE_DATE ||
+       field->type() == MYSQL_TYPE_DATETIME))
     field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES;
   err= value->save_in_field_no_warnings(field, 1);
   if (err > 0 && field->cmp_type() != value->result_type())

--- 1.224/sql/sql_acl.cc	2006-12-03 21:19:45 +01:00
+++ 1.225/sql/sql_acl.cc	2006-12-03 21:19:45 +01:00
@@ -761,7 +761,7 @@
   Field **pos;
 
   for (pos=form->field+fieldnr, bit=1;
-       *pos && (*pos)->real_type() == FIELD_TYPE_ENUM &&
+       *pos && (*pos)->real_type() == MYSQL_TYPE_ENUM &&
 	 ((Field_enum*) (*pos))->typelib->count == 2 ;
        pos++, fieldnr++, bit<<=1)
   {
@@ -1969,7 +1969,7 @@
   ulong priv;
   uint next_field;
   for (tmp_field= table->field+3, priv = SELECT_ACL;
-       *tmp_field && (*tmp_field)->real_type() == FIELD_TYPE_ENUM &&
+       *tmp_field && (*tmp_field)->real_type() == MYSQL_TYPE_ENUM &&
 	 ((Field_enum*) (*tmp_field))->typelib->count == 2 ;
        tmp_field++, priv <<= 1)
   {

--- 1.235/sql/sql_insert.cc	2006-12-03 21:19:45 +01:00
+++ 1.236/sql/sql_insert.cc	2006-12-03 21:19:45 +01:00
@@ -1292,7 +1292,7 @@
   {
     if (!bitmap_is_set(write_set, (*field)->field_index) &&
         ((*field)->flags & NO_DEFAULT_VALUE_FLAG) &&
-        ((*field)->real_type() != FIELD_TYPE_ENUM))
+        ((*field)->real_type() != MYSQL_TYPE_ENUM))
     {
       bool view= FALSE;
       if (table_list)

--- 1.602/sql/sql_parse.cc	2006-12-03 21:19:45 +01:00
+++ 1.603/sql/sql_parse.cc	2006-12-03 21:19:45 +01:00
@@ -6213,7 +6213,7 @@
     */
     if (default_value->type() == Item::FUNC_ITEM && 
         !(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
-         type == FIELD_TYPE_TIMESTAMP))
+         type == MYSQL_TYPE_TIMESTAMP))
     {
       my_error(ER_INVALID_DEFAULT, MYF(0), field_name);
       DBUG_RETURN(1);
@@ -6235,13 +6235,13 @@
     }
   }
 
-  if (on_update_value && type != FIELD_TYPE_TIMESTAMP)
+  if (on_update_value && type != MYSQL_TYPE_TIMESTAMP)
   {
     my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name);
     DBUG_RETURN(1);
   }
 
-  if (type == FIELD_TYPE_TIMESTAMP && length)
+  if (type == MYSQL_TYPE_TIMESTAMP && length)
   {
     /* Display widths are no longer supported for TIMSTAMP as of MySQL 4.1.
        In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4),

--- 1.473/sql/sql_select.cc	2006-12-03 21:19:45 +01:00
+++ 1.474/sql/sql_select.cc	2006-12-03 21:19:45 +01:00
@@ -8550,8 +8550,8 @@
         thd->substitute_null_with_insert_id= FALSE;
       }
       /* fix to replace 'NULL' dates with '0' (shreeve@stripped) */
-      else if (((field->type() == FIELD_TYPE_DATE) ||
-		(field->type() == FIELD_TYPE_DATETIME)) &&
+      else if (((field->type() == MYSQL_TYPE_DATE) ||
+		(field->type() == MYSQL_TYPE_DATETIME)) &&
 		(field->flags & NOT_NULL_FLAG) &&
 	       !field->table->maybe_null)
       {
@@ -8926,7 +8926,7 @@
         field->result_field= result;
     } 
     else if (table_cant_handle_bit_fields && field->field->type() ==
-             FIELD_TYPE_BIT)
+             MYSQL_TYPE_BIT)
     {
       *from_field= field->field;
       result= create_tmp_field_from_item(thd, item, table, copy_func,
@@ -9243,7 +9243,7 @@
 	    *blob_field++= fieldnr;
 	    blob_count++;
 	  }
-          if (new_field->type() == FIELD_TYPE_BIT)
+          if (new_field->type() == MYSQL_TYPE_BIT)
             total_uneven_bit_length+= new_field->field_length & 7;
 	  *(reg_field++)= new_field;
           if (new_field->real_type() == MYSQL_TYPE_STRING ||
@@ -9305,7 +9305,7 @@
       reclength+=new_field->pack_length();
       if (!(new_field->flags & NOT_NULL_FLAG))
 	null_count++;
-      if (new_field->type() == FIELD_TYPE_BIT)
+      if (new_field->type() == MYSQL_TYPE_BIT)
         total_uneven_bit_length+= new_field->field_length & 7;
       if (new_field->flags & BLOB_FLAG)
       {
@@ -9450,7 +9450,7 @@
     }
     else
       field->move_field((char*) pos,(uchar*) 0,0);
-    if (field->type() == FIELD_TYPE_BIT)
+    if (field->type() == MYSQL_TYPE_BIT)
     {
       /* We have to reserve place for extra bits among null bits */
       ((Field_bit*) field)->set_bit_ptr(null_flags + null_count / 8,
@@ -11746,7 +11746,7 @@
 	if (field->binary() &&
 	    field->real_type() != MYSQL_TYPE_STRING &&
 	    field->real_type() != MYSQL_TYPE_VARCHAR &&
-	    (field->type() != FIELD_TYPE_FLOAT || field->decimals() == 0))
+	    (field->type() != MYSQL_TYPE_FLOAT || field->decimals() == 0))
 	{
 	  return !store_val_in_field(field, right_item, CHECK_FIELD_WARN);
 	}
@@ -13661,11 +13661,11 @@
     if (field)
     {
       enum_field_types type;
-      if ((type= field->type()) == FIELD_TYPE_BLOB)
+      if ((type= field->type()) == MYSQL_TYPE_BLOB)
 	key_length+=MAX_BLOB_WIDTH;		// Can't be used as a key
       else if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_VAR_STRING)
         key_length+= field->field_length + HA_KEY_BLOB_LENGTH;
-      else if (type == FIELD_TYPE_BIT)
+      else if (type == MYSQL_TYPE_BIT)
       {
         /* Bit is usually stored as a longlong key for group fields */
         key_length+= 8;                         // Big enough

--- 1.379/sql/sql_show.cc	2006-12-03 21:19:45 +01:00
+++ 1.380/sql/sql_show.cc	2006-12-03 21:19:45 +01:00
@@ -1116,7 +1116,7 @@
 
     if (flags & NOT_NULL_FLAG)
       packet->append(STRING_WITH_LEN(" NOT NULL"));
-    else if (field->type() == FIELD_TYPE_TIMESTAMP)
+    else if (field->type() == MYSQL_TYPE_TIMESTAMP)
     {
       /*
         TIMESTAMP field require explicit NULL flag, because unlike
@@ -1132,7 +1132,7 @@
     has_now_default= table->timestamp_field == field && 
                      field->unireg_check != Field::TIMESTAMP_UN_FIELD;
     
-    has_default= (field->type() != FIELD_TYPE_BLOB &&
+    has_default= (field->type() != MYSQL_TYPE_BLOB &&
                   !(field->flags & NO_DEFAULT_VALUE_FLAG) &&
 		  field->unireg_check != Field::NEXT_NUMBER &&
                   !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
@@ -1625,7 +1625,7 @@
   field_list.push_back(field=new Item_empty_string("db",NAME_LEN));
   field->maybe_null=1;
   field_list.push_back(new Item_empty_string("Command",16));
-  field_list.push_back(new Item_return_int("Time",7, FIELD_TYPE_LONG));
+  field_list.push_back(new Item_return_int("Time",7, MYSQL_TYPE_LONG));
   field_list.push_back(field=new Item_empty_string("State",30));
   field->maybe_null=1;
   field_list.push_back(field=new Item_empty_string("Info",max_query_length));
@@ -3098,7 +3098,7 @@
     pos=(byte*) ((flags & NOT_NULL_FLAG) ?  "NO" : "YES");
     table->field[6]->store((const char*) pos,
                            strlen((const char*) pos), cs);
-    is_blob= (field->type() == FIELD_TYPE_BLOB);
+    is_blob= (field->type() == MYSQL_TYPE_BLOB);
     if (field->has_charset() || is_blob ||
         field->real_type() == MYSQL_TYPE_VARCHAR ||  // For varbinary type
         field->real_type() == MYSQL_TYPE_STRING)     // For binary type
@@ -3122,25 +3122,25 @@
 
     decimals= field->decimals();
     switch (field->type()) {
-    case FIELD_TYPE_NEWDECIMAL:
+    case MYSQL_TYPE_NEWDECIMAL:
       field_length= ((Field_new_decimal*) field)->precision;
       break;
-    case FIELD_TYPE_DECIMAL:
+    case MYSQL_TYPE_DECIMAL:
       field_length= field->field_length - (decimals  ? 2 : 1);
       break;
-    case FIELD_TYPE_TINY:
-    case FIELD_TYPE_SHORT:
-    case FIELD_TYPE_LONG:
-    case FIELD_TYPE_LONGLONG:
-    case FIELD_TYPE_INT24:
+    case MYSQL_TYPE_TINY:
+    case MYSQL_TYPE_SHORT:
+    case MYSQL_TYPE_LONG:
+    case MYSQL_TYPE_LONGLONG:
+    case MYSQL_TYPE_INT24:
       field_length= field->max_length() - 1;
       break;
-    case FIELD_TYPE_BIT:
+    case MYSQL_TYPE_BIT:
       field_length= field->max_length();
       decimals= -1;                             // return NULL
       break;
-    case FIELD_TYPE_FLOAT:  
-    case FIELD_TYPE_DOUBLE:
+    case MYSQL_TYPE_FLOAT:  
+    case MYSQL_TYPE_DOUBLE:
       field_length= field->field_length;
       if (decimals == NOT_FIXED_DEC)
         decimals= -1;                           // return NULL

--- 1.375/sql/sql_table.cc	2006-12-03 21:19:45 +01:00
+++ 1.376/sql/sql_table.cc	2006-12-03 21:19:45 +01:00
@@ -2022,10 +2022,10 @@
   DBUG_ASSERT(sql_field->charset);
 
   switch (sql_field->sql_type) {
-  case FIELD_TYPE_BLOB:
-  case FIELD_TYPE_MEDIUM_BLOB:
-  case FIELD_TYPE_TINY_BLOB:
-  case FIELD_TYPE_LONG_BLOB:
+  case MYSQL_TYPE_BLOB:
+  case MYSQL_TYPE_MEDIUM_BLOB:
+  case MYSQL_TYPE_TINY_BLOB:
+  case MYSQL_TYPE_LONG_BLOB:
     sql_field->pack_flag=FIELDFLAG_BLOB |
       pack_length_to_packflag(sql_field->pack_length -
                               portable_sizeof_char_ptr);
@@ -2035,7 +2035,7 @@
     sql_field->unireg_check=Field::BLOB_FIELD;
     (*blob_columns)++;
     break;
-  case FIELD_TYPE_GEOMETRY:
+  case MYSQL_TYPE_GEOMETRY:
 #ifdef HAVE_SPATIAL
     if (!(table_flags & HA_CAN_GEOMETRY))
     {
@@ -2075,12 +2075,12 @@
     }
 #endif
     /* fall through */
-  case FIELD_TYPE_STRING:
+  case MYSQL_TYPE_STRING:
     sql_field->pack_flag=0;
     if (sql_field->charset->state & MY_CS_BINSORT)
       sql_field->pack_flag|=FIELDFLAG_BINARY;
     break;
-  case FIELD_TYPE_ENUM:
+  case MYSQL_TYPE_ENUM:
     sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) |
       FIELDFLAG_INTERVAL;
     if (sql_field->charset->state & MY_CS_BINSORT)
@@ -2090,7 +2090,7 @@
                                  sql_field->interval,
                                  sql_field->charset);
     break;
-  case FIELD_TYPE_SET:
+  case MYSQL_TYPE_SET:
     sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) |
       FIELDFLAG_BITFIELD;
     if (sql_field->charset->state & MY_CS_BINSORT)
@@ -2100,19 +2100,19 @@
                                  sql_field->interval,
                                  sql_field->charset);
     break;
-  case FIELD_TYPE_DATE:			// Rest of string types
-  case FIELD_TYPE_NEWDATE:
-  case FIELD_TYPE_TIME:
-  case FIELD_TYPE_DATETIME:
-  case FIELD_TYPE_NULL:
+  case MYSQL_TYPE_DATE:			// Rest of string types
+  case MYSQL_TYPE_NEWDATE:
+  case MYSQL_TYPE_TIME:
+  case MYSQL_TYPE_DATETIME:
+  case MYSQL_TYPE_NULL:
     sql_field->pack_flag=f_settype((uint) sql_field->sql_type);
     break;
-  case FIELD_TYPE_BIT:
+  case MYSQL_TYPE_BIT:
     /* 
       We have sql_field->pack_flag already set here, see mysql_prepare_table().
     */
     break;
-  case FIELD_TYPE_NEWDECIMAL:
+  case MYSQL_TYPE_NEWDECIMAL:
     sql_field->pack_flag=(FIELDFLAG_NUMBER |
                           (sql_field->flags & UNSIGNED_FLAG ? 0 :
                            FIELDFLAG_DECIMAL) |
@@ -2120,7 +2120,7 @@
                            FIELDFLAG_ZEROFILL : 0) |
                           (sql_field->decimals << FIELDFLAG_DEC_SHIFT));
     break;
-  case FIELD_TYPE_TIMESTAMP:
+  case MYSQL_TYPE_TIMESTAMP:
     /* We should replace old TIMESTAMP fields with their newer analogs */
     if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD)
     {
@@ -2245,10 +2245,10 @@
     */
     if (sql_field->def && 
         save_cs != sql_field->def->collation.collation &&
-        (sql_field->sql_type == FIELD_TYPE_VAR_STRING ||
-         sql_field->sql_type == FIELD_TYPE_STRING ||
-         sql_field->sql_type == FIELD_TYPE_SET ||
-         sql_field->sql_type == FIELD_TYPE_ENUM))
+        (sql_field->sql_type == MYSQL_TYPE_VAR_STRING ||
+         sql_field->sql_type == MYSQL_TYPE_STRING ||
+         sql_field->sql_type == MYSQL_TYPE_SET ||
+         sql_field->sql_type == MYSQL_TYPE_ENUM))
     {
       Query_arena backup_arena;
       bool need_to_change_arena= !thd->stmt_arena->is_conventional();
@@ -2273,8 +2273,8 @@
       }
     }
 
-    if (sql_field->sql_type == FIELD_TYPE_SET ||
-        sql_field->sql_type == FIELD_TYPE_ENUM)
+    if (sql_field->sql_type == MYSQL_TYPE_SET ||
+        sql_field->sql_type == MYSQL_TYPE_ENUM)
     {
       uint32 dummy;
       CHARSET_INFO *cs= sql_field->charset;
@@ -2320,7 +2320,7 @@
                                        interval->type_lengths[i]);
           interval->type_lengths[i]= lengthsp;
           ((uchar *)interval->type_names[i])[lengthsp]= '\0';
-          if (sql_field->sql_type == FIELD_TYPE_SET)
+          if (sql_field->sql_type == MYSQL_TYPE_SET)
           {
             if (cs->coll->instr(cs, interval->type_names[i], 
                                 interval->type_lengths[i], 
@@ -2334,7 +2334,7 @@
         sql_field->interval_list.empty(); // Don't need interval_list anymore
       }
 
-      if (sql_field->sql_type == FIELD_TYPE_SET)
+      if (sql_field->sql_type == MYSQL_TYPE_SET)
       {
         uint32 field_length;
         if (sql_field->def != NULL)
@@ -2370,10 +2370,10 @@
         calculate_interval_lengths(cs, interval, &dummy, &field_length);
         sql_field->length= field_length + (interval->count - 1);
       }
-      else  /* FIELD_TYPE_ENUM */
+      else  /* MYSQL_TYPE_ENUM */
       {
         uint32 field_length;
-        DBUG_ASSERT(sql_field->sql_type == FIELD_TYPE_ENUM);
+        DBUG_ASSERT(sql_field->sql_type == MYSQL_TYPE_ENUM);
         if (sql_field->def != NULL)
         {
           String str, *def= sql_field->def->val_str(&str);
@@ -2403,7 +2403,7 @@
       set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1);
     }
 
-    if (sql_field->sql_type == FIELD_TYPE_BIT)
+    if (sql_field->sql_type == MYSQL_TYPE_BIT)
     { 
       sql_field->pack_flag= FIELDFLAG_NUMBER;
       if (file->ha_table_flags() & HA_CAN_BIT_FIELD)
@@ -3059,7 +3059,7 @@
                MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
       DBUG_RETURN(1);
     }
-    sql_field->sql_type= FIELD_TYPE_BLOB;
+    sql_field->sql_type= MYSQL_TYPE_BLOB;
     sql_field->flags|= BLOB_FLAG;
     sprintf(warn_buff, ER(ER_AUTO_CONVERT), sql_field->field_name,
             (sql_field->charset == &my_charset_bin) ? "VARBINARY" : "VARCHAR",
@@ -3070,7 +3070,7 @@
     
   if ((sql_field->flags & BLOB_FLAG) && sql_field->length)
   {
-    if (sql_field->sql_type == FIELD_TYPE_BLOB)
+    if (sql_field->sql_type == MYSQL_TYPE_BLOB)
     {
       /* The user has given a length to the blob column */
       sql_field->sql_type= get_blob_type_from_length(sql_field->length);
@@ -3098,11 +3098,11 @@
 
 void sp_prepare_create_field(THD *thd, create_field *sql_field)
 {
-  if (sql_field->sql_type == FIELD_TYPE_SET ||
-      sql_field->sql_type == FIELD_TYPE_ENUM)
+  if (sql_field->sql_type == MYSQL_TYPE_SET ||
+      sql_field->sql_type == MYSQL_TYPE_ENUM)
   {
     uint32 field_length, dummy;
-    if (sql_field->sql_type == FIELD_TYPE_SET)
+    if (sql_field->sql_type == MYSQL_TYPE_SET)
     {
       calculate_interval_lengths(sql_field->charset,
                                  sql_field->interval, &dummy, 
@@ -3110,7 +3110,7 @@
       sql_field->length= field_length + 
                          (sql_field->interval->count - 1);
     }
-    else /* FIELD_TYPE_ENUM */
+    else /* MYSQL_TYPE_ENUM */
     {
       calculate_interval_lengths(sql_field->charset,
                                  sql_field->interval,
@@ -3120,7 +3120,7 @@
     set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1);
   }
 
-  if (sql_field->sql_type == FIELD_TYPE_BIT)
+  if (sql_field->sql_type == MYSQL_TYPE_BIT)
   {
     sql_field->pack_flag= FIELDFLAG_NUMBER |
                           FIELDFLAG_TREAT_BIT_AS_CHAR;
@@ -5601,7 +5601,7 @@
       }
       if (alter)
       {
-	if (def->sql_type == FIELD_TYPE_BLOB)
+	if (def->sql_type == MYSQL_TYPE_BLOB)
 	{
 	  my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
 	  DBUG_RETURN(TRUE);
@@ -6829,7 +6829,7 @@
 	    for (uint i= 0; i < t->s->fields; i++ )
 	    {
 	      Field *f= t->field[i];
-	      if ((f->type() == FIELD_TYPE_BLOB) ||
+	      if ((f->type() == MYSQL_TYPE_BLOB) ||
                   (f->type() == MYSQL_TYPE_VARCHAR))
 	      {
 		String tmp;

--- 1.521/sql/sql_yacc.yy	2006-12-03 21:19:45 +01:00
+++ 1.522/sql/sql_yacc.yy	2006-12-03 21:19:45 +01:00
@@ -1632,7 +1632,7 @@
               When collation support in SP is implemented, then this test
               should be removed.
             */
-            if (($8 == FIELD_TYPE_STRING || $8 == MYSQL_TYPE_VARCHAR)
+            if (($8 == MYSQL_TYPE_STRING || $8 == MYSQL_TYPE_VARCHAR)
                 && (lex->type & BINCMP_FLAG))
             {
               my_error(ER_NOT_SUPPORTED_YET, MYF(0), "return value collation");
@@ -4145,31 +4145,31 @@
 type:
 	int_type opt_len field_options	{ $$=$1; }
 	| real_type opt_precision field_options { $$=$1; }
-	| FLOAT_SYM float_options field_options { $$=FIELD_TYPE_FLOAT; }
+	| FLOAT_SYM float_options field_options { $$=MYSQL_TYPE_FLOAT; }
 	| BIT_SYM			{ Lex->length= (char*) "1";
-					  $$=FIELD_TYPE_BIT; }
+					  $$=MYSQL_TYPE_BIT; }
 	| BIT_SYM '(' NUM ')'		{ Lex->length= $3.str;
-					  $$=FIELD_TYPE_BIT; }
+					  $$=MYSQL_TYPE_BIT; }
 	| BOOL_SYM			{ Lex->length=(char*) "1";
-					  $$=FIELD_TYPE_TINY; }
+					  $$=MYSQL_TYPE_TINY; }
 	| BOOLEAN_SYM			{ Lex->length=(char*) "1";
-					  $$=FIELD_TYPE_TINY; }
+					  $$=MYSQL_TYPE_TINY; }
 	| char '(' NUM ')' opt_binary	{ Lex->length=$3.str;
-					  $$=FIELD_TYPE_STRING; }
+					  $$=MYSQL_TYPE_STRING; }
 	| char opt_binary		{ Lex->length=(char*) "1";
-					  $$=FIELD_TYPE_STRING; }
+					  $$=MYSQL_TYPE_STRING; }
 	| nchar '(' NUM ')' opt_bin_mod	{ Lex->length=$3.str;
-					  $$=FIELD_TYPE_STRING;
+					  $$=MYSQL_TYPE_STRING;
 					  Lex->charset=national_charset_info; }
 	| nchar opt_bin_mod		{ Lex->length=(char*) "1";
-					  $$=FIELD_TYPE_STRING;
+					  $$=MYSQL_TYPE_STRING;
 					  Lex->charset=national_charset_info; }
 	| BINARY '(' NUM ')'		{ Lex->length=$3.str;
 					  Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_STRING; }
+					  $$=MYSQL_TYPE_STRING; }
 	| BINARY			{ Lex->length= (char*) "1";
 					  Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_STRING; }
+					  $$=MYSQL_TYPE_STRING; }
 	| varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
 					  $$= MYSQL_TYPE_VARCHAR; }
 	| nvarchar '(' NUM ')' opt_bin_mod { Lex->length=$3.str;
@@ -4178,33 +4178,33 @@
 	| VARBINARY '(' NUM ')' 	{ Lex->length=$3.str;
 					  Lex->charset=&my_charset_bin;
 					  $$= MYSQL_TYPE_VARCHAR; }
-	| YEAR_SYM opt_len field_options { $$=FIELD_TYPE_YEAR; }
-	| DATE_SYM			{ $$=FIELD_TYPE_DATE; }
-	| TIME_SYM			{ $$=FIELD_TYPE_TIME; }
+	| YEAR_SYM opt_len field_options { $$=MYSQL_TYPE_YEAR; }
+	| DATE_SYM			{ $$=MYSQL_TYPE_DATE; }
+	| TIME_SYM			{ $$=MYSQL_TYPE_TIME; }
 	| TIMESTAMP opt_len
 	  {
 	    if (YYTHD->variables.sql_mode & MODE_MAXDB)
-	      $$=FIELD_TYPE_DATETIME;
+	      $$=MYSQL_TYPE_DATETIME;
 	    else
             {
               /* 
                 Unlike other types TIMESTAMP fields are NOT NULL by default.
               */
               Lex->type|= NOT_NULL_FLAG;
-	      $$=FIELD_TYPE_TIMESTAMP;
+	      $$=MYSQL_TYPE_TIMESTAMP;
             }
 	   }
-	| DATETIME			{ $$=FIELD_TYPE_DATETIME; }
+	| DATETIME			{ $$=MYSQL_TYPE_DATETIME; }
 	| TINYBLOB			{ Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_TINY_BLOB; }
+					  $$=MYSQL_TYPE_TINY_BLOB; }
 	| BLOB_SYM opt_len		{ Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_BLOB; }
+					  $$=MYSQL_TYPE_BLOB; }
 	| spatial_type
           {
 #ifdef HAVE_SPATIAL
             Lex->charset=&my_charset_bin;
             Lex->uint_geom_type= (uint)$1;
-            $$=FIELD_TYPE_GEOMETRY;
+            $$=MYSQL_TYPE_GEOMETRY;
 #else
             my_error(ER_FEATURE_DISABLED, MYF(0),
                      sym_group_geom.name, sym_group_geom.needed_define);
@@ -4212,30 +4212,30 @@
 #endif
           }
 	| MEDIUMBLOB			{ Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_MEDIUM_BLOB; }
+					  $$=MYSQL_TYPE_MEDIUM_BLOB; }
 	| LONGBLOB			{ Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_LONG_BLOB; }
+					  $$=MYSQL_TYPE_LONG_BLOB; }
 	| LONG_SYM VARBINARY		{ Lex->charset=&my_charset_bin;
-					  $$=FIELD_TYPE_MEDIUM_BLOB; }
-	| LONG_SYM varchar opt_binary	{ $$=FIELD_TYPE_MEDIUM_BLOB; }
-	| TINYTEXT opt_binary		{ $$=FIELD_TYPE_TINY_BLOB; }
-	| TEXT_SYM opt_len opt_binary	{ $$=FIELD_TYPE_BLOB; }
-	| MEDIUMTEXT opt_binary		{ $$=FIELD_TYPE_MEDIUM_BLOB; }
-	| LONGTEXT opt_binary		{ $$=FIELD_TYPE_LONG_BLOB; }
+					  $$=MYSQL_TYPE_MEDIUM_BLOB; }
+	| LONG_SYM varchar opt_binary	{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
+	| TINYTEXT opt_binary		{ $$=MYSQL_TYPE_TINY_BLOB; }
+	| TEXT_SYM opt_len opt_binary	{ $$=MYSQL_TYPE_BLOB; }
+	| MEDIUMTEXT opt_binary		{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
+	| LONGTEXT opt_binary		{ $$=MYSQL_TYPE_LONG_BLOB; }
 	| DECIMAL_SYM float_options field_options
-                                        { $$=FIELD_TYPE_NEWDECIMAL;}
+                                        { $$=MYSQL_TYPE_NEWDECIMAL;}
 	| NUMERIC_SYM float_options field_options
-                                        { $$=FIELD_TYPE_NEWDECIMAL;}
+                                        { $$=MYSQL_TYPE_NEWDECIMAL;}
 	| FIXED_SYM float_options field_options
-                                        { $$=FIELD_TYPE_NEWDECIMAL;}
+                                        { $$=MYSQL_TYPE_NEWDECIMAL;}
 	| ENUM {Lex->interval_list.empty();} '(' string_list ')' opt_binary
-	  { $$=FIELD_TYPE_ENUM; }
+	  { $$=MYSQL_TYPE_ENUM; }
 	| SET { Lex->interval_list.empty();} '(' string_list ')' opt_binary
-	  { $$=FIELD_TYPE_SET; }
-	| LONG_SYM opt_binary		{ $$=FIELD_TYPE_MEDIUM_BLOB; }
+	  { $$=MYSQL_TYPE_SET; }
+	| LONG_SYM opt_binary		{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
 	| SERIAL_SYM
 	  {
-	    $$=FIELD_TYPE_LONGLONG;
+	    $$=MYSQL_TYPE_LONGLONG;
 	    Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
 		         UNIQUE_FLAG);
 	  }
@@ -4277,17 +4277,17 @@
 	;
 
 int_type:
-	INT_SYM		{ $$=FIELD_TYPE_LONG; }
-	| TINYINT	{ $$=FIELD_TYPE_TINY; }
-	| SMALLINT	{ $$=FIELD_TYPE_SHORT; }
-	| MEDIUMINT	{ $$=FIELD_TYPE_INT24; }
-	| BIGINT	{ $$=FIELD_TYPE_LONGLONG; };
+	INT_SYM		{ $$=MYSQL_TYPE_LONG; }
+	| TINYINT	{ $$=MYSQL_TYPE_TINY; }
+	| SMALLINT	{ $$=MYSQL_TYPE_SHORT; }
+	| MEDIUMINT	{ $$=MYSQL_TYPE_INT24; }
+	| BIGINT	{ $$=MYSQL_TYPE_LONGLONG; };
 
 real_type:
 	REAL		{ $$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
-			      FIELD_TYPE_FLOAT : FIELD_TYPE_DOUBLE; }
-	| DOUBLE_SYM	{ $$=FIELD_TYPE_DOUBLE; }
-	| DOUBLE_SYM PRECISION { $$=FIELD_TYPE_DOUBLE; };
+			      MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE; }
+	| DOUBLE_SYM	{ $$=MYSQL_TYPE_DOUBLE; }
+	| DOUBLE_SYM PRECISION { $$=MYSQL_TYPE_DOUBLE; };
 
 
 float_options:

--- 1.262/sql/table.cc	2006-12-03 21:19:45 +01:00
+++ 1.263/sql/table.cc	2006-12-03 21:19:45 +01:00
@@ -877,7 +877,7 @@
       field_type=(enum_field_types) (uint) strpos[13];
 
       /* charset and geometry_type share the same byte in frm */
-      if (field_type == FIELD_TYPE_GEOMETRY)
+      if (field_type == MYSQL_TYPE_GEOMETRY)
       {
 #ifdef HAVE_SPATIAL
 	geom_type= (Field::geometry_type) strpos[14];
@@ -952,7 +952,7 @@
     }
     
 #ifndef TO_BE_DELETED_ON_PRODUCTION
-    if (field_type == FIELD_TYPE_NEWDECIMAL && !share->mysql_version)
+    if (field_type == MYSQL_TYPE_NEWDECIMAL && !share->mysql_version)
     {
       /*
         Fix pack length of old decimal values from 5.0.3 -> 5.0.4
@@ -999,7 +999,7 @@
 
     reg_field->field_index= i;
     reg_field->comment=comment;
-    if (field_type == FIELD_TYPE_BIT && !f_bit_as_char(pack_flag))
+    if (field_type == MYSQL_TYPE_BIT && !f_bit_as_char(pack_flag))
     {
       if ((null_bit_pos+= field_length & 7) > 7)
       {
@@ -1089,10 +1089,10 @@
           keyinfo->extra_length+= HA_KEY_NULL_LENGTH;
           keyinfo->key_length+= HA_KEY_NULL_LENGTH;
         }
-        if (field->type() == FIELD_TYPE_BLOB ||
+        if (field->type() == MYSQL_TYPE_BLOB ||
             field->real_type() == MYSQL_TYPE_VARCHAR)
         {
-          if (field->type() == FIELD_TYPE_BLOB)
+          if (field->type() == MYSQL_TYPE_BLOB)
             key_part->key_part_flag|= HA_BLOB_PART;
           else
             key_part->key_part_flag|= HA_VAR_LENGTH_PART;
@@ -1144,7 +1144,7 @@
         if (field->key_length() != key_part->length)
         {
 #ifndef TO_BE_DELETED_ON_PRODUCTION
-          if (field->type() == FIELD_TYPE_NEWDECIMAL)
+          if (field->type() == MYSQL_TYPE_NEWDECIMAL)
           {
             /*
               Fix a fatal error in decimal key handling that causes crashes

--- 1.83/sql/item_subselect.h	2006-12-03 21:19:45 +01:00
+++ 1.84/sql/item_subselect.h	2006-12-03 21:19:45 +01:00
@@ -323,7 +323,7 @@
     result= res;
     item= si;
     res_type= STRING_RESULT;
-    res_field_type= FIELD_TYPE_VAR_STRING;
+    res_field_type= MYSQL_TYPE_VAR_STRING;
     maybe_null= 0;
   }
   virtual ~subselect_engine() {}; // to satisfy compiler

--- 1.313/storage/innobase/handler/ha_innodb.cc	2006-12-03 21:19:45 +01:00
+++ 1.314/storage/innobase/handler/ha_innodb.cc	2006-12-03 21:19:45 +01:00
@@ -2591,10 +2591,10 @@
 	case MYSQL_TYPE_BIT:
 	case MYSQL_TYPE_STRING:
 	case MYSQL_TYPE_VAR_STRING:
-	case FIELD_TYPE_TINY_BLOB:
-	case FIELD_TYPE_MEDIUM_BLOB:
-	case FIELD_TYPE_BLOB:
-	case FIELD_TYPE_LONG_BLOB:
+	case MYSQL_TYPE_TINY_BLOB:
+	case MYSQL_TYPE_MEDIUM_BLOB:
+	case MYSQL_TYPE_BLOB:
+	case MYSQL_TYPE_LONG_BLOB:
 	case MYSQL_TYPE_VARCHAR:
 		/* Use the charset number to pick the right charset struct for
 		the comparison. Since the MySQL function get_charset may be
@@ -2658,11 +2658,11 @@
 	8 bits: this is used in ibuf and also when DATA_NOT_NULL is ORed to
 	the type */
 
-	DBUG_ASSERT((ulint)FIELD_TYPE_STRING < 256);
-	DBUG_ASSERT((ulint)FIELD_TYPE_VAR_STRING < 256);
-	DBUG_ASSERT((ulint)FIELD_TYPE_DOUBLE < 256);
-	DBUG_ASSERT((ulint)FIELD_TYPE_FLOAT < 256);
-	DBUG_ASSERT((ulint)FIELD_TYPE_DECIMAL < 256);
+	DBUG_ASSERT((ulint)MYSQL_TYPE_STRING < 256);
+	DBUG_ASSERT((ulint)MYSQL_TYPE_VAR_STRING < 256);
+	DBUG_ASSERT((ulint)MYSQL_TYPE_DOUBLE < 256);
+	DBUG_ASSERT((ulint)MYSQL_TYPE_FLOAT < 256);
+	DBUG_ASSERT((ulint)MYSQL_TYPE_DECIMAL < 256);
 
 	if (field->flags & UNSIGNED_FLAG) {
 
@@ -2671,8 +2671,8 @@
 		*unsigned_flag = 0;
 	}
 
-	if (field->real_type() == FIELD_TYPE_ENUM
-		|| field->real_type() == FIELD_TYPE_SET) {
+	if (field->real_type() == MYSQL_TYPE_ENUM
+		|| field->real_type() == MYSQL_TYPE_SET) {
 
 		/* MySQL has field->type() a string type for these, but the
 		data is actually internally stored as an unsigned integer
@@ -2710,31 +2710,31 @@
 		} else {
 			return(DATA_MYSQL);
 		}
-	case FIELD_TYPE_NEWDECIMAL:
+	case MYSQL_TYPE_NEWDECIMAL:
 		return(DATA_FIXBINARY);
-	case FIELD_TYPE_LONG:
-	case FIELD_TYPE_LONGLONG:
-	case FIELD_TYPE_TINY:
-	case FIELD_TYPE_SHORT:
-	case FIELD_TYPE_INT24:
-	case FIELD_TYPE_DATE:
-	case FIELD_TYPE_DATETIME:
-	case FIELD_TYPE_YEAR:
-	case FIELD_TYPE_NEWDATE:
-	case FIELD_TYPE_TIME:
-	case FIELD_TYPE_TIMESTAMP:
+	case MYSQL_TYPE_LONG:
+	case MYSQL_TYPE_LONGLONG:
+	case MYSQL_TYPE_TINY:
+	case MYSQL_TYPE_SHORT:
+	case MYSQL_TYPE_INT24:
+	case MYSQL_TYPE_DATE:
+	case MYSQL_TYPE_DATETIME:
+	case MYSQL_TYPE_YEAR:
+	case MYSQL_TYPE_NEWDATE:
+	case MYSQL_TYPE_TIME:
+	case MYSQL_TYPE_TIMESTAMP:
 		return(DATA_INT);
-	case FIELD_TYPE_FLOAT:
+	case MYSQL_TYPE_FLOAT:
 		return(DATA_FLOAT);
-	case FIELD_TYPE_DOUBLE:
+	case MYSQL_TYPE_DOUBLE:
 		return(DATA_DOUBLE);
-	case FIELD_TYPE_DECIMAL:
+	case MYSQL_TYPE_DECIMAL:
 		return(DATA_DECIMAL);
-	case FIELD_TYPE_GEOMETRY:
-	case FIELD_TYPE_TINY_BLOB:
-	case FIELD_TYPE_MEDIUM_BLOB:
-	case FIELD_TYPE_BLOB:
-	case FIELD_TYPE_LONG_BLOB:
+	case MYSQL_TYPE_GEOMETRY:
+	case MYSQL_TYPE_TINY_BLOB:
+	case MYSQL_TYPE_MEDIUM_BLOB:
+	case MYSQL_TYPE_BLOB:
+	case MYSQL_TYPE_LONG_BLOB:
 		return(DATA_BLOB);
 	default:
 		assert(0);
@@ -2902,10 +2902,10 @@
 
 			buff += key_len;
 
-		} else if (mysql_type == FIELD_TYPE_TINY_BLOB
-			|| mysql_type == FIELD_TYPE_MEDIUM_BLOB
-			|| mysql_type == FIELD_TYPE_BLOB
-			|| mysql_type == FIELD_TYPE_LONG_BLOB) {
+		} else if (mysql_type == MYSQL_TYPE_TINY_BLOB
+			|| mysql_type == MYSQL_TYPE_MEDIUM_BLOB
+			|| mysql_type == MYSQL_TYPE_BLOB
+			|| mysql_type == MYSQL_TYPE_LONG_BLOB) {
 
 			CHARSET_INFO*	cs;
 			ulint		key_len;
@@ -2999,8 +2999,8 @@
 			type is not enum or set. For these fields check
 			if character set is multi byte. */
 
-			if (real_type != FIELD_TYPE_ENUM
-				&& real_type != FIELD_TYPE_SET
+			if (real_type != MYSQL_TYPE_ENUM
+				&& real_type != MYSQL_TYPE_SET
 				&& ( mysql_type == MYSQL_TYPE_VAR_STRING
 					|| mysql_type == MYSQL_TYPE_STRING)) {
 
@@ -7219,10 +7219,10 @@
 		field = key_part->field;
 		mysql_type = field->type();
 
-		if (mysql_type == FIELD_TYPE_TINY_BLOB
-			|| mysql_type == FIELD_TYPE_MEDIUM_BLOB
-			|| mysql_type == FIELD_TYPE_BLOB
-			|| mysql_type == FIELD_TYPE_LONG_BLOB) {
+		if (mysql_type == MYSQL_TYPE_TINY_BLOB
+			|| mysql_type == MYSQL_TYPE_MEDIUM_BLOB
+			|| mysql_type == MYSQL_TYPE_BLOB
+			|| mysql_type == MYSQL_TYPE_LONG_BLOB) {
 
 			/* In the MySQL key value format, a column prefix of
 			a BLOB is preceded by a 2-byte length field */

--- 1.132/sql/sp.cc	2006-12-03 21:19:45 +01:00
+++ 1.133/sql/sp.cc	2006-12-03 21:19:45 +01:00
@@ -48,7 +48,7 @@
 {
   MYSQL_PROC_FIELD_DB = 0,
   MYSQL_PROC_FIELD_NAME,
-  MYSQL_PROC_FIELD_TYPE,
+  MYSQL_PROC_MYSQL_TYPE,
   MYSQL_PROC_FIELD_SPECIFIC_NAME,
   MYSQL_PROC_FIELD_LANGUAGE,
   MYSQL_PROC_FIELD_ACCESS,
@@ -541,7 +541,7 @@
       store(sp->m_db.str, sp->m_db.length, system_charset_info);
     table->field[MYSQL_PROC_FIELD_NAME]->
       store(sp->m_name.str, sp->m_name.length, system_charset_info);
-    table->field[MYSQL_PROC_FIELD_TYPE]->
+    table->field[MYSQL_PROC_MYSQL_TYPE]->
       store((longlong)type, TRUE);
     table->field[MYSQL_PROC_FIELD_SPECIFIC_NAME]->
       store(sp->m_name.str, sp->m_name.length, system_charset_info);
@@ -743,7 +743,7 @@
 {
   Protocol *protocol= thd->protocol;
 
-  if (table->field[MYSQL_PROC_FIELD_TYPE]->val_int() == type)
+  if (table->field[MYSQL_PROC_MYSQL_TYPE]->val_int() == type)
   {
     String db_string;
     String name_string;
Thread
bk commit into 5.1 tree (baker:1.2344)Brian Aker3 Dec