You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I am running on latest develop branch with the lightweight connector.
On MySQL when I create a table with constraint it gets replicated to Clickhouse without the constraint.
But when I create a table without a constraint then later add a constraint, the constraint is added to Clickhouse.
Is this a bug or expected behavior?
Below is code to replicate issue:
MySQL Code:
CREATE TABLE `test` (
`id` int NOT NULL AUTO_INCREMENT,
`num` int NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `less_ten` CHECK (num < 10)
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `test2` (
`id` int NOT NULL AUTO_INCREMENT,
`num` int NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
alter table test2 add CONSTRAINT `less_ten` CHECK (num < 10);
On Clickhouse:
3694b8a7cbfe :) show create table test;
SHOW CREATE TABLE test
Query id: 04b938f6-c96b-43f4-9e6f-b98b0ff9ee98
┌─statement─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE etadb.test
(
`id` Int32,
`num` Int32,
`_version` UInt64,
`is_deleted` UInt8
)
ENGINE = ReplacingMergeTree(_version, is_deleted)
ORDER BY id
SETTINGS index_granularity = 8192 │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
1 row in set. Elapsed: 0.002 sec.
3694b8a7cbfe :) show create table test2;
SHOW CREATE TABLE test2
Query id: e635e760-3b39-4a7d-9c25-e76445e12140
┌─statement───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE etadb.test2
(
`id` Int32,
`num` Int32,
`_version` UInt64,
`is_deleted` UInt8,
CONSTRAINT less_ten_2 CHECK num < 10
)
ENGINE = ReplacingMergeTree(_version, is_deleted)
ORDER BY id
SETTINGS index_granularity = 8192 │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
1 row in set. Elapsed: 0.001 sec.
The text was updated successfully, but these errors were encountered:
Note: I am running on latest develop branch with the lightweight connector.
On MySQL when I create a table with constraint it gets replicated to Clickhouse without the constraint.
But when I create a table without a constraint then later add a constraint, the constraint is added to Clickhouse.
Is this a bug or expected behavior?
Below is code to replicate issue:
MySQL Code:
On Clickhouse:
The text was updated successfully, but these errors were encountered: