use of io.mycat.prototypeserver.mysql.MySQLResultSet in project Mycat2 by MyCATApache.
the class ShowProcedureStatusSQLHandler method onExecute.
@Override
protected Future<Void> onExecute(SQLRequest<MySqlShowProcedureStatusStatement> request, MycatDataContext dataContext, Response response) {
List<ColumnDefPacket> columnDefPacketList = getShowProcedureStatusColumns();
MySQLResultSet mySQLResultSet = MySQLResultSet.create(columnDefPacketList);
mySQLResultSet.setRows(Collections.emptyList());
return response.sendResultSet(mySQLResultSet.build());
}
use of io.mycat.prototypeserver.mysql.MySQLResultSet in project Mycat2 by MyCATApache.
the class ShowCreateDatabaseHandler method onExecute.
@Override
protected Future<Void> onExecute(SQLRequest<MySqlShowCreateDatabaseStatement> request, MycatDataContext dataContext, Response response) {
List<ColumnDefPacket> columnDefPacketList = getShowCreateDatabaseColumns();
MySQLResultSet mySQLResultSet = MySQLResultSet.create(columnDefPacketList);
String database = SQLUtils.normalize(request.getAst().getDatabase().toString());
SQLCreateDatabaseStatement sqlCreateDatabaseStatement = new SQLCreateDatabaseStatement();
sqlCreateDatabaseStatement.setDatabase(database);
ArrayList<Object[]> objects = new ArrayList<>();
objects.add(new Object[] { database, sqlCreateDatabaseStatement.toString() });
mySQLResultSet.setRows(objects);
return response.sendResultSet(mySQLResultSet.build());
}
use of io.mycat.prototypeserver.mysql.MySQLResultSet in project Mycat2 by MyCATApache.
the class ShowCreateTableSQLHandler method onExecute.
@Override
protected Future<Void> onExecute(SQLRequest<SQLShowCreateTableStatement> request, MycatDataContext dataContext, Response response) {
SQLShowCreateTableStatement ast = request.getAst();
SQLName name = ast.getName();
if (name instanceof SQLIdentifierExpr) {
SQLPropertyExpr sqlPropertyExpr = new SQLPropertyExpr();
sqlPropertyExpr.setOwner(dataContext.getDefaultSchema());
sqlPropertyExpr.setName(name.toString());
ast.setName(sqlPropertyExpr);
}
List<ColumnDefPacket> showCreateTableColumns = PrototypeService.getShowCreateTableColumns();
MySQLResultSet mySQLResultSet = MySQLResultSet.create(showCreateTableColumns);
mySQLResultSet.setRows(showCreateTable(ast));
return response.sendResultSet(mySQLResultSet.build());
}
use of io.mycat.prototypeserver.mysql.MySQLResultSet in project Mycat2 by MyCATApache.
the class ShowErrorsSQLHandler method onExecute.
@Override
protected Future<Void> onExecute(SQLRequest<MySqlShowErrorsStatement> request, MycatDataContext dataContext, Response response) {
MySQLResultSet mySQLResultSet = MySQLResultSet.create(PrototypeService.getShowErrorsColumns());
mySQLResultSet.setRows(Collections.emptyList());
return response.sendResultSet(mySQLResultSet.build());
}
use of io.mycat.prototypeserver.mysql.MySQLResultSet in project Mycat2 by MyCATApache.
the class ShowWarningsSQLHandler method onExecute.
@Override
protected Future<Void> onExecute(SQLRequest<MySqlShowWarningsStatement> request, MycatDataContext dataContext, Response response) {
List<ColumnDefPacket> columnDefPacketList = getShowWarningsColumns();
MySQLResultSet mySQLResultSet = MySQLResultSet.create(columnDefPacketList);
mySQLResultSet.setRows(Collections.emptyList());
return response.sendResultSet(mySQLResultSet.build());
}
Aggregations