Commit 3edc4a09 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-25229 SON_TABLE: Server crashes in hton_name upon MATCH .. AGAINST.

No plugin for the JSON_TABLE so get the storage type name directly.
parent 6a5f86bf
......@@ -554,5 +554,10 @@ View Create View character_set_client collation_connection
v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `jt`.`o` AS `o` from JSON_TABLE('{}', '$' COLUMNS (NESTED PATH '$.*' COLUMNS (NESTED PATH '$.*' COLUMNS (`o` FOR ORDINALITY)))) `jt` latin1 latin1_swedish_ci
DROP VIEW v;
#
# MDEV-25229 JSON_TABLE: Server crashes in hton_name upon MATCH .. AGAINST.
#
SELECT val, MATCH(val) AGAINST( 'MariaDB') FROM JSON_TABLE('{"db":"xx"}', '$' COLUMNS(val VARCHAR(32) PATH '$**.*')) AS jt;
ERROR HY000: The storage engine JSON_TABLE function doesn't support FULLTEXT indexes
#
# End of 10.6 tests
#
......@@ -430,6 +430,13 @@ SELECT * FROM v;
SHOW CREATE VIEW v;
DROP VIEW v;
--echo #
--echo # MDEV-25229 JSON_TABLE: Server crashes in hton_name upon MATCH .. AGAINST.
--echo #
--error ER_TABLE_CANT_HANDLE_FT
SELECT val, MATCH(val) AGAINST( 'MariaDB') FROM JSON_TABLE('{"db":"xx"}', '$' COLUMNS(val VARCHAR(32) PATH '$**.*')) AS jt;
--echo #
--echo # End of 10.6 tests
--echo #
......@@ -4154,7 +4154,7 @@ class handler :public Sql_alloc
{ return; } /* prepare InnoDB for HANDLER */
virtual void free_foreign_key_create_info(char* str) {}
/** The following can be called without an open handler */
const char *table_type() const { return hton_name(ht)->str; }
virtual const char *table_type() const { return hton_name(ht)->str; }
const char **bas_ext() const { return ht->tablefile_extensions; }
virtual int get_default_no_partitions(HA_CREATE_INFO *create_info)
......
......@@ -73,6 +73,10 @@ class ha_json_table: public handler
handler *clone(const char *name, MEM_ROOT *mem_root) override { return NULL; }
/* Rows also use a fixed-size format */
enum row_type get_row_type() const override { return ROW_TYPE_FIXED; }
const char *table_type() const override
{
return "JSON_TABLE function";
}
ulonglong table_flags() const override
{
return (HA_FAST_KEY_READ | /*HA_NO_BLOBS |*/ HA_NULL_IN_KEY |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment