MySQL  8.0.17
Source Code Documentation
sql_digest_stream.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef SQL_DIGEST_STREAM_H
24 #define SQL_DIGEST_STREAM_H
25 
26 #include "sql/sql_digest.h"
27 
28 union Lexer_yystype;
29 
30 /**
31  State data storage for @c digest_start, @c digest_add_token.
32  This structure extends the @c sql_digest_storage structure
33  with temporary state used only during parsing.
34 */
36  /**
37  Index, in the digest token array, of the last identifier seen.
38  Reduce rules used in the digest computation can not
39  apply to tokens seen before an identifier.
40  @sa digest_add_token
41  */
44 
45  inline void reset(unsigned char *token_array, uint length) {
46  m_last_id_index = 0;
47  m_digest_storage.reset(token_array, length);
48  }
49 
50  inline bool is_empty() { return m_digest_storage.is_empty(); }
51 };
53 
56 
58  uint token_right);
59 
60 #endif
sql_digest_storage m_digest_storage
Definition: sql_digest_stream.h:43
bool is_empty()
Definition: sql_digest.h:134
void reset(unsigned char *token_array, uint length)
Definition: sql_digest_stream.h:45
sql_digest_state * digest_reduce_token(sql_digest_state *state, uint token_left, uint token_right)
Definition: sql_digest.cc:622
unsigned int uint
Definition: uca-dump.cc:29
void reset(unsigned char *token_array, size_t length)
Definition: sql_digest.h:121
int m_last_id_index
Index, in the digest token array, of the last identifier seen.
Definition: sql_digest_stream.h:42
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:97
State data storage for digest_start, digest_add_token.
Definition: sql_digest_stream.h:35
sql_digest_state * digest_add_token(sql_digest_state *state, uint token, Lexer_yystype *yylval)
Definition: sql_digest.cc:380
#define yylval
Definition: fts0pars.cc:68
Definition: lexer_yystype.h:32
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
bool is_empty()
Definition: sql_digest_stream.h:50