Files
tidb/tests/integrationtest/r/expression/multi_valued_index.result
2024-06-18 03:22:16 +00:00

519 lines
30 KiB
Plaintext

drop table if exists t;
create table t(a json);
select cast(a as signed array) from t;
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
select json_extract(cast(a as signed array), '$[0]') from t;
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
select * from t where cast(a as signed array);
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
select cast('[1,2,3]' as unsigned array);
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
drop table t;
CREATE TABLE t(x INT, KEY k ((1 AND CAST(JSON_ARRAY(x) AS UNSIGNED ARRAY))));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
CREATE TABLE t1 (f1 json, key mvi((cast(cast(f1 as unsigned array) as unsigned array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
CREATE TABLE t1 (f1 json, primary key mvi((cast(cast(f1 as unsigned array) as unsigned array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
CREATE TABLE t1 (f1 json, key mvi((cast(f1->>'$[*]' as unsigned array))));
Error 3146 (22032): Invalid data type for JSON data in argument 1 to function cast_as_array; a JSON string or JSON type is required.
CREATE TABLE t1 (f1 json, key mvi((cast(f1->'$[*]' as year array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of year(-1) BINARY'
CREATE TABLE t1 (f1 json, key mvi((cast(f1->'$[*]' as json array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of json BINARY'
CREATE TABLE t1 (f1 json, key mvi((cast(f1->'$[*]' as char(10) charset gbk array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'specifying charset for multi-valued index'
create table t(j json, gc json as ((concat(cast(j->'$[*]' as unsigned array),"x"))));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
create table t(j json, gc json as (cast(j->'$[*]' as unsigned array)));
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
create table t1(j json, key i1((cast(j->"$" as char array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs with unspecified length'
create table t1(j json, key i1((cast(j->"$" as binary array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of char/binary BLOBs with unspecified length'
create table t1(j json, key i1((cast(j->"$" as float array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of float BINARY'
create table t1(j json, key i1((cast(j->"$" as decimal(4,2) array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'CAST-ing data to array of decimal(4,2) BINARY'
create view v as select cast('[1,2,3]' as unsigned array);
Error 1235 (42000): This version of TiDB doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
create table t(a json, index idx((cast(a as signed array))));
drop table t;
create table t(a json, index idx(((cast(a as signed array)))));
drop table t;
create table t(j json, key i1((cast(j->"$" as double array))));
drop table t;
create table t(a json, b int, index idx(b, (cast(a as signed array)), (cast(a as signed array))));
Error 1235 (42000): This version of TiDB doesn't yet support 'more than one multi-valued key part per index'
create table t(a json, b int);
create index idx on t (b, (cast(a as signed array)), (cast(a as signed array)));
Error 1235 (42000): This version of TiDB doesn't yet support 'more than one multi-valued key part per index'
alter table t add index idx(b, (cast(a as signed array)), (cast(a as signed array)));
Error 1235 (42000): This version of TiDB doesn't yet support 'more than one multi-valued key part per index'
create index idx1 on t (b, (cast(a as signed array)));
alter table t add index idx2(b, (cast(a as signed array)));
drop table t;
create table t(a json, b int, index idx3(b, (cast(a as signed array))));
drop table t;
set names gbk;
create table t(a json, b int, index idx3(b, (cast(a as char(10) array))));
CREATE TABLE users (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, doc JSON);
CREATE TABLE t (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, doc JSON, FOREIGN KEY fk_user_id ((cast(doc->'$[*]' as signed array))) REFERENCES users(id));
Error 1072 (42000): Key column '_V$_fk_user_id_0' doesn't exist in table
set names default;
set @@sql_mode='';
drop table if exists t;
create table t(a json, index idx((cast(a as unsigned array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
Error 3752 (HY000): Value is out of range for expression index 'idx' at row 1
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as signed array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as char(1) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as char(2) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as binary(1) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as binary(2) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as date array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as time array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as datetime array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as double array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
insert into t values ('[1.0]');
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
set @@sql_mode=default;
drop table if exists t;
create table t(a json, index idx((cast(a as unsigned array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
Error 3752 (HY000): Value is out of range for expression index 'idx' at row 1
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as signed array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as char(1) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as char(2) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as binary(1) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as binary(2) array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
insert into t values ('["a"]');
insert into t values ('["汉字"]');
Error 3907 (HY000): Data too long for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as date array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as time array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as datetime array))));
insert into t values ('[1,2,3]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[-1]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.0]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
drop table if exists t;
create table t(a json, index idx((cast(a as double array))));
insert into t values ('[1,2,3]');
insert into t values ('[-1]');
insert into t values ('["1"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["a"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('["汉字"]');
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values ('[1.2]');
insert into t values ('[1.0]');
insert into t values (json_array(cast("11:00:00" as time)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02" as date)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast("2022-02-02 11:00:00" as datetime)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
insert into t values (json_array(cast('{"a":1}' as json)));
Error 3903 (22018): Invalid JSON value for CAST for expression index 'idx'
set sql_mode=default;
drop table if exists t;
create table t (j json not null, str varchar(5), KEY `idx` ((cast(`j` as unsigned array)),`str`));
insert into t values ('1', 'abcde');
drop table t;
create table t (j json not null, str varchar(5) collate utf8mb4_unicode_ci, KEY `idx` ((cast(`j` as unsigned array)),`str`));
insert into t values ('1', 'abcde');
drop table t;
create table t (j json not null, str varchar(5) collate gbk_chinese_ci, KEY `idx` ((cast(`j` as unsigned array)),`str`));
insert into t values ('1', 'abcde');
drop table t;