Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE TABLE DDL not transformed properly #321

Closed
subkanthi opened this issue Oct 20, 2023 · 4 comments
Closed

CREATE TABLE DDL not transformed properly #321

subkanthi opened this issue Oct 20, 2023 · 4 comments
Assignees
Labels
bug Something isn't working GA-1 All the issues that are issues in release(Scheduled Dec 2023) high-priority mysql qa-verified label to mark issues that were verified by QA

Comments

@subkanthi
Copy link
Collaborator

CREATE TABLE `t1` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `h1` varchar(64) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `v1` varchar(4096) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hint_uidx` (`h1`)
) ENGINE=InnoDB AUTO_INCREMENT=157407 DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs
@subkanthi
Copy link
Collaborator Author

In 23.3.4.17, the table was created in Clickhouse

show create table t1;

SHOW CREATE TABLE t1

Query id: d40e1c9c-75fe-48eb-a5b0-3cb3a41494b6

┌─statement──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE test.t1
(
    `id` Int64,
    `last_update` DateTime64(3),
    `h1` String,
    `v1` String,
    `_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. 

a96470a11fe1 :) select version();

SELECT version()

Query id: 31c3c353-9fcb-43b6-b4ca-cfa4a6fea2e7

┌─version()─┐
│ 23.3.4.17 │
└───────────┘

1 row in set. Elapsed: 0.002 sec. 

@aadant aadant added the bug Something isn't working label Oct 20, 2023
@subkanthi
Copy link
Collaborator Author

seems to work even with allow_nullable_key

CREATE TABLE test.t5
(
    `id` Int64,
    `last_update` DateTime64(3),
    `h1` String,
    `v1` String,
    `_version` UInt64,
    `is_deleted` UInt8
)
ENGINE = ReplacingMergeTree(_version, is_deleted)
ORDER BY id
SETTINGS index_granularity = 8192, allow_nullable_key = 1

@subkanthi
Copy link
Collaborator Author

Adding not null similar to the python version.

@subkanthi
Copy link
Collaborator Author

Fixed in #356

@subkanthi subkanthi added the GA-1 All the issues that are issues in release(Scheduled Dec 2023) label Dec 18, 2023
@Selfeer Selfeer added the qa-verified label to mark issues that were verified by QA label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GA-1 All the issues that are issues in release(Scheduled Dec 2023) high-priority mysql qa-verified label to mark issues that were verified by QA
Projects
None yet
Development

No branches or pull requests

3 participants