diff options
author | Monty <monty@mariadb.org> | 2017-06-03 16:08:23 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-06-03 16:08:23 +0300 |
commit | 36ae8846ca86bc82900f8c1b2bbad2666a3e9945 (patch) | |
tree | db4b5b9b6d611410d8751673a8e737c235b94c39 /sql/sql_sequence.cc | |
parent | 3356e42d01dbef2bfa9a02ec08c7756760385e1e (diff) | |
download | mariadb-git-36ae8846ca86bc82900f8c1b2bbad2666a3e9945.tar.gz |
Fixed sequences based on comments from Peter Gulutzan and Andrii Nikitin
- Changed names of SEQUENCE table columns to be more close to ANSI
- Fixed error message for SHOW SEQUENCE non_existing_sequence
- Allow syntax CACHE +1
- Fixed ALTER TABLE for TEMPORARY sequences.
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r-- | sql/sql_sequence.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 35792bfe72e..be360c59e34 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -47,18 +47,19 @@ struct Field_definition static Field_definition sequence_structure[]= { - {"next_value", 21, &type_handler_longlong, {STRING_WITH_LEN("next not cached value")}, - FL}, - {"min_value", 21, &type_handler_longlong, {STRING_WITH_LEN("min value")}, FL}, - {"max_value", 21, &type_handler_longlong, {STRING_WITH_LEN("max value")}, FL}, - {"start", 21, &type_handler_longlong, {STRING_WITH_LEN("start value")}, FL}, + {"next_not_cached_value", 21, &type_handler_longlong, + {STRING_WITH_LEN("")}, FL}, + {"minimum_value", 21, &type_handler_longlong, STRING_WITH_LEN(""), FL}, + {"maximum_value", 21, &type_handler_longlong, STRING_WITH_LEN(""), FL}, + {"start_value", 21, &type_handler_longlong, {STRING_WITH_LEN("start value when sequences is created or value if RESTART is used")}, FL}, {"increment", 21, &type_handler_longlong, {C_STRING_WITH_LEN("increment value")}, FL}, - {"cache", 21, &type_handler_longlong, {STRING_WITH_LEN("cache size")}, FL}, - {"cycle", 1, &type_handler_tiny, {STRING_WITH_LEN("cycle state")}, + {"cache_size", 21, &type_handler_longlong, STRING_WITH_LEN(""), + FL | UNSIGNED_FLAG}, + {"cycle_option", 1, &type_handler_tiny, {STRING_WITH_LEN("0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed")}, FL | UNSIGNED_FLAG }, - {"round", 21, &type_handler_longlong, - {STRING_WITH_LEN("How many cycles has been done")}, FL}, + {"cycle_count", 21, &type_handler_longlong, + {STRING_WITH_LEN("How many cycles have been done")}, FL}, {NULL, 0, &type_handler_longlong, {STRING_WITH_LEN("")}, 0} }; @@ -458,9 +459,12 @@ int SEQUENCE::read_initial_values(TABLE *table_arg) DBUG_RETURN(error); } + /* - Read data from sequence table and update values - Done when table is opened + Do the actiual reading of data from sequence table and + update values in the sequence object. + + Called once from when table is opened */ int SEQUENCE::read_stored_values() |