MySQL 9.0.0
Source Code Documentation
sql_test.h
Go to the documentation of this file.
1/* Copyright (c) 2006, 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_TEST_INCLUDED
25#define SQL_TEST_INCLUDED
26
27#include <sys/types.h>
28
29#include "sql/enum_query_type.h" // enum_query_type
30#include "sql/mem_root_array.h" // Mem_root_array
31#include "sql/sql_lex.h"
32#include "sql/sql_select.h"
33#include "thr_lock.h" // TL_WRITE_ONLY
34
35class Item;
36class JOIN;
37class Table_ref;
38
40
41extern const char *lock_descriptions[TL_WRITE_ONLY + 1];
42
43#ifndef NDEBUG
44void print_where(const THD *thd, const Item *cond, const char *info,
45 enum_query_type query_type);
46void TEST_join(JOIN *join);
47void print_plan(JOIN *join, uint idx, double record_count, double read_time,
48 double current_read_time, const char *info);
50#endif
52
54 const Key_use_array *keyuse_array);
55#endif /* SQL_TEST_INCLUDED */
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Definition: sql_optimizer.h:133
A per-session context which is always available at any point of execution, because in practice it's a...
Definition: opt_trace_context.h:94
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1175
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: table.h:2871
Query_block * query_block
Definition: table.h:3718
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:31
std::string join(Container cont, const std::string &delim)
join elements of an container into a string separated by a delimiter.
Definition: string.h:151
void print_where(const THD *thd, const Item *cond, const char *info, enum_query_type query_type)
Definition: sql_test.cc:96
Mem_root_array< Key_use > Key_use_array
Definition: sql_test.h:37
const char * lock_descriptions[TL_WRITE_ONLY+1]
Definition: sql_test.cc:79
void TEST_join(JOIN *join)
Definition: sql_test.cc:111
void dump_TABLE_LIST_graph(Query_block *query_block, Table_ref *tl)
void print_plan(JOIN *join, uint idx, double record_count, double read_time, double current_read_time, const char *info)
Print the current state during query optimization.
Definition: sql_test.cc:216
void print_keyuse_array(THD *thd, Opt_trace_context *trace, const Key_use_array *keyuse_array)
Definition: sql_test.cc:162
@ TL_WRITE_ONLY
Definition: thr_lock.h:94