mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-11445 JSON_MERGE requires at least two arguments in MySQL, but not in MariaDB.
Create_func_json_merge::create_native fixed.
This commit is contained in:
@@ -197,6 +197,8 @@ t1 CREATE TABLE `t1` (
|
||||
`json_quote('foo')` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select json_merge('string');
|
||||
ERROR 42000: Incorrect parameter count in the call to native function 'json_merge'
|
||||
select json_merge('string', 123);
|
||||
json_merge('string', 123)
|
||||
["string", 123]
|
||||
|
@@ -83,6 +83,8 @@ select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
|
||||
select json_merge('string');
|
||||
select json_merge('string', 123);
|
||||
|
||||
select json_type('{"k1":123, "k2":345}');
|
||||
|
@@ -5192,7 +5192,7 @@ Create_func_json_merge::create_native(THD *thd, LEX_STRING name,
|
||||
int arg_count;
|
||||
|
||||
if (item_list == NULL ||
|
||||
(arg_count= item_list->elements) == 0)
|
||||
(arg_count= item_list->elements) < 2) // json, json
|
||||
{
|
||||
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
|
||||
func= NULL;
|
||||
|
Reference in New Issue
Block a user