diff options
author | unknown <knielsen@knielsen-hq.org> | 2014-02-27 08:21:41 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2014-02-27 08:21:41 +0100 |
commit | 5fcb6d4096d45ba5a9fc48c82f45f32f7c5fa5cf (patch) | |
tree | f759f3ce4331bddcf3fc031dc1486ebf9cb09bee /sql/item_create.cc | |
parent | 1c9aa7ec42856ab335ec82b87bbab1a3884b0440 (diff) | |
download | mariadb-git-5fcb6d4096d45ba5a9fc48c82f45f32f7c5fa5cf.tar.gz |
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.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 8466319b66f..a3e0dc6012b 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -3197,6 +3197,13 @@ Create_func_binlog_gtid_pos Create_func_binlog_gtid_pos::s_singleton; Item* 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); return new (thd->mem_root) Item_func_binlog_gtid_pos(arg1, arg2); } |