Repository navigation
fix(linux-safe-mode): run MySQL executable comments and read them as each server does - #3790
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/*!,/*!NNNNN,/*M!) are code to the script lexer, up to the first*/outside a string, a quoted name or a line comment, as the server reads them./*!40101 ... */;line of a dump is a statement of its own, a/*!50100 PARTITION BY ... */stays with itsCREATE TABLE, and a dumped trigger underDELIMITER ;;is one statement.*/past one nested/* */. MySQL reads/*M!as a plain comment, MariaDB skips/*!50700to/*!99999, Galera runs/*!99997.$tag$quotes, soCREATE PROCEDURE p() LANGUAGE JAVASCRIPT AS $$ /* $$; DROP TABLE t; -- */is destructive.DELIMITERline as SQL, since the server never reads it as a directive."as a name (ANSI_QUOTES), and[name]as a name (MariaDB's MSSQL mode).DELIMITERline cuts it into, since the driver splits an editor statement again./*!comment no longer makes a statement a write by itself:SELECT /*!40001 SQL_NO_CACHE */ * FROM treads again under Read-Only and in an export./*!comment as code, and Format SQL leaves a statement as typed when formatting would change the text of one.statement_access::tests::a_mysql_conditional_comment_is_read_as_codenow expectsSELECT 1 /*M!100000 , 2 */to read.Test plan
main:statement_access::tests::an_executable_comment_ends_where_the_server_ends_itanda_skipped_executable_comment_ends_where_the_server_ends_it(Write instead of Destructive).server_reading(version digits per server, Galera), the dollar quote,DELIMITERline, sql_mode quoting and Galera cases instatement_access,a_credential_any_server_reading_runs_is_withheld, thescript_corpusMySQL cases,safe_mode_gate::a_mysql_executable_comment_is_sent_and_read_as_the_server_reads_it,catalog_change::ddl_only_some_mysql_server_versions_run_counts,completion_scope::a_mysql_executable_comment_is_codeandsignificant_tokens::a_mysql_executable_comment_must_stay_as_written.flavour_suite::a_dump_runs_its_executable_commentsruns a dump split as the editor splits it on MySQL 8.0 and MariaDB 10.11.Fixes #3783