summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence/create.result
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-28152 Features for sequencesbb-11.0-mdev-28152Yuchen Pei2023-03-211-7/+624
| | | | | | | | | | | | | | | | | - Add `as <int_type>` to sequence creation options - int_type can be signed or unsigned integer types, including tinyint, smallint, mediumint, int and bigint - Limitation: when alter sequence as <new_int_type>, cannot have any other alter options in the same statement - Limitation: increment remains signed longlong, and the hidden constraint (cache_size x abs(increment) < longlong_max) stays for unsigned types. This means for bigint unsigned, neither abs(increment) nor (cache_size x abs(increment)) can be between longlong_max and ulonglong_max - Truncating maxvalue and minvalue from user input to the nearest max or min value of the type, plus or minus 1. When the truncation happens, a warning is emitted - Information schema table for sequences
* Merge 10.5 into 10.6Marko Mäkelä2022-09-201-3/+3
|\
| * Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2022-09-141-3/+3
| |\
| | * Merge 10.3 into 10.4Marko Mäkelä2022-09-131-3/+3
| | |\
| | | * MDEV-29446 Change SHOW CREATE TABLE to display default collationAlexander Barkov2022-09-121-3/+3
| | | |
| * | | MDEV-13005 after-merge fixupMarko Mäkelä2022-04-061-1/+1
| | | |
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-061-6/+36
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-04-061-6/+36
| |\ \ \ |/ / / / | | _ / | | /
| * | MDEV-13005: Fixing bugs in SEQUENCE, part 3, 5/5Rucha Deodhar2022-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task 6: We can find the .frm type of file. If it is sequence then is_sequence passed to dd_frm_type() will be true. Since there is already a check to give error message if we trigger is on temporary table or view, an additional condition is added to check if .frm is sequence (is_sequence==true) and error message is changed to show "Trigger's '%-.192s' is view, temporary table or sequence" instead of "Trigger's '%-.192s' is view or temporary table".
| * | MDEV-13005: Fixing bugs in SEQUENCE, part 3, 4/5Rucha Deodhar2022-03-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Task 4 and 5: Already fixed when I started working on bug. Task 4 correctly gives syntax error ('(' and ')' are not part of create sequence syntax). Task 5 also gives correct error because s1 is table not sequence. Fails with ER_NOT_SEQUENCE2
| * | MDEV-13005: Fixing bugs in SEQUENCE, part 3, 3/5Rucha Deodhar2022-03-301-0/+3
| | | | | | | | | | | | | | | Task 3: Added an additional condition for SEQUENCE option to check if cache < 0.
| * | MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5Rucha Deodhar2022-03-301-4/+7
| | | | | | | | | | | | | | | Task 2: changed the error message and made it more reusable.
| * | MDEV-13005: Fixing bugs in SEQUENCE, part 3, 1/5Rucha Deodhar2022-03-301-2/+10
| |/ | | | | | | | | | | | | | | | | Task 1: If table is added to list using option TL_OPTION_SEQUENCE (done when we have sequence functions) then then we are dealing with sequence instead of table. So global table list will have sequence set to true. This is used to check and give correct error message about unknown sequence instead of table doesn't exist.
| * MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or ↵bb-10.3-MDEV-19273Oleksandr Byelkin2020-12-091-1/+1
| | | | | | | | | | | | | | | | Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Early report error in case of DROP SEQUENCE <non-sequence> Do not use error variable for other purposes except error.
* | Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistentMonty2020-06-141-7/+6
|/ | | | | | | | | | | | | - IF EXISTS ends with a list of all not existing object, instead of a separate note for every not existing object - Produce a "Note" for all wrongly dropped objects (like trying to do DROP SEQUENCE for a normal table) - Do not write existing tables that could not be dropped to binlog Other things: MDEV-22820 Bogus "Unknown table" warnings produced upon attempt to drop parent table referenced by FK This was caused by an older version of this commit patch and later fixed
* Don't allow illegal create options for SEQUENCEMonty2020-06-071-0/+34
| | | | | MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X' failed in lock_rec_lock
* MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1Monty2018-10-291-0/+9
| | | | | | | 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)
* MDEV-15348 Failure to load CREATE SEQUENCE...ROW_FORMAT=REDUNDANTMarko Mäkelä2018-04-071-0/+3
| | | | | | | | | 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.
* MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANTMarko Mäkelä2018-02-061-0/+7
| | | | dict_tf_is_valid(): Allow no-rollback tables in ROW_FORMAT=REDUNDANT.
* MDEV-14824 Assertion `!trx_is_started(trx)' failed in ↵Marko Mäkelä2018-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* Merge 10.2 into bb-10.2-extMarko Mäkelä2017-12-121-7/+7
|
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-201-7/+7
|
* MDEV-13721 Assertion is_lock_owner() failed in mysql_rm_table_no_locksAleksey Midenkov2017-10-221-0/+62
| | | | | | | | | 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-221-0/+21
| | | | | | | | | | 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-221-0/+52
| | | | | | | CREATE TABLE ... sequence=0 and sequence=DEFAULT created sequence tables when they should not. Signed-off-by: Monty <monty@mariadb.org>
* After-merge fix: Adjust some results.Marko Mäkelä2017-09-211-7/+7
|
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-08-071-7/+7
| | | | | | | | | | | 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
* Fixed sequences based on comments from Peter Gulutzan and Andrii NikitinMonty2017-06-031-146/+147
| | | | | | | - 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-021-1/+1
| | | | | - Changed warning to "'%-.192s.%-.192s' is not of type '%s'" to make the english a bit more correct
* MDEV-10139 Support for SEQUENCE objectsMonty2017-05-081-0/+2
| | | | | | | | | | - 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
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-05-051-7/+7
|
* MDEV-10139 Support for SEQUENCE objectsMonty2017-04-071-0/+497
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.