Skip to content

mysql: enum values are sometimes string, sometimes int #3183

Description

@pankajmyt

Peerdb -> latest version
clickhouse -> latest version

clickhouse table that got created
CREATE TABLE myt.myt_twilio_sms
(
    `id` Int32,
   ....
   `message_sent_by` LowCardinality(String),
....
    `_peerdb_synced_at` DateTime64(9) DEFAULT now64(),
    `_peerdb_is_deleted` Int8,
    `_peerdb_version` Int64
)
ENGINE = ReplacingMergeTree(_peerdb_version)
PRIMARY KEY id
ORDER BY id
SETTINGS index_granularity = 8192

mysql table

CREATE TABLE `twilio_sms` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message_sent_by` enum('sms','whatsapp') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sms',
  ....
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid` (`uuid`),
) ENGINE=InnoDB AUTO_INCREMENT=2435567 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

over a synced data for 1 month. on 15 days message_sent_by value is 'whatsapp' then it become 2 for couple of days. Then again its whatsapp.


Will like it to be consistent to run queries, and will prefer string.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions