summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h161
1 files changed, 10 insertions, 151 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b23b65dae2f..5acdda7f40b 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -114,7 +114,7 @@ extern bool volatile shutdown_in_progress;
#define TC_HEURISTIC_RECOVER_COMMIT 1
#define TC_HEURISTIC_RECOVER_ROLLBACK 2
-extern uint tc_heuristic_recover;
+extern ulong tc_heuristic_recover;
typedef struct st_user_var_events
{
@@ -426,13 +426,13 @@ typedef struct system_variables
ulong log_warnings;
ulong group_concat_max_len;
- uint binlog_format; ///< binlog format for this thd (see enum_binlog_format)
+ ulong binlog_format; ///< binlog format for this thd (see enum_binlog_format)
my_bool binlog_direct_non_trans_update;
my_bool sql_log_bin;
- uint completion_type;
- uint query_cache_type;
- uint tx_isolation;
- uint updatable_views_with_limit;
+ ulong completion_type;
+ ulong query_cache_type;
+ ulong tx_isolation;
+ ulong updatable_views_with_limit;
uint max_user_connections;
/**
In slave thread we need to know in behalf of which
@@ -1566,125 +1566,6 @@ public:
return current_stmt_binlog_format == BINLOG_FORMAT_ROW;
}
- enum enum_stmt_accessed_table
- {
- /*
- If a transactional table is about to be read. Note that
- a write implies a read.
- */
- STMT_READS_TRANS_TABLE= 0,
- /*
- If a transactional table is about to be updated.
- */
- STMT_WRITES_TRANS_TABLE,
- /*
- If a non-transactional table is about to be read. Note that
- a write implies a read.
- */
- STMT_READS_NON_TRANS_TABLE,
- /*
- If a non-transactional table is about to be updated.
- */
- STMT_WRITES_NON_TRANS_TABLE,
- /*
- If a temporary transactional table is about to be read. Note
- that a write implies a read.
- */
- STMT_READS_TEMP_TRANS_TABLE,
- /*
- If a temporary transactional table is about to be updated.
- */
- STMT_WRITES_TEMP_TRANS_TABLE,
- /*
- If a temporary non-transactional table is about to be read. Note
- that a write implies a read.
- */
- STMT_READS_TEMP_NON_TRANS_TABLE,
- /*
- If a temporary non-transactional table is about to be updated.
- */
- STMT_WRITES_TEMP_NON_TRANS_TABLE,
- /*
- The last element of the enumeration. Please, if necessary add
- anything before this.
- */
- STMT_ACCESS_TABLE_COUNT
- };
-
- /**
- Sets the type of table that is about to be accessed while executing a
- statement.
-
- @param accessed_table Enumeration type that defines the type of table,
- e.g. temporary, transactional, non-transactional.
- */
- inline void set_stmt_accessed_table(enum_stmt_accessed_table accessed_table)
- {
- DBUG_ENTER("THD::set_stmt_accessed_table");
-
- DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT);
- stmt_accessed_table_flag |= (1U << accessed_table);
-
- DBUG_VOID_RETURN;
- }
-
- /**
- Checks if a type of table is about to be accessed while executing a
- statement.
-
- @param accessed_table Enumeration type that defines the type of table,
- e.g. temporary, transactional, non-transactional.
-
- @return
- @retval TRUE if the type of the table is about to be accessed
- @retval FALSE otherwise
- */
- inline bool stmt_accessed_table(enum_stmt_accessed_table accessed_table)
- {
- DBUG_ENTER("THD::stmt_accessed_table");
-
- DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT);
-
- DBUG_RETURN((stmt_accessed_table_flag & (1U << accessed_table)) != 0);
- }
-
- /**
- Checks if a temporary table is about to be accessed while executing a
- statement.
-
- @return
- @retval TRUE if a temporary table is about to be accessed
- @retval FALSE otherwise
- */
- inline bool stmt_accessed_temp_table()
- {
- DBUG_ENTER("THD::stmt_accessed_temp_table");
-
- DBUG_RETURN((stmt_accessed_table_flag &
- ((1U << STMT_READS_TEMP_TRANS_TABLE) |
- (1U << STMT_WRITES_TEMP_TRANS_TABLE) |
- (1U << STMT_READS_TEMP_NON_TRANS_TABLE) |
- (1U << STMT_WRITES_TEMP_NON_TRANS_TABLE))) != 0);
- }
-
- /**
- Checks if a temporary non-transactional table is about to be accessed
- while executing a statement.
-
- @return
- @retval TRUE if a temporary non-transactional table is about to be
- accessed
- @retval FALSE otherwise
- */
- inline bool stmt_accessed_non_trans_temp_table()
- {
- DBUG_ENTER("THD::stmt_accessed_non_trans_temp_table");
-
- DBUG_RETURN((stmt_accessed_table_flag &
- ((1U << STMT_READS_TEMP_NON_TRANS_TABLE) |
- (1U << STMT_WRITES_TEMP_NON_TRANS_TABLE))) != 0);
- }
-
private:
/**
Indicates the format in which the current statement will be
@@ -1695,24 +1576,8 @@ private:
/**
Bit field for the state of binlog warnings.
- There are two groups of bits:
-
- - The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
- unsafeness that the current statement has.
-
- - The following Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types
- of unsafeness that the current statement has issued warnings
- for.
-
- Hence, this variable must be big enough to hold
- 2*Lex::BINLOG_STMT_UNSAFE_COUNT bits. This is asserted in @c
- issue_unsafe_warnings().
-
- The first and second groups of bits are set by @c
- decide_logging_format() when it detects that a warning should be
- issued. The third group of bits is set from @c binlog_query()
- when a warning is issued. All bits are cleared at the end of the
- top-level statement.
+ The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
+ unsafeness that the current statement has.
This must be a member of THD and not of LEX, because warnings are
detected and issued in different places (@c
@@ -1722,20 +1587,14 @@ private:
*/
uint32 binlog_unsafe_warning_flags;
- /**
- Bit field that determines the type of tables that are about to be
- be accessed while executing a statement.
- */
- uint32 stmt_accessed_table_flag;
-
- void issue_unsafe_warnings();
-
/*
Number of outstanding table maps, i.e., table maps in the
transaction cache.
*/
uint binlog_table_maps;
public:
+ void issue_unsafe_warnings();
+
uint get_binlog_table_maps() const {
return binlog_table_maps;
}