use of io.mycat.commands.ReceiverImpl in project Mycat2 by MyCATApache.
the class MycatVertxMySQLHandler method handlePrepareStatementExecute.
private Future<Void> handlePrepareStatementExecute(long statementId, byte flags, int[] params, BindValue[] values, MycatVertxMysqlSession MycatMysqlSession) throws Exception {
MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);
MycatDataContext dataContext = session.getDataContext();
Map<Long, io.mycat.PreparedStatement> longPreparedStatementMap = dataContext.getPrepareInfo();
io.mycat.PreparedStatement preparedStatement = longPreparedStatementMap.get(statementId);
SQLStatement statement = preparedStatement.getSQLStatementByBindValue(values);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("preparestatement:{}", statement);
}
SQLStatement typeStatement = metadataManager.typeInferenceUpdate(statement, dataContext.getDefaultSchema());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("typeInferenceUpdate:{}", typeStatement);
}
Response receiver = new ReceiverImpl(session, 1, true);
IOExecutor ioExecutor = MetaClusterCurrent.wrapper(IOExecutor.class);
return ioExecutor.executeBlocking(event -> MycatdbCommand.execute(dataContext, receiver, typeStatement).onComplete(event));
}
Aggregations