mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-11966: Impossible to execute prepared ANALYZE SELECT
Prepare os ANALYZE now respond as EXPLAIN.
This commit is contained in:
committed by
Sergei Golubchik
parent
32de60bb2e
commit
01c49e66b5
@ -1527,7 +1527,7 @@ static int mysql_test_select(Prepared_statement *stmt,
|
|||||||
*/
|
*/
|
||||||
if (unit->prepare(thd, 0, 0))
|
if (unit->prepare(thd, 0, 0))
|
||||||
goto error;
|
goto error;
|
||||||
if (!lex->describe && !stmt->is_sql_prepare())
|
if (!lex->describe && !thd->lex->analyze_stmt && !stmt->is_sql_prepare())
|
||||||
{
|
{
|
||||||
/* Make copy of item list, as change_columns may change it */
|
/* Make copy of item list, as change_columns may change it */
|
||||||
List<Item> fields(lex->select_lex.item_list);
|
List<Item> fields(lex->select_lex.item_list);
|
||||||
|
@ -19479,6 +19479,25 @@ static void test_big_packet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Test simple prepares of all DML statements */
|
||||||
|
|
||||||
|
static void test_prepare_analyze()
|
||||||
|
{
|
||||||
|
MYSQL_STMT *stmt;
|
||||||
|
int rc;
|
||||||
|
myheader("test_prepare_analyze");
|
||||||
|
|
||||||
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
check_stmt(stmt);
|
||||||
|
rc= mysql_stmt_prepare(stmt, STRING_WITH_LEN("ANALYZE SELECT 1"));
|
||||||
|
check_execute(stmt, rc);
|
||||||
|
verify_param_count(stmt, 0);
|
||||||
|
rc= mysql_stmt_execute(stmt);
|
||||||
|
check_execute(stmt, rc);
|
||||||
|
|
||||||
|
mysql_stmt_close(stmt);
|
||||||
|
}
|
||||||
|
|
||||||
static struct my_tests_st my_tests[]= {
|
static struct my_tests_st my_tests[]= {
|
||||||
{ "disable_query_logs", disable_query_logs },
|
{ "disable_query_logs", disable_query_logs },
|
||||||
{ "test_view_sp_list_fields", test_view_sp_list_fields },
|
{ "test_view_sp_list_fields", test_view_sp_list_fields },
|
||||||
@ -19755,6 +19774,7 @@ static struct my_tests_st my_tests[]= {
|
|||||||
#endif
|
#endif
|
||||||
{ "test_compressed_protocol", test_compressed_protocol },
|
{ "test_compressed_protocol", test_compressed_protocol },
|
||||||
{ "test_big_packet", test_big_packet },
|
{ "test_big_packet", test_big_packet },
|
||||||
|
{ "test_prepare_analyze", test_prepare_analyze },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user