@@ -36,10 +36,11 @@ import (
3636)
3737
3838const (
39- testErrorSQL = "ERROR ..."
40- testQuerySQL = "SELECT ..."
41- testExecuteSQL = "INSERT ..."
42- testExtendedSQL = "SELECT ... TRAIN ..."
39+ testErrorSQL = "ERROR ..."
40+ testQuerySQL = "SELECT ..."
41+ testExecuteSQL = "INSERT ..."
42+ testExtendedSQL = "SELECT ... TRAIN ..."
43+ testExtendedSQLWithSpace = "SELECT ... TRAIN ...; \n \t "
4344)
4445
4546var testServerAddress string
@@ -67,6 +68,8 @@ func mockRun(sql string, db *sf.DB, modelDir string, session *pb.Session) *sf.Pi
6768 case testExtendedSQL :
6869 wr .Write ("log 0" )
6970 wr .Write ("log 1" )
71+ default :
72+ wr .Write (fmt .Errorf ("unexcepted SQL: %s" , sql ))
7073 }
7174 }()
7275 return rd
@@ -123,7 +126,9 @@ func TestSQL(t *testing.T) {
123126 _ , err = stream .Recv ()
124127 a .Equal (status .Error (codes .Unknown , fmt .Sprintf ("run error: %v" , testErrorSQL )), err )
125128
126- for _ , s := range []string {testQuerySQL , testExecuteSQL , testExtendedSQL } {
129+ testMultipleSQL := fmt .Sprintf ("%s; %s" , testQuerySQL , testExtendedSQL )
130+
131+ for _ , s := range []string {testQuerySQL , testExecuteSQL , testExtendedSQL , testExtendedSQLWithSpace , testMultipleSQL } {
127132 stream , err := c .Run (ctx , & pb.Request {Sql : s })
128133 a .NoError (err )
129134 for {
0 commit comments