summaryrefslogtreecommitdiff
path: root/sql/sql_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_priv.h')
-rw-r--r--sql/sql_priv.h61
1 files changed, 14 insertions, 47 deletions
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 0e609e41b6b..8084e3f97b4 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -50,7 +50,7 @@
do { \
compile_time_assert(MYSQL_VERSION_ID < VerHi * 10000 + VerLo * 100); \
if (((THD *) Thd) != NULL) \
- push_warning_printf(((THD *) Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \
+ push_warning_printf(((THD *) Thd), Sql_condition::WARN_LEVEL_WARN, \
ER_WARN_DEPRECATED_SYNTAX, \
ER(ER_WARN_DEPRECATED_SYNTAX), \
(Old), (New)); \
@@ -78,7 +78,7 @@
#define WARN_DEPRECATED_NO_REPLACEMENT(Thd,Old) \
do { \
if (((THD *) Thd) != NULL) \
- push_warning_printf(((THD *) Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \
+ push_warning_printf(((THD *) Thd), Sql_condition::WARN_LEVEL_WARN, \
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT, \
ER(ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT), \
(Old)); \
@@ -137,6 +137,8 @@
/* The following is used to detect a conflict with DISTINCT */
#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
+#define OPTION_GTID_BEGIN (1ULL << 25) // GTID BEGIN found in log
+
/** The following can be set when importing tables in a 'wrong order'
to suppress foreign key checks */
#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog
@@ -170,55 +172,15 @@
however, needs to rollback the effects of the
succeeded statement to keep replication consistent.
*/
-#define OPTION_MASTER_SQL_ERROR (1ULL << 35)
+#define OPTION_MASTER_SQL_ERROR (1ULL << 35)
/*
Dont report errors for individual rows,
But just report error on commit (or read ofcourse)
Note! Reserved for use in MySQL Cluster
*/
-#define OPTION_ALLOW_BATCH (ULL(1) << 36) // THD, intern (slave)
-#define OPTION_SKIP_REPLICATION (ULL(1) << 37) // THD, user
-
-/*
- Check how many bytes are available on buffer.
-
- @param buf_start Pointer to buffer start.
- @param buf_current Pointer to the current position on buffer.
- @param buf_len Buffer length.
-
- @return Number of bytes available on event buffer.
-*/
-template <class T> T available_buffer(const char* buf_start,
- const char* buf_current,
- T buf_len)
-{
- /* Sanity check */
- if (buf_current < buf_start ||
- buf_len < static_cast<T>(buf_current - buf_start))
- return static_cast<T>(0);
-
- return buf_len - (buf_current - buf_start);
-}
-
-/*
- Check if jump value is within buffer limits.
-
- @param jump Number of positions we want to advance.
- @param buf_start Pointer to buffer start
- @param buf_current Pointer to the current position on buffer.
- @param buf_len Buffer length.
-
- @return True If jump value is within buffer limits.
- False Otherwise.
-*/
-template <class T> bool valid_buffer_range(T jump,
- const char* buf_start,
- const char* buf_current,
- T buf_len)
-{
- return (jump <= available_buffer(buf_start, buf_current, buf_len));
-}
+#define OPTION_ALLOW_BATCH (1ULL << 36) // THD, intern (slave)
+#define OPTION_SKIP_REPLICATION (1ULL << 37) // THD, user
/* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT
@@ -259,7 +221,8 @@ template <class T> bool valid_buffer_range(T jump,
#define OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE (1ULL << 25)
#define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1ULL << 26)
#define OPTIMIZER_SWITCH_EXTENDED_KEYS (1ULL << 27)
-#define OPTIMIZER_SWITCH_LAST (1ULL << 27)
+#define OPTIMIZER_SWITCH_EXISTS_TO_IN (1ULL << 28)
+#define OPTIMIZER_SWITCH_USE_CONDITION_SELECTIVITY (1ULL << 29)
#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
@@ -269,6 +232,7 @@ template <class T> bool valid_buffer_range(T jump,
OPTIMIZER_SWITCH_DERIVED_MERGE | \
OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \
OPTIMIZER_SWITCH_TABLE_ELIMINATION | \
+ OPTIMIZER_SWITCH_EXTENDED_KEYS | \
OPTIMIZER_SWITCH_IN_TO_EXISTS | \
OPTIMIZER_SWITCH_MATERIALIZATION | \
OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
@@ -281,7 +245,8 @@ template <class T> bool valid_buffer_range(T jump,
OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
OPTIMIZER_SWITCH_SEMIJOIN | \
OPTIMIZER_SWITCH_FIRSTMATCH | \
- OPTIMIZER_SWITCH_LOOSE_SCAN )
+ OPTIMIZER_SWITCH_LOOSE_SCAN | \
+ OPTIMIZER_SWITCH_EXISTS_TO_IN)
/*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
use strictly more than 64 bits by adding one more define above, you should
@@ -394,10 +359,12 @@ enum enum_yes_no_unknown
};
#ifdef MYSQL_SERVER
+
/*
External variables
*/
+
/* sql_yacc.cc */
#ifndef DBUG_OFF
extern void turn_parser_debug_on();