diff options
author | Otto Kekäläinen <otto@seravo.fi> | 2015-09-05 21:28:14 +0300 |
---|---|---|
committer | Otto Kekäläinen <otto@seravo.fi> | 2015-09-05 21:28:14 +0300 |
commit | d6c5e7e2cc16fa63875ef9e5a63caf5c9f147e7c (patch) | |
tree | c0c1c07edf6beeb1b8e97783934b5b9a778117da /sql/sql_digest.cc | |
parent | b9fee60871264ea56a5582ca7a436aabdabea6fc (diff) | |
parent | 67dbfab3d7945886caf6ba8de6a17799e3db25aa (diff) | |
download | mariadb-git-d6c5e7e2cc16fa63875ef9e5a63caf5c9f147e7c.tar.gz |
Merge branch '10.1' of https://github.com/MariaDB/server into ok-debpkg-10.1
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); |