@@ -746,21 +746,23 @@ func TestShowColumnsWithSubQueryView(t *testing.T) {
746
746
tk := testkit .NewTestKit (t , store )
747
747
tk .MustExec ("use test" )
748
748
749
- if tk .MustQuery ( "select @@tidb_schema_cache_size > 0" ). Equal ( testkit . Rows ( "1" )) {
750
- // infoschema v2 requires network, so it cannot be tested this way.
751
- t . Skip ( )
752
- }
749
+ tk .MustExec ( "set @@global. tidb_schema_cache_size = 0;" )
750
+ t . Cleanup ( func () {
751
+ tk . MustExec ( "set @@global.tidb_schema_cache_size = default;" )
752
+ })
753
753
754
754
tk .MustExec ("CREATE TABLE added (`id` int(11), `name` text, `some_date` timestamp);" )
755
755
tk .MustExec ("CREATE TABLE incremental (`id` int(11), `name`text, `some_date` timestamp);" )
756
756
tk .MustExec ("create view temp_view as (select * from `added` where id > (select max(id) from `incremental`));" )
757
757
// Show columns should not send coprocessor request to the storage.
758
- require .NoError (t , failpoint .Enable ("tikvclient/tikvStoreSendReqResult" , `return("timeout")` ))
758
+ testfailpoint .Enable (t , "tikvclient/tikvStoreSendReqResult" , `return("timeout")` )
759
+ testfailpoint .Enable (t , "github.com/pingcap/tidb/pkg/planner/core/BuildDataSourceFailed" , "panic" )
760
+
759
761
tk .MustQuery ("show columns from temp_view;" ).Check (testkit .Rows (
760
762
"id int(11) YES <nil> " ,
761
763
"name text YES <nil> " ,
762
764
"some_date timestamp YES <nil> " ))
763
- require . NoError ( t , failpoint . Disable ( "tikvclient/tikvStoreSendReqResult " ))
765
+ tk . MustQuery ( "select COLUMN_NAME from information_schema.columns where table_name = 'temp_view';" ). Check ( testkit . Rows ( "id" , "name" , "some_date " ))
764
766
}
765
767
766
768
// Code below are helper utilities for the test cases.
0 commit comments