luky116 commented on code in PR #725: URL: https://github.com/apache/incubator-seata-go/pull/725#discussion_r1874409492
########## pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder_test.go: ########## @@ -143,6 +143,26 @@ func TestInsertOnDuplicateBuildBeforeImageSQL(t *testing.T) { expectQuery1: "SELECT * FROM t_user WHERE (name = ? and age = ? ) OR (name = ? and age = ? ) ", expectQueryArgs1: []driver.Value{"Jack1", 81, "Michal", int64(35)}, }, + // Test case for null unique index + { + execCtx: &types.ExecContext{ + Query: "insert into t_unique(id, a, b) values(1, NULL, 2) on duplicate key update b = 5", + MetaDataMap: map[string]types.TableMeta{"t_unique": tableMeta1}, + }, + sourceQueryArgs: []driver.Value{1, nil, 2}, + expectQuery1: "SELECT * FROM t_unique WHERE (id = ? ) ", + expectQueryArgs1: []driver.Value{1}, + }, + // Test case for null primary key + { + execCtx: &types.ExecContext{ + Query: "insert into t_unique(id, b) values(NULL, 2) on duplicate key update b = 5", + MetaDataMap: map[string]types.TableMeta{"t_unique": tableMeta1}, Review Comment: t_unique 改为 t_user -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org