Commit graph

7 commits

Author SHA1 Message Date
Monty
a9bee9884a Don't allow ALTER TABLE ... ORDER BY on SEQUENCE objects
MDEV-19320 Sequence gets corrupted and produces ER_KEY_NOT_FOUND
           (Can't find record) after ALTER .. ORDER BY
2020-06-07 16:32:00 +03:00
Monty
e6a6382f15 Don't allow illegal create options for SEQUENCE
MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S ||
           (0xFUL & mode) == LOCK_X' failed in lock_rec_lock
2020-06-07 16:32:00 +03:00
Sergei Golubchik
2d2f857fb3 fixes for --embedded 2017-10-06 12:28:56 +02:00
Monty
ef2ecf0370 MDEV-13732 User with SELECT privilege can ALTER sequence
Bug in privilege checking of sequences. Test case added.
2017-09-08 13:24:42 +03:00
Monty
36ae8846ca 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.
2017-06-03 16:08:23 +03:00
Monty
6a779a6d28 Make SEQUENCE working with replication
- 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
2017-05-23 21:12:27 +03:00
Monty
71fa413c16 MDEV-10139 Support for SEQUENCE objects
- 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
2017-05-08 02:44:55 +03:00