MDEV-21915 Server crashes in copy_fields,Item_func_group_concat::add …
…while using json_arrayagg() as a window function. We don't support JSON_ARRAYAGG and JSON_OBJECTAGG in window functions yet.
This commit is contained in:
parent
2e6b21be4a
commit
ffc5e00e9c
@ -1221,3 +1221,14 @@ SELECT JSON_ARRAYAGG(a) FROM t1;
|
|||||||
JSON_ARRAYAGG(a)
|
JSON_ARRAYAGG(a)
|
||||||
NULL
|
NULL
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-21915 Server crashes in copy_fields,Item_func_group_concat::add
|
||||||
|
while using json_arrayagg() as a window function
|
||||||
|
#
|
||||||
|
select json_arrayagg(a) over () from (select 1 a) t;
|
||||||
|
ERROR 42000: This version of MariaDB doesn't yet support 'JSON_ARRAYAGG() aggregate as window function'
|
||||||
|
select json_objectagg(a, b) over () from (select 1 a, 2 b) t;
|
||||||
|
ERROR 42000: This version of MariaDB doesn't yet support 'JSON_OBJECTAGG() aggregate as window function'
|
||||||
|
#
|
||||||
|
# End of 10.5 tests
|
||||||
|
#
|
||||||
|
@ -740,3 +740,19 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
SELECT JSON_ARRAYAGG(a) FROM t1;
|
SELECT JSON_ARRAYAGG(a) FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
-- echo #
|
||||||
|
-- echo # MDEV-21915 Server crashes in copy_fields,Item_func_group_concat::add
|
||||||
|
-- echo while using json_arrayagg() as a window function
|
||||||
|
-- echo #
|
||||||
|
|
||||||
|
--error ER_NOT_SUPPORTED_YET
|
||||||
|
select json_arrayagg(a) over () from (select 1 a) t;
|
||||||
|
|
||||||
|
--error ER_NOT_SUPPORTED_YET
|
||||||
|
select json_objectagg(a, b) over () from (select 1 a, 2 b) t;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ public:
|
|||||||
bool is_json_type() { return true; }
|
bool is_json_type() { return true; }
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
|
enum Sumfunctype sum_func () const {return JSON_OBJECTAGG_FUNC;}
|
||||||
const char *func_name() const { return "json_objectagg("; }
|
const char *func_name() const { return "json_objectagg("; }
|
||||||
const Type_handler *type_handler() const
|
const Type_handler *type_handler() const
|
||||||
{
|
{
|
||||||
|
@ -355,7 +355,8 @@ public:
|
|||||||
ROW_NUMBER_FUNC, RANK_FUNC, DENSE_RANK_FUNC, PERCENT_RANK_FUNC,
|
ROW_NUMBER_FUNC, RANK_FUNC, DENSE_RANK_FUNC, PERCENT_RANK_FUNC,
|
||||||
CUME_DIST_FUNC, NTILE_FUNC, FIRST_VALUE_FUNC, LAST_VALUE_FUNC,
|
CUME_DIST_FUNC, NTILE_FUNC, FIRST_VALUE_FUNC, LAST_VALUE_FUNC,
|
||||||
NTH_VALUE_FUNC, LEAD_FUNC, LAG_FUNC, PERCENTILE_CONT_FUNC,
|
NTH_VALUE_FUNC, LEAD_FUNC, LAG_FUNC, PERCENTILE_CONT_FUNC,
|
||||||
PERCENTILE_DISC_FUNC, SP_AGGREGATE_FUNC, JSON_ARRAYAGG_FUNC
|
PERCENTILE_DISC_FUNC, SP_AGGREGATE_FUNC, JSON_ARRAYAGG_FUNC,
|
||||||
|
JSON_OBJECTAGG_FUNC
|
||||||
};
|
};
|
||||||
|
|
||||||
Item **ref_by; /* pointer to a ref to the object used to register it */
|
Item **ref_by; /* pointer to a ref to the object used to register it */
|
||||||
|
@ -2936,6 +2936,14 @@ bool Window_func_runner::add_function_to_run(Item_window_func *win_func)
|
|||||||
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
||||||
"COUNT(DISTINCT) aggregate as window function");
|
"COUNT(DISTINCT) aggregate as window function");
|
||||||
return true;
|
return true;
|
||||||
|
case Item_sum::JSON_ARRAYAGG_FUNC:
|
||||||
|
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
||||||
|
"JSON_ARRAYAGG() aggregate as window function");
|
||||||
|
return true;
|
||||||
|
case Item_sum::JSON_OBJECTAGG_FUNC:
|
||||||
|
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
||||||
|
"JSON_OBJECTAGG() aggregate as window function");
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user