mariadb/mysql-test/suite
Tony Chen 6d35506647 MDEV-7381 Implement reversed executable comments
Add support for reversed executable comments using /*!!version */ and
/*M!!version */ syntax. These execute the comment body only when the
server version is strictly less than the specified version, which is
the inverse of the existing /*!version */ syntax.

This enables writing portable SQL that uses newer syntax on new servers
while falling back to older syntax on older servers, e.g.:

  CREATE /*!100000 OR REPLACE */ TABLE /*!!100000 IF NOT EXISTS */ t1 ...

On MariaDB >= 10.0 this expands to CREATE OR REPLACE TABLE t1, while
on older versions it expands to CREATE TABLE IF NOT EXISTS t1.

Implementation: in lex_one_token(), after detecting a versioned comment
(/*! or /*M!), check for an additional '!' character. If present, invert
the version comparison so the comment body is expanded only when
MYSQL_VERSION_ID < version.

Tests added to main.comments and plugins.server_audit confirming:
- Reversed comments with version <= server version do not execute
- Reversed comments with version > server version execute
- MariaDB-specific /*M!! variant works correctly
- Reversed comments without a version number always execute
- Audit plugin correctly logs executed reversed comments
- Combined forward + reversed comments in a single statement

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2026-03-03 14:10:03 +02:00
..
archive
atomic
binlog MDEV-33830 Support for cursors on prepared statements 2026-02-09 15:28:24 +04:00
binlog_encryption MDEV-32570 (test): Add tests 2026-01-27 12:59:23 -07:00
binlog_in_engine MDEV-37530 fixes 2026-02-07 22:06:40 +01:00
client
compat MDEV-19683 Add support for Oracle TO_DATE() 2026-02-10 00:03:02 +01:00
csv
encryption parsing of table/index/field attributes: auto-alias all boolean values 2026-02-06 17:46:52 +01:00
engines 13.0 deprecations 2026-02-16 21:55:18 +01:00
events Fixed failure in buildbot for events_stress 2026-02-04 16:23:33 +02:00
federated fix printing of per-partition engine options 2026-02-06 17:46:52 +01:00
funcs_1 13.0 deprecations 2026-02-16 21:55:18 +01:00
funcs_2
galera 13.0 deprecations 2026-02-16 21:55:18 +01:00
galera_3nodes Binlog-in-engine: New binlog implementation integrated in InnoDB 2026-01-23 03:21:03 +01:00
galera_3nodes_sr
galera_sr Merge branch '11.8' into 12.2 2026-01-08 12:02:45 +01:00
gcol 13.0 deprecations 2026-02-16 21:55:18 +01:00
handler
heap
innodb 13.0 deprecations 2026-02-16 21:55:18 +01:00
innodb_fts Merge branch '12.2' into 12.3 2026-02-07 22:12:32 +01:00
innodb_gis 13.0 deprecations 2026-02-16 21:55:18 +01:00
innodb_i_s
innodb_zip MDEV-37138: Innochecksum fails to handle doublewrite buffer and 2025-11-11 13:43:43 +05:30
jp
json Merge branch 'bb-11.8-release' into bb-12.1-release 2025-11-05 08:58:12 +01:00
large_tests
maria Merge branch '11.8' into 12.2 2026-02-03 14:53:15 +01:00
mariabackup Merge branch '11.8' into 12.2 2026-02-03 14:53:15 +01:00
merge Merge branch 'bb-11.8-release' into bb-12.1-release 2025-11-05 08:58:12 +01:00
mtr/t
mtr2
multi_source MDEV-15327 Reset Master_Server_Id on CHANGE MASTER and RESET SLAVE 2026-02-24 20:42:31 +02:00
optimizer_unfixed_bugs
parts Merge branch '12.2' into 12.3 2026-02-07 22:12:32 +01:00
perfschema Merge branch '12.2' into 12.3 2026-02-07 22:12:32 +01:00
perfschema_stress
period Merge branch '11.8' into bb-12.1-release 2025-10-08 09:05:38 +02:00
plugins MDEV-7381 Implement reversed executable comments 2026-03-03 14:10:03 +02:00
roles
rpl MDEV-15327 Reset Master_Server_Id on CHANGE MASTER and RESET SLAVE 2026-02-24 20:42:31 +02:00
s3 Merge branch '12.2' into 12.3 2026-02-07 22:12:32 +01:00
sql_sequence Merge branch '11.8' into 12.2 2026-02-03 14:53:15 +01:00
storage_engine 13.0 deprecations 2026-02-16 21:55:18 +01:00
stress
sys_vars 13.0 deprecations 2026-02-16 21:55:18 +01:00
sysschema Merge branch '12.2' into 12.3 2026-02-07 22:12:32 +01:00
unit
vcol MDEV-37422: SIGSEGV / Assert for vcol substitution in GROUP BY WITH ROLLUP 2025-11-13 16:45:36 +01:00
versioning Merge branch '11.8' into 12.2 2026-02-03 14:53:15 +01:00
wsrep Merge branch '11.8' into 12.2 2026-01-08 12:02:45 +01:00