diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-12-18 01:56:13 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-12-18 01:56:13 +0400 |
commit | ece71fafd61940d32c21e7a6ed179e0a29803ec0 (patch) | |
tree | 5468fa7e7c96267acebeb04daddad62a8de56c52 /sql/sql_lex.cc | |
parent | 9f4dd86c2ee02e0ec46272c9c05db1ddb26b8db6 (diff) | |
parent | fa7faa2955cf6d6c0af294c3ad6714e206ee2889 (diff) | |
download | mariadb-git-ece71fafd61940d32c21e7a6ed179e0a29803ec0.tar.gz |
Merge 10.0-base->10.0
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 2110f81dd4f..bcabf9bd150 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1523,19 +1523,14 @@ int lex_one_token(void *arg, THD *thd) lip->save_in_comment_state(); - if (lip->yyPeekn(2) == 'M' && lip->yyPeekn(3) == '!') - { - /* Skip MariaDB unique marker */ - lip->set_echo(FALSE); - lip->yySkip(); - /* The following if will be true */ - } - if (lip->yyPeekn(2) == '!') + if (lip->yyPeekn(2) == '!' || + (lip->yyPeekn(2) == 'M' && lip->yyPeekn(3) == '!')) { + bool maria_comment_syntax= lip->yyPeekn(2) == 'M'; lip->in_comment= DISCARD_COMMENT; /* Accept '/' '*' '!', but do not keep this marker. */ lip->set_echo(FALSE); - lip->yySkipn(3); + lip->yySkipn(maria_comment_syntax ? 4 : 3); /* The special comment format is very strict: @@ -1565,7 +1560,14 @@ int lex_one_token(void *arg, THD *thd) version= (ulong) my_strtoll10(lip->get_ptr(), &end_ptr, &error); - if (version <= MYSQL_VERSION_ID) + /* + MySQL-5.7 has new features and might have new SQL syntax that + MariaDB-10.0 does not understand. Ignore all versioned comments + with MySQL versions in the range 50700–999999, but + do not ignore MariaDB specific comments for the same versions. + */ + if (version <= MYSQL_VERSION_ID && + (version < 50700 || version > 999999 || maria_comment_syntax)) { /* Accept 'M' 'm' 'm' 'd' 'd' */ lip->yySkipn(length); |