Conversation
…sConnectionTerminatedError Support PostgreSQL connection termination detection alongside MySQL. The new function uses string matching on error messages to identify termination errors across database drivers and gRPC boundaries. Issue: #2727
Cover MySQL positive matches (4 cases), PostgreSQL positive matches (5 cases), and negative matches (7 cases) using map case pattern. Issue: #2727
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Summary
_errors.Is(mysql.ErrInvalidConn, execErr)with unifiedisConnectionTerminatedErrorfunctionexecSQLsExecErr branch (covers SQL execution-time termination in transaction mode)github.com/go-sql-driver/mysqlpackage in sqled.goTest plan
go build ./sqle/server/...passesgo vet ./sqle/server/...passesgo test -run Test_isConnectionTerminatedError ./sqle/server/...all PASSCloses https://github.com/actiontech/sqle-ee/issues/2727
Description
添加统一的连接终止错误检测函数
使用字符串匹配支持 MySQL 与 PostgreSQL
替换原有 mysql 包错误检测逻辑
新增单元测试覆盖多种错误场景
Diagram Walkthrough
File Walkthrough
sqled.go
修改 SQL 执行中的连接终止错误检测sqle/server/sqled.go
sqled_terminate_test.go
新增连接终止错误检测单元测试sqle/server/sqled_terminate_test.go