Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ package vtgate
import (
"context"
"fmt"
"testing"

"github.com/google/go-cmp/cmp"
"testing"

"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -529,6 +528,16 @@ func TestSelectNull(t *testing.T) {
exec(t, conn, "delete from t5_null_vindex")
}

func TestDoStatement(t *testing.T) {
ctx := context.Background()
conn, err := mysql.Connect(ctx, &vtParams)
require.NoError(t, err)
defer conn.Close()

exec(t, conn, "do 1")
exec(t, conn, "do 'a', 1+2,database()")
}

func TestShowColumns(t *testing.T) {
conn, err := mysql.Connect(context.Background(), &vtParams)
require.NoError(t, err)
Expand Down Expand Up @@ -559,6 +568,6 @@ func assertIsEmpty(t *testing.T, conn *mysql.Conn, query string) {
func exec(t *testing.T, conn *mysql.Conn, query string) *sqltypes.Result {
t.Helper()
qr, err := conn.ExecuteFetch(query, 1000, true)
require.Nil(t, err)
require.NoError(t, err)
return qr
}
6 changes: 6 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,12 @@ var (
}, {
input: "SHOW EXTENDED INDEXES IN `AO_E8B6CC_PROJECT_MAPPING` IN `jiradb`",
output: "show extended indexes from AO_E8B6CC_PROJECT_MAPPING from jiradb",
}, {
input: "do 1",
output: "otheradmin",
}, {
input: "do funcCall(), 2 = 1, 3 + 1",
output: "otheradmin",
}}
)

Expand Down
Loading