1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-28480: Assertion `0' failed in Item_row::illegal_method_call on

SELECT FROM JSON_TABLE

Analysis: When fix_fields_if_needed() is called, it doesnt check if operands
are valid because check_cols() is not called. So it doesn't error out and
eventually crashes.
Fix: Use fix_fields_if_needed_for_scalar() instead of
fix_fields_if_needed(). It filters the scalar and returns the error if
it occurs.
This commit is contained in:
Rucha Deodhar
2022-10-10 16:21:46 +05:30
parent 1feccb505f
commit 5a9a80a213
4 changed files with 20 additions and 1 deletions

View File

@@ -1005,5 +1005,11 @@ name VARCHAR(10) CHARACTER SET latin1 COLLATE DEFAULT PATH '$.name'
name
Jeans
#
# MDEV-28480: Assertion `0' failed in Item_row::illegal_method_call
# on SELECT FROM JSON_TABLE
#
SELECT 1 FROM JSON_TABLE (row(1,2), '$' COLUMNS (o FOR ORDINALITY)) AS j;
ERROR 21000: Operand should contain 1 column(s)
#
# End of 10.6 tests
#