~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_show.cc

Initial submit of code and tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
713
713
    else
714
714
      type.set_charset(system_charset_info);
715
715
 
 
716
    if (field->vcol_info)
 
717
    {
 
718
      packet->append(STRING_WITH_LEN("VIRTUAL "));
 
719
    }
 
720
 
716
721
    field->sql_type(type);
717
722
    packet->append(type.ptr(), type.length(), system_charset_info);
718
723
 
 
724
    if (field->vcol_info)
 
725
    {
 
726
      packet->append(STRING_WITH_LEN(" AS ("));
 
727
      packet->append(field->vcol_info->expr_str.str,
 
728
                     field->vcol_info->expr_str.length,
 
729
                     system_charset_info);
 
730
      packet->append(STRING_WITH_LEN(")"));
 
731
      if (field->is_stored)
 
732
        packet->append(STRING_WITH_LEN(" STORED"));
 
733
    }
 
734
    
719
735
    if (field->has_charset())
720
736
    {
721
737
      if (field->charset() != share->table_charset)
762
778
          packet->append(STRING_WITH_LEN(" DYNAMIC */"));
763
779
      }
764
780
    }
765
 
    if (get_field_default_value(thd, table->timestamp_field,
 
781
    if (!field->vcol_info &&
 
782
        get_field_default_value(thd, table->timestamp_field,
766
783
                                field, &def_value, 1))
767
784
    {
768
785
      packet->append(STRING_WITH_LEN(" DEFAULT "));
3177
3194
        field->unireg_check != Field::TIMESTAMP_DN_FIELD)
3178
3195
      table->field[16]->store(STRING_WITH_LEN("on update CURRENT_TIMESTAMP"),
3179
3196
                              cs);
3180
 
 
 
3197
    if (field->vcol_info)
 
3198
          table->field[16]->store(STRING_WITH_LEN("VIRTUAL"), cs);
3181
3199
    table->field[18]->store(field->comment.str, field->comment.length, cs);
3182
3200
    {
3183
3201
      enum column_format_type column_format= (enum column_format_type)