Skip to content

bad 'where' for table xxxx: field xxx doen't exist #523

Closed
@jmbkeyes

Description

@jmbkeyes

Description

when I use dtle to sync table from one mysql to another server.
the job status raises "bad 'where' for table bocai.trainee_center_info: field centerId does not exist"
The table trainee_center_info has the following columns(id, centerId, name, ......), and pk is id, and centerId is the sharding key.

Steps to reproduce the issue

  1. create table trainee_center_info (id, name, centerId)[id is pk, centerId is sharding key], and insert test data to the test table.
  2. config the job.json
  3. use api to add the job

Describe the results you received

[root@slave2 ~]# curl -XGET "10.0.0.72:8190/v1/jobs" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2455 0 2455 0 0 554k 0 --:--:-- --:--:-- --:--:-- 599k
[
{
"CreateIndex": 814,
"ID": "9d355a52-fe3d-6d9e-0b8f-725bf9639c24",
"JobModifyIndex": 825,
"JobSummary": {
"Constraints": null,
"CreateIndex": 814,
"Datacenters": [
"dc1"
],
"EnforceIndex": false,
"Failover": false,
"ID": "9d355a52-fe3d-6d9e-0b8f-725bf9639c24",
"JobModifyIndex": 825,
"ModifyIndex": 825,
"Name": "dtle-shard2",
"Orders": null,
"Region": "global",
"Status": "dead",
"StatusDescription": "bad 'where' for table bocai.trainee_center_info: field centerId does not exist",
"Tasks": [
{
"Config": {
"TrafficAgainstLimits": 0,
"NatsAddr": "10.0.0.73:8193",
"ReplicateDoDb": [
{
"Tables": [
{
"TableName": "trainee_center_info",
"Where": "centerId%10000=3"
}
],
"TableSchema": "bocai"
}
],
"ConnectionConfig": {
"User": "root",
"Password": "",
"Host": "10.0.0.5",
"Port": "3306"
}
},
"ConfigLock": {},
"Constraints": null,
"Driver": "MySQL",
"Leader": false,
"NodeID": "",
"NodeName": "",
"Type": "Src"
},
{
"Config": {
"ConnectionConfig": {
"User": "bocai",
"Password": "
",
"Host": "rm-bpf13n98b800812s1s3q1o.mysql.rds.aliyuncs.com",
"Port": "3306"
},
"NatsAddr": "10.0.0.73:8193",
"Gtid": ""
},
"ConfigLock": {},
"Constraints": null,
"Driver": "MySQL",
"Leader": true,
"NodeID": "",
"NodeName": "",
"Type": "Dest"
}
],
"Type": "synchronous"
},
"ModifyIndex": 825,
"Name": "dtle-shard2",
"Status": "dead",
"StatusDescription": "bad 'where' for table bocai.trainee_center_info: field centerId does not exist",
"Type": "synchronous"
}
]

Describe the results you expected

Output of ./dtle version:**

Dtle 2.19.11.0

Additional information

(e.g. issue happens only occasionally)

Additional details (log, config, job config etc):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions