~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unireg.cc

Create default_values record from proto instead of reading from FRM. assert if different to FRM.

Restore the "blob can't have default value" error message.

Fix default values for: blob, vachar, enum and varbinary.
Default value for a BLOB can be "" thanks to TINYTEXT or something.
proto now has default_bin_value as well as default_value. the default_bin_value used for varbinary and in future, blobs.

Load enum values out of proto instead of FRM and fill in the crazy interval structures.

Jay will fix up the create.test change (incorrect datetime for timestamp "0").

Show diffs side-by-side

added added

removed removed

Lines of Context:
565
565
      }
566
566
      else
567
567
      {
568
 
        String s;
569
 
        field_options->set_default_value(field_arg->def->val_str(&s)->c_ptr());
 
568
        String d;
 
569
        String *default_value= field_arg->def->val_str(&d);
 
570
 
 
571
        if(field_arg->sql_type==DRIZZLE_TYPE_VARCHAR
 
572
           && field_arg->charset==&my_charset_bin)
 
573
        {
 
574
          string bin_default;
 
575
          bin_default.assign(default_value->c_ptr(),
 
576
                             default_value->length());
 
577
          field_options->set_default_bin_value(bin_default);
 
578
        }
 
579
        else
 
580
        {
 
581
          field_options->set_default_value(default_value->c_ptr());
 
582
        }
570
583
      }
571
584
    }
572
585