summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-02-11 16:44:38 +0100
committerunknown <knielsen@knielsen-hq.org>2013-02-11 16:44:38 +0100
commit041f26d349f1afb9edf6b0f17dfecfb3f29a9d25 (patch)
tree820cad1d6821d3d806ee0e7c4f0e5166141a56e4 /sql/item_create.cc
parent132c26604417abb0936df1bca5198c08a5d8bb84 (diff)
downloadmariadb-git-041f26d349f1afb9edf6b0f17dfecfb3f29a9d25.tar.gz
MDEV-26. Intermediate commit.
Implement binlog_gtid_pos() function. This will be used so that the slave can obtain the gtid position automatically from first connect with old-style position - then MASTER_GTID_POS=AUTO will work the next time. Can also be used by mysqldump --master-data to give the current gtid position directly.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index fc31b074055..bfa0e36005a 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -447,6 +447,19 @@ protected:
};
+class Create_func_binlog_gtid_pos : public Create_func_arg2
+{
+public:
+ virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
+
+ static Create_func_binlog_gtid_pos s_singleton;
+
+protected:
+ Create_func_binlog_gtid_pos() {}
+ virtual ~Create_func_binlog_gtid_pos() {}
+};
+
+
class Create_func_bit_count : public Create_func_arg1
{
public:
@@ -3100,6 +3113,16 @@ Create_func_bin::create_1_arg(THD *thd, Item *arg1)
}
+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)
+{
+ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
+ return new (thd->mem_root) Item_func_binlog_gtid_pos(arg1, arg2);
+}
+
+
Create_func_bit_count Create_func_bit_count::s_singleton;
Item*
@@ -5323,6 +5346,7 @@ static Native_func_registry func_array[] =
{ { C_STRING_WITH_LEN("ATAN2") }, BUILDER(Create_func_atan)},
{ { C_STRING_WITH_LEN("BENCHMARK") }, BUILDER(Create_func_benchmark)},
{ { C_STRING_WITH_LEN("BIN") }, BUILDER(Create_func_bin)},
+ { { C_STRING_WITH_LEN("BINLOG_GTID_POS") }, BUILDER(Create_func_binlog_gtid_pos)},
{ { C_STRING_WITH_LEN("BIT_COUNT") }, BUILDER(Create_func_bit_count)},
{ { C_STRING_WITH_LEN("BIT_LENGTH") }, BUILDER(Create_func_bit_length)},
{ { C_STRING_WITH_LEN("BUFFER") }, GEOM_BUILDER(Create_func_buffer)},