Correctly propagate error
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
The `pkg/parser/ast/dml.go` file has some functions where the returned error is not checked and the error is not bubbled up when calling "Restore()" method
There are 3 calls to `` where this happens:
https://github.com/pingcap/tidb/blob/master/pkg/parser/ast/dml.go#L3456
https://github.com/pingcap/tidb/blob/master/pkg/parser/ast/dml.go#L3463
https://github.com/pingcap/tidb/blob/master/pkg/parser/ast/dml.go#L3525
This was discovered when implementing custom types (Not using `parser_driver` or `test_driver`) and the Restore method implementation of either the ValueExpr or the ParamMarkerExpr was returning an error.
I this case, Restore was still returning `nil` and the generated string from Restore call was an invalid SQL query.
Contributor guide
Assessment
This issue has not been assessed yet.