@@ -17,123 +17,123 @@ func TestNumericArgsBindRewriteQuery(t *testing.T) {
1717 )
1818 for _ , tt := range []struct {
1919 sql string
20- args []interface {}
20+ args []any
2121 yql string
22- params []interface {}
22+ params []any
2323 err error
2424 }{
2525 {
2626 sql : `SELECT $123abc, $2` ,
27- args : []interface {} {
27+ args : []any {
2828 100 ,
2929 },
3030 err : ErrInconsistentArgs ,
3131 },
3232 {
3333 sql : `SELECT $123abc, $1` ,
34- args : []interface {} {
34+ args : []any {
3535 200 ,
3636 },
3737 yql : `-- origin query with numeric args replacement
3838SELECT $123abc, $p0` ,
39- params : []interface {} {
39+ params : []any {
4040 table .ValueParam ("$p0" , types .Int32Value (200 )),
4141 },
4242 },
4343 {
4444 sql : `SELECT $1, $2` ,
45- args : []interface {} {
45+ args : []any {
4646 table .ValueParam ("$name1" , types .Int32Value (100 )),
4747 table .ValueParam ("$name2" , types .Int32Value (200 )),
4848 },
4949 yql : `-- origin query with numeric args replacement
5050SELECT $name1, $name2` ,
51- params : []interface {} {
51+ params : []any {
5252 table .ValueParam ("$name1" , types .Int32Value (100 )),
5353 table .ValueParam ("$name2" , types .Int32Value (200 )),
5454 },
5555 },
5656 {
5757 sql : `SELECT $1, $2` ,
58- args : []interface {} {
58+ args : []any {
5959 table .ValueParam ("$namedArg" , types .Int32Value (100 )),
6060 200 ,
6161 },
6262 yql : `-- origin query with numeric args replacement
6363SELECT $namedArg, $p1` ,
64- params : []interface {} {
64+ params : []any {
6565 table .ValueParam ("$namedArg" , types .Int32Value (100 )),
6666 table .ValueParam ("$p1" , types .Int32Value (200 )),
6767 },
6868 },
6969 {
7070 sql : `SELECT $0, $1` ,
71- args : []interface {} {
71+ args : []any {
7272 100 ,
7373 200 ,
7474 },
7575 err : ErrUnexpectedNumericArgZero ,
7676 },
7777 {
7878 sql : `SELECT $1, $2` ,
79- args : []interface {} {
79+ args : []any {
8080 100 ,
8181 200 ,
8282 },
8383 yql : `-- origin query with numeric args replacement
8484SELECT $p0, $p1` ,
85- params : []interface {} {
85+ params : []any {
8686 table .ValueParam ("$p0" , types .Int32Value (100 )),
8787 table .ValueParam ("$p1" , types .Int32Value (200 )),
8888 },
8989 },
9090 {
9191 sql : `SELECT $1, $2` ,
92- args : []interface {} {
92+ args : []any {
9393 100 ,
9494 },
9595 err : ErrInconsistentArgs ,
9696 },
9797 {
9898 sql : `SELECT $1, "$2"` ,
99- args : []interface {} {
99+ args : []any {
100100 100 ,
101101 },
102102 yql : `-- origin query with numeric args replacement
103103SELECT $p0, "$2"` ,
104- params : []interface {} {
104+ params : []any {
105105 table .ValueParam ("$p0" , types .Int32Value (100 )),
106106 },
107107 },
108108 {
109109 sql : `SELECT $1, '$2'` ,
110- args : []interface {} {
110+ args : []any {
111111 100 ,
112112 },
113113 yql : `-- origin query with numeric args replacement
114114SELECT $p0, '$2'` ,
115- params : []interface {} {
115+ params : []any {
116116 table .ValueParam ("$p0" , types .Int32Value (100 )),
117117 },
118118 },
119119 {
120120 sql : "SELECT $1, `$2`" ,
121- args : []interface {} {
121+ args : []any {
122122 100 ,
123123 },
124124 yql : "-- origin query with numeric args replacement\n SELECT $p0, `$2`" ,
125- params : []interface {} {
125+ params : []any {
126126 table .ValueParam ("$p0" , types .Int32Value (100 )),
127127 },
128128 },
129129 {
130130 sql : "SELECT ?, $1, $p0" ,
131- params : []interface {} {},
131+ params : []any {},
132132 err : ErrInconsistentArgs ,
133133 },
134134 {
135135 sql : "SELECT $1, $2, $3" ,
136- args : []interface {} {
136+ args : []any {
137137 1 ,
138138 "test" ,
139139 []string {
@@ -144,7 +144,7 @@ SELECT $p0, '$2'`,
144144 },
145145 yql : `-- origin query with numeric args replacement
146146SELECT $p0, $p1, $p2` ,
147- params : []interface {} {
147+ params : []any {
148148 table .ValueParam ("$p0" , types .Int32Value (1 )),
149149 table .ValueParam ("$p1" , types .TextValue ("test" )),
150150 table .ValueParam ("$p2" , types .ListValue (
@@ -156,7 +156,7 @@ SELECT $p0, $p1, $p2`,
156156 },
157157 {
158158 sql : "SELECT $1, $2, $3, $1, $2" ,
159- args : []interface {} {
159+ args : []any {
160160 1 ,
161161 "test" ,
162162 []string {
@@ -167,7 +167,7 @@ SELECT $p0, $p1, $p2`,
167167 },
168168 yql : `-- origin query with numeric args replacement
169169SELECT $p0, $p1, $p2, $p0, $p1` ,
170- params : []interface {} {
170+ params : []any {
171171 table .ValueParam ("$p0" , types .Int32Value (1 )),
172172 table .ValueParam ("$p1" , types .TextValue ("test" )),
173173 table .ValueParam ("$p2" , types .ListValue (
@@ -179,7 +179,7 @@ SELECT $p0, $p1, $p2, $p0, $p1`,
179179 },
180180 {
181181 sql : "SELECT $1, $2, $3" ,
182- args : []interface {} {
182+ args : []any {
183183 types .Int32Value (1 ),
184184 types .TextValue ("test" ),
185185 types .ListValue (
@@ -190,7 +190,7 @@ SELECT $p0, $p1, $p2, $p0, $p1`,
190190 },
191191 yql : `-- origin query with numeric args replacement
192192SELECT $p0, $p1, $p2` ,
193- params : []interface {} {
193+ params : []any {
194194 table .ValueParam ("$p0" , types .Int32Value (1 )),
195195 table .ValueParam ("$p1" , types .TextValue ("test" )),
196196 table .ValueParam ("$p2" , types .ListValue (
@@ -202,12 +202,12 @@ SELECT $p0, $p1, $p2`,
202202 },
203203 {
204204 sql : "SELECT $1, a, b, c WHERE id = $1 AND date < $2 AND value IN ($3)" ,
205- args : []interface {} {
205+ args : []any {
206206 1 , now , []string {"3" },
207207 },
208208 yql : `-- origin query with numeric args replacement
209209SELECT $p0, a, b, c WHERE id = $p0 AND date < $p1 AND value IN ($p2)` ,
210- params : []interface {} {
210+ params : []any {
211211 table .ValueParam ("$p0" , types .Int32Value (1 )),
212212 table .ValueParam ("$p1" , types .TimestampValueFromTime (now )),
213213 table .ValueParam ("$p2" , types .ListValue (types .TextValue ("3" ))),
@@ -225,47 +225,47 @@ SELECT 1`,
225225 },
226226 {
227227 sql : "SELECT $1, $2" ,
228- args : []interface {} {
228+ args : []any {
229229 1 ,
230230 },
231231 err : ErrInconsistentArgs ,
232232 },
233233 {
234234 sql : "SELECT $1, $2 -- some comment with $3" ,
235- args : []interface {} {
235+ args : []any {
236236 100 ,
237237 200 ,
238238 },
239239 yql : `-- origin query with numeric args replacement
240240SELECT $p0, $p1 -- some comment with $3` ,
241- params : []interface {} {
241+ params : []any {
242242 table .ValueParam ("$p0" , types .Int32Value (100 )),
243243 table .ValueParam ("$p1" , types .Int32Value (200 )),
244244 },
245245 },
246246 {
247247 sql : "SELECT $1 /* some comment with $3 */, $2" ,
248- args : []interface {} {
248+ args : []any {
249249 100 ,
250250 200 ,
251251 },
252252 yql : `-- origin query with numeric args replacement
253253SELECT $p0 /* some comment with $3 */, $p1` ,
254- params : []interface {} {
254+ params : []any {
255255 table .ValueParam ("$p0" , types .Int32Value (100 )),
256256 table .ValueParam ("$p1" , types .Int32Value (200 )),
257257 },
258258 },
259259 {
260260 sql : "SELECT $1, $2 -- some comment with $3" ,
261- args : []interface {} {
261+ args : []any {
262262 100 ,
263263 },
264264 err : ErrInconsistentArgs ,
265265 },
266266 {
267267 sql : "SELECT $1, $2, $3" ,
268- args : []interface {} {
268+ args : []any {
269269 100 ,
270270 200 ,
271271 },
@@ -274,40 +274,40 @@ SELECT $p0 /* some comment with $3 */, $p1`,
274274 {
275275 sql : `
276276SELECT $1 /* some comment with $3 */, $2` ,
277- args : []interface {} {
277+ args : []any {
278278 100 ,
279279 200 ,
280280 },
281281 yql : `-- origin query with numeric args replacement
282282
283283SELECT $p0 /* some comment with $3 */, $p1` ,
284- params : []interface {} {
284+ params : []any {
285285 table .ValueParam ("$p0" , types .Int32Value (100 )),
286286 table .ValueParam ("$p1" , types .Int32Value (200 )),
287287 },
288288 },
289289 {
290290 sql : "SELECT $1, $2" ,
291- args : []interface {} {
291+ args : []any {
292292 100 ,
293293 200 ,
294294 },
295295 yql : `-- origin query with numeric args replacement
296296SELECT $p0, $p1` ,
297- params : []interface {} {
297+ params : []any {
298298 table .ValueParam ("$p0" , types .Int32Value (100 )),
299299 table .ValueParam ("$p1" , types .Int32Value (200 )),
300300 },
301301 },
302302 {
303303 sql : "SELECT $1, $2" ,
304- args : []interface {} {
304+ args : []any {
305305 100 ,
306306 200 ,
307307 },
308308 yql : `-- origin query with numeric args replacement
309309SELECT $p0, $p1` ,
310- params : []interface {} {
310+ params : []any {
311311 table .ValueParam ("$p0" , types .Int32Value (100 )),
312312 table .ValueParam ("$p1" , types .Int32Value (200 )),
313313 },
0 commit comments