diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-09-03 12:58:41 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-09-03 12:58:41 +0200 |
commit | 530a6e74819ec14b5fdc42aa588b236ecb9f2fcd (patch) | |
tree | a4d45b1fd0e434c23577507364fa443226676eb5 /sql/sql_digest.cc | |
parent | 5088cbf4ed7224698678f3eaf406361c6e7db4b8 (diff) | |
parent | 4b41e3c7f33714186c97a6cc2e6d3bb93b050c61 (diff) | |
download | mariadb-git-530a6e74819ec14b5fdc42aa588b236ecb9f2fcd.tar.gz |
Merge branch '10.0' into 10.1
referenced_by_foreign_key2(), needed for InnoDB to compile,
was taken from 10.0-galera
Diffstat (limited to 'sql/sql_digest.cc')
-rw-r--r-- | sql/sql_digest.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/sql_digest.cc b/sql/sql_digest.cc index cdbfcbb2e89..7f6f3bbfe9b 100644 --- a/sql/sql_digest.cc +++ b/sql/sql_digest.cc @@ -224,6 +224,7 @@ void compute_digest_text(const sql_digest_storage* digest_storage, /* All identifiers are printed with their name. */ case IDENT: case IDENT_QUOTED: + case TOK_IDENT: { char *id_ptr= NULL; int id_len= 0; @@ -259,13 +260,10 @@ void compute_digest_text(const sql_digest_storage* digest_storage, break; } /* Copy the converted identifier into the digest string. */ - if (tok == IDENT_QUOTED) - digest_output->append("`", 1); + digest_output->append("`", 1); if (id_length > 0) digest_output->append(id_string, id_length); - if (tok == IDENT_QUOTED) - digest_output->append("`", 1); - digest_output->append(" ", 1); + digest_output->append("` ", 2); } break; @@ -575,6 +573,15 @@ sql_digest_state* digest_add_token(sql_digest_state *state, char *yytext= lex_token->lex_str.str; size_t yylen= lex_token->lex_str.length; + /* + REDUCE: + TOK_IDENT := IDENT | IDENT_QUOTED + The parser gives IDENT or IDENT_TOKEN for the same text, + depending on the character set used. + We unify both to always print the same digest text, + and always have the same digest hash. + */ + token= TOK_IDENT; /* Add this token and identifier string to digest storage. */ store_token_identifier(digest_storage, token, yylen, yytext); |