use of com.actiontech.dble.backend.mysql.nio.handler.builder.HandlerBuilder in project dble by actiontech.
the class NonBlockingSession method executeMultiResultSet.
private void executeMultiResultSet(PlanNode node) {
init();
HandlerBuilder builder = new HandlerBuilder(node, this);
try {
// no next
builder.build(false);
} catch (SQLSyntaxErrorException e) {
LOGGER.info(String.valueOf(source) + " execute plan is : " + node, e);
source.writeErrMessage(ErrorCode.ER_YES, "optimizer build error");
} catch (NoSuchElementException e) {
LOGGER.info(String.valueOf(source) + " execute plan is : " + node, e);
this.terminate();
source.writeErrMessage(ErrorCode.ER_NO_VALID_CONNECTION, "no valid connection");
} catch (MySQLOutPutException e) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info(String.valueOf(source) + " execute plan is : " + node, e);
}
this.terminate();
source.writeErrMessage(e.getSqlState(), e.getMessage(), e.getErrorCode());
} catch (Exception e) {
LOGGER.info(String.valueOf(source) + " execute plan is : " + node, e);
this.terminate();
source.writeErrMessage(ErrorCode.ER_HANDLE_DATA, e.toString());
}
}
use of com.actiontech.dble.backend.mysql.nio.handler.builder.HandlerBuilder in project dble by actiontech.
the class ExplainHandler method buildNodes.
private static BaseHandlerBuilder buildNodes(RouteResultset rrs, ServerConnection c) {
SQLSelectStatement ast = (SQLSelectStatement) rrs.getSqlStatement();
MySQLPlanNodeVisitor visitor = new MySQLPlanNodeVisitor(c.getSchema(), c.getCharset().getResultsIndex(), DbleServer.getInstance().getTmManager(), false);
visitor.visit(ast);
PlanNode node = visitor.getTableNode();
node.setSql(rrs.getStatement());
node.setUpFields();
PlanUtil.checkTablesPrivilege(c, node, ast);
node = MyOptimizer.optimize(node);
if (!PlanUtil.containsSubQuery(node) && !visitor.isContainSchema()) {
node.setAst(ast);
}
HandlerBuilder builder = new HandlerBuilder(node, c.getSession2());
return builder.getBuilder(c.getSession2(), node, true);
}
Aggregations