/* Field position in sequence table for some fields we refer to directly */ #define NEXT_FIELD_NO 0 #define MIN_VALUE_FIELD_NO 1 #define ROUND_FIELD_NO 7
class sequence_definition :public Sql_alloc
{ public:
sequence_definition():
min_value_from_parser(1, false),
max_value_from_parser(LONGLONG_MAX-1, false), start_from_parser(1, false),
increment(1), cache(1000), round(0), restart_from_parser(0, false),
cycle(0), used_fields(0), /* Weusevaluetypeandis_unsignedinsteadofahandlerbecause Type_handlerisincomplete,whichwecannotinitialiseherewith &type_handler_slonglong.
*/
value_type(MYSQL_TYPE_LONGLONG), is_unsigned(false)
{}
longlong reserved_until;
longlong min_value;
longlong max_value;
longlong start;
Longlong_hybrid min_value_from_parser;
Longlong_hybrid max_value_from_parser;
Longlong_hybrid start_from_parser;
longlong increment;
longlong cache;
ulonglong round;
longlong restart; // alter sequence restart value
Longlong_hybrid restart_from_parser; bool cycle;
uint used_fields; // Which fields where used in CREATE
enum_field_types value_type; // value type of the sequence bool is_unsigned;
Type_handler const *value_type_handler(); /* max value for the value type, e.g. 32767 for smallint. */
longlong value_type_max(); /* min value for the value type, e.g. -32768 for smallint. */
longlong value_type_min(); bool check_and_adjust(THD *thd, bool set_reserved_until, bool adjust_next= true); void store_fields(TABLE *table); void read_fields(TABLE *table); int write_initial_sequence(TABLE *table); int write(TABLE *table, bool all_fields); /* This must be called after sequence data has been updated */ void adjust_values(longlong next_value);
longlong truncate_value(const Longlong_hybrid& original); inlinevoid print_dbug()
{
DBUG_PRINT("sequence", ("reserved: %lld start: %lld increment: %lld min_value: %lld max_value: %lld cache: %lld round: %lld",
reserved_until, start, increment, min_value,
max_value, cache, round));
} staticbool is_allowed_value_type(enum_field_types type); bool prepare_sequence_fields(List<Create_field> *fields, bool alter);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.