Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.2.25
-
None
Description
Hi,
In my particular case I tested this from a Galera cluster to an asynchronous slave, but I don't think the Galera part has anything to do with it.
On the cluster, I have a schema. On the slave I have the same schema but with a denormalization of the week number:
CREATE TABLE `example` (
|
`id` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
`user_id` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
`event_code` int(11) NOT NULL,
|
`local_date_time` datetime NOT NULL,
|
`utc_date_time` datetime NOT NULL,
|
`collection_id` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
PRIMARY KEY(id)
|
);
|
On the slave I add a virtual column:
ALTER TABLE example
|
ADD `local_year_weeknum` int(11) GENERATED ALWAYS AS (year(`local_date_time`) * 100 + week(`local_date_time`, 0)) VIRTUAL,
|
ADD KEY `michael_user_yearweeknum_collection_eventcode` (`user_id`, `local_year_weeknum`, `collection_id`, `event_code`);
|
I can find data that is already present in the example table, but when data comes in through replication it does not appear in the index.
I can, however, select the same data using the clustered index.
Thanks in advance!
Michaël
Attachments
Issue Links
- relates to
-
MDEV-17890 Server crash on DELETE with YEAR field with truncated expr
- Closed