IMPORT MYSQLDUMP failure for CONSTRAINT CHECK
local test, cockroachedb in docker container, version latest-v21.1, insecure mode library gorm, golang import this mysqldump
DROP TABLE IF EXISTS accounts;
/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE accounts (
type tinyint(4) DEFAULT NULL,
state tinyint(4) DEFAULT NULL,
user_id varchar(64) NOT NULL,
customer_id varchar(20) NOT NULL,
id varchar(40) NOT NULL,
created_at datetime(6) NOT NULL,
updated_at datetime(6) NOT NULL,
deleted_at datetime(6) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY idx_accounts_customer_id (customer_id),
KEY idx_accounts_deleted_at (deleted_at),
CONSTRAINT chk_accounts_user_id CHECK (user_id <> ''),
CONSTRAINT chk_accounts_customer_id CHECK (customer_id <> '')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/!40101 SET character_set_client = @saved_cs_client */;
get the error ERROR: mysql parse error: syntax error at position 1479 near 'CHECK' (SQLSTATE XXUUU)
when i deleted this is two lines: CONSTRAINT chk_accounts_user_id CHECK (user_id <> ''), CONSTRAINT chk_accounts_customer_id CHECK (customer_id <> '') imported successfully
Jira issue: CRDB-9506
Hello, I am Blathers. I am here to help you get the issue triaged.
It looks like you have not filled out the issue in the format of any of our templates. To best assist you, we advise you to use one of these templates.
I have CC'd a few people who may be able to assist you:
- @cockroachdb/sql-schema (found keywords: DROP TABLE)
- @cockroachdb/sql-experience (found keywords: gorm)
- @cockroachdb/bulkio (found keywords: import)
If we have not gotten back to your issue within a few business days, you can try the following:
- Join our community slack channel and ask on #cockroachdb.
- Try find someone from here if you know they worked closely on the area and CC them.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!