Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drainer: process empty string from tidb in update/delete statement on oracle (#1163) #1166

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
process empty string
cartersz authored and ti-chi-bot committed May 27, 2022
commit 521369bcd02c1142a6196687d9ad490af537ab22
4 changes: 2 additions & 2 deletions pkg/loader/model.go
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ func (dml *DML) buildOracleWhere(builder *strings.Builder, oracleHolderPos int)
if i > 0 {
builder.WriteString(" AND ")
}
if wargs[i] == nil {
if wargs[i] == nil || wargs[i] == "" {
builder.WriteString(escapeName(wnames[i]) + " IS NULL")
} else {
builder.WriteString(fmt.Sprintf("%s = :%d", escapeName(wnames[i]), pOracleHolderPos))
@@ -380,7 +380,7 @@ func (dml *DML) oracleDeleteNewValueSQL() (sql string, args []interface{}) {
if i > 0 {
builder.WriteString(" AND ")
}
if colValues[i] == nil {
if colValues[i] == nil || colValues[i] == "" {
builder.WriteString(escapeName(colNames[i]) + " IS NULL")
} else {
builder.WriteString(fmt.Sprintf("%s = :%d", colNames[i], oracleHolderPos))