diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2021-12-13 07:29:25 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2021-12-13 07:29:25 +0400 |
commit | 9bb8cb4d262956611b0cedf30325a571ec6710e5 (patch) | |
tree | 3be65eac4eef78f32e1aa6db36f963e780d79cce /sql/json_table.cc | |
parent | 5be1d7f2a070a697ad30e17678dbad7de117962c (diff) | |
download | mariadb-git-bb-10.8-mdev22224-hf.tar.gz |
MDEV-22224 Support JSON Path negative index.bb-10.8-mdev22224-hf
When we see the negative index in the path, we do extra parsing to
calculate the size of the array.
Diffstat (limited to 'sql/json_table.cc')
-rw-r--r-- | sql/json_table.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/json_table.cc b/sql/json_table.cc index e57dccd00c4..30d59fb06b5 100644 --- a/sql/json_table.cc +++ b/sql/json_table.cc @@ -312,7 +312,8 @@ handle_new_nested: while (!json_get_path_next(&m_engine, &m_cur_path)) { - if (json_path_compare(&m_path, &m_cur_path, m_engine.value_type)) + if (json_path_compare(&m_path, &m_cur_path, m_engine.value_type, + NULL)) continue; /* path found. */ ++m_ordinality_counter; @@ -501,7 +502,7 @@ int ha_json_table::fill_column_values(THD *thd, uchar * buf, uchar *pos) { json_engine_t je; json_path_step_t *cur_step; - uint array_counters[JSON_DEPTH_LIMIT]; + int array_counters[JSON_DEPTH_LIMIT]; int not_found; const uchar* node_start; const uchar* node_end; |