Browse Source

post-merge: --ps-protocol fixes

Includes:

MDEV-17302 Add support for ALTER USER command in prepared statement

and

MDEV-17673 main.cte_recursive fails in bb-10.4-ps branch in --ps

  Set correct SELECT_LEX linkage for recursive CTEs.
  Do not delegate this job to TABLE_LIST::set_as_with_table,
  because it is only run on prepare, while With_element::move_anchors_ahead
  is run both on prepare and execute (fix by Igor)
pull/1231/head
Sergei Golubchik 7 years ago
parent
commit
1f020299f8
  1. 2
      mysql-test/extra/rpl_tests/create_recursive_construct.inc
  2. 7
      mysql-test/r/show_explain_ps.result
  3. 2
      mysql-test/suite/innodb/t/innodb-index.test
  4. 16
      mysql-test/t/show_explain_ps.test
  5. 1
      sql/sql_cte.cc
  6. 7
      sql/sql_parse.cc
  7. 1
      sql/sql_prepare.cc

2
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.

7
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;

2
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

16
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;

1
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;
}

7
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 &

1
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:

Loading…
Cancel
Save