Skip to content

sync-diff-inspector: data inconsistency+expression index, will occur upstream don't have key _V$_countries_0 error occured #863

@JQWong7

Description

@JQWong7

Feature Request

Is your feature request related to a problem? Please describe:

upstrem:

drop database if exists test;
create database test;
CREATE TABLE `test`.`t1` (
 `id` bigint(20) NOT NULL,
 `countries` json NOT NULL,
 PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
 KEY `countries` ((cast(`countries` as char(3) array)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `test`.`t1` (
  `id`, `countries`
) VALUES
( 1, '["US", "CA"]'),
(2, '["GB"]'),
(3,'["JP", "KR"]');

downstream:

drop database if exists test;
create database test;
CREATE TABLE `test`.`t1` (
 `id` bigint(20) NOT NULL,
 `countries` json NOT NULL,
 PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
 KEY `countries` ((cast(`countries` as char(3) array)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `test`.`t1` (
  `id`, `countries`
) VALUES
( 1, '["US", "CA"]'),
(2, '["GB"]');

occur error

A total of 1 tables need to be compared


Comparing the table structure of `test`.`t1` ... skip
Comparing the table data of `test`.`t1` ...
_____________________________________________________________________________
Progress [>------------------------------------------------------------] 0% 0/1
Comparing the table data of `test`.`t1` ... failure
_____________________________________________________________________________
Progress [============================================================>] 100% 0/0
Progress [============================================================>] 100% 0/0
Error in comparison process:
upstream don't have key _V$_countries_0 error occured in `test`.`t1`
You can view the comparison details through './output/sync_diff.log'

Describe the feature you'd like:

column list contain expression index name like

Image
column and data filed will not match in

for _, column := range columns {
if data1, ok = map1[column.Name.O]; !ok {
return false, 0, errors.Errorf("upstream don't have key %s", column.Name.O)
}
if data2, ok = map2[column.Name.O]; !ok {
return false, 0, errors.Errorf("downstream don't have key %s", column.Name.O)
}

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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