2010-03-31 16:05:33 +02:00
|
|
|
/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
/**
|
|
|
|
@file
|
|
|
|
|
|
|
|
@details
|
|
|
|
Mostly this file is used in the server. But a little part of it is used in
|
|
|
|
mysqlbinlog too (definition of SELECT_DISTINCT and others).
|
|
|
|
The consequence is that 90% of the file is wrapped in \#ifndef MYSQL_CLIENT,
|
|
|
|
except the part which must be in the server and in the client.
|
|
|
|
*/
|
|
|
|
|
2010-04-21 00:29:30 +02:00
|
|
|
#ifndef SQL_PRIV_INCLUDED
|
|
|
|
#define SQL_PRIV_INCLUDED
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#ifndef MYSQL_CLIENT
|
|
|
|
|
|
|
|
/*
|
|
|
|
Generates a warning that a feature is deprecated. After a specified
|
|
|
|
version asserts that the feature is removed.
|
|
|
|
|
|
|
|
Using it as
|
|
|
|
|
|
|
|
WARN_DEPRECATED(thd, 6,2, "BAD", "'GOOD'");
|
|
|
|
|
|
|
|
Will result in a warning
|
|
|
|
|
|
|
|
"The syntax 'BAD' is deprecated and will be removed in MySQL 6.2. Please
|
|
|
|
use 'GOOD' instead"
|
|
|
|
|
|
|
|
Note that in macro arguments BAD is not quoted, while 'GOOD' is.
|
|
|
|
Note that the version is TWO numbers, separated with a comma
|
|
|
|
(two macro arguments, that is)
|
|
|
|
*/
|
|
|
|
#define WARN_DEPRECATED(Thd,VerHi,VerLo,Old,New) \
|
|
|
|
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, \
|
|
|
|
ER_WARN_DEPRECATED_SYNTAX, \
|
|
|
|
ER(ER_WARN_DEPRECATED_SYNTAX), \
|
|
|
|
(Old), (New)); \
|
|
|
|
else \
|
|
|
|
sql_print_warning("The syntax '%s' is deprecated and will be removed " \
|
|
|
|
"in a future release. Please use %s instead.", \
|
|
|
|
(Old), (New)); \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
extern char err_shared_dir[];
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
This is included in the server and in the client.
|
|
|
|
Options for select set by the yacc parser (stored in lex->options).
|
|
|
|
|
|
|
|
NOTE
|
|
|
|
log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD
|
|
|
|
options list are written into binlog. These options can NOT change their
|
|
|
|
values, or it will break replication between version.
|
|
|
|
|
|
|
|
context is encoded as following:
|
|
|
|
SELECT - SELECT_LEX_NODE::options
|
|
|
|
THD - THD::options
|
|
|
|
intern - neither. used only as
|
|
|
|
func(..., select_node->options | thd->options | OPTION_XXX, ...)
|
|
|
|
|
|
|
|
TODO: separate three contexts above, move them to separate bitfields.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SELECT_DISTINCT (1ULL << 0) // SELECT, user
|
|
|
|
#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user
|
|
|
|
#define SELECT_DESCRIBE (1ULL << 2) // SELECT, user
|
|
|
|
#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user
|
|
|
|
#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user
|
|
|
|
#define OPTION_FOUND_ROWS (1ULL << 5) // SELECT, user
|
|
|
|
#define OPTION_TO_QUERY_CACHE (1ULL << 6) // SELECT, user
|
|
|
|
#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern
|
|
|
|
/** always the opposite of OPTION_NOT_AUTOCOMMIT except when in fix_autocommit() */
|
|
|
|
#define OPTION_AUTOCOMMIT (1ULL << 8) // THD, user
|
|
|
|
#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
|
|
|
|
#define OPTION_LOG_OFF (1ULL << 10) // THD, user
|
|
|
|
#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused
|
|
|
|
#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
|
|
|
|
#define OPTION_WARNINGS (1ULL << 13) // THD, user
|
|
|
|
#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
|
|
|
|
#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser
|
|
|
|
#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
|
|
|
|
#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
|
|
|
|
#define OPTION_BIN_LOG (1ULL << 18) // THD, user
|
|
|
|
#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user
|
|
|
|
#define OPTION_BEGIN (1ULL << 20) // THD, intern
|
|
|
|
#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern
|
|
|
|
#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
|
|
|
|
#define OPTION_KEEP_LOG (1ULL << 23) // THD, user
|
|
|
|
|
|
|
|
/* The following is used to detect a conflict with DISTINCT */
|
|
|
|
#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
|
|
|
|
/** 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
|
|
|
|
/** The following speeds up inserts to InnoDB tables by suppressing unique
|
|
|
|
key checks in some cases */
|
|
|
|
#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog
|
|
|
|
#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern
|
|
|
|
#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern
|
|
|
|
/** Flag set if setup_tables already done */
|
|
|
|
#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // intern
|
|
|
|
/** If not set then the thread will ignore all warnings with level notes. */
|
|
|
|
#define OPTION_SQL_NOTES (1ULL << 31) // THD, user
|
|
|
|
/**
|
|
|
|
Force the used temporary table to be a MyISAM table (because we will use
|
|
|
|
fulltext functions when reading from it.
|
|
|
|
*/
|
|
|
|
#define TMP_TABLE_FORCE_MYISAM (1ULL << 32)
|
|
|
|
#define OPTION_PROFILING (1ULL << 33)
|
Committing on behalf or Dmitry Lenev:
Fix for bug #46947 "Embedded SELECT without FOR UPDATE is
causing a lock", with after-review fixes.
SELECT statements with subqueries referencing InnoDB tables
were acquiring shared locks on rows in these tables when they
were executed in REPEATABLE-READ mode and with statement or
mixed mode binary logging turned on.
This was a regression which were introduced when fixing
bug 39843.
The problem was that for tables belonging to subqueries
parser set TL_READ_DEFAULT as a lock type. In cases when
statement/mixed binary logging at open_tables() time this
type of lock was converted to TL_READ_NO_INSERT lock at
open_tables() time and caused InnoDB engine to acquire
shared locks on reads from these tables. Although in some
cases such behavior was correct (e.g. for subqueries in
DELETE) in case of SELECT it has caused unnecessary locking.
This patch tries to solve this problem by rethinking our
approach to how we handle locking for SELECT and subqueries.
Now we always set TL_READ_DEFAULT lock type for all cases
when we read data. When at open_tables() time this lock
is interpreted as TL_READ_NO_INSERT or TL_READ depending
on whether this statement as a whole or call to function
which uses particular table should be written to the
binary log or not (if yes then statement should be properly
serialized with concurrent statements and stronger lock
should be acquired).
Test coverage is added for both InnoDB and MyISAM.
This patch introduces an "incompatible" change in locking
scheme for subqueries used in SELECT ... FOR UPDATE and
SELECT .. IN SHARE MODE.
In 4.1 the server would use a snapshot InnoDB read for
subqueries in SELECT FOR UPDATE and SELECT .. IN SHARE MODE
statements, regardless of whether the binary log is on or off.
If the user required a different type of read (i.e. locking read),
he/she could request so explicitly by providing FOR UPDATE/IN SHARE MODE
clause for each individual subquery.
On of the patches for 5.0 broke this behaviour (which was not documented
or tested), and started to use locking reads fora all subqueries in SELECT ...
FOR UPDATE/IN SHARE MODE. This patch restored 4.1 behaviour.
mysql-test/include/check_concurrent_insert.inc:
Added auxiliary script which allows to check if statement
reading table allows concurrent inserts in it.
mysql-test/include/check_no_concurrent_insert.inc:
Added auxiliary script which allows to check that statement
reading table doesn't allow concurrent inserts in it.
mysql-test/include/check_no_row_lock.inc:
Added auxiliary script which allows to check if statement
reading table doesn't take locks on its rows.
mysql-test/include/check_shared_row_lock.inc:
Added auxiliary script which allows to check if statement
reading table takes shared locks on some of its rows.
mysql-test/r/bug39022.result:
After bug #46947 'Embedded SELECT without FOR UPDATE is
causing a lock' was fixed test case for bug 39022 has to
be adjusted in order to trigger execution path on which
original problem was encountered.
mysql-test/r/innodb_mysql_lock2.result:
Added coverage for handling of locking in various cases when
we read data from InnoDB tables (includes test case for
bug #46947 'Embedded SELECT without FOR UPDATE is causing a
lock').
mysql-test/r/lock_sync.result:
Added coverage for handling of locking in various cases when
we read data from MyISAM tables.
mysql-test/t/bug39022.test:
After bug #46947 'Embedded SELECT without FOR UPDATE is
causing a lock' was fixed test case for bug 39022 has to
be adjusted in order to trigger execution path on which
original problem was encountered.
mysql-test/t/innodb_mysql_lock2.test:
Added coverage for handling of locking in various cases when
we read data from InnoDB tables (includes test case for
bug #46947 'Embedded SELECT without FOR UPDATE is causing a
lock').
mysql-test/t/lock_sync.test:
Added coverage for handling of locking in various cases when
we read data from MyISAM tables.
sql/log_event.cc:
Since LEX::lock_option member was removed we no longer can
rely on its value in Load_log_event::print_query() to
determine that log event correponds to LOAD DATA CONCURRENT
statement (this was not correct in all situations anyway).
A new Load_log_event's member was introduced as a replacement.
It is initialized at event object construction time and
explicitly indicates whether LOAD DATA was concurrent.
sql/log_event.h:
Since LEX::lock_option member was removed we no longer can
rely on its value in Load_log_event::print_query() to
determine that log event correponds to LOAD DATA CONCURRENT
statement (this was not correct in all situations anyway).
A new Load_log_event's member was introduced as a replacement.
It is initialized at event object construction time and
explicitly indicates whether LOAD DATA was concurrent.
sql/sp_head.cc:
sp_head::reset_lex():
Before parsing substatement reset part of parser state
which needs this (e.g. set Yacc_state::m_lock_type to
default value).
sql/sql_acl.cc:
Since LEX::reset_n_backup_query_tables_list() now also
resets LEX::sql_command member (as it became part of
Query_tables_list class) we have to restore it in cases
when while working with proxy Query_table_list we assume
that LEX::sql_command still corresponds to original SQL
command being executed (for example, when we are logging
statement to the binary log while having Query_tables_list
reset and backed up).
sql/sql_base.cc:
Changed read_lock_type_for_table() to return a weak TL_READ
type of lock in cases when we are executing statement which
won't update tables directly and table doesn't belong to
statement's prelocking list and thus can't be used by a
stored function. It is OK to do so since in this case table
won't be used by statement or function call which will be
written to the binary log, so serializability requirements
for it can be relaxed.
One of results from this change is that SELECTs on InnoDB
tables no longer takes shared row locks for tables which
are used in subqueries (i.e. bug #46947 is fixed).
Another result is that for similar SELECTs on MyISAM tables
concurrent inserts are allowed.
In order to implement this change signature of
read_lock_type_for_table() function was changed to take
pointers to Query_tables_list and TABLE_LIST objects.
sql/sql_base.h:
- Function read_lock_type_for_table() now takes pointers
to Query_tables_list and TABLE_LIST elements as its
arguments since to correctly determine lock type it needs
to know what statement is being performed and whether table
element for which lock type to be determined belongs to
prelocking list.
sql/sql_lex.cc:
- Removed LEX::lock_option and st_select_lex::lock_option
members. Places in parser that were using them now use
Yacc_state::m_lock_type instead.
- To emphasize that LEX::sql_command member is used during
process of opening and locking of tables it was moved to
Query_tables_list class. It is now reset by
Query_tables_list::reset_query_tables_list() method.
sql/sql_lex.h:
- Removed st_select_lex::lock_option member as there is no
real need for per-SELECT lock type (HIGH_PRIORITY option
should apply to the whole statement. FOR UPDATE/LOCK IN
SHARE MODE clauses can be handled without this member).
The main effect which was achieved by introduction of this
member, i.e. using TL_READ_DEFAULT lock type for
subqueries, is now achieved by setting LEX::lock_option
(or rather its replacement - Yacc_state::m_lock_type) to
TL_READ_DEFAULT in almost all cases.
- To emphasize that LEX::sql_command member is used during
process of opening and locking of tables it was moved to
Query_tables_list class.
- Replaced LEX::lock_option with Yacc_state::m_lock_type
in order to emphasize that this value is relevant only
during parsing. Unlike for LEX::lock_option the default
value for Yacc_state::m_lock_type is TL_READ_DEFAULT.
Note that for cases when it is OK to take a "weak" read
lock (e.g. simple SELECT) this lock type will be converted
to TL_READ at open_tables() time. So this change won't
cause negative change in behavior for such statements.
OTOH this change ensures that, for example, for SELECTs
which are used in stored functions TL_READ_NO_INSERT lock
is taken when necessary and as result calls to such stored
functions can be written to the binary log with correct
serialization.
sql/sql_load.cc:
Load_log_event constructor now requires a parameter that
indicates whether LOAD DATA is concurrent.
sql/sql_parse.cc:
LEX::lock_option was replaced with Yacc_state::m_lock_type.
And instead of resetting the latter implicitly in
mysql_init_multi_delete() we do it explicitly in the
places in parser which call this function.
sql/sql_priv.h:
- To be able more easily distinguish high-priority SELECTs
in st_select_lex::print() method added flag for
HIGH_PRIORITY option.
sql/sql_select.cc:
Changed code not to rely on LEX::lock_option to determine
that it is high-priority SELECT. It was replaced with
Yacc_state::m_lock_type which is accessible only at
parse time. So instead of LEX::lock_option we now rely
on a newly introduced flag for st_select_lex::options -
SELECT_HIGH_PRIORITY.
sql/sql_show.cc:
Since LEX::reset_n_backup_query_tables_list() now also
resets LEX::sql_command member (as it became part of
Query_tables_list class) we have to restore it in cases
when while working with proxy Query_table_list we assume
that LEX::sql_command still corresponds to original SQL
command being executed.
sql/sql_table.cc:
Since LEX::reset_query_tables_list() now also resets
LEX::sql_command member (as it became part of
Query_tables_list class) we have to restore value of this
member when this method is called by mysql_admin_table(),
to make this code safe for re-execution.
sql/sql_trigger.cc:
Since LEX::reset_n_backup_query_tables_list() now also
resets LEX::sql_command member (as it became part of
Query_tables_list class) we have to restore it in cases
when while working with proxy Query_table_list we assume
that LEX::sql_command still corresponds to original SQL
command being executed (for example, when we are logging
statement to the binary log while having Query_tables_list
reset and backed up).
sql/sql_update.cc:
Function read_lock_type_for_table() now takes pointers
to Query_tables_list and TABLE_LIST elements as its
arguments since to correctly determine lock type it needs
to know what statement is being performed and whether table
element for which lock type to be determined belongs to
prelocking list.
sql/sql_yacc.yy:
- Removed st_select_lex::lock_option member as there is no
real need for per-SELECT lock type (HIGH_PRIORITY option
should apply to the whole statement. FOR UPDATE/LOCK IN
SHARE MODE clauses can be handled without this member).
The main effect which was achieved by introduction of this
member, i.e. using TL_READ_DEFAULT lock type for
subqueries, is now achieved by setting LEX::lock_option
(or rather its replacement - Yacc_state::m_lock_type) to
TL_READ_DEFAULT in almost all cases.
- Replaced LEX::lock_option with Yacc_state::m_lock_type
in order to emphasize that this value is relevant only
during parsing. Unlike for LEX::lock_option the default
value for Yacc_state::m_lock_type is TL_READ_DEFAULT.
Note that for cases when it is OK to take a "weak" read
lock (e.g. simple SELECT) this lock type will be converted
to TL_READ at open_tables() time. So this change won't
cause negative change in behavior for such statements.
OTOH this change ensures that, for example, for SELECTs
which are used in stored functions TL_READ_NO_INSERT lock
is taken when necessary and as result calls to such stored
functions can be written to the binary log with correct
serialization.
- To be able more easily distinguish high-priority SELECTs
in st_select_lex::print() method we now use new flag
in st_select_lex::options bit-field.
2010-04-28 14:04:11 +04:00
|
|
|
/**
|
|
|
|
Indicates that this is a HIGH_PRIORITY SELECT.
|
|
|
|
Currently used only for printing of such selects.
|
|
|
|
Type of locks to be acquired is specified directly.
|
|
|
|
*/
|
|
|
|
#define SELECT_HIGH_PRIORITY (1ULL << 34) // SELECT, user
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* The rest of the file is included in the server only */
|
|
|
|
#ifndef MYSQL_CLIENT
|
|
|
|
|
|
|
|
/* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */
|
|
|
|
#define OPTIMIZER_SWITCH_INDEX_MERGE (1ULL << 0)
|
|
|
|
#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION (1ULL << 1)
|
|
|
|
#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION (1ULL << 2)
|
|
|
|
#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT (1ULL << 3)
|
|
|
|
#define OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN (1ULL << 4)
|
|
|
|
#define OPTIMIZER_SWITCH_LAST (1ULL << 5)
|
|
|
|
|
|
|
|
/* The following must be kept in sync with optimizer_switch_str in mysqld.cc */
|
|
|
|
#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
|
|
|
|
OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
|
|
|
|
OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
|
|
|
|
OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
|
|
|
|
OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
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
|
|
|
|
contact the replication team because the replication code should then be
|
|
|
|
updated (to store more bytes on disk).
|
|
|
|
|
|
|
|
NOTE: When adding new SQL_MODE types, make sure to also add them to
|
|
|
|
the scripts used for creating the MySQL system tables
|
|
|
|
in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
// uncachable cause
|
|
|
|
#define UNCACHEABLE_DEPENDENT 1
|
|
|
|
#define UNCACHEABLE_RAND 2
|
|
|
|
#define UNCACHEABLE_SIDEEFFECT 4
|
|
|
|
/// forcing to save JOIN for explain
|
|
|
|
#define UNCACHEABLE_EXPLAIN 8
|
|
|
|
/** Don't evaluate subqueries in prepare even if they're not correlated */
|
|
|
|
#define UNCACHEABLE_PREPARE 16
|
|
|
|
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
|
|
|
|
#define UNCACHEABLE_UNITED 32
|
|
|
|
#define UNCACHEABLE_CHECKOPTION 64
|
|
|
|
|
|
|
|
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
|
|
|
|
#define UNDEF_POS (-1)
|
|
|
|
|
|
|
|
/* BINLOG_DUMP options */
|
|
|
|
|
|
|
|
#define BINLOG_DUMP_NON_BLOCK 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
Some defines for exit codes for ::is_equal class functions.
|
|
|
|
*/
|
|
|
|
#define IS_EQUAL_NO 0
|
|
|
|
#define IS_EQUAL_YES 1
|
|
|
|
#define IS_EQUAL_PACK_LENGTH 2
|
|
|
|
|
|
|
|
enum enum_parsing_place
|
|
|
|
{
|
|
|
|
NO_MATTER,
|
|
|
|
IN_HAVING,
|
|
|
|
SELECT_LIST,
|
|
|
|
IN_WHERE,
|
|
|
|
IN_ON
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum enum_var_type
|
|
|
|
{
|
|
|
|
OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
|
|
|
|
};
|
|
|
|
|
|
|
|
class sys_var;
|
|
|
|
|
Draft patch that fixes and a sketches test cases for:
Bug#20837 Apparent change of isolation level during transaction,
Bug#46527 COMMIT AND CHAIN RELEASE does not make sense,
Bug#53343 completion_type=1, COMMIT/ROLLBACK AND CHAIN don't
preserve the isolation level
Bug#53346 completion_type has strange effect in a stored
procedure/prepared statement
Make thd->tx_isolation mean strictly "current transaction
isolation level"
Make thd->variables.tx_isolation mean "current session isolation
level".
The current transaction isolation level is now established
at transaction start. If there was a SET TRANSACTION
ISOLATION LEVEL statement, the value is taken from it.
Otherwise, the session value is used.
A change in a session value, made while a transaction is active,
whereas still allowed, no longer has any effect on the
current transaction isolation level. This is an incompatible
change.
A change in a session isolation level, made while there is
no active transaction, overrides SET TRANSACTION statement,
if there was any.
Changed the impelmentation to not look at @@session.completion_type
in the parser, and thus fixed Bug#53346.
Changed the parser to not allow AND NO CHAIN RELEASE,
and thus fixed Bug#46527.
Changed the transaction API to take the current transaction
isolation level into account:
- BEGIN/COMMIT now do preserve the current transaction
isolation level if chaining is on.
- implicit commit, XA COMMIT or XA ROLLBACK or autocommit don't.
2010-05-07 20:28:59 +04:00
|
|
|
enum enum_yes_no_unknown
|
|
|
|
{
|
|
|
|
TVL_YES, TVL_NO, TVL_UNKNOWN
|
|
|
|
};
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
#ifdef MYSQL_SERVER
|
|
|
|
|
|
|
|
#endif /* MYSQL_SERVER */
|
|
|
|
|
|
|
|
#ifdef MYSQL_SERVER
|
|
|
|
/*
|
|
|
|
A set of constants used for checking non aggregated fields and sum
|
|
|
|
functions mixture in the ONLY_FULL_GROUP_BY_MODE.
|
|
|
|
*/
|
|
|
|
#define NON_AGG_FIELD_USED 1
|
|
|
|
#define SUM_FUNC_USED 2
|
|
|
|
|
|
|
|
/*
|
|
|
|
External variables
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* sql_yacc.cc */
|
|
|
|
#ifndef DBUG_OFF
|
|
|
|
extern void turn_parser_debug_on();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
convert a hex digit into number.
|
|
|
|
*/
|
|
|
|
|
|
|
|
inline int hexchar_to_int(char c)
|
|
|
|
{
|
|
|
|
if (c <= '9' && c >= '0')
|
|
|
|
return c-'0';
|
|
|
|
c|=32;
|
|
|
|
if (c <= 'f' && c >= 'a')
|
|
|
|
return c-'a'+10;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */
|
|
|
|
#define ER_NOT_RW_DIR_PATHSIZE 200
|
|
|
|
|
|
|
|
#define IS_TABLESPACES_TABLESPACE_NAME 0
|
|
|
|
#define IS_TABLESPACES_ENGINE 1
|
|
|
|
#define IS_TABLESPACES_TABLESPACE_TYPE 2
|
|
|
|
#define IS_TABLESPACES_LOGFILE_GROUP_NAME 3
|
|
|
|
#define IS_TABLESPACES_EXTENT_SIZE 4
|
|
|
|
#define IS_TABLESPACES_AUTOEXTEND_SIZE 5
|
|
|
|
#define IS_TABLESPACES_MAXIMUM_SIZE 6
|
|
|
|
#define IS_TABLESPACES_NODEGROUP_ID 7
|
|
|
|
#define IS_TABLESPACES_TABLESPACE_COMMENT 8
|
|
|
|
|
|
|
|
#endif /* MYSQL_SERVER */
|
|
|
|
|
|
|
|
#endif /* MYSQL_CLIENT */
|
|
|
|
|
2010-04-21 00:29:30 +02:00
|
|
|
#endif /* SQL_PRIV_INCLUDED */
|