mariadb/mysql-test/suite/sql_sequence
Sergei Golubchik c27d78beb5 MDEV-36870 Spurious unrelated permission error when selecting from table with default that uses nextval(sequence)
Lots of different cases, SELECT, SELECT DEFAULT(),
UPDATE t SET x=DEFAULT, prepares statements,
opening of a table for the I_S, prelocking (so TL_WRITE),
insert with subquery (so SQLCOM_SELECT), etc.

Don't check NEXTVAL privileges in fix_fields() anymore, it cannot
possibly handle all the cases correctly. Make a special method
Item_func_nextval::check_access() for that and invoke it from

* fix_fields on explicit SELECT NEXTVAL()
  (but not if NEXTVAL() is used in a DEFAULT clause)
* when DEFAULT bareword in used in, say, UPDATE t SET x=DEFAULT
  (but not if DEFAULT() itself is used in a DEFAULT clause)
* in CREATE TABLE
* in ALTER TABLE ALGORITHM=INPLACE (that doesn't go CREATE TABLE path)
* on INSERT

helpers
* Virtual_column_info::check_access() to walk the item tree and invoke
  Item::check_access()
* TABLE::check_sequence_privileges() to iterate default expressions
  and invoke Virtual_column_info::check_access()

also, single-table UPDATE in prepared statements now associates
value items with fields just as multi-update already did, fixes the
case of PREPARE s "UPDATE t SET x=?"; EXECUTE s USING DEFAULT.
2025-07-09 18:04:46 +02:00
..
alter.opt MDEV-36038 ALTER TABLE…SEQUENCE does not work correctly with InnoDB 2025-02-18 16:38:18 +01:00
alter.result Merge branch '10.5' into '10.6' 2025-02-27 04:02:33 +01:00
alter.test Merge branch '10.5' into '10.6' 2025-02-27 04:02:33 +01:00
alter_notembedded.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
alter_notembedded.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
aria.result MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5 2022-03-30 15:12:43 +05:30
aria.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
auto_increment.result
auto_increment.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
binlog.result Merge 10.3 into 10.4 2022-03-11 09:26:42 +02:00
binlog.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
concurrent_create.result MDEV-24545 Sequence created by one connection remains invisible to another 2021-04-27 08:44:28 +03:00
concurrent_create.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
create.result Merge branch '10.5' into 10.6 2024-10-29 14:20:03 +01:00
create.test Fixed that SHOW CREATE TABLE for sequences shows used table options 2024-10-16 17:24:46 +03:00
debug_sync.opt
debug_sync.result
debug_sync.test
default.result bugfix: nextval() in default, and UPDATE SET x=DEFAULT 2025-07-09 17:32:37 +02:00
default.test bugfix: nextval() in default, and UPDATE SET x=DEFAULT 2025-07-09 17:32:37 +02:00
disabled.def
grant.result MDEV-36870 Spurious unrelated permission error when selecting from table with default that uses nextval(sequence) 2025-07-09 18:04:46 +02:00
grant.test MDEV-36870 Spurious unrelated permission error when selecting from table with default that uses nextval(sequence) 2025-07-09 18:04:46 +02:00
gtid-master.opt
gtid-slave.opt
gtid.result MDEV-36380 User has unauthorized access to a sequence through a view with security invoker 2025-04-17 17:18:55 +02:00
gtid.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
kill.result MDEV-16929 Assertion ... in close_thread_tables upon killing connection 2020-07-21 15:12:53 +03:00
kill.test MDEV-16929 Assertion ... in close_thread_tables upon killing connection 2020-07-21 15:12:53 +03:00
lock.result
lock.test
mysqldump.result MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump) 2025-01-17 15:39:55 +04:00
mysqldump.test MDEV-21785: sequences used as default by other table not dumped in right order by mysqldump 2021-01-26 10:41:02 +01:00
next.result MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
next.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
other.result MDEV-32086 (part 2) Server crash when inserting from derived table containing insert target table 2025-04-25 15:10:36 +02:00
other.test MDEV-32086 (part 2) Server crash when inserting from derived table containing insert target table 2025-04-25 15:10:36 +02:00
partition.result
partition.test
read_only.result
read_only.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
rebuild.result Merge branch 10.3 into 10.4 2021-07-02 17:17:33 +10:00
rebuild.test Merge 10.4 into 10.5 2020-04-29 15:40:51 +03:00
rename.result
rename.test
replication-master.opt
replication-slave.opt
replication.result MDEV-36380 User has unauthorized access to a sequence through a view with security invoker 2025-04-17 17:18:55 +02:00
replication.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
replication_drop.result
replication_drop.test
replication_mixed.result
replication_mixed.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
setval.result
setval.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
slave_nextval.result
slave_nextval.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
temporary.result
temporary.test MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
view.result
view.test MDEV-36380 User has unauthorized access to a sequence through a view with security invoker 2025-04-17 17:18:55 +02:00