Skip to content

Commit

Permalink
Update dispatch on mysql command sleep
Browse files Browse the repository at this point in the history
The handling is now matching the MySQL. It will raise error UNKNOWN
COMMAND when receiving command COM_SLEEP from clients.
  • Loading branch information
igxlin committed Oct 26, 2022
1 parent 6c55faf commit 4b2ecee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions server/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,6 @@ func (cc *clientConn) dispatch(ctx context.Context, data []byte) error {
}

switch cmd {
case mysql.ComSleep:
// TODO: According to mysql document, this command is supposed to be used only internally.
// So it's just a temp fix, not sure if it's done right.
// Investigate this command and write test case later.
return nil
case mysql.ComQuit:
return io.EOF
case mysql.ComInitDB:
Expand Down
12 changes: 0 additions & 12 deletions server/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,6 @@ func TestDispatch(t *testing.T) {
userData = append(userData, 0x0)

inputs := []dispatchInput{
{
com: mysql.ComSleep,
in: nil,
err: nil,
out: nil,
},
{
com: mysql.ComQuit,
in: nil,
Expand Down Expand Up @@ -468,12 +462,6 @@ func TestDispatchClientProtocol41(t *testing.T) {
userData = append(userData, 0x0)

inputs := []dispatchInput{
{
com: mysql.ComSleep,
in: nil,
err: nil,
out: nil,
},
{
com: mysql.ComQuit,
in: nil,
Expand Down

0 comments on commit 4b2ecee

Please sign in to comment.