mysql 表名包含 “-” 报错 where 1=2
- 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
异常结果:

如果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