diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index b7405aa4c7f..e0648b66e3d 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -296,7 +296,9 @@ if ($CRC_RET_stmt_sidef) { --echo --echo Invoking $CRC_RET_desc. if ($CRC_create) { + --disable_ps_protocol --eval $CRC_create + --enable_ps_protocol } --echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings. diff --git a/mysql-test/r/show_explain_ps.result b/mysql-test/r/show_explain_ps.result index 71c8f117fa2..38f368ec4f5 100644 --- a/mysql-test/r/show_explain_ps.result +++ b/mysql-test/r/show_explain_ps.result @@ -31,12 +31,11 @@ count(*) set debug_dbug=''; select event_name from -performance_schema.events_stages_history_long +performance_schema.events_stages_history_long join +performance_schema.threads using (thread_id) where event_name like '%show explain' and -thread_id in(select thread_id -from performance_schema.events_statements_history_long -where EVENT_NAME='statement/sql/show_explain'); +processlist_id=$thr1; event_name stage/sql/show explain drop table t0; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index 17cb9e7b4e1..8bd3919af91 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -1166,7 +1166,9 @@ DROP TABLE t; CREATE TABLE t (a INT) ENGINE=INNODB; -- remove_file $MYSQL_DATA_DIR/test/t.frm -- move_file $MYSQL_DATA_DIR/test/t.fr_ $MYSQL_DATA_DIR/test/t.frm +--enable_prepare_warnings SHOW CREATE TABLE t; +--disable_prepare_warnings DROP TABLE t; --disable_query_log diff --git a/mysql-test/t/show_explain_ps.test b/mysql-test/t/show_explain_ps.test index b43cd559e09..13cd1538143 100644 --- a/mysql-test/t/show_explain_ps.test +++ b/mysql-test/t/show_explain_ps.test @@ -49,12 +49,12 @@ reap; set debug_dbug=''; -select event_name -from -performance_schema.events_stages_history_long -where - event_name like '%show explain' and - thread_id in(select thread_id - from performance_schema.events_statements_history_long - where EVENT_NAME='statement/sql/show_explain'); +evalp select event_name + from + performance_schema.events_stages_history_long join + performance_schema.threads using (thread_id) + where + event_name like '%show explain' and + processlist_id=$thr1; + drop table t0; diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 5d4c2b20872..bcba4d03492 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -689,6 +689,7 @@ void With_element::move_anchors_ahead() } } first_recursive= new_pos; + spec->first_select()->linkage= DERIVED_TABLE_TYPE; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d2dde1277a1..a0107347fde 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2479,8 +2479,11 @@ void log_slow_statement(THD *thd) if (!thd->enable_slow_log) goto end; // E.g. SP statement - DBUG_EXECUTE_IF("simulate_slow_query", - thd->server_status|= SERVER_QUERY_WAS_SLOW;); + DBUG_EXECUTE_IF("simulate_slow_query", { + if (thd->get_command() == COM_QUERY || + thd->get_command() == COM_STMT_EXECUTE) + thd->server_status|= SERVER_QUERY_WAS_SLOW; + }); if (((thd->server_status & SERVER_QUERY_WAS_SLOW) || ((thd->server_status & diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index f99dc237cd0..fa9fc6fb9f8 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2530,6 +2530,7 @@ static bool check_prepared_statement(Prepared_statement *stmt) case SQLCOM_ALTER_DB_UPGRADE: case SQLCOM_CHECKSUM: case SQLCOM_CREATE_USER: + case SQLCOM_ALTER_USER: case SQLCOM_RENAME_USER: case SQLCOM_DROP_USER: case SQLCOM_CREATE_ROLE: