[regression-test](prepared statement) Fix connection error when test framework used lower jdbc version (#18665)

This commit is contained in:
lihangyu
2023-04-16 18:13:45 +08:00
committed by GitHub
parent c12646382d
commit 7bc242d665
3 changed files with 55 additions and 16 deletions

View File

@ -212,6 +212,12 @@ public class ConnectProcessor {
packetBuf.getInt();
LOG.debug("execute prepared statement {}", stmtId);
PrepareStmtContext prepareCtx = ctx.getPreparedStmt(String.valueOf(stmtId));
if (prepareCtx == null) {
LOG.debug("No such statement in context, stmtId:{}", stmtId);
ctx.getState().setError(ErrorCode.ERR_UNKNOWN_COM_ERROR,
"msg: Not supported such prepared statement");
return;
}
int paramCount = prepareCtx.stmt.getParmCount();
// null bitmap
byte[] nullbitmapData = new byte[(paramCount + 7) / 8];