mirror of
https://github.com/MariaDB/server.git
synced 2026-03-10 10:28:40 +01:00
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. |
||
|---|---|---|
| .. | ||
| audit_null.result | ||
| audit_null_debug.result | ||
| auth_ed25519.result | ||
| auth_v0100.result | ||
| binlog-simple_plugin_check.result | ||
| compression,innodb-lz4.rdiff | ||
| compression,innodb-lzma.rdiff | ||
| compression,innodb-lzo.rdiff | ||
| compression,innodb-snappy.rdiff | ||
| compression,mroonga-lz4.rdiff | ||
| compression.result | ||
| compression_load.result | ||
| cracklib_password_check.result | ||
| dialog.result | ||
| false_dupes-6543.result | ||
| feedback_plugin_install.result | ||
| feedback_plugin_load.result | ||
| feedback_plugin_send.result | ||
| fulltext_notembedded.result | ||
| fulltext_plugin.result | ||
| locales.result | ||
| max_password_errors_auth_named_pipe.result | ||
| max_password_errors_auth_socket.result | ||
| mdev38431.result | ||
| multiauth.result | ||
| pam.result | ||
| pam_cleartext.result | ||
| pam_v1.result | ||
| parsec.result | ||
| password_reuse_check.result | ||
| processlist.result | ||
| qc_info.result | ||
| qc_info_priv.result | ||
| rpl_auth.result | ||
| server_audit.result | ||
| server_audit_buffering.result | ||
| server_audit_pwd_mask.result | ||
| server_audit_query_id.result | ||
| show_all_plugins.result | ||
| simple_password_check.result | ||
| sql_error_log.result | ||
| sql_error_log_withdbinfo.result | ||
| test_sql_service.result | ||
| thread_pool_server_audit.result | ||
| two_password_validations.result | ||
| unix_socket.result | ||
| unix_socket_osuser_match_auth_string.result | ||