MySQL 8.4.0
Source Code Documentation
query_options.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 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 QUERY_OPTIONS_INCLUDED
25#define QUERY_OPTIONS_INCLUDED
26
27/**
28 @file
29
30 @details
31 This file is used in the server, and the mysqlbinlog client.
32*/
33
34/*
35 This is included in the server and in the client.
36 Options for select set by the yacc parser (stored in lex->options).
37
38 NOTE
39 log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD
40 options list are written into binlog. These options can NOT change their
41 values, or it will break replication between version.
42
43 context is encoded as following:
44 SELECT - Query_block::options
45 THD - THD::options
46 intern - neither. used only as
47 func(..., select_node->options | thd->options | OPTION_XXX, ...)
48
49 TODO: separate three contexts above, move them to separate bitfields.
50*/
51
52#define SELECT_DISTINCT (1ULL << 0) // SELECT, user
53#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user
54// Free slot, used to be SELECT_DESCRIBE: (1ULL << 2)
55#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user
56#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user
57#define OPTION_FOUND_ROWS \
58 (1ULL << 5) // SELECT, user
59 // 1ULL << 6 is free
60#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern
61/** always the opposite of OPTION_NOT_AUTOCOMMIT except when in fix_autocommit()
62 */
63#define OPTION_AUTOCOMMIT (1ULL << 8) // THD, user
64#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
65#define OPTION_LOG_OFF (1ULL << 10) // THD, user
66#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused
67#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
68#define OPTION_WARNINGS (1ULL << 13) // THD, user
69#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
70#define OPTION_FOUND_COMMENT (1ULL << 15) // DEPRECATED
71#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
72#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
73#define OPTION_BIN_LOG (1ULL << 18) // THD, user
74#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user
75#define OPTION_BEGIN (1ULL << 20) // THD, intern
76#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern
77#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
78#define OPTION_NO_CONST_TABLES (1ULL << 23) // No const tables, intern
79
80/* The following is used to detect a conflict with DISTINCT */
81#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
82#define SELECT_NO_SEMI_JOIN (1ULL << 25) // SELECT, intern
83/** The following can be set when importing tables in a 'wrong order'
84 to suppress foreign key checks */
85#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog
86/** The following speeds up inserts to InnoDB tables by suppressing unique
87 key checks in some cases */
88#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog
89#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern
90#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern
91#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // OBSOLETE
92/** If not set then the thread will ignore all warnings with level notes. */
93#define OPTION_SQL_NOTES (1ULL << 31) // THD, user
94
95/** (1ULL << 32) is not used after removing TMP_TABLE_FORCE_MYISAM option */
96
97#define OPTION_PROFILING (1ULL << 33)
98/**
99 Indicates that this is a HIGH_PRIORITY SELECT.
100 Currently used only for printing of such selects.
101 Type of locks to be acquired is specified directly.
102*/
103#define SELECT_HIGH_PRIORITY (1ULL << 34) // SELECT, user
104/**
105 Is set in slave SQL thread when there was an
106 error on master, which, when is not reproducible
107 on slave (i.e. the query succeeds on slave),
108 is not terminal to the state of replication,
109 and should be ignored. The slave SQL thread,
110 however, needs to rollback the effects of the
111 succeeded statement to keep replication consistent.
112*/
113#define OPTION_MASTER_SQL_ERROR (1ULL << 35)
114
115/*
116 Dont report errors for individual rows,
117 But just report error on commit (or read, of course)
118 Note! Reserved for use in MySQL Cluster
119*/
120#define OPTION_ALLOW_BATCH (1ULL << 36) // THD, intern (slave)
121
122#define OPTION_SELECT_FOR_SHOW (1ULL << 37) // SELECT for SHOW over DD.
123
124// Is set while thread is updating the data dictionary tables.
125#define OPTION_DD_UPDATE_CONTEXT (1ULL << 38) // intern
126
127/**
128 If this option is set, subqueries should not be evaluated during
129 optimization, even if they are known to produce a constant result.
130*/
131#define OPTION_NO_SUBQUERY_DURING_OPTIMIZATION (1ULL << 39) // intern
132
133#endif /* QUERY_OPTIONS_INCLUDED */