MySQL 9.0.0
Source Code Documentation
sql_digest_stream.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, Oracle and/or its affiliates.
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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SQL_DIGEST_STREAM_H
25#define SQL_DIGEST_STREAM_H
26
27#include "sql/sql_digest.h"
28
29union Lexer_yystype;
30
31/**
32 State data storage for @c digest_start, @c digest_add_token.
33 This structure extends the @c sql_digest_storage structure
34 with temporary state used only during parsing.
35*/
37 /**
38 Index, in the digest token array, of the last identifier seen.
39 Reduce rules used in the digest computation can not
40 apply to tokens seen before an identifier.
41 @sa digest_add_token
42 */
45
46 inline void reset(unsigned char *token_array, uint length) {
48 m_digest_storage.reset(token_array, length);
49 }
50
51 inline bool is_empty() { return m_digest_storage.is_empty(); }
52};
54
57
59 uint token_right);
60
61#endif
#define yylval
Definition: fts0pars.cc:68
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:76
sql_digest_state * digest_reduce_token(sql_digest_state *state, uint token_left, uint token_right)
Definition: sql_lexer.cc:59
sql_digest_state * digest_add_token(sql_digest_state *state, uint token, Lexer_yystype *yylval)
Definition: sql_lexer.cc:53
State data storage for digest_start, digest_add_token.
Definition: sql_digest_stream.h:36
bool is_empty()
Definition: sql_digest_stream.h:51
sql_digest_storage m_digest_storage
Definition: sql_digest_stream.h:44
void reset(unsigned char *token_array, uint length)
Definition: sql_digest_stream.h:46
int m_last_id_index
Index, in the digest token array, of the last identifier seen.
Definition: sql_digest_stream.h:43
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:98
void reset(unsigned char *token_array, size_t length)
Definition: sql_digest.h:122
bool is_empty()
Definition: sql_digest.h:135
Definition: lexer_yystype.h:33