Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: create table中直接使用/*T![auto_rand] AUTO_RANDOM(5) */不会创建auto_random?
TiDB Version: v5.3.0
Question 1: As follows:
Question 2:
Using dumpling and lightning for export and import, auto_random is also gone.
Please provide the table creation statement, and I’ll give it a try.
tidb version: v5.3.0
CREATE TABLE `log_mobile_ones1` (
`id` bigint(11) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
`mobile` varchar(255) NOT NULL DEFAULT '',
`app_id` varchar(255) DEFAULT NULL,
`uuid` varchar(255) DEFAULT '',
`data` json DEFAULT NULL,
`send_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
KEY `idx_mobile` (`mobile`),
KEY `idx_app_id` (`app_id`),
KEY `idx_send_at` (`send_at`),
KEY `idx_uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
I tested it and there was no problem. I suspect that your client version is relatively low, try adding --comments
when logging in.
The above content was exported using dumpling and then imported using lightning. The lightning import also does not have auto_random.
The client is MySQL 8.0.30.
The image is not visible. Please provide the text you need translated.
Did you add --comments
when logging in?
Adding --comments is fine.
However, there are still issues with Dumpling and Lightning.
This might be a bug with dumpling. I tested it on version 5.3 and it indeed doesn’t work, but exporting with TiDB version 6.1 works fine.
Okay, we will take a look at how to solve it on our end. Thank you, thank you.
Please use the latest version of the tool. It is backward compatible by default and also resolves long-standing bugs.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.