~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Monty Taylor
  • Date: 2008-11-15 17:58:57 UTC
  • mfrom: (575.5.1 drizzle)
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 586.
  • Revision ID: monty@inaugust.com-20081115175857-kxdeopxzbyyz5bkd
MergedĀ fromĀ David.

Show diffs side-by-side

added added

removed removed

Lines of Context:
803
803
                                     sql_field->charset, &dup_val_count))
804
804
      return(1);
805
805
    break;
806
 
  case DRIZZLE_TYPE_NEWDATE:  // Rest of string types
 
806
  case DRIZZLE_TYPE_DATE:  // Rest of string types
807
807
  case DRIZZLE_TYPE_TIME:
808
808
  case DRIZZLE_TYPE_DATETIME:
809
809
  case DRIZZLE_TYPE_NULL:
4104
4104
      If the '0000-00-00' value isn't allowed then raise the error_if_not_empty
4105
4105
      flag to allow ALTER Table only if the table to be altered is empty.
4106
4106
      */
4107
 
    if ((def->sql_type == DRIZZLE_TYPE_NEWDATE ||
 
4107
    if ((def->sql_type == DRIZZLE_TYPE_DATE ||
4108
4108
         def->sql_type == DRIZZLE_TYPE_DATETIME) &&
4109
4109
         !alter_info->datetime_field &&
4110
4110
         !(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) &&
5048
5048
    enum enum_drizzle_timestamp_type t_type= DRIZZLE_TIMESTAMP_DATE;
5049
5049
    switch (alter_info->datetime_field->sql_type)
5050
5050
    {
5051
 
      case DRIZZLE_TYPE_NEWDATE:
 
5051
      case DRIZZLE_TYPE_DATE:
5052
5052
        f_val= "0000-00-00";
5053
5053
        t_type= DRIZZLE_TIMESTAMP_DATE;
5054
5054
        break;