[fix](forward) set error code for query state to handle exception of (#31975)

This commit is contained in:
Yongqiang YANG
2024-03-08 22:50:17 +08:00
committed by yiguolei
parent 1d094a46ec
commit 78feb7f519
2 changed files with 2 additions and 3 deletions

View File

@ -93,8 +93,7 @@ public class QueryState {
}
public void setError(String errorMsg) {
this.stateType = MysqlStateType.ERR;
this.errorMessage = errorMsg;
this.setError(ErrorCode.ERR_UNKNOWN_ERROR, errorMsg);
}
public void setError(ErrorCode code, String msg) {

View File

@ -46,7 +46,7 @@ public class MysqlErrPacketTest {
// assert indicator
Assert.assertEquals(0xff, MysqlProto.readInt1(buffer));
// error code
Assert.assertEquals(1064, MysqlProto.readInt2(buffer));
Assert.assertEquals(1105, MysqlProto.readInt2(buffer));
// sql state marker
Assert.assertEquals('#', MysqlProto.readInt1(buffer));
// sql state