alibaba / alibaba/DataX

mysql 表名包含 “-” 报错 where 1=2

Open
#979 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

错误json:
{
"content":[
{
"reader":{
"name":"txtfilereader",
"parameter":{
"column":[
{
"index":0,
"type":"long"
},
{
"index":1,
"type":"string"
}
],
"csvReaderConfig":{
"safetySwitch":false,
"skipEmptyRecords":false,
"useTextQualifier":true
},
"encoding":"UTF-8",
"fieldDelimiter":",",
"path":[
"C:/Users/xxx/Desktop/od_data.csv"
],
"skipHeader":true
}
},
"writer":{
"name":"mysqlwriter",
"parameter":{
"column":[
"id",
"aa"
],
"connection":[
{
"jdbcUrl":"jdbc:mysql://192.168.20.12:3306/smt111",
"table":[
"csv-test"
]
}
],
"password":"*******",
"username":"root"
}
}
}
],
"setting":{
"speed":{
"channel":2
}
}
}
此表名为csv-test

异常结果:
![image](https://user-images.githubusercontent.com/33984497/110953578-7f520180-8382-11eb-98e3-b38783bee269.png)
如果jiang将表名改成csv_test 则成功

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided DataX configuration with the mysqlwriter against the `csv-test` table, then compare it with the working `csv_test` case. Trace the mysqlwriter path that produces the `where 1=2` error and verify that a table name containing `-` completes successfully without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.