Commit 5fcb6d40 authored by unknown's avatar unknown

MDEV-5728: BINLOG_GTID_POS(..) does not return proper error unless mysql_store_result is called

Add a check for binlog open already during the parsing, so that
BINLOG_GTID_POS() can return the error early and not delay it
until execution.
parent 1c9aa7ec
...@@ -3197,6 +3197,13 @@ Create_func_binlog_gtid_pos Create_func_binlog_gtid_pos::s_singleton; ...@@ -3197,6 +3197,13 @@ Create_func_binlog_gtid_pos Create_func_binlog_gtid_pos::s_singleton;
Item* Item*
Create_func_binlog_gtid_pos::create_2_arg(THD *thd, Item *arg1, Item *arg2) Create_func_binlog_gtid_pos::create_2_arg(THD *thd, Item *arg1, Item *arg2)
{ {
#ifdef HAVE_REPLICATION
if (!mysql_bin_log.is_open())
#endif
{
my_error(ER_NO_BINARY_LOGGING, MYF(0));
return NULL;
}
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
return new (thd->mem_root) Item_func_binlog_gtid_pos(arg1, arg2); return new (thd->mem_root) Item_func_binlog_gtid_pos(arg1, arg2);
} }
......
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