Copilot commented on code in PR #1141:
URL:
https://github.com/apache/incubator-seata-go/pull/1141#discussion_r3869345120
##########
pkg/datasource/sql/datasource/utils.go:
##########
@@ -115,24 +116,29 @@ func DeepEqual(x, y interface{}) bool {
case reflect.Ptr:
typy = typy.Elem()
}
+ if (typx.Kind() == reflect.Float32 || typx.Kind() == reflect.Float64) &&
+ (typy.Kind() == reflect.Float32 || typy.Kind() ==
reflect.Float64) {
Review Comment:
DeepEqual calls Value.Elem() for pointer inputs without checking IsNil(),
which will panic when x or y is a typed nil pointer (e.g. (*int)(nil)). Guard
nil pointers before dereferencing so DeepEqual remains safe for all inputs.
##########
pkg/datasource/sql/undo/executor/executor.go:
##########
@@ -123,8 +123,15 @@ func (b *BaseExecutor) queryCurrentRecords(ctx
context.Context, conn *sql.Conn)
return nil, nil
}
Review Comment:
queryCurrentRecords returns (nil, nil) when it cannot project any PK values
from the undo image. dataValidationAndGoOn then dereferences currentImage.Rows,
which can panic. Missing PK metadata/values should be treated as an error so
validation cannot crash on malformed undo images.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]