mariadb/mysql-test/suite/plugins/r
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
..
audit_null.result MariaDB 11.4.4 release 2024-11-08 07:17:00 +01:00
audit_null_debug.result MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1 2023-08-02 14:45:31 +02:00
auth_ed25519.result Merge branch '11.4' into 11.8 2026-01-31 14:08:54 +01:00
auth_v0100.result cleanup: disconnect before DROP USER 2025-07-16 09:14:33 +07:00
binlog-simple_plugin_check.result MDEV-26647 (plugin name) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy 2022-07-27 15:23:39 +02:00
compression,innodb-lz4.rdiff MDEV-33421 innodb.corrupted_during_recovery fails due to error that the table is corrupted 2024-02-08 14:20:42 +02:00
compression,innodb-lzma.rdiff MDEV-33421 innodb.corrupted_during_recovery fails due to error that the table is corrupted 2024-02-08 14:20:42 +02:00
compression,innodb-lzo.rdiff MDEV-33421 innodb.corrupted_during_recovery fails due to error that the table is corrupted 2024-02-08 14:20:42 +02:00
compression,innodb-snappy.rdiff MDEV-33421 innodb.corrupted_during_recovery fails due to error that the table is corrupted 2024-02-08 14:20:42 +02:00
compression,mroonga-lz4.rdiff MDEV-34830: LSN in the future is not being treated as serious corruption 2024-10-18 10:12:47 +03:00
compression.result MDEV-34830: LSN in the future is not being treated as serious corruption 2024-10-18 10:12:47 +03:00
compression_load.result MDEV-26774 Compression provider unloading at runtime has no effect but doesn't produce a warning 2021-10-27 15:55:14 +02:00
cracklib_password_check.result Merge branch '10.6' into 10.7 2022-08-08 17:12:32 +02:00
dialog.result Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
false_dupes-6543.result
feedback_plugin_install.result Update feedback plugin URL to use feedback.mariadb.org subdomain 2023-03-20 18:15:17 +02:00
feedback_plugin_load.result MDEV-25829 Change default Unicode collation to uca1400_ai_ci 2024-05-24 15:50:05 +04:00
feedback_plugin_send.result Re-recording MTR_FEEDBACK_PLUGIN=1 mtr plugins.feedback_plugin_send results 2024-05-28 07:27:30 +04:00
fulltext_notembedded.result MDEV-35050 fix for embedded 2024-10-03 10:09:24 +02:00
fulltext_plugin.result Merge branch '11.6' into 11.7 2024-11-10 19:22:21 +01:00
locales.result MDEV-31530 Localizations for Swahili language 2023-07-04 13:02:49 +10:00
max_password_errors_auth_named_pipe.result
max_password_errors_auth_socket.result
mdev38431.result MDEV-38431: fix database pointer calculation for long passwords 2026-01-14 19:34:33 +01:00
multiauth.result Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
pam.result Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
pam_cleartext.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
pam_v1.result Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
parsec.result MDEV-34854 Parsec sends garbage when using an empty password 2024-11-08 07:17:44 +01:00
password_reuse_check.result Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
processlist.result
qc_info.result MDEV-24487 Error after update to 10.5.8 on CentOS-8: DBD::mysql::st execute failed: Unknown MySQL error 2022-01-27 15:54:20 +04:00
qc_info_priv.result cleanup: disconnect before DROP USER 2025-07-16 09:14:33 +07:00
rpl_auth.result Two problems with auth_parsec.so 2024-08-12 10:32:03 +02:00
server_audit.result MDEV-7381 Implement reversed executable comments 2026-03-03 14:10:03 +02:00
server_audit_buffering.result MDEV-37160 When >=2 clients are in use, the server_audit_file_buffer_size setting is not honored 2025-08-02 15:24:34 +02:00
server_audit_pwd_mask.result Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
server_audit_query_id.result Reproducible test case for MDEV-37434 2025-09-18 18:01:33 +02:00
show_all_plugins.result MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
simple_password_check.result 13.0 deprecations 2026-02-16 21:55:18 +01:00
sql_error_log.result Merge branch '10.6' into 10.11 2024-02-01 18:36:14 +01:00
sql_error_log_withdbinfo.result Merge branch '10.6' into 10.11 2024-02-01 18:36:14 +01:00
test_sql_service.result Merge branch '10.6' into 10.11 2023-12-18 11:19:04 +01:00
thread_pool_server_audit.result Merge branch '11.8' into 12.2 2026-01-08 12:02:45 +01:00
two_password_validations.result MDEV-26647 (simple_password_check) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy 2022-07-27 16:04:20 +02:00
unix_socket.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
unix_socket_osuser_match_auth_string.result Extend Unix socket authentication to support authentication_string 2024-08-05 10:51:49 +01:00