diff options
author | Monty <monty@mariadb.org> | 2017-05-30 21:31:30 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-05-30 21:31:30 +0300 |
commit | 959891662dfbb0b860f0bc70e09bc2c92dab831b (patch) | |
tree | bae0ebda5c0f26e870ea17cca6de3d92f11eae33 /sql/sql_sequence.cc | |
parent | d5d8fa6e0406b6ee1058f78ac4539eb7d0579d88 (diff) | |
download | mariadb-git-959891662dfbb0b860f0bc70e09bc2c92dab831b.tar.gz |
MDEV-12930 Testing SEQUENCE object
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
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r-- | sql/sql_sequence.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 1b591f10c9f..35792bfe72e 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -576,7 +576,7 @@ int sequence_definition::write_initial_sequence(TABLE *table) int sequence_definition::write(TABLE *table, bool all_fields) { int error; - MY_BITMAP *save_rpl_write_set, *save_write_set; + MY_BITMAP *save_rpl_write_set, *save_write_set, *save_read_set; DBUG_ASSERT(((ha_sequence*) table->file)->is_locked()); save_rpl_write_set= table->rpl_write_set; @@ -593,12 +593,16 @@ int sequence_definition::write(TABLE *table, bool all_fields) /* Update table */ save_write_set= table->write_set; - table->write_set= &table->s->all_set; + save_read_set= table->read_set; + table->read_set= table->write_set= &table->s->all_set; + table->file->column_bitmaps_signal(); store_fields(table); if ((error= table->file->ha_write_row(table->record[0]))) table->file->print_error(error, MYF(0)); table->rpl_write_set= save_rpl_write_set; + table->read_set= save_read_set; table->write_set= save_write_set; + table->file->column_bitmaps_signal(); return error; } |