Commit ceb40ef4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-26504 THD::copy_db_to() fails to return true if THD::db is null

THD::copy_db_to(): Always return true if the output parameter
was left uninitialized. This fixes a regression that was caused
by commit 7d0d934c (MDEV-16473).

MariaDB Server 10.3 and later were unaffected by this bug
thanks to commit a7e352b5.

Possibly this bug only affects mysql_list_fields()
in the Embedded Server (libmysqld).

This bug was found by GCC 11.2.0 in CMAKE_BUILD_TYPE=RelWithDebInfo.
parent fda704c8
......@@ -4003,11 +4003,9 @@ class THD :public Statement,
for any CTE references.
*/
if (!lex->with_cte_resolution)
{
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
return TRUE;
}
}
else
{
*p_db= strmake(db, db_length);
......
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