~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_table.cc

  • Committer: Lee Bieber
  • Date: 2011-03-17 23:23:47 UTC
  • mfrom: (2240.1.3 build)
  • Revision ID: kalebral@gmail.com-20110317232347-15tn59mrrfx2ubvm
Merge Stewart - 728855: BLOB column can have default '' (empty string) in CREATE TABLE but not ALTER TABLE ALTER 
Merge Stewart - 728856: CREATE TABLE t1 (a int default 'aoeu'); succeeds
Merge Stewart - 730420: ER_TOO_BIG_FIELDLENGTH can report allowed size in bytes or characters depending on codepath producing the error
Merge Stewart - dbqp source (and all its libs) should use emacs python mode, not emacs C mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
339
339
 
340
340
      if (alter != alter_info->alter_list.end())
341
341
      {
342
 
        if (def->sql_type == DRIZZLE_TYPE_BLOB)
343
 
        {
344
 
          my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
345
 
          return true;
346
 
        }
 
342
        def->setDefaultValue(alter->def, NULL);
347
343
 
348
 
        if ((def->def= alter->def))
349
 
        {
350
 
          /* Use new default */
351
 
          def->flags&= ~NO_DEFAULT_VALUE_FLAG;
352
 
        }
353
 
        else
354
 
        {
355
 
          def->flags|= NO_DEFAULT_VALUE_FLAG;
356
 
        }
357
344
        alter_info->alter_list.erase(alter);
358
345
      }
359
346
    }