20
20
#include <drizzled/sql_show.h>
21
21
#include <mysys/my_dir.h>
22
22
#include <libdrizzle/gettext.h>
23
#include <drizzled/util/convert.h>
24
26
inline const char *
25
27
str_or_nil(const char *str)
653
655
HA_CREATE_INFO *create_info_arg)
655
657
List<Item> field_list;
656
char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], def_value_buf[MAX_FIELD_WIDTH];
658
char tmp[MAX_FIELD_WIDTH], *for_str, def_value_buf[MAX_FIELD_WIDTH];
657
659
const char *alias;
658
661
String type(tmp, sizeof(tmp), system_charset_info);
659
662
String def_value(def_value_buf, sizeof(def_value_buf), system_charset_info);
660
663
Field **ptr,*field;
825
828
(key_part->length !=
826
829
table->field[key_part->fieldnr-1]->key_length()))
830
end= int10_to_str((long) key_part->length /
831
key_part->field->charset()->mbmaxlen,
834
packet->append(buff,(uint) (end-buff));
832
buff= to_string(buff, (int32_t) key_part->length /
833
key_part->field->charset()->mbmaxlen);
835
packet->append(buff.c_str(), buff.length());
837
838
packet->append(')');
882
883
if (create_info.auto_increment_value > 1)
885
885
packet->append(STRING_WITH_LEN(" AUTO_INCREMENT="));
886
end= int64_t10_to_str(create_info.auto_increment_value, buff,10);
887
packet->append(buff, (uint) (end - buff));
886
buff= to_string(create_info.auto_increment_value);
887
packet->append(buff.c_str(), buff.length());
890
890
if (share->min_rows)
893
892
packet->append(STRING_WITH_LEN(" MIN_ROWS="));
894
end= int64_t10_to_str(share->min_rows, buff, 10);
895
packet->append(buff, (uint) (end- buff));
893
buff= to_string(share->min_rows);
894
packet->append(buff.c_str(), buff.length());
898
897
if (share->max_rows && !table_list->schema_table)
901
899
packet->append(STRING_WITH_LEN(" MAX_ROWS="));
902
end= int64_t10_to_str(share->max_rows, buff, 10);
903
packet->append(buff, (uint) (end - buff));
900
buff= to_string(share->max_rows);
901
packet->append(buff.c_str(), buff.length());
906
904
if (share->avg_row_length)
909
906
packet->append(STRING_WITH_LEN(" AVG_ROW_LENGTH="));
910
end= int64_t10_to_str(share->avg_row_length, buff,10);
911
packet->append(buff, (uint) (end - buff));
907
buff= to_string(share->avg_row_length);
908
packet->append(buff.c_str(), buff.length());
914
911
if (share->db_create_options & HA_OPTION_PACK_KEYS)
938
935
if (table->s->key_block_size)
941
937
packet->append(STRING_WITH_LEN(" KEY_BLOCK_SIZE="));
942
end= int64_t10_to_str(table->s->key_block_size, buff, 10);
943
packet->append(buff, (uint) (end - buff));
938
buff= to_string(table->s->key_block_size);
939
packet->append(buff.c_str(), buff.length());
945
941
if (share->block_size)
948
943
packet->append(STRING_WITH_LEN(" BLOCK_SIZE="));
949
end= int64_t10_to_str(share->block_size, buff,10);
950
packet->append(buff, (uint) (end - buff));
944
buff= to_string(share->block_size);
945
packet->append(buff.c_str(), buff.length());
952
947
table->file->append_create_info(packet);
953
948
if (share->comment.length)