@@ -793,69 +793,6 @@ func (s *testSessionSuite) TestMySQLTypes(c *C) {
793793 mustExecSQL (c , se , dropDBSQL )
794794}
795795
796- func (s * testSessionSuite ) TestShow (c * C ) {
797- defer testleak .AfterTest (c )()
798- dbName := "test_show"
799- dropDBSQL := fmt .Sprintf ("drop database %s;" , dbName )
800- se := newSession (c , s .store , dbName )
801-
802- mustExecSQL (c , se , "set global autocommit=1" )
803- r := mustExecSQL (c , se , "show global variables where variable_name = 'autocommit'" )
804- row , err := r .Next ()
805- c .Assert (err , IsNil )
806- match (c , row .Data , "autocommit" , "ON" )
807-
808- mustExecSQL (c , se , "drop table if exists t" )
809- mustExecSQL (c , se , `create table if not exists t (c int) comment '注释'` )
810- r = mustExecSQL (c , se , `show columns from t` )
811- rows , err := GetRows (r )
812- c .Assert (err , IsNil )
813- c .Assert (rows , HasLen , 1 )
814- match (c , rows [0 ], "c" , "int(11)" , "YES" , "" , nil , "" )
815-
816- r = mustExecSQL (c , se , "show collation where Charset = 'utf8' and Collation = 'utf8_bin'" )
817- row , err = r .Next ()
818- c .Assert (err , IsNil )
819- match (c , row .Data , "utf8_bin" , "utf8" , 83 , "" , "Yes" , 1 )
820-
821- r = mustExecSQL (c , se , "show tables" )
822- row , err = r .Next ()
823- c .Assert (err , IsNil )
824- c .Assert (row .Data , HasLen , 1 )
825-
826- r = mustExecSQL (c , se , "show full tables" )
827- row , err = r .Next ()
828- c .Assert (err , IsNil )
829- c .Assert (row .Data , HasLen , 2 )
830-
831- r = mustExecSQL (c , se , "show create table t" )
832- row , err = r .Next ()
833- c .Assert (err , IsNil )
834- c .Assert (row .Data , HasLen , 2 )
835- c .Assert (row .Data [0 ].GetString (), Equals , "t" )
836-
837- r = mustExecSQL (c , se , fmt .Sprintf ("show table status from %s like 't';" , dbName ))
838- row , err = r .Next ()
839- c .Assert (err , IsNil )
840- c .Assert (row .Data , HasLen , 18 )
841- c .Assert (row .Data [0 ].GetString (), Equals , "t" )
842- c .Assert (row .Data [17 ].GetString (), Equals , "注释" )
843-
844- r = mustExecSQL (c , se , "show databases like 'test'" )
845- row , err = r .Next ()
846- c .Assert (err , IsNil )
847- c .Assert (row .Data , HasLen , 1 )
848- c .Assert (row .Data [0 ].GetString (), Equals , "test" )
849-
850- r = mustExecSQL (c , se , "grant all on *.* to 'root'@'%'" )
851- r = mustExecSQL (c , se , "show grants" )
852- row , err = r .Next ()
853- c .Assert (err , IsNil )
854- c .Assert (row .Data , HasLen , 1 )
855-
856- mustExecSQL (c , se , dropDBSQL )
857- }
858-
859796func (s * testSessionSuite ) TestBit (c * C ) {
860797 defer testleak .AfterTest (c )()
861798 dbName := "test_bit"
@@ -979,33 +916,6 @@ func (s *testSessionSuite) TestSet(c *C) {
979916 mustExecSQL (c , se , dropDBSQL )
980917}
981918
982- func (s * testSessionSuite ) TestDatabase (c * C ) {
983- defer testleak .AfterTest (c )()
984- dbName := "test_database"
985- dropDBSQL := fmt .Sprintf ("drop database %s;" , dbName )
986- se := newSession (c , s .store , dbName )
987-
988- // Test database.
989- mustExecSQL (c , se , "create database xxx" )
990- mustExecSQL (c , se , "drop database xxx" )
991-
992- mustExecSQL (c , se , "drop database if exists xxx" )
993- mustExecSQL (c , se , "create database xxx" )
994- mustExecSQL (c , se , "create database if not exists xxx" )
995- mustExecSQL (c , se , "drop database if exists xxx" )
996-
997- // Test schema.
998- mustExecSQL (c , se , "create schema xxx" )
999- mustExecSQL (c , se , "drop schema xxx" )
1000-
1001- mustExecSQL (c , se , "drop schema if exists xxx" )
1002- mustExecSQL (c , se , "create schema xxx" )
1003- mustExecSQL (c , se , "create schema if not exists xxx" )
1004- mustExecSQL (c , se , "drop schema if exists xxx" )
1005-
1006- mustExecSQL (c , se , dropDBSQL )
1007- }
1008-
1009919func (s * testSessionSuite ) TestWhereLike (c * C ) {
1010920 defer testleak .AfterTest (c )()
1011921 dbName := "test_where_like"
@@ -1051,18 +961,6 @@ func (s *testSessionSuite) TestDefaultFlenBug(c *C) {
1051961 c .Assert (err , IsNil )
1052962}
1053963
1054- func (s * testSessionSuite ) TestExecRestrictedSQL (c * C ) {
1055- defer testleak .AfterTest (c )()
1056- dbName := "test_exec_restricted_sql"
1057- dropDBSQL := fmt .Sprintf ("drop database %s;" , dbName )
1058- se := newSession (c , s .store , dbName ).(* session )
1059- r , _ , err := se .ExecRestrictedSQL (se , "select 1;" )
1060- c .Assert (err , IsNil )
1061- c .Assert (len (r ), Equals , 1 )
1062-
1063- mustExecSQL (c , se , dropDBSQL )
1064- }
1065-
1066964func (s * testSessionSuite ) TestOrderBy (c * C ) {
1067965 defer testleak .AfterTest (c )()
1068966 dbName := "test_order_by"
@@ -1294,24 +1192,6 @@ func (s *testSessionSuite) TestFieldText(c *C) {
12941192 mustExecSQL (c , se , dropDBSQL )
12951193}
12961194
1297- func (s * testSessionSuite ) TestIndexPointLookup (c * C ) {
1298- defer testleak .AfterTest (c )()
1299- dbName := "test_index_point_lookup"
1300- dropDBSQL := fmt .Sprintf ("drop database %s;" , dbName )
1301- se := newSession (c , s .store , dbName )
1302- mustExecSQL (c , se , "drop table if exists t" )
1303- mustExecSQL (c , se , "create table t (a int)" )
1304- mustExecSQL (c , se , "insert t values (1), (2), (3)" )
1305- mustExecMatch (c , se , "select * from t where a = '1.1';" , [][]interface {}{})
1306- mustExecMatch (c , se , "select * from t where a > '1.1';" , [][]interface {}{{2 }, {3 }})
1307- mustExecMatch (c , se , "select * from t where a = '2';" , [][]interface {}{{2 }})
1308- mustExecMatch (c , se , "select * from t where a = 3;" , [][]interface {}{{3 }})
1309- mustExecMatch (c , se , "select * from t where a = 4;" , [][]interface {}{})
1310- mustExecSQL (c , se , "drop table t" )
1311-
1312- mustExecSQL (c , se , dropDBSQL )
1313- }
1314-
13151195func (s * testSessionSuite ) TestIssue454 (c * C ) {
13161196 defer testleak .AfterTest (c )()
13171197 dbName := "test_issue454"
@@ -1451,24 +1331,6 @@ func (s *testSessionSuite) TestRetryPreparedStmt(c *C) {
14511331 mustExecSQL (c , se , dropDBSQL )
14521332}
14531333
1454- func (s * testSessionSuite ) TestSleep (c * C ) {
1455- defer testleak .AfterTest (c )()
1456- dbName := "test_sleep"
1457- dropDBSQL := fmt .Sprintf ("drop database %s;" , dbName )
1458- se := newSession (c , s .store , dbName )
1459-
1460- mustExecSQL (c , se , "select sleep(0.01);" )
1461- mustExecSQL (c , se , "drop table if exists t;" )
1462- mustExecSQL (c , se , "create table t (a int);" )
1463- mustExecSQL (c , se , "insert t values (sleep(0.02));" )
1464- r := mustExecSQL (c , se , "select * from t;" )
1465- row , err := r .Next ()
1466- c .Assert (err , IsNil )
1467- match (c , row .Data , 0 )
1468-
1469- mustExecSQL (c , se , dropDBSQL )
1470- }
1471-
14721334func (s * testSessionSuite ) TestIssue893 (c * C ) {
14731335 defer testleak .AfterTest (c )()
14741336 dbName := "test_issue893"
0 commit comments