@@ -146,6 +146,8 @@ var setFunctionTests = TableTest{
146146 name : "set-contains-int" ,
147147 SQLs : sqls (
148148 "select * from selectwithset where setcontains(ievent, 101)" ,
149+ "select * from selectwithset where setcontainsany(ievent, [101])" ,
150+ "select * from selectwithset where setcontainsall(ievent, [101])" ,
149151 ),
150152 ExpHdrs : hdrs (
151153 hdr ("_id" , fldTypeID ),
@@ -159,6 +161,23 @@ var setFunctionTests = TableTest{
159161 ),
160162 Compare : CompareExactUnordered ,
161163 },
164+ {
165+ // SetContainsInt
166+ name : "set-contains-int-using-value" ,
167+ SQLs : sqls (
168+ "select _id, setcontainsany(ievent, [101]) from selectwithset" ,
169+ ),
170+ ExpHdrs : hdrs (
171+ hdr ("_id" , fldTypeID ),
172+ hdr ("" , fldTypeBool ),
173+ ),
174+ ExpRows : rows (
175+ row (int64 (1 ), true ),
176+ row (int64 (2 ), nil ),
177+ row (int64 (3 ), nil ),
178+ ),
179+ Compare : CompareExactUnordered ,
180+ },
162181 {
163182 // SetContainsOrSetContains
164183 // SetContainsAny
@@ -227,6 +246,30 @@ var setFunctionTests = TableTest{
227246 ),
228247 ExpErr : "types 'stringset' and 'stringset' are not equatable" ,
229248 },
249+ {
250+ // SetContainsWrongTypeSet
251+ name : "set-contains-null-in-values" ,
252+ SQLs : sqls (
253+ "select * from selectwithset where setcontains(event, [null])" ,
254+ ),
255+ ExpErr : "set literal must contain ints or strings" ,
256+ },
257+ {
258+ // SetContainsWrongTypeSet
259+ name : "set-contains-null-value" ,
260+ SQLs : sqls (
261+ "select * from selectwithset where setcontains(event, null)" ,
262+ ),
263+ ExpErr : "types 'stringset' and 'void' are not equatable" ,
264+ },
265+ {
266+ // SetContainsWrongTypeSet
267+ name : "set-contains-null-set" ,
268+ SQLs : sqls (
269+ "select * from selectwithset where setcontains(null, [1])" ,
270+ ),
271+ ExpErr : "set expression expected" ,
272+ },
230273 },
231274}
232275
0 commit comments