Commit e7669cf6 authored by Jan Lindström's avatar Jan Lindström

Merge branch '10.1' of github.com:MariaDB/server into 10.1

parents 8984bef2 0c5e04f0
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;
-- 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 @@ class Prepared_statement: public Statement
uint param_count;
uint last_errno;
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];
#ifndef EMBEDDED_LIBRARY
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();
}
select_number_after_prepare= thd->select_number;
lex_end(lex);
cleanup_stmt();
thd->restore_backup_statement(this, &stmt_backup);
......@@ -3582,6 +3598,7 @@ Prepared_statement::execute_loop(String *expanded_query,
bool error;
int reprepare_attempt= 0;
thd->select_number= select_number_after_prepare;
/* Check if we got an error when sending long data */
if (state == Query_arena::STMT_ERROR)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment