Skip to content

Commit

Permalink
Support mysql COM_RESET_CONNECTION command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibing-Li committed Nov 28, 2024
1 parent a4d9aaa commit a2f7a47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.doris.common.util.SqlUtils;
import org.apache.doris.common.util.Util;
import org.apache.doris.datasource.CatalogIf;
import org.apache.doris.datasource.InternalCatalog;
import org.apache.doris.metric.MetricRepo;
import org.apache.doris.mysql.MysqlChannel;
import org.apache.doris.mysql.MysqlPacket;
Expand Down Expand Up @@ -198,6 +199,11 @@ protected void handleDebug() {
ctx.getState().setOk();
}

protected void handleResetConnection() {
ctx.changeDefaultCatalog(InternalCatalog.INTERNAL_CATALOG_NAME);
ctx.getState().setOk();
}

protected void handleStmtReset() {
ctx.getState().setOk();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ private void dispatch() throws IOException {
case COM_SET_OPTION:
handleSetOption();
break;
case COM_RESET_CONNECTION:
handleResetConnection();
break;
default:
ctx.getState().setError(ErrorCode.ERR_UNKNOWN_COM_ERROR, "Unsupported command(" + command + ")");
LOG.warn("Unsupported command(" + command + ")");
Expand Down

0 comments on commit a2f7a47

Please sign in to comment.