~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/sql_show.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
756
756
        Add field flags about FIELD FORMAT (FIXED or DYNAMIC)
757
757
        and about STORAGE (DISK or MEMORY).
758
758
      */
759
 
      enum ha_storage_media storage_type= (enum ha_storage_media)
760
 
        ((flags >> FIELD_STORAGE_FLAGS) & STORAGE_TYPE_MASK);
761
759
      enum column_format_type column_format= (enum column_format_type)
762
760
        ((flags >> COLUMN_FORMAT_FLAGS) & COLUMN_FORMAT_MASK);
763
 
      if (storage_type)
764
 
      {
765
 
        packet->append(STRING_WITH_LEN(" /*!"));
766
 
        packet->append(STRING_WITH_LEN(MYSQL_VERSION_TABLESPACE_IN_FRM_STR));
767
 
        packet->append(STRING_WITH_LEN(" STORAGE"));
768
 
        if (storage_type == HA_SM_DISK)
769
 
          packet->append(STRING_WITH_LEN(" DISK */"));
770
 
        else
771
 
          packet->append(STRING_WITH_LEN(" MEMORY */"));
772
 
      }
773
761
      if (column_format)
774
762
      {
775
763
        packet->append(STRING_WITH_LEN(" /*!"));
877
865
      to the CREATE TABLE statement
878
866
    */
879
867
 
880
 
    switch (table->s->default_storage_media) {
881
 
    case(HA_SM_DEFAULT):
882
 
      if ((for_str= (char *)file->get_tablespace_name()))
883
 
      {
884
 
        packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE "));
885
 
        append_identifier(thd, packet, for_str, strlen(for_str));
886
 
        packet->append(STRING_WITH_LEN(" */"));
887
 
      }
888
 
      break;
889
 
    case(HA_SM_DISK):
890
 
      packet->append(STRING_WITH_LEN(" /*!50100"));
891
 
      if ((for_str= (char *)file->get_tablespace_name()))
892
 
      {
893
 
        packet->append(STRING_WITH_LEN(" TABLESPACE "));
894
 
        append_identifier(thd, packet, for_str, strlen(for_str));
895
 
      }
896
 
      packet->append(STRING_WITH_LEN(" STORAGE DISK */"));
897
 
      break;
898
 
    case(HA_SM_MEMORY):
899
 
      packet->append(STRING_WITH_LEN(" /*!50100"));
900
 
      if ((for_str= (char *)file->get_tablespace_name()))
901
 
      {
902
 
        packet->append(STRING_WITH_LEN(" TABLESPACE "));
903
 
        append_identifier(thd, packet, for_str, strlen(for_str));
904
 
      }
905
 
      packet->append(STRING_WITH_LEN(" STORAGE MEMORY */"));
906
 
      break;
907
 
    };
908
 
 
909
868
    /*
910
869
      IF   check_create_info
911
870
      THEN add ENGINE only if it was used when creating the table
3241
3200
 
3242
3201
    table->field[18]->store(field->comment.str, field->comment.length, cs);
3243
3202
    {
3244
 
      enum ha_storage_media storage_type= (enum ha_storage_media)
3245
 
        ((field->flags >> FIELD_STORAGE_FLAGS) & STORAGE_TYPE_MASK);
3246
3203
      enum column_format_type column_format= (enum column_format_type)
3247
3204
        ((field->flags >> COLUMN_FORMAT_FLAGS) & COLUMN_FORMAT_MASK);
3248
 
      pos=(uchar*)(storage_type == HA_SM_DEFAULT ? "Default" :
3249
 
                   storage_type == HA_SM_DISK ? "Disk" : "Memory");
 
3205
      pos=(uchar*)"Default";
3250
3206
      table->field[19]->store((const char*) pos,
3251
3207
                              strlen((const char*) pos), cs);
3252
3208
      pos=(uchar*)(column_format == COLUMN_FORMAT_TYPE_DEFAULT ? "Default" :