Merge branch '10.1' of github.com:MariaDB/server into 10.1
This commit is contained in:
commit
e7669cf607
@ -0,0 +1,45 @@
|
|||||||
|
SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= NO;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
NO
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= YES;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
YES
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= LOGGING;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
LOGGING
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= default;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
NO
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 0;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
NO
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 1;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
YES
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 2;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
LOGGING
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 3;
|
||||||
|
ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of '3'
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
LOGGING
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= "N";
|
||||||
|
ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of 'N'
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
LOGGING
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= -1;
|
||||||
|
ERROR 42000: Variable 'slave_run_triggers_for_rbr' can't be set to the value of '-1'
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
@@global.slave_run_triggers_for_rbr
|
||||||
|
LOGGING
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
|
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
-- source include/have_rbr_triggers.inc
|
||||||
|
|
||||||
|
SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= NO;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= YES;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= LOGGING;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= default;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 0;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 1;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 2;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
--error ER_WRONG_VALUE_FOR_VAR
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= 3;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
--error ER_WRONG_VALUE_FOR_VAR
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= "N";
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
--error ER_WRONG_VALUE_FOR_VAR
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= -1;
|
||||||
|
select @@global.slave_run_triggers_for_rbr;
|
||||||
|
|
||||||
|
|
||||||
|
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
|
@ -160,6 +160,20 @@ public:
|
|||||||
uint param_count;
|
uint param_count;
|
||||||
uint last_errno;
|
uint last_errno;
|
||||||
uint flags;
|
uint flags;
|
||||||
|
/*
|
||||||
|
The value of thd->select_number at the end of the PREPARE phase.
|
||||||
|
|
||||||
|
The issue is: each statement execution opens VIEWs, which may cause
|
||||||
|
select_lex objects to be created, and select_number values to be assigned.
|
||||||
|
|
||||||
|
On the other hand, PREPARE assigns select_number values for triggers and
|
||||||
|
subqueries.
|
||||||
|
|
||||||
|
In order for select_number values from EXECUTE not to conflict with
|
||||||
|
select_number values from PREPARE, we keep the number and set it at each
|
||||||
|
execution.
|
||||||
|
*/
|
||||||
|
uint select_number_after_prepare;
|
||||||
char last_error[MYSQL_ERRMSG_SIZE];
|
char last_error[MYSQL_ERRMSG_SIZE];
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end,
|
bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end,
|
||||||
@ -3456,6 +3470,8 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
|
|||||||
thd->mdl_context.release_transactional_locks();
|
thd->mdl_context.release_transactional_locks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select_number_after_prepare= thd->select_number;
|
||||||
|
|
||||||
lex_end(lex);
|
lex_end(lex);
|
||||||
cleanup_stmt();
|
cleanup_stmt();
|
||||||
thd->restore_backup_statement(this, &stmt_backup);
|
thd->restore_backup_statement(this, &stmt_backup);
|
||||||
@ -3582,6 +3598,7 @@ Prepared_statement::execute_loop(String *expanded_query,
|
|||||||
bool error;
|
bool error;
|
||||||
int reprepare_attempt= 0;
|
int reprepare_attempt= 0;
|
||||||
|
|
||||||
|
thd->select_number= select_number_after_prepare;
|
||||||
/* Check if we got an error when sending long data */
|
/* Check if we got an error when sending long data */
|
||||||
if (state == Query_arena::STMT_ERROR)
|
if (state == Query_arena::STMT_ERROR)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user