summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence
Commit message (Collapse)AuthorAgeFilesLines
...
* | MDEV 13679 Enabled sequences to be used in DEFAULTMonty2017-12-226-0/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other changes done to get this to work: - Added 'internal_tables' to TABLE object to list which sequence tables is needed to use the table. - Mark any expression using DEFAULT() with LEX->default_used. This is needed when deciding if we should open internal sequence tables when a table is opened (we don't need to open sequence tables if the main table is only used with SELECT). - Create_and_open_temporary_table() can now also open all internal sequence tables. - Added option MYSQL_LOCK_USE_MALLOC to mysql_lock_tables() to force memory allocation to be used with malloc instead of memroot. - Added flag to MYSQL_LOCK to remember if allocation was done with malloc or memroot (makes code simpler and safer). - init_one_table_for_prelocking() now takes argument for what lock to use instead of it's a routine or something else. - Renamed prelocking placeholders to make them more understandable as they are now used in more code. - Changed test in check_lock_and_start_stmt() if found table has correct locks. The old test didn't work for tables that has lock TL_WRITE_ALLOW_WRITE, which is what sequence tables are using. - Added VCOL_NOT_VIRTUAL option to ensure that sequence functions can't be used with virtual columns - More sequence tests
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-12-122-8/+8
|\ \ | |/
| * Merge 10.2 into bb-10.2-extMarko Mäkelä2017-12-122-8/+8
| |
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-302-8/+8
|\ \ | |/
| * Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-202-8/+8
| |
* | Tests: dependency on wsrep removed from sql_sequence testsAleksey Midenkov2017-11-164-15/+12
| | | | | | | | | | Affected tests: sql_sequence.gtid sql_sequence.replication
* | (Part#2) MDEV-13049 Querying INFORMATION_SCHEMA becomes slow in MariaDB 10.1Alexander Barkov2017-10-312-2/+2
| | | | | | | | | | | | | | This is a 10.3 specific part of MDEV-13049. It disables automatic sorting for "SELECT .. FROM INFORMATION_SCHEMA.{SCHEMATA|TABLES}" and adjusts the affected tests accordingly.
* | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-308-0/+483
|\ \ | |/ | | | | TODO: enable MDEV-13049 optimization for 10.3
| * MDEV-13720 Server crashes in SEQUENCE::write_lock for temporary tablesAleksey Midenkov2017-10-222-0/+16
| | | | | | | | | | | | | | | | This happens when doing NEXT VALUE for a temporary table Fixed by giving ER_NOT_SEQUENCE when trying to use normal temporary table with sequence functions Signed-off-by: Monty <monty@mariadb.org>
| * MDEV-13721 Assertion is_lock_owner() failed in mysql_rm_table_no_locksAleksey Midenkov2017-10-222-0/+92
| | | | | | | | | | | | | | | | | | This happened when trying to do delete a sequence hidden by a temporary table. Fixed by ignoring non-sequence temporary tables when trying to drop sequences. Signed-off-by: Monty <monty@mariadb.org>
| * MDEV-13711 Assertion failure on CREATE TABLE .. LIKE <sequence>Aleksey Midenkov2017-10-222-0/+31
| | | | | | | | | | | | | | | | | | | | Fixes two issues: - Update assert in open_and_process_tables to handle sequences - Removed not needed and conflicting mdl_context.release_transactional_locks in sql_sequence.cc. The MDL lock is released at end of mysql_execute_command(). Signed-off-by: Monty <monty@mariadb.org>
| * MDEV-13714 Value of SEQUENCE table option is ignored upon creationAleksey Midenkov2017-10-222-0/+86
| | | | | | | | | | | | | | CREATE TABLE ... sequence=0 and sequence=DEFAULT created sequence tables when they should not. Signed-off-by: Monty <monty@mariadb.org>
| * MDEV-13715 Server crashes in ha_partition::engine_nameAleksey Midenkov2017-10-222-0/+18
| | | | | | | | | | | | | | This happened when trying to PARTITION a SEQUENCE table Problem was that wrong function was used to get engine name Signed-off-by: Monty <monty@mariadb.org>
| * MDEV-14092 NEXTVAL fails on slaveMichael Widenius2017-10-192-0/+240
| | | | | | | | | | | | The problem was that the code in replication didn't distinguish between a setval() failing because the stored sequence number was bigger than the current (should have been ignored) and a failure from the storage engine.
* | fixes for --embeddedmariadb-10.3.2Sergei Golubchik2017-10-064-72/+75
| |
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-212-8/+8
|\ \ | |/
| * After-merge fix: Adjust some results.Marko Mäkelä2017-09-212-8/+8
| |
* | MDEV-13732 User with SELECT privilege can ALTER sequenceMonty2017-09-082-0/+72
| | | | | | | | Bug in privilege checking of sequences. Test case added.
* | Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2017-08-261-1/+1
|\ \ | |/
| * MDEV-13545 sql_sequence.gtid fails in buildbotSergei Golubchik2017-08-252-0/+5
| |
* | Fixed sequence.gtidMonty2017-08-242-0/+7
| |
* | MDEV-13014 Typos in ER_WRONG_INSERT_INTO_SEQUENCEElena Stepanova2017-08-141-2/+2
|/
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-08-072-8/+8
| | | | | | | | | | | Conflicts: mysql-test/r/func_json.result mysql-test/r/win.result mysql-test/t/func_json.test mysql-test/t/win.test sql/share/errmsg-utf8.txt storage/rocksdb/ha_rocksdb.cc storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result
* MDEV-13020 Server crashes in Item_func_nextval::val_int...Monty2017-07-062-0/+55
| | | | | The problem was that we didn't check on open of sequence if the table is a view, which is not allowed. We are now generating a proper error message for this case.
* Merge 10.2 into bb-10.2-ext; also, fix MDEV-13015 After restart, InnoDB ↵Marko Mäkelä2017-06-152-6/+23
| | | | | | | | wrongly thinks that a SEQUENCE is a TABLE sql_sequence.read_only: Show that the sequence can be read in both read-only and read-write mode, and that the sequence remains accessible after a server restart.
* Re-record failing SEQUENCE testsMarko Mäkelä2017-06-141-0/+14
|
* Fixed sequences based on comments from Peter Gulutzan and Andrii NikitinMonty2017-06-0320-667/+709
| | | | | | | - 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.
* Improved warning "xxx is not BASE TABLE/SEQUENCE"Monty2017-06-022-2/+2
| | | | | - Changed warning to "'%-.192s.%-.192s' is not of type '%s'" to make the english a bit more correct
* MDEV-12930 Testing SEQUENCE objectMonty2017-05-305-2/+150
| | | | | | | | | Fixed the following things from the above MDEV: - Ensure the user has INSERT privilege when generating new sequence values with NEXT VALUE FOR or SETVAL() - Fixed bug in InnoDB when generating several sequence values in one statement - Ensure that read_set is up to date before calling ha_sequence::ha_write_row() - This is only a potential bug with storage engines that trusts the column maps completely
* More tests for SEQUENCE'sMonty2017-05-244-0/+112
| | | | | | | - Test with LOCK TABLES - Test mysqldump - Don't update rows for sequence tables if values doesn't change. This is needed as InnoDB gives an error for updates where values doesn't change.
* Fixed failing test sql_sequence.replicationMonty2017-05-242-0/+5
|
* Make SEQUENCE working with replicationMonty2017-05-2315-712/+1123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Old sequence code forced row based replication for any statements that refered to a sequence table. What is new is that row based replication is now sequence aware: - NEXT VALUE is now generating a short row based event with only next_value and round being replicated. - Short row based events are now on the slave updated as trough SET_VALUE(sequence_name) - Full row based events are on the slave updated with a full insert, which is practically same as ALTER SEQUENCE. - INSERT on a SEQUENCE table does now a EXCLUSIVE LOCK to ensure that it is logged in binary log before any following NEXT VALUE calls. - Enable all sequence tests and fixed found bugs - ALTER SEQUENCE doesn't anymore allow changes that makes the next_value outside of allowed range - SEQUENCE changes are done with TL_WRITE_ALLOW_WRITE. Because of this one can generate a statement for MyISAM with both TL_WRITE_CONCURRENT_INSERT and TL_WRITE_ALLOW_WRITE. To fix a warning I had to add an extra test in thr_lock.c for this. - Removed UPDATE of SEQUENCE (no need to support this as we have ALTER SEQUENCE, which takes the EXCLUSIVE lock properly. - Removed DBUG_ASSERT() in MDL_context::upgrade_shared_lock. This was removed upstream in MySQL 5.6 in 72f823de453. - Simplified test in decided_logging_format() by using sql_command_flags() - Fix that we log DROP SEQUENCE correctly. - Fixed that Aria works with SEQUENCE
* MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data ↵Alexander Barkov2017-05-204-0/+50
| | | | type for INT functions
* Fixed buildbot failures with --embedded-serverMichael Widenius2017-05-131-0/+1
| | | | This push just fixes tests, nothing wrong in server
* MDEV-10139 Support for SEQUENCE objectsMonty2017-05-088-1/+765
| | | | | | | | | | - SETVAL(sequence_name, next_value, is_used, round) - ALTER SEQUENCE, including RESTART WITH Other things: - Added handler::extra() option HA_EXTRA_PREPARE_FOR_ALTER_TABLE to signal ha_sequence() that it should allow write_row statments. - ALTER ONLINE TABLE now works with SEQUENCE:s
* Fixed crash with SEQUENCE when using REPAIRMonty2017-05-082-0/+71
|
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-05-051-7/+7
|
* Fixed that sql_sequence.binlog failed sporadically.Alexander Barkov2017-04-072-26/+21
|
* MDEV-10139 Support for SEQUENCE objectsMonty2017-04-0717-0/+4901
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.