diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-08-03 16:34:59 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-08-03 16:34:59 +0200 |
commit | 0a99293db39b94db9c6a5515b4b2dd9814244e26 (patch) | |
tree | fec208a0d29decc410b10f26bf21178dc45f7a11 /sql/sql_digest.cc | |
parent | ab7b672983da567b7599bc331d492154ee915f9b (diff) | |
parent | 167c540048ed1c49fa97f86cadba1e7ff0559d12 (diff) | |
download | mariadb-git-0a99293db39b94db9c6a5515b4b2dd9814244e26.tar.gz |
Merge branch 'merge-perfschema-5.6' into 10.0
5.6.26
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 324f2fbd428..c8ba371ea7e 100644 --- a/sql/sql_digest.cc +++ b/sql/sql_digest.cc @@ -223,6 +223,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; @@ -258,13 +259,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; @@ -574,6 +572,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); |