From 282c303746d0653a927b0fcd16ecdc9b690bbb00 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 29 Aug 2011 18:14:14 +0300 Subject: Added MariaDB executable comment syntax: /*M!##### */ client/mysql.cc: Don't remove MariaDB executable comments. mysql-test/r/comments.result: Test MariaDB executable comments. mysql-test/r/mysql.result: Test MariaDB executable comments. mysql-test/t/comments.test: Test MariaDB executable comments. mysql-test/t/mysql.test: Test MariaDB executable comments. sql/sql_cache.cc: Don't delete MariaDB executable comments. sql/sql_lex.cc: Handle MariaDB executable comments --- sql/sql_cache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_cache.cc') diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index d7040a825fb..5378390ebb4 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -491,11 +491,12 @@ static void make_base_query(String *new_query, continue; // Continue with next symbol case '/': // Start of comment ? /* - Comment of format /#!number #/, must be skipped. + Comment of format /#!number #/ or /#M!number #/, must be skipped. These may include '"' and other comments, but it should be safe to parse the content as a normal string. */ - if (query[0] != '*' || query[1] == '!') + if (query[0] != '*' || query[1] == '!' || + (query[1] == 'M' && query[2] == '!')) break; query++; // skip "/" -- cgit v1.2.1