github-actions[bot] commented on PR #1152:
URL: 
https://github.com/apache/incubator-seata-go/pull/1152#issuecomment-5477414438

   > Bot detected the issue body's language is not English, translate it 
automatically.
   
   > Note: original text was truncated due to length.
   
   This PR (# 1152) takes over # 1120, completing the migration of SQL Parser 
to the upstream official (`[github.com/pingcap/tidb/pkg/parser] 
(https://github.com/pingcap/tidb/pkg/parser)`) and addressing the blocking and 
security issues previously raised in the Review.  
   
   # # # I. Change of background and core objectives
   
   1. * * Unofficial Fork Decoupling * *: Switches the core SQL parsing 
dependency back to the upstream official `[github.com/pingcap/tidb/pkg/parser] 
(https://github.com/pingcap/tidb/pkg/parser)` maintained by the discontinued 
`[github.com/arana-db/parser] (https://github.com/arana-db/parser)`.2. * * 
Decoupling of production code from `test_driver` * *: The actuator and Undo 
Builder no longer directly rely on `* test_driver.ParamMarkerExpr`, and unify 
parameter extraction based on the 'ast.ParamMarkerExpr` interface and abstract 
auxiliary methods.  
   3. * * AST Traversal Full Branch Alignment and Parameter Equivalence * *: 
Completes Undo Log Builder's recursive traversal of 13 complex AST nodes to 
ensure consistent parameter order in multiple sub-queries, Case When, and other 
scenarios to prevent damage due to rollback data misalignment.  
   4. * * Go 1.25 Toolchain and Disruptive Change Registration * *: As the 
upstream Parser's `go.mod` declaration requires Go 1.25, synchronously upgrade 
the minimum version and explicitly declare Breaking Change in the change log, 
while adapting to syntax access control.  
   
   # # # II. File-by-File Details
   
   # # # # 1. Version and Change Statement (Documentation)
   
   - * * `changes/dev.md`/`changes/dev_zh.md` * *- Associate `[# 1104]` in the 
`# # # breaking change:` module, highlighting the 'action required` description 
to increase the minimum Go version from 1.20 to 1.25.  
     - Associate `[# 1104]` in `# # # optimize:` to register optimizations to 
migrate Parser dependencies back to the official repository.  
   
   # # # # 2. SQL Parser Core Abstraction and Sorting (Parser Factory)
   
   - * * `pkg/datasource/sql/parser/parser_factory.go` * *
   
       
   
     - * * Driver Initialization Notes * *: Leave 
`_"[github.com/pingcap/tidb/pkg/parser/test_driver] 
(https://github.com/pingcap/tidb/pkg/parser/test_driver)"` anonymously imported 
and supplemented with schema notes describing the global drivers used to 
instantiate `ParamMarkerExpr` to TiDB Parser registration.- * * Interface 
abstraction extraction * *: Added `getParamMarkerOffset` and the exported 
`GetParamMarkerOrder` function, preferentially extracting 'Offset`/'Order` 
through interface assertions, and using reflection to read non-exported fields 
on the back of the pocket to eliminate the hard-coded dependence of business 
code on specific drive structures.  
     - * * Deterministic Sorting * *: Change the sorting in 
`assignParamMarkerOrders` to `sort.SliceStable' and preallocate the slice 
capacity, giving the placeholder `Order` exactly as per the physical text 
offset (Offset).  
   
   - * * `pkg/datasource/sql/parser/parse_factory_test.go` * *
   
       
   
     - Added `TestAssignParamMarkerOrders_EquivalenceMatrix` to override 
parameter placeholder order equivalence validation for complex SQL such as` 
Case When `, multi-child query nesting' join `,` insert... ON duplicate key: 
[redacted].- Added `TestGetParamMarkerOrder_NonMarkerNode` to verify defensive 
degradation when non-parametric nodes are passed in.  
   
   # # # # 3. AT Executors and Key Generation (AT Executors)
   
   - * * `pkg/datasource/sql/exec/at/base_executor.go` * *
   
       
   
     - Remove the `test_driver` dependency, refactor `traversalArgs` as` case 
ast.ParamMarkerExpr `, and get the parameter index uniformly through` 
parser.GetParamMarkerOrder (expr) `.  
     - Clean up unused `ctx context.Context` parameter in `buildSelectFields` 
as`_`.  
   
   - * * `pkg/datasource/sql/exec/at/base_executor_test.go` * *- Added 
`TestBaseExecutorBuildSelectArgs` to verify that `baseExecutor` can accurately 
extract and restore `selectArgs` under multi-conditional `between', 'IN', 
'limit` SQL.  
   
   - * * `pkg/datasource/sql/exec/at/select_for_update_executor.go` * *
   
       
   
     - Optimize `bytes.Buffer` in `buildLockKey` to `strings.Builder` to 
improve memory allocation performance.  
     - Increase empty primary key defense check (return empty string directly 
when `len (columnNames) = = 0`).  
     - Remove redundant reflection method calls and use the unified 
`reflectx.GetElemDataValue` and `getSqlNullValue` to extract the underlying 
values to enhance the robustness of the key construction.  
   
   - * * `pkg/datasource/sql/exec/at/select_for_update_executor_test.go` * *- 
Added `TestBuildLockKey_EmptyPrimaryKey' to override the key generation path 
when there is no primary key metadata.  
   
   - * * 
`pkg/datasource/sql/exec/at/multi_sequential_executor.go`/`multi_sequential_executor_test.go`
 * *
   
       
   
     - Smooth migration of `ast` and `format` import paths to 
`[github.com/pingcap/tidb/pkg/pars


-- 
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]

Reply via email to