Search in sources :

Example 1 with ShowTablesHandler

use of com.actiontech.dble.backend.mysql.nio.handler.ShowTablesHandler in project dble by actiontech.

the class ShowTables method parserAndExecuteShowTables.

private static void parserAndExecuteShowTables(ServerConnection c, String originSql, String node, ShowCreateStmtInfo info) throws Exception {
    RouteResultset rrs = new RouteResultset(originSql, ServerParse.SHOW);
    if (info.getSchema() != null) {
        StringBuilder sql = new StringBuilder();
        sql.append("SHOW ");
        if (info.isFull()) {
            sql.append("FULL ");
        }
        sql.append("TABLES ");
        if (info.getCond() != null) {
            sql.append(info.getCond());
        }
        rrs.setStatement(sql.toString());
    }
    RouterUtil.routeToSingleNode(rrs, node);
    ShowTablesHandler showTablesHandler = new ShowTablesHandler(rrs, c.getSession2(), info);
    showTablesHandler.execute();
}
Also used : ShowTablesHandler(com.actiontech.dble.backend.mysql.nio.handler.ShowTablesHandler) RouteResultset(com.actiontech.dble.route.RouteResultset)

Aggregations

ShowTablesHandler (com.actiontech.dble.backend.mysql.nio.handler.ShowTablesHandler)1 RouteResultset (com.actiontech.dble.route.RouteResultset)1