@@ -11,29 +11,56 @@ import (
1111
1212 "github.com/ydb-platform/ydb-go-sdk/v3/table"
1313 "github.com/ydb-platform/ydb-go-sdk/v3/table/options"
14+ "github.com/ydb-platform/ydb-go-sdk/v3/table/types"
1415 "github.com/ydb-platform/ydb-go-sdk/v3/testutil"
1516)
1617
1718func TestQueryCachePolicyKeepInCache (t * testing.T ) {
1819 for _ , test := range [... ]struct {
1920 name string
21+ params * table.QueryParameters
2022 executeDataQueryOptions []options.ExecuteDataQueryOption
2123 keepInCache bool
2224 }{
2325 {
24- name : "no options" ,
26+ name : "no params, no options" ,
27+ params : table .NewQueryParameters (),
28+ executeDataQueryOptions : nil ,
29+ keepInCache : false ,
30+ },
31+ {
32+ name : "not empty params, no options" ,
33+ params : table .NewQueryParameters (table .ValueParam ("a" , types .UTF8Value ("b" ))),
2534 executeDataQueryOptions : nil ,
2635 keepInCache : true ,
2736 },
2837 {
29- name : "with server cache" ,
38+ name : "no params, with server cache" ,
39+ params : table .NewQueryParameters (),
3040 executeDataQueryOptions : []options.ExecuteDataQueryOption {
3141 options .WithKeepInCache (true ),
3242 },
3343 keepInCache : true ,
3444 },
3545 {
36- name : "no server cache" ,
46+ name : "not empty params, with server cache" ,
47+ params : table .NewQueryParameters (table .ValueParam ("a" , types .UTF8Value ("b" ))),
48+ executeDataQueryOptions : []options.ExecuteDataQueryOption {
49+ options .WithKeepInCache (true ),
50+ },
51+ keepInCache : true ,
52+ },
53+ {
54+ name : "no params, no server cache" ,
55+ params : table .NewQueryParameters (),
56+ executeDataQueryOptions : []options.ExecuteDataQueryOption {
57+ options .WithKeepInCache (false ),
58+ },
59+ keepInCache : false ,
60+ },
61+ {
62+ name : "not empty params, no server cache" ,
63+ params : table .NewQueryParameters (table .ValueParam ("a" , types .UTF8Value ("b" ))),
3764 executeDataQueryOptions : []options.ExecuteDataQueryOption {
3865 options .WithKeepInCache (false ),
3966 },
@@ -81,7 +108,7 @@ func TestQueryCachePolicyKeepInCache(t *testing.T) {
81108 table .CommitTx (),
82109 ),
83110 "SELECT 1" ,
84- table . NewQueryParameters () ,
111+ test . params ,
85112 test .executeDataQueryOptions ... ,
86113 )
87114 if err != nil {
0 commit comments