Commit 7dcef650 authored by Dmitry Shulga's avatar Dmitry Shulga Committed by Marko Mäkelä

MDEV-24827: Follow-up patch to fix compilation warning

Mixed declarations and code is not allowed for C90 so
fix it to avoid compilation break on some platforms.
parent 1d27b578
...@@ -12960,6 +12960,12 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables, ...@@ -12960,6 +12960,12 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables,
if (!send_error) if (!send_error)
result->send_eof(); // Should be safe result->send_eof(); // Should be safe
} }
/*
JOIN::join_free() must be called after the virtual method
select::send_result_set_metadata() returned control since
implementation of this method could use data strutcures
that are released by the method JOIN::join_free().
*/
join->join_free(); join->join_free();
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -19967,6 +19967,9 @@ static void test_mdev24827() ...@@ -19967,6 +19967,9 @@ static void test_mdev24827()
int rc; int rc;
MYSQL_STMT *stmt; MYSQL_STMT *stmt;
unsigned long cursor = CURSOR_TYPE_READ_ONLY; unsigned long cursor = CURSOR_TYPE_READ_ONLY;
const char* query=
"SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 "
"WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1";
myheader("test_mdev24827"); myheader("test_mdev24827");
...@@ -19991,10 +19994,6 @@ static void test_mdev24827() ...@@ -19991,10 +19994,6 @@ static void test_mdev24827()
"SELECT seq, seq FROM seq_1_to_20000"); "SELECT seq, seq FROM seq_1_to_20000");
myquery(rc); myquery(rc);
const char* query=
"SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 "
"WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1";
stmt= mysql_stmt_init(mysql); stmt= mysql_stmt_init(mysql);
check_stmt(stmt); check_stmt(stmt);
......
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