[Pick](PreparedStatement) allow prepare mysql command in Nerids even … (#39960)
…if enableServeSidePreparedStatement is false to avoid fallback to legacy planner backport #39465
This commit is contained in:
@ -412,6 +412,9 @@ public class ConnectContext {
|
||||
}
|
||||
|
||||
public void addPreparedStatementContext(String stmtName, PreparedStatementContext ctx) throws UserException {
|
||||
if (!sessionVariable.enableServeSidePreparedStatement) {
|
||||
throw new UserException("Failed to do prepared command, server side prepared statement is disabled");
|
||||
}
|
||||
if (this.preparedStatementContextMap.size() > sessionVariable.maxPreparedStmtCount) {
|
||||
throw new UserException("Failed to create a server prepared statement"
|
||||
+ "possibly because there are too many active prepared statements on server already."
|
||||
|
||||
@ -227,13 +227,8 @@ public abstract class ConnectProcessor {
|
||||
Exception nereidsParseException = null;
|
||||
long parseSqlStartTime = System.currentTimeMillis();
|
||||
List<StatementBase> cachedStmts = null;
|
||||
// Currently we add a config to decide whether using PREPARED/EXECUTE command for nereids
|
||||
// TODO: after implemented full prepared, we could remove this flag
|
||||
boolean nereidsUseServerPrep = (sessionVariable.enableServeSidePreparedStatement
|
||||
&& !sessionVariable.isEnableInsertGroupCommit())
|
||||
|| mysqlCommand == MysqlCommand.COM_QUERY;
|
||||
CacheKeyType cacheKeyType = null;
|
||||
if (nereidsUseServerPrep && sessionVariable.isEnableNereidsPlanner()) {
|
||||
if (!sessionVariable.isEnableInsertGroupCommit() && sessionVariable.isEnableNereidsPlanner()) {
|
||||
if (wantToParseSqlFromSqlCache) {
|
||||
cachedStmts = parseFromSqlCache(originStmt);
|
||||
Optional<SqlCacheContext> sqlCacheContext = ConnectContext.get()
|
||||
|
||||
Reference in New Issue
Block a user