diff options
author | Michael Widenius <monty@mariadb.org> | 2018-03-09 14:05:35 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-03-29 13:59:44 +0300 |
commit | a7abddeffa6a760ce948c2dfb007cdf3f1a369d5 (patch) | |
tree | 70eb743fa965a17380bbc0ac88ae79ca1075b896 /mysql-test/main/type_json.result | |
parent | ab1941266c59a19703a74b5593cf3f508a5752d7 (diff) | |
download | mariadb-git-a7abddeffa6a760ce948c2dfb007cdf3f1a369d5.tar.gz |
Create 'main' test directory and move 't' and 'r' there
Diffstat (limited to 'mysql-test/main/type_json.result')
-rw-r--r-- | mysql-test/main/type_json.result | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/main/type_json.result b/mysql-test/main/type_json.result new file mode 100644 index 00000000000..2c1fdbe2b95 --- /dev/null +++ b/mysql-test/main/type_json.result @@ -0,0 +1,39 @@ +create or replace table t1(a json); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1(a json character set utf8); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character set utf8)' at line 1 +create or replace table t1(a json default '{a:1}'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '{a:1}' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1(a json not null check (json_valid(a))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a`)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 values ('[]'); +insert t1 values ('a'); +ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +set timestamp=unix_timestamp('2010:11:12 13:14:15'); +create or replace table t1(a json default(json_object('now', now()))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',current_timestamp()) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 values (); +select * from t1; +a +{"now": "2010-11-12 13:14:15"} +drop table t1; +select cast('{a:1}' as text); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'text)' at line 1 +select cast('{a:1}' as json); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json)' at line 1 |