1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-32790: Output result in show create table for mysql_json type should be longtext

- We don't test `json` MySQL tables from `std_data` since the error `ER_TABLE_NEEDS_REBUILD
` is invoked. However MDEV-32235 will override this test after merge,
but leave it to show behavior and historical changes.

- Closes PR #2833
Reviewer: <cvicentiu@mariadb.org>
          <serg@mariadb.com>
This commit is contained in:
Anel Husakovic
2023-11-13 15:40:13 +01:00
committed by Anel
parent 9e9e0b99ad
commit 9a5f85dcbe
3 changed files with 81 additions and 1 deletions

View File

@ -88,3 +88,39 @@ from mysql_json_test_big;
drop table tempty;
drop table mysql_json_test;
drop table mysql_json_test_big;
--echo #
--echo # MDEV-32790: Output result in show create table
--echo # for mysql_json type should be longtext
--echo #
create table t1(j json);
show create table t1;
drop table t1;
create table t1(j mysql_json);
show create table t1;
drop table t1;
# `json` type should not have character set and collation other than utf8mb4_bin
--error ER_PARSE_ERROR
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
# By removing character set from `json` field query should work and
# expand to `longtext` with characterset
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
drop table testjson;
# `longtext` that is alias can have character set
create table `testjson` (
`t` longtext /* JSON from MySQL 5.7 */ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
drop table testjson;
--echo #
--echo # End of 10.5 tests
--echo #