summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2020-10-293-28/+16
|\
| * MDEV-24018: SIGSEGV in Item_func_nextval::update_table on SELECT SETVALAnel Husakovic2020-10-272-0/+12
| | | | | | | | Reviewed-by: wlad@mariadb.com
| * MDEV-21786 mysqldump will forget sequence definition details on --no-data dumpAnel Husakovic2020-10-231-28/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Original patch was contributed by Jani Tolonen <jani.k.tolonen@gmail.com> https://github.com/an3l/server/commits/bb-10.3-anel-MDEV-21786-dump-sequence which distinguishes data structure (linked list) of sequences from tables. - Added standard sql output to prevent future changes of sequences and disabled locks for sequences. - Added test case for `MDEV-20070: mysqldump won't work correct on sequences` where table column depends on sequence value. - Restore sequence last value in the following way: - Find `next_not_cached_value` and use it to `setval()` - We just need for logical restore, so don't execute `setval()` - `setval()` should be showed also in case of `--no-data` option. Reviewed-by: daniel@mariadb.org
* | Merge branch '10.3' into 10.4Sujatha2020-09-282-0/+19
|\ \ | |/
| * MDEV-23823 Crash in SELECT NEXT VALUE on locked viewVladislav Vaintroub2020-09-282-0/+19
| | | | | | | | | | Make open_table() fail if sequence should be opened, but it turns out to be locked view.
* | Merge 10.3 into 10.4Marko Mäkelä2020-07-212-0/+32
|\ \ | |/
| * MDEV-16929 Assertion ... in close_thread_tables upon killing connectionMonty2020-07-212-0/+32
| | | | | | | | | | Problem was that the code didn't handle a transaction created in innodb as part of a failed mysql_lock_tables()
* | Merge 10.3 into 10.4Marko Mäkelä2020-06-084-0/+108
|\ \ | |/
| * Don't allow ALTER TABLE ... ORDER BY on SEQUENCE objectsMonty2020-06-072-0/+18
| | | | | | | | | | MDEV-19320 Sequence gets corrupted and produces ER_KEY_NOT_FOUND (Can't find record) after ALTER .. ORDER BY
| * Don't allow illegal create options for SEQUENCEMonty2020-06-074-0/+90
| | | | | | | | | | MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X' failed in lock_rec_lock
* | Merge 10.3 into 10.4Marko Mäkelä2020-04-271-0/+1
|\ \ | |/
| * Flag a result dependency on PLUGIN_PERFSCHEMAMarko Mäkelä2020-04-271-0/+1
| |
* | Merge 10.3 into 10.4Marko Mäkelä2020-04-161-1/+1
|\ \ | |/ | | | | | | | | | | In main.index_merge_myisam we remove the test that was added in commit a2d24def8cc42d27c72d833abfb39ef24a2b96ba because it duplicates the test case that was added in commit 5af12e463549e4bbc2ce6ab720d78937d5e5db4e.
| * Merge 10.2 into 10.3Marko Mäkelä2020-04-151-1/+1
| |
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-094-0/+202
|\ \ | |/
| * Merge pull request #1261 from robertbindar/mdev-17978Robert Bindar2019-12-052-0/+21
| | | | | | MDEV-17978 Server crash in SHOW CREATE SEQUENCE on a broken view
| * Re-record sql_sequence.rebuild with sorted_resultVicențiu Ciorbaru2019-12-032-110/+112
| |
| * MDEV-15977 Assertion !thd->in_sub_stmt failed in trans_commit_stmtRobert Bindar2019-12-022-0/+179
| |
* | Merge 10.3 into 10.4Marko Mäkelä2019-11-012-0/+227
|\ \ | |/
| * MDEV-20074: Lost connection on update triggerOleksandr Byelkin2019-10-172-0/+227
| | | | | | | | | | Instead of checking lex->sql_command which does not corect in case of triggers mark tables for insert.
* | Write information about restart in .resultMichael Widenius2019-04-011-0/+2
|/ | | | Idea comes from MySQL which does something similar
* MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1Monty2018-10-292-0/+20
| | | | | | | Fixed by adding table flag HA_WANTS_PRIMARY_KEY, which is like HA_REQUIRE_PRIMARY_KEY but tells SQL upper layer that the storage engine internally can handle tables without primary keys (for example for sequences or trough user variables)
* Sequences with negative numbers and auto_increment_increment crashesMonty2018-08-304-0/+86
| | | | | | | This also fixes MDEV-16313 Assertion `next_free_value % real_increment == offset' fails upon CREATE SEQUENCE in galera cluster Fixed by adding llabs() to assert. Also adjusted auto_increment_offset to mod auto_increment_increment.
* MDEV-16234 CREATE TABLE .. SELECT LASTVAL breaks replicationMonty2018-05-222-0/+62
| | | | Fixed by marking NEXTVAL() and LASTVAL() to be replicated row based
* MDEV-15970 Crash when doing truncate on locked sequenceMichael Widenius2018-05-142-1/+17
| | | | | | | | | Problem was that we used table->s->db_type() for accessing handlerton of opened file instead of table->file->ht Other bug fixed: - Ensure that we set error if reopen_tables() fails (This was the cause of assert)
* sql_sequence.debug_sync fails upon server startupElena Stepanova2018-05-091-1/+1
| | | | | Debug command-line option should be loose, otherwise the test fails before it has a chance to be skipped
* Added test case for MDEV-13029Monty2018-05-083-0/+23
| | | | | | | | MDEV 13029 Assertion `ds_control' failed in debug_sync upon closing connection after creating temporary sequence This test doesn't fail anymore. Adding it to ensure that the bug doesn't appear again.
* Added test case for MDEV-13007 ALTER .. ENGINE on temporary sequence may go ↵Monty2018-05-072-0/+42
| | | | | | | wrong Looks like the bug was fixed some time ago (at least I can't repeat it). I added the test case just have this case tested properly.
* MDEV-13024: Server crashes in my_store_ptr upon DELETE from sequence in ↵Oleksandr Byelkin2018-05-062-0/+36
| | | | | | multi-table format It is test only (fix was done by Monty in ha_sequence::open by allocating ref)
* Fix for MDEV-15812 Assert in SEQUENCE when forcing STATEMEMT formatMonty2018-05-062-0/+22
| | | | | The bug was the we copied the lock type to the underlying engine even when external_lock failed.
* MDEV-15106 Unexpected ER_WRONG_INSERT_INTO_SEQUENCE upon INSERT with ↵Monty2018-05-034-8/+39
| | | | | | | multiple locks on sequences Fixed by removing the check of single lock in sequence insert and let MDL code handle deadlock detection
* MDEV-15732: Assertion `next_free_value % real_increment == offset && ↵Oleksandr Byelkin2018-04-262-0/+32
| | | | | | | next_free_value >= reserved_until' failed in sequence_definition::adjust_values upon SETVAL for sequence with INCREMENT 0 there was a problem with "next_free_value >= reserved_until" condition: SEQUENCE::set_value handle next_free_value & reserved_until after adjust_values() call, so it is incorect to put assert on it in adjust_values()
* MDEV-15348 Failure to load CREATE SEQUENCE...ROW_FORMAT=REDUNDANTMarko Mäkelä2018-04-072-0/+7
| | | | | | | | | dict_sys_tables_type_valid(): Do not reject NO_ROLLBACK (sequence) in ROW_FORMAT=REDUNDANT. dict_load_table_low(): When flagging an error, assign *table = NULL. Failure to do so could cause a crash if an error was flagged when accessing INFORMATION_SCHEMA.INNODB_SYS_TABLES.
* Added test case for MDEV-15742 to prove that it worksMichael Widenius2018-04-062-0/+26
| | | | | MDEV-15742 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed in handler::ha_write_row
* MDEV-14762 Server crashes in MDL_ticket::has_stronger_or_equal_type upon ↵Michael Widenius2018-04-052-0/+16
| | | | | | inserting into temporary sequence Fix is to not upgrade MDL locks for temporary tables
* Fix for MDEV-14831Monty2018-04-022-0/+43
| | | | | | | | | | | | | | | | MDEV-14831 CREATE OR REPLACE SEQUENCE under LOCK TABLE corrupts the sequence, causes ER_KEY_NOT_FOUND The problem was that sequence_insert didn't properly handle the case where there where there was a LOCK TABLE while creating the sequence. Fixed by opening the sequence table, for inserting the first record, in a new environment without any other open tables. Found also a bug in Locked_tables_list::reopen_tables() where the lock structure for the new tables was allocated in THD::mem_root, which causes crashes. This could cause problems with other create tables done under LOCK TABLES.
* MDEV-15149 Assert upon concurrent creating / querying sequencesMonty2018-03-292-0/+27
| | | | | | | | | | MDEV-15117 Server crashes in in open_and_process_table or ASAN heap-use-after-free in is_temporary_table upon creating/flushing sequences. Problem was that sequence_insert closed and reopened the like table without proper locking. Fixed by ensuring that the like table is not reopened in sequence_insert
* MDEV-15149 Assert upon concurrent creating / querying sequencesMonty2018-03-292-0/+64
| | | | | | Problem was that sequence_insert closed and reopened the like table without proper locking. Fixed by ensuring that the like table is not reopened in sequence_insert
* Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-195-0/+35
|\
| * Fix for MDEV-15105 (memory loss with LOCK sequence)Monty2018-02-192-0/+12
| | | | | | | | | | MDEV 15105 "Bytes lost and Assertion `global_status_var.global_memory_used == 0' fails on shutdown after attempts to LOCK/RENAME sequence"
| * Test case for MDEV-12887 (bug fixed long ago)Monty2018-02-192-0/+19
| | | | | | | | | | MDEV-12887 UT_LIST_GET_LEN(trx->lock.trx_locks) == 0 when mysqldump sequence
| * Don't run sql_sequence.grant for embeddes serverMonty2018-02-161-0/+4
| |
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-154-2/+145
|\ \ | |/
| * Crash when giving error message for ALTER SEQUENCEMonty2018-02-152-0/+20
| | | | | | | | | | Fixes MDEV-14761 "Assertion `!mysql_parse_status || thd->is_error() || thd->get_internal_handler()' failed in parse_sql"
| * Fix privilege checking for sequenceMonty2018-02-142-0/+123
| | | | | | | | MDEV-13732 User with SELECT privilege can ALTER sequence
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-062-0/+15
|\ \ | |/
| * MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANTMarko Mäkelä2018-02-062-0/+15
| | | | | | | | dict_tf_is_valid(): Allow no-rollback tables in ROW_FORMAT=REDUNDANT.
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-112-0/+2
|\ \ | |/
| * MDEV-14824 Assertion `!trx_is_started(trx)' failed in ↵Marko Mäkelä2018-01-112-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innobase_start_trx_and_assign_read_view In CREATE SEQUENCE or CREATE TEMPORARY SEQUENCE, we should not start an InnoDB transaction for inserting the sequence status record into the underlying no-rollback table. Because we did this, a debug assertion failure would fail in START TRANSACTION WITH CONSISTENT SNAPSHOT after CREATE TEMPORARY SEQUENCE was executed. row_ins_step(): Do not start the transaction. Let the caller do that. que_thr_step(): Start the transaction before calling row_ins_step(). row_ins_clust_index_entry(): Skip locking and undo logging for no-rollback tables, even for temporary no-rollback tables. row_ins_index_entry(): Allow trx->id==0 for no-rollback tables. row_insert_for_mysql(): Do not start a transaction for no-rollback tables.
* | Fixed that sequences and default works with ps-protocolMonty2018-01-032-0/+30
| | | | | | | | | | The bug was that for prepared statments the new TABLE_LIST was allocated in the wrong arena.