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