mariadb/mysys
Monty 17a87d6063 MDEV-10139 Support for SEQUENCE objects
Working features:
CREATE OR REPLACE [TEMPORARY] SEQUENCE [IF NOT EXISTS] name
    [ INCREMENT [ BY | = ] increment ]
    [ MINVALUE [=] minvalue | NO MINVALUE ]
    [ MAXVALUE [=] maxvalue | NO MAXVALUE ]
    [ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ]
    ENGINE=xxx COMMENT=".."
SELECT NEXT VALUE FOR sequence_name;
SELECT NEXTVAL(sequence_name);
SELECT PREVIOUS VALUE FOR sequence_name;
SELECT LASTVAL(sequence_name);

SHOW CREATE SEQUENCE sequence_name;
SHOW CREATE TABLE sequence_name;
CREATE TABLE sequence-structure ... SEQUENCE=1
ALTER TABLE sequence RENAME TO sequence2;
RENAME TABLE sequence TO sequence2;
DROP [TEMPORARY] SEQUENCE  [IF EXISTS] sequence_names

Missing features
- SETVAL(value,sequence_name), to be used with replication.
- Check replication, including checking that sequence tables are marked
  not transactional.
- Check that a commit happens for NEXT VALUE that changes table data (may
  already work)
- ALTER SEQUENCE. ANSI SQL version of setval.
- Share identical sequence entries to not add things twice to table list.
- testing insert/delete/update/truncate/load data
- Run and fix Alibaba sequence tests (part of mysql-test/suite/sql_sequence)
- Write documentation for NEXT VALUE / PREVIOUS_VALUE
- NEXTVAL in DEFAULT
  - Ensure that NEXTVAL in DEFAULT uses database from base table
- Two NEXTVAL for same row should give same answer.
- Oracle syntax sequence_table.nextval, without any FOR or FROM.
- Sequence tables are treated as 'not read constant tables' by SELECT; Would
  be better if we would have a separate list for sequence tables so that
  select doesn't know about them, except if refereed to with FROM.

Other things done:
- Improved output for safemalloc backtrack
- frm_type_enum changed to Table_type
- Removed lex->is_view and replaced with lex->table_type. This allows
  use to more easy check if item is view, sequence or table.
- Added table flag HA_CAN_TABLES_WITHOUT_ROLLBACK, needed for handlers
  that want's to support sequences
- Added handler calls:
 - engine_name(), to simplify getting engine name for partition and sequences
 - update_first_row(), to be able to do efficient sequence implementations.
 - Made binlog_log_row() global to be able to call it from ha_sequence.cc
- Added handler variable: row_already_logged, to be able to flag that the
  changed row is already logging to replication log.
- Added CF_DB_CHANGE and CF_SCHEMA_CHANGE flags to simplify
  deny_updates_if_read_only_option()
- Added sp_add_cfetch() to avoid new conflicts in sql_yacc.yy
- Moved code for add_table_options() out from sql_show.cc::show_create_table()
- Added String::append_longlong() and used it in sql_show.cc to simplify code.
- Added extra option to dd_frm_type() and ha_table_exists to indicate if
  the table is a sequence. Needed by DROP SQUENCE to not drop a table.
2017-04-07 18:09:56 +04:00
..
array.c
base64.c
ChangeLog
charset-def.c
charset.c
checksum.c
CMakeLists.txt
errors.c
file_logger.c
get_password.c
hash.c
lf_alloc-pin.c
lf_dynarray.c
lf_hash.c
list.c
ma_dyncol.c
mf_arr_appstr.c
mf_cache.c
mf_dirname.c
mf_fn_ext.c
mf_format.c
mf_getdate.c
mf_iocache.c
mf_iocache2.c
mf_keycache.c
mf_keycaches.c
mf_loadpath.c
mf_pack.c
mf_path.c
mf_qsort.c
mf_qsort2.c
mf_radix.c
mf_same.c
mf_sort.c
mf_soundex.c
mf_tempdir.c
mf_tempfile.c
mf_unixpath.c
mf_wcomp.c
mulalloc.c
my_access.c
my_addr_resolve.c
my_alarm.c
my_alloc.c
my_atomic.c
my_atomic_writes.c
my_basename.c
my_bit.c
my_bitmap.c
my_chmod.c
my_chsize.c
my_compare.c
my_compress.c
my_conio.c
my_context.c
my_copy.c
my_create.c
my_default.c
my_delete.c
my_div.c
my_dlerror.c
my_error.c
my_file.c
my_fopen.c
my_fstream.c
my_gethwaddr.c
my_getncpus.c
my_getopt.c
my_getpagesize.c
my_getsystime.c
my_getwd.c
my_init.c
my_largepage.c
my_lib.c
my_libwrap.c
my_lock.c
my_lockmem.c
my_malloc.c
my_memmem.c
my_mess.c
my_mkdir.c
my_mmap.c
my_new.cc
my_once.c
my_open.c
my_port.c
my_pread.c
my_pthread.c
my_quick.c
my_rdtsc.c
my_read.c
my_redel.c
my_rename.c
my_rnd.c
my_safehash.c
my_safehash.h
my_seek.c
my_setuser.c
my_sleep.c
my_static.c
my_static.h
my_symlink.c
my_symlink2.c
my_sync.c
my_thr_init.c
my_timer_cycles.il
my_uuid.c
my_wincond.c
my_windac.c
my_winerr.c
my_winfile.c
my_winthread.c
my_write.c
mysys_priv.h
psi_noop.c
ptr_cmp.c
queues.c
safemalloc.c
stacktrace.c
string.c
test_charset.c
test_dir.c
test_thr_mutex.c
test_xml.c
testhash.c
thr_alarm.c
thr_lock.c
thr_mutex.c
thr_rwlock.c
thr_timer.c
tree.c
typelib.c
waiting_threads.c
wqueue.c