686
686
packet->append(file->engine->getName().c_str());
690
Add AUTO_INCREMENT=... if there is an AUTO_INCREMENT column,
691
and NEXT_ID > 1 (the default). We must not print the clause
692
for engines that do not support this as it would break the
693
import of dumps, but as of this writing, the test for whether
694
AUTO_INCREMENT columns are allowed and wether AUTO_INCREMENT=...
695
is supported is identical, !(file->table_flags() & HA_NO_AUTO_INCREMENT))
696
Because of that, we do not explicitly test for the feature,
697
but may extrapolate its existence from that of an AUTO_INCREMENT column.
700
if (create_info.auto_increment_value > 1)
702
packet->append(STRING_WITH_LEN(" AUTO_INCREMENT="));
703
buff= to_string(create_info.auto_increment_value);
704
packet->append(buff.c_str(), buff.length());
709
packet->append(STRING_WITH_LEN(" MIN_ROWS="));
710
buff= to_string(share->min_rows);
711
packet->append(buff.c_str(), buff.length());
714
if (share->max_rows && !table_list->schema_table)
716
packet->append(STRING_WITH_LEN(" MAX_ROWS="));
717
buff= to_string(share->max_rows);
718
packet->append(buff.c_str(), buff.length());
721
if (share->avg_row_length)
723
packet->append(STRING_WITH_LEN(" AVG_ROW_LENGTH="));
724
buff= to_string(share->avg_row_length);
725
packet->append(buff.c_str(), buff.length());
728
689
if (share->db_create_options & HA_OPTION_PACK_KEYS)
729
690
packet->append(STRING_WITH_LEN(" PACK_KEYS=1"));
730
691
if (share->db_create_options & HA_OPTION_NO_PACK_KEYS)
731
692
packet->append(STRING_WITH_LEN(" PACK_KEYS=0"));
732
/* We use CHECKSUM, instead of TABLE_CHECKSUM, for backward compability */
733
if (share->db_create_options & HA_OPTION_CHECKSUM)
734
packet->append(STRING_WITH_LEN(" CHECKSUM=1"));
735
693
if (share->page_checksum != HA_CHOICE_UNDEF)
737
695
packet->append(STRING_WITH_LEN(" PAGE_CHECKSUM="));
738
696
packet->append(ha_choice_values[(uint32_t) share->page_checksum], 1);
740
if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
741
packet->append(STRING_WITH_LEN(" DELAY_KEY_WRITE=1"));
742
698
if (create_info.row_type != ROW_TYPE_DEFAULT)
744
700
packet->append(STRING_WITH_LEN(" ROW_FORMAT="));
757
713
packet->append(buff.c_str(), buff.length());
759
715
table->file->append_create_info(packet);
760
if (share->comment.length)
716
if (share->hasComment() && share->getCommentLength())
762
718
packet->append(STRING_WITH_LEN(" COMMENT="));
763
append_unescaped(packet, share->comment.str, share->comment.length);
719
append_unescaped(packet, share->getComment(),
720
share->getCommentLength());
765
722
if (share->connect_string.length)