Bug #103897 Cannot import json data in version 5.7.16, but in 5.7.17 it is OK
Submitted: 3 Jun 2021 7:03 Modified: 3 Jun 2021 8:35
Reporter: z yz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: JSON Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Jun 2021 7:03] z yz
Description:
I have meet some issue when i load data in MySQL server 
it is different in version 5.7.16 and 5.7.17

when i using version 5.7.16, when i enter "source formdesignerinfo.SQL;"
it hangs for a lot of time and cannot stop , show processlist can see this query,
but this file only include one line for json type table , it running for a long time and cannot stop .

when i using version 5.7.17 , when i enter "source formdesignerinfo.SQL;"
it execute succressfully in less then 1 sec
mysql> source formdesignerinfo.SQL;
Query OK, 1 row affected (0.18 sec)

mysql>

How to repeat:
mysql> create database pai_core;
Query OK, 1 row affected (0.00 sec)

mysql> use pai_core
Database changed

CREATE TABLE `formdesignerinfo` (
  `id` varchar(36) CHARACTER SET utf8 NOT NULL COMMENT '主键',
  `fromId` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '来自哪个版本的Id',
  `compJsons` json DEFAULT NULL COMMENT '组件json数据',
  `dataJsons` json DEFAULT NULL COMMENT 'smartDs数据json',
  `initJsons` json DEFAULT NULL COMMENT '初始化方法的json',
  `serviceJsons` json DEFAULT NULL COMMENT 'service数据的json',
  `viewModels` json DEFAULT NULL COMMENT '视图模式',
  `ver` decimal(9,2) DEFAULT NULL COMMENT '版本号',
  `compileFile` json DEFAULT NULL COMMENT '编译后的文件数据',
  `selectedTranModel` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `cssTextData` text CHARACTER SET utf8,
  `formDesignerId` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '父表主键',
  `verDesc` json DEFAULT NULL COMMENT '版本描述',
  `created_by` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建用户',
  `created_date` datetime DEFAULT NULL COMMENT '创建时间',
  `last_modified_by` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '更新用户',
  `last_modified_date` datetime DEFAULT NULL COMMENT '更新时间',
  `is_del` tinyint(4) DEFAULT '0' COMMENT '是否删除(0_false,1_true)',
  PRIMARY KEY (`id`),
  KEY `FormVer` (`ver`,`formDesignerId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='表单设计器子信息表'

mysql> source formdesignerinfo.SQL;
^C^C -- query aborted
^C^C -- query aborted

file link:
https://cslc1.s3.cn-north-1.amazonaws.com.cn/formdesignerinfo.SQL
[3 Jun 2021 8:35] MySQL Verification Team
Hello z yz!

Thank you for the report and test case.
I'm not seeing any issues in latest GA 5.7.34.
Please note that 5.7.16 is very old version and since then many bugs fixed. Also, we don't fix bugs in old versions, don't backport bug fixes, so need to check with latest version anyway. So, please, upgrade and inform us if problem still exists.

-

mysql> create database pai_core;
Query OK, 1 row affected (0.02 sec)

mysql> use pai_core
Database changed
mysql> CREATE TABLE `formdesignerinfo` (
    ->   `id` varchar(36) CHARACTER SET utf8 NOT NULL COMMENT '主键',
    ->   `fromId` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '来自哪个版本的Id',
    ->   `compJsons` json DEFAULT NULL COMMENT '组件json数据',
    ->   `dataJsons` json DEFAULT NULL COMMENT 'smartDs数据json',
    ->   `initJsons` json DEFAULT NULL COMMENT '初始化方法的json',
    ->   `serviceJsons` json DEFAULT NULL COMMENT 'service数据的json',
    ->   `viewModels` json DEFAULT NULL COMMENT '视图模式',
    ->   `ver` decimal(9,2) DEFAULT NULL COMMENT '版本号',
    ->   `compileFile` json DEFAULT NULL COMMENT '编译后的文件数据',
    ->   `selectedTranModel` varchar(50) COLLATE utf8_bin DEFAULT NULL,
    ->   `cssTextData` text CHARACTER SET utf8,
    ->   `formDesignerId` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '父表主键',
    ->   `verDesc` json DEFAULT NULL COMMENT '版本描述',
    ->   `created_by` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建用户',
    ->   `created_date` datetime DEFAULT NULL COMMENT '创建时间',
    ->   `last_modified_by` varchar(36) CHARACTER SET utf8 DEFAULT NULL COMMENT '更新用户',
    ->   `last_modified_date` datetime DEFAULT NULL COMMENT '更新时间',
    ->   `is_del` tinyint(4) DEFAULT '0' COMMENT '是否删除(0_false,1_true)',
    ->   PRIMARY KEY (`id`),
    ->   KEY `FormVer` (`ver`,`formDesignerId`)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='表单设计器子信息表';
Query OK, 0 rows affected (0.06 sec)

mysql> source formdesignerinfo.SQL;
Query OK, 1 row affected (0.36 sec)

mysql> select count(*) from formdesignerinfo;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

mysql> show variables like '%version%';
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 5.7.34                       |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| tls_version             | TLSv1,TLSv1.1,TLSv1.2        |
| version                 | 5.7.34                       |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86_64                       |
| version_compile_os      | el7                          |
+-------------------------+------------------------------+
8 rows in set (0.00 sec)

regards,
Umesh