1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/func_json_exists.result
Rucha Deodhar 9fe37d5919 MDEV-32854: Make JSON_DEPTH_LIMIT unlimited
This patch is the columnstore-part of the task. Columnstore wanted to have
previous 32 depth, so this patch aims at keeping the compatibility.
2025-09-14 17:16:17 +04:00

29 lines
933 B
Plaintext

DROP DATABASE IF EXISTS json_exists_db;
CREATE DATABASE json_exists_db;
USE json_exists_db;
# ----------------------------------------------------------------------
# Test of JSON_EXISTS function.
# ----------------------------------------------------------------------
# Test case 0
CREATE TABLE t1(j TEXT, p TEXT) ENGINE = columnstore;
SET @json = '{"key1":"xxxx", "key2":[1, 2, 3]}';
INSERT INTO t1 VALUES (@json, '$.key1');
INSERT INTO t1 VALUES (@json, '$.key1[0]');
INSERT INTO t1 VALUES (@json, '$.key2');
INSERT INTO t1 VALUES (@json, '$.key2[1]');
INSERT INTO t1 VALUES (@json, '$.key2[10]');
SELECT
j,
p,
JSON_EXISTS(j, p) AS result
FROM
t1;
j p result
{"key1":"xxxx", "key2":[1, 2, 3]} $.key1 1
{"key1":"xxxx", "key2":[1, 2, 3]} $.key1[0] 1
{"key1":"xxxx", "key2":[1, 2, 3]} $.key2 1
{"key1":"xxxx", "key2":[1, 2, 3]} $.key2[1] 1
{"key1":"xxxx", "key2":[1, 2, 3]} $.key2[10] 0
DROP TABLE t1;
DROP DATABASE json_exists_db;