diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index a1d39f9ef7b..1522604060b 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -38,7 +38,7 @@ TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE= TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA== '; SET @binlog_fragment_1=''; -BINLOG DEFRAGMENT(@binlog_fragment_0, @binlog_fragment_1); +BINLOG CONCAT(@binlog_fragment_0, @binlog_fragment_1); select * from t1; a 1 diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index 19e8ccc1905..5f45251392a 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -86,7 +86,7 @@ TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE= TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA== '; SET @binlog_fragment_1=''; -BINLOG DEFRAGMENT(@binlog_fragment_0, @binlog_fragment_1); +BINLOG CONCAT(@binlog_fragment_0, @binlog_fragment_1); # The above line should succeed and 3 should be in the table select * from t1; diff --git a/sql/item_create.cc b/sql/item_create.cc index 82f6bbd3173..8ced934143e 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -631,19 +631,6 @@ class Create_func_compress : public Create_func_arg1 }; -class Create_func_concat : public Create_native_func -{ -public: - virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); - - static Create_func_concat s_singleton; - -protected: - Create_func_concat() {} - virtual ~Create_func_concat() {} -}; - - class Create_func_decode_histogram : public Create_func_arg2 { public: @@ -3475,26 +3462,6 @@ Create_func_dyncol_json::create_1_arg(THD *thd, Item *arg1) return new (thd->mem_root) Item_func_dyncol_json(thd, arg1); } -Create_func_concat Create_func_concat::s_singleton; - -Item* -Create_func_concat::create_native(THD *thd, LEX_STRING name, - List *item_list) -{ - int arg_count= 0; - - if (item_list != NULL) - arg_count= item_list->elements; - - if (arg_count < 1) - { - my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); - return NULL; - } - - return new (thd->mem_root) Item_func_concat(thd, *item_list); -} - Create_func_decode_histogram Create_func_decode_histogram::s_singleton; Item * @@ -5778,7 +5745,6 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("COLUMN_LIST") }, BUILDER(Create_func_dyncol_list)}, { { C_STRING_WITH_LEN("COLUMN_JSON") }, BUILDER(Create_func_dyncol_json)}, { { C_STRING_WITH_LEN("COMPRESS") }, BUILDER(Create_func_compress)}, - { { C_STRING_WITH_LEN("CONCAT") }, BUILDER(Create_func_concat)}, { { C_STRING_WITH_LEN("CONCAT_WS") }, BUILDER(Create_func_concat_ws)}, { { C_STRING_WITH_LEN("CONNECTION_ID") }, BUILDER(Create_func_connection_id)}, { { C_STRING_WITH_LEN("CONV") }, BUILDER(Create_func_conv)}, diff --git a/sql/lex.h b/sql/lex.h index cd3f3803b80..322c26bdc2c 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -133,7 +133,6 @@ static SYMBOL symbols[] = { { "COMPACT", SYM(COMPACT_SYM)}, { "COMPLETION", SYM(COMPLETION_SYM)}, { "COMPRESSED", SYM(COMPRESSED_SYM)}, - { "DEFRAGMENT", SYM(DEFRAGMENT_SYM)}, { "CONCURRENT", SYM(CONCURRENT)}, { "CONDITION", SYM(CONDITION_SYM)}, { "CONNECTION", SYM(CONNECTION_SYM)}, @@ -679,6 +678,7 @@ static SYMBOL sql_functions[] = { { "BIT_OR", SYM(BIT_OR)}, { "BIT_XOR", SYM(BIT_XOR)}, { "CAST", SYM(CAST_SYM)}, + { "CONCAT", SYM(CONCAT_SYM)}, { "COUNT", SYM(COUNT_SYM)}, { "CURDATE", SYM(CURDATE)}, { "CURTIME", SYM(CURTIME)}, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c15a3e98110..dff093ec9ba 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1134,6 +1134,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token COMPACT_SYM %token COMPLETION_SYM %token COMPRESSED_SYM +%token CONCAT_SYM %token CONCURRENT %token CONDITION_SYM /* SQL-2003-R, SQL-2008-R */ %token CONNECTION_SYM @@ -1179,7 +1180,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token DECLARE_SYM /* SQL-2003-R */ %token DEFAULT /* SQL-2003-R */ %token DEFINER_SYM -%token DEFRAGMENT_SYM /* MYSQL */ %token DELAYED_SYM %token DELAY_KEY_WRITE_SYM %token DELETE_SYM /* SQL-2003-R */ @@ -7953,7 +7953,7 @@ binlog_base64_event: Lex->comment= $2; } | - BINLOG_SYM DEFRAGMENT_SYM '(' '@' ident_or_text ',' '@' ident_or_text ')' + BINLOG_SYM CONCAT_SYM '(' '@' ident_or_text ',' '@' ident_or_text ')' { Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT; Lex->fragmented_binlog_event.n_frag= 2; @@ -9645,6 +9645,12 @@ function_call_conflict: if ($$ == NULL) MYSQL_YYABORT; } + | CONCAT_SYM '(' expr_list ')' + { + $$= new (thd->mem_root) Item_func_concat(thd, *$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DATABASE '(' ')' { $$= new (thd->mem_root) Item_func_database(thd); @@ -13932,6 +13938,7 @@ keyword: | COLUMN_GET_SYM {} | COMMENT_SYM {} | COMMIT_SYM {} + | CONCAT_SYM {} | CONTAINS_SYM {} | DEALLOCATE_SYM {} | DO_SYM {} @@ -14047,7 +14054,6 @@ keyword_sp: | DATE_SYM {} | DAY_SYM {} | DEFINER_SYM {} - | DEFRAGMENT_SYM {} | DELAY_KEY_WRITE_SYM {} | DES_KEY_FILE {} | DIAGNOSTICS_SYM {}