1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
U
¸ý°d1ëã@sâddlmZddlZddlmZddlmZddlmZddlmZddl    m
Z
ddl    m Z dd    l    m Z dd
l mZdd lmZdd lmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlm Z d dlm!Z!d dlm"Z"d dlm#Z#d d lm$Z$d d!lm%Z%d d"lm&Z&d d#lm'Z'd d$lm(Z(d d%l)m*Z*d d&l)m+Z+Gd'd(„d(ej,ƒZ-Gd)d*„d*ej,ƒZ.Gd+d,„d,ej/ƒZ0Gd-d.„d.ej,ƒZ1Gd/d0„d0ej,ƒZ2Gd1d2„d2ej,ƒZ3Gd3d4„d4ej,ƒZ4Gd5d6„d6eeej,ƒZ5Gd7d8„d8ej,ƒZ6Gd9d:„d:ej,ƒZ7Gd;d<„d<ej,ƒZ8Gd=d>„d>ej,ƒZ9Gd?d@„d@ej,ƒZ:GdAdB„dBej,ƒZ;GdCdD„dDeej,ƒZ<GdEdF„dFej,ƒZ=dS)GéNé)ÚAssertsCompiledSQL)ÚAssertsExecutionResults)Úconfig)Úfixtures)Ú assert_raises)Úeq_)Úin_)Ú    CursorSQL)ÚColumn)ÚTableé)Ú    bindparam)Úcase)Úcolumn)ÚComputed)Úexists)Úfalse)Ú
ForeignKey)Úfunc)ÚIdentity)ÚInteger)Úliteral)Úliteral_column)Únull)Úselect)ÚString)Útable)Útesting)Útext)Útrue)Útuple_)Ú    TupleType)Úunion)Úvalues)Ú DatabaseError)ÚProgrammingErrorc@s@eZdZdZedd„ƒZedd„ƒZdd„Zej    j
dd    „ƒZ d
S) Ú CollateTestTcCs&td|tdtddtdtdƒƒƒdS)NÚ
some_tableÚidT©Ú primary_keyÚdataéd©r r rr©ÚclsÚmetadata©r2ú[d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/testing/suite/test_select.pyÚ define_tables.s   üzCollateTest.define_tablescCs(| |jj ¡dddœdddœg¡dS)Néú collate data1©r)r,rú collate data2©ÚexecuteÚtablesr(Úinsert©r0Ú
connectionr2r2r3Ú insert_data7s 
þþzCollateTest.insert_datac    Cs.tj ¡}t| |¡ ¡|ƒW5QRXdS©N©rÚdbÚconnectrr:Úfetchall©ÚselfrÚresultÚconnr2r2r3Ú_assert_resultAs zCollateTest._assert_resultcCsBtj tj¡}| t|jjƒ |jjj    j
  |¡  ¡¡ddg¡dS)N)r5r6)rr8) rÚrequiresZget_order_by_collationrrIrr;r(Úorder_byÚcr,ZcollateZasc)rFZ    collationr2r2r3Útest_collate_order_byEs ÿüz!CollateTest.test_collate_order_byN) Ú__name__Ú
__module__Ú __qualname__Ú __backend__Ú classmethodr4r?rIrrJZorder_by_collationrMr2r2r2r3r'+s
 
    r'c@sleZdZdZdZedd„ƒZedd„ƒZdd„Zd    d
„Z    d d „Z
d d„Z dd„Z dd„Z ejjdd„ƒZdS)ÚOrderByLabelTestz©Test the dialect sends appropriate ORDER BY expressions when
    labels are used.
 
    This essentially exercises the "supports_simple_order_by_label"
    setting.
 
    Tc CsBtd|tdtddtdtƒtdtƒtdtdƒƒtd    tdƒƒƒdS)
Nr(r)Tr*ÚxÚyÚqé2Úpr.r/r2r2r3r4\s   ùzOrderByLabelTest.define_tablesc CsB| |jj ¡ddddddœddddddœddd    d
d dœg¡dS) Nr5rZq1Zp3)r)rTrUrVrXr Zq2Úp2éZq3Úp1r9r=r2r2r3r?hs
ýþzOrderByLabelTest.insert_datac    Cs.tj ¡}t| |¡ ¡|ƒW5QRXdSr@rArEr2r2r3rIss zOrderByLabelTest._assert_resultcCs6|jj}|jj d¡}| t|ƒ |¡dddg¡dS)NÚlx©r5©r©r )r;r(rLrTÚlabelrIrrK©rFrr\r2r2r3Ú
test_plainwszOrderByLabelTest.test_plaincCs>|jj}|jj|jj d¡}| t|ƒ |¡dddg¡dS)Nr\r_©é©é)    r;r(rLrTrUr`rIrrKrar2r2r3Útest_composed_int|sz"OrderByLabelTest.test_composed_intcCsb|jj}|jj|jj d¡}t |jj¡|jj     d¡}| 
t ||ƒ  ||  ¡¡dddg¡dS)Nr\Úly)r Zq1p3)rdZq2p2)rfZq3p1)r;r(rLrTrUr`rÚlowerrVrXrIrrKÚdesc)rFrr\rhr2r2r3Útest_composed_multiplesþz'OrderByLabelTest.test_composed_multiplecCs:|jj}|jj d¡}| t|ƒ | ¡¡dddg¡dS)Nr\r_r^r])    r;r(rLrTr`rIrrKrjrar2r2r3Útest_plain_descŠsz OrderByLabelTest.test_plain_desccCsB|jj}|jj|jj d¡}| t|ƒ |     ¡¡dddg¡dS)Nr\rercr_)
r;r(rLrTrUr`rIrrKrjrar2r2r3Útest_composed_int_descsz'OrderByLabelTest.test_composed_int_desccCsT|jj}|jj|jj d¡}tt |jj    ¡|ƒ 
|¡  |¡}|  |dddg¡dS)Nr\)r5r )r5rd)r5rf) r;r(rLrTrUr`rrÚcountr)Zgroup_byrKrI)rFrÚexprÚstmtr2r2r3Útest_group_by_composed”s
ÿz'OrderByLabelTest.test_group_by_composedN)rNrOrPÚ__doc__rQrRr4r?rIrbrgrkrlrmrrJZgroup_by_complex_expressionrqr2r2r2r3rSQs
 
 
    rSc@seZdZdZdZdd„ZdS)ÚValuesExpressionTest)Ztable_value_constructorTcCsHttdtƒtdtƒdd dddg¡}t| t|ƒ¡ ¡dddgƒdS)Nr)ÚnameZ    my_values)rt)r5Zname1)rZname2)r Zname3)    r$rrrr,rr:rÚall)rFr>Z
value_exprr2r2r3Ú test_tuples£sÿþþz ValuesExpressionTest.test_tuplesN)rNrOrPÚ __requires__rQrvr2r2r2r3rsžsrsc@s8eZdZdZedd„ƒZedd„ƒZdIdd    „ZdJd
d „Zd d „Z    dd„Z
e j j dd„ƒZe j jdd„ƒZe jdddgdddgdddgdde j jdd„ƒƒZe j j dd„ƒZe j jdd„ƒZe j jd d!„ƒZe j jd"d#„ƒZe j j d$d%„ƒZe j jd&d'„ƒZe j jd(d)„ƒZe j jd*d+„ƒZe j j d,d-„ƒZe j jd.d/„ƒZe j jd0d1„ƒZ e j jd2d3„ƒZ!e j j e j j"d4d5„ƒƒZ#e j jd6d7„ƒZ$e j jd8d9„ƒZ%e j j&d:d;„ƒZ'e j j&e j j(d<d=„ƒƒZ)e j j&e j j(d>d?„ƒƒZ*e j j+d@dA„ƒZ,e j j+e j j(dBdC„ƒƒZ-e j j&e j j+dDdE„ƒƒZ.e j j&e j j+e j j(dFdG„ƒƒƒZ/dHS)KÚFetchLimitOffsetTestTcCs*td|tdtddtdtƒtdtƒƒdS©Nr(r)Tr*rTrU©r r rr/r2r2r3r4±s ûz"FetchLimitOffsetTest.define_tablesc CsJ| |jj ¡ddddœddddœddddœddddœddddœg¡dS)Nr5r©r)rTrUr rZrdér9r=r2r2r3r?»s
 
 
 
 
 
ûþz FetchLimitOffsetTest.insert_datar2FcCsT|r:| ||¡ ¡}tt|ƒt|ƒƒtt|ƒt|ƒƒnt| ||¡ ¡|ƒdSr@)r:rDrÚlenÚset)rFr>rrGÚparamsÚset_Z    query_resr2r2r3rIÈs
z#FetchLimitOffsetTest._assert_resultc    Cs0tj ¡}t| ||¡ ¡|ƒW5QRXdSr@)rrBrCrZexec_driver_sqlrD©rFrrGrrHr2r2r3Ú_assert_result_strÓs z'FetchLimitOffsetTest._assert_result_strcCsP|jj}t|ƒ |jj¡}| || d¡ddg¡| || d¡dddg¡dS©Nr©r5r5r©rrr r ©r r rZ)r;r(rrKrLr)rIÚlimit)rFr>rrpr2r2r3Útest_simple_limit×sýýz&FetchLimitOffsetTest.test_simple_limitcCsL|jj}t|jjƒ d¡ ¡}tt|ƒt|ƒƒ ¡ ¡}|     ||dg¡dS)Nr5r])
r;r(rrLr)r‡Zscalar_subqueryr#ÚsubqueryrI)rFr>rrpÚur2r2r3Ú test_limit_render_multiple_timesåsÿýz5FetchLimitOffsetTest.test_limit_render_multiple_timescCsZ|jj}| |t|ƒ |jj¡ d¡ddg¡| |t|ƒ |jj¡ d¡dddg¡dSrƒ©r;r(rIrrKrLr)Úfetch©rFr>rr2r2r3Útest_simple_fetchósýýz&FetchLimitOffsetTest.test_simple_fetchcCsZ|jj}| |t|ƒ |jj¡ d¡dddg¡| |t|ƒ |jj¡ d¡ddg¡dS)Nrr†©rZrZrd©rdrZr|r ©r;r(rIrrKrLr)ÚoffsetrŽr2r2r3Útest_simple_offsetsýýz'FetchLimitOffsetTest.test_simple_offset)rr©rr5)r r)r r5Úcases)ÚargnamescCsl|jj}|jid}dddddg}|D]@\}}||||…}| |t|ƒ |jj¡ |¡     |¡|¡q&dS)N)Zcompiled_cacher„r…r†rr‘)
r;r(Zexecution_optionsrIrrKrLr)r‡r“)rFr>r–rZ assert_datar‡r“Úexpectedr2r2r3Útest_simple_limit_offsets  ýz-FetchLimitOffsetTest.test_simple_limit_offsetcCsf|jj}| |t|ƒ |jj¡ d¡ d¡ddg¡| |t|ƒ |jj¡ d¡ d¡dddg¡dS)Nrr5r…r†r rr‘©    r;r(rIrrKrLr)rr“rŽr2r2r3Útest_simple_fetch_offset$sýýz-FetchLimitOffsetTest.test_simple_fetch_offsetcCs2|jj}|j|t|ƒ d¡dddddgdddS)    Né
r„r…r†rr‘T©r€)r;r(rIrrrŽr2r2r3Útest_fetch_offset_no_order3s  üz/FetchLimitOffsetTest.test_fetch_offset_no_orderc    Csb|jj}| |t|ƒ |jj¡ d¡dddddg¡| |t|ƒ |jj¡ d¡ddddg¡dS)Nrr„r…r†rr‘r5r’rŽr2r2r3Útest_simple_offset_zero=s ý
ýz,FetchLimitOffsetTest.test_simple_offset_zerocCsX|jj}t|ƒ |jj¡ d¡ d¡}|jt    j
j ddid}t |ƒ}|  |ddg¡dS©    z7test that 'literal binds' mode works - no bound params.rr5Ú literal_bindsT)ÚdialectÚcompile_kwargsr…r†N)r;r(rrKrLr)r‡r“ÚcompilerrBr¢Ústrr‚©rFrrpZsqlr2r2r3Útest_limit_offset_nobindsLsÿz.FetchLimitOffsetTest.test_limit_offset_nobindscCsX|jj}t|ƒ |jj¡ d¡ d¡}|jt    j
j ddid}t |ƒ}|  |ddg¡dSr )r;r(rrKrLr)rr“r¤rrBr¢r¥r‚r¦r2r2r3Útest_fetch_offset_nobindsYsÿz.FetchLimitOffsetTest.test_fetch_offset_nobindscCsr|jj}|j|t|ƒ |jj¡ tdƒ¡ddgddid|j|t|ƒ |jj¡ tdƒ¡dddgddiddS)NÚlr„r…r©rr†r )    r;r(rIrrKrLr)r‡rrŽr2r2r3Útest_bound_limitfsüüz%FetchLimitOffsetTest.test_bound_limitcCsv|jj}|j|t|ƒ |jj¡ tdƒ¡dddgddid|j|t|ƒ |jj¡ tdƒ¡ddddgddiddS)    NÚor†rr‘rrªr…r5)    r;r(rIrrKrLr)r“rrŽr2r2r3Útest_bound_offsetwsü
üz&FetchLimitOffsetTest.test_bound_offsetcCsŠ|jj}|j|t|ƒ |jj¡ tdƒ¡     tdƒ¡ddgdddœd|j|t|ƒ |jj¡ tdƒ¡     tdƒ¡dd    d
gd ddœddS) Nr©r¬r…r†rr5)r©r¬rªrr‘r )
r;r(rIrrKrLr)r‡rr“rŽr2r2r3Útest_bound_limit_offsetˆs2ÿþýù
ÿþýùz,FetchLimitOffsetTest.test_bound_limit_offsetcCsŠ|jj}|j|t|ƒ |jj¡ tdƒ¡     tdƒ¡ddgdddœd|j|t|ƒ |jj¡ tdƒ¡     tdƒ¡dd    d
gd ddœddS) NÚfr¬r…r†rr5)r¯r¬rªrr‘r )
r;r(rIrrKrLr)rrr“rŽr2r2r3Útest_bound_fetch_offsetŸs2ÿþýù
ÿþýùz,FetchLimitOffsetTest.test_bound_fetch_offsetcCs>|jj}| |t|ƒ |jj¡ tdƒtdƒ¡ddg¡dS)NÚ1Ú2rr‘)    r;r(rIrrKrLr)r“rrŽr2r2r3Útest_expr_offset¶sÿþûz%FetchLimitOffsetTest.test_expr_offsetcCs@|jj}| |t|ƒ |jj¡ tdƒtdƒ¡dddg¡dS)Nr±r²r„r…r†)    r;r(rIrrKrLr)r‡rrŽr2r2r3Útest_expr_limitÁsÿþûz$FetchLimitOffsetTest.test_expr_limitcCsP|jj}| |t|ƒ |jj¡ tdƒtdƒ¡     tdƒtdƒ¡ddg¡dS©Nr±r†r©
r;r(rIrrKrLr)r‡rr“rŽr2r2r3Útest_expr_limit_offsetÌsÿþýúz+FetchLimitOffsetTest.test_expr_limit_offsetcCsP|jj}| |t|ƒ |jj¡ tdƒtdƒ¡     tdƒtdƒ¡ddg¡dSrµ)
r;r(rIrrKrLr)rrr“rŽr2r2r3Útest_expr_fetch_offsetØsÿþýúz+FetchLimitOffsetTest.test_expr_fetch_offsetcCs~|jj}| |t|ƒ |jj¡ d¡ t    dƒt    dƒ¡ddg¡| |t|ƒ |jj¡ d¡ t    dƒt    dƒ¡dddg¡dS)Nrr±r†rr r‘)
r;r(rIrrKrLr)r‡r“rrŽr2r2r3Útest_simple_limit_expr_offsetås.ÿþýú    ÿþýúz2FetchLimitOffsetTest.test_simple_limit_expr_offsetcCs||jj}| |t|ƒ |jj¡ tdƒtdƒ¡     d¡ddg¡| |t|ƒ |jj¡ tdƒtdƒ¡     d¡ddg¡dS)Nr±rr†rr5r…r¶rŽr2r2r3Útest_expr_limit_simple_offsetús.ÿþýú    ÿþýúz2FetchLimitOffsetTest.test_expr_limit_simple_offsetcCsr|jj}|j|t|ƒ |jj ¡¡jdddddgdd|j|t|ƒ |jj ¡¡jddddddgdddS)    Nr5T©Ú    with_tiesrr‘rr r†©    r;r(rIrrKrLrTrjrrŽr2r2r3Útest_simple_fetch_tiessüüz+FetchLimitOffsetTest.test_simple_fetch_tiescCsZ|jj}| t|ƒ |jj¡jddd d¡¡     ¡}t
|ddƒt
t |ƒdddhƒdS)NrTr»rr†rr‘© r;r(r:rrKrLrTrr“rDrr~©rFr>rÚfar2r2r3Útest_fetch_offset_ties sÿþýÿz+FetchLimitOffsetTest.test_fetch_offset_tiescCsl|jj}| |t|ƒ |jj¡jddd d¡ddg¡| |t|ƒ |jj¡jddd d¡dd    g¡dS)
NrTr»r5r…r†r rr‘)    r;r(rIrrKrLrTrr“rŽr2r2r3Ú#test_fetch_offset_ties_exact_number-s2ÿþýú    ÿþýúz8FetchLimitOffsetTest.test_fetch_offset_ties_exact_numbercCs4|jj}| |t|ƒ |jj¡jddddg¡dS)NéT©Úpercentr„rŒrŽr2r2r3Útest_simple_fetch_percentCs ýz.FetchLimitOffsetTest.test_simple_fetch_percentcCs<|jj}| |t|ƒ |jj¡jddd d¡ddg¡dS)Né(TrÅr5r…r†ršrŽr2r2r3Útest_fetch_offset_percentLsÿþýúz.FetchLimitOffsetTest.test_fetch_offset_percentcCs@|jj}|j|t|ƒ |jj ¡¡jddddddgdddS)NrÄT©rÆr¼rr‘rr½rŽr2r2r3Útest_simple_fetch_percent_tiesYs
ÿþúz3FetchLimitOffsetTest.test_simple_fetch_percent_tiescCs\|jj}| t|ƒ |jj¡jdddd d¡¡     ¡}t
|ddƒt
t |ƒdddhƒdS)    NrÈTrÊrrr†rr‘r¿rÀr2r2r3Útest_fetch_offset_percent_tiesfsÿþýÿz3FetchLimitOffsetTest.test_fetch_offset_percent_tiesN)r2F)r2)0rNrOrPrQrRr4r?rIr‚rˆr‹rrJZ fetch_firstrr“r”Ú combinationsr™r›Zfetch_no_order_byržrŸr§r¨Zbound_limit_offsetr«r­r®r°Zsql_expression_limit_offsetr³r´r·Zfetch_expressionr¸r¹rºZ
fetch_tiesr¾Zfetch_offset_with_optionsrÂrÃZ fetch_percentrÇrÉrËrÌr2r2r2r3rx®s”
    
ÿ
 
 
 
ü 
 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  rxc@sHeZdZdZdZdZedd„ƒZedd„ƒZdd    „Z    d
d „Z
d d „Z dS)ÚSameNamedSchemaTableTestztests for #7471T)Zschemasc    CsBtd|tdtddtjdtd|tdtddtdtddƒdS)    Nr(r)Tr*)ÚschemaÚ some_table_idF©Znullable)r r rrÚ test_schemar/r2r2r3r4|s  ü üüz&SameNamedSchemaTableTest.define_tablescCsD| ddtj¡\}}| | ¡ddi¡| | ¡dddœ¡dS)Nr(ú %s.some_tabler)r5)r)rÐ)r;rrÒr:r<)r0r>r(Úsome_table_schemar2r2r3r?s ÿz$SameNamedSchemaTableTest.insert_datac    CsJ| ddtj¡\}}t| t||ƒ |||jj|jj    k¡¡ 
¡dƒdS)Nr(rÓ©r5r5r5) r;rrÒrr:rÚ    join_fromrLrÐr)Úfirst©rFr>r(rÔr2r2r3Útest_simple_join_both_tables˜sÿ
ýÿøz5SameNamedSchemaTableTest.test_simple_join_both_tablesc    CsV| ddtj¡\}}t| t|ƒ |||jj|jj    k¡ 
|jj    dk¡¡  ¡dƒdS)Nr(rÓr5©r5r5) r;rrÒrr:rrÖrLrÐr)Úwherer×rØr2r2r3Ú!test_simple_join_whereclause_only¨s ÿü
úÿ    öz:SameNamedSchemaTableTest.test_simple_join_whereclause_onlyc    CsŒ| ddtj¡\}}t|ƒ |||jj|jjk¡ |jjdk¡     ¡}t
|  t||jjƒ |||jj|jjk¡ |jjdk¡¡  ¡dƒdS)Nr(rÓr5rÕ) r;rrÒrrÖrLrÐr)rÛr‰rr:r×)rFr>r(rÔZsubqr2r2r3Ú test_subqueryºs0ÿü
úÿ ü
úÿ    öz&SameNamedSchemaTableTest.test_subqueryN) rNrOrPrrrQrwrRr4r?rÙrÜrÝr2r2r2r3rÎus
 
rÎc@sZeZdZdZddd„Zedd„ƒZedd„ƒZd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dS)ÚJoinTestTr2c    Cs0tj ¡}t| ||¡ ¡|ƒW5QRXdSr@rArr2r2r3rIÛs zJoinTest._assert_resultc    Cs@td|tdtddƒtd|tdtddtdtdƒdd    ƒdS)
NÚar)Tr*ÚbÚa_idza.idFrÑ)r r rrr/r2r2r3r4ßs üzJoinTest.define_tablesc    Csj| |jj ¡ddiddiddiddiddig¡| |jj ¡dddœdddœdddœdddœg¡dS)Nr)r5rr rZrd)r)rá)r:r;rßr<ràr=r2r2r3r?és
 þ
üþzJoinTest.insert_datacCsN| dd¡\}}t||ƒ | |¡¡ |jj|jj¡}| |ddddg¡dS©NrßràrÕ)r5rr5)rrZr)r rdr ©r;rÚ select_fromÚjoinrKrLr)rI©rFrßràrpr2r2r3Útest_inner_join_fkús&zJoinTest.test_inner_join_fkc Csn| dd¡\}}t||ƒ | |tƒ¡¡ |jj|jj¡}| |dd„t     
ddddd    gd
d d d g¡Dƒ¡dS)NrßràcSs g|]\\}\}}|||f‘qSr2r2)Ú.0rßràrLr2r2r3Ú
<listcomp> s ÿz1JoinTest.test_inner_join_true.<locals>.<listcomp>r]r^r_©rZrcrÚr•)rZr)rdr ) r;rrärår rKrLr)rIÚ    itertoolsÚproductrær2r2r3Útest_inner_join_trues"
 ÿþÿ 
þþþzJoinTest.test_inner_join_truecCsJ| dd¡\}}t||ƒ | |tƒ¡¡ |jj|jj¡}| |g¡dS)Nrßrà)    r;rrärårrKrLr)rIrær2r2r3Útest_inner_join_falses
 ÿþÿzJoinTest.test_inner_join_falsecCsT| dd¡\}}t||ƒ | |tƒ¡¡ |jj|jj¡}| |dddddg¡dS)Nrßrà)r5NN)rNN)r NN)rZNN)rdNN)    r;rräZ    outerjoinrrKrLr)rIrær2r2r3Útest_outer_join_false s"
 ÿþÿûþzJoinTest.test_outer_join_falsecCsN| dd¡\}}t||ƒ | |¡¡ |jj|jj¡}| |ddddg¡dSrârãrær2r2r3Útest_outer_join_fk4s&zJoinTest.test_outer_join_fkN)r2) rNrOrPrQrIrRr4r?rçrírîrïrðr2r2r2r3rÞØs
 
    
 rÞc@sŠeZdZdZedd„ƒZedd„ƒZddd„Zd    d
„Zd d „Z    e
j j e
j j d d„ƒƒZe
j jdd„ƒZdd„Ze
j j dd„ƒZdd„ZdS)ÚCompoundSelectTestTcCs*td|tdtddtdtƒtdtƒƒdSryrzr/r2r2r3r4?s ûz CompoundSelectTest.define_tablesc
Cs@| |jj ¡ddddœddddœddddœddddœg¡dS)Nr5rr{r rZrdr9r=r2r2r3r?Is
 
 
 
 
üþzCompoundSelectTest.insert_datar2c    Cs0tj ¡}t| ||¡ ¡|ƒW5QRXdSr@rArr2r2r3rIUs z!CompoundSelectTest._assert_resultcCs\|jj}t|ƒ |jjdk¡}t|ƒ |jjdk¡}t||ƒ}| | |j    j¡ddg¡dS©Nrr r…r†)
r;r(rrÛrLr)r#rIrKÚselected_columns©rFrÚs1Ús2Úu1r2r2r3Útest_plain_unionYs
 ÿz#CompoundSelectTest.test_plain_unioncCsd|jj}t|ƒ |jjdk¡}t|ƒ |jjdk¡}t||ƒ ¡ ¡}| |     |j
j¡ddg¡dSrò) r;r(rrÛrLr)r#ÚaliasrIrKrórôr2r2r3Útest_select_from_plain_unioncs ÿz/CompoundSelectTest.test_select_from_plain_unioncCs‚|jj}t|ƒ |jjdk¡ d¡ |jj¡}t|ƒ |jjdk¡ d¡ |jj¡}t||ƒ d¡}|     | |j
j¡ddg¡dS©Nrr5r r…r†) r;r(rrÛrLr)r‡rKr#rIrórôr2r2r3Ú&test_limit_offset_selectable_in_unionsms&& ÿz9CompoundSelectTest.test_limit_offset_selectable_in_unionscCsv|jj}t|ƒ |jjdk¡ |jj¡}t|ƒ |jjdk¡ |jj¡}t||ƒ d¡}|     | |j
j¡ddg¡dSrò) r;r(rrÛrLr)rKr#r‡rIrórôr2r2r3Ú"test_order_by_selectable_in_unionsys   ÿz5CompoundSelectTest.test_order_by_selectable_in_unionscCsj|jj}t|ƒ |jjdk¡ ¡}t|ƒ |jjdk¡ ¡}t||ƒ d¡}|     | 
|j j¡ddg¡dSrò) r;r(rrÛrLr)Údistinctr#r‡rIrKrórôr2r2r3Ú"test_distinct_selectable_in_unions„s ÿz5CompoundSelectTest.test_distinct_selectable_in_unionscCsŠ|jj}t|ƒ |jjdk¡ d¡ |jj¡}t|ƒ |jjdk¡ d¡ |jj¡}t||ƒ     ¡}| 
| ¡ d¡ |jj¡ddg¡dSrû) r;r(rrÛrLr)r‡rKr#rùrIrôr2r2r3Ú&test_limit_offset_in_unions_from_aliasŽs&&ÿz9CompoundSelectTest.test_limit_offset_in_unions_from_aliascCs’|jj}t|ƒ |jjdk¡ d¡ |jj¡ ¡ ¡}t|ƒ |jjdk¡ d¡ |jj¡ ¡ ¡}t    ||ƒ d¡}| 
| |j j¡ddg¡dSrû) r;r(rrÛrLr)r‡rKrùr#rIrórôr2r2r3Ú.test_limit_offset_aliased_selectable_in_unionsšs,
ÿþý
ÿ    
ÿþý
ÿ     ÿzACompoundSelectTest.test_limit_offset_aliased_selectable_in_unionsN)r2)rNrOrPrQrRr4r?rIrørúrrJZorder_by_col_from_unionZ/parens_in_union_contained_select_w_limit_offsetrüZ0parens_in_union_contained_select_wo_limit_offsetrýrÿrrr2r2r2r3rñ<s"
    
 
 
 
 
 
 
 
 
rñc@sleZdZdZdZedd„ƒZedd„ƒZdd„Zd    d
„Z    d d „Z
d d„Z e j jdd„ƒZe j jdd„ƒZdS)ÚPostCompileParamsTestT)Zstandard_cursor_sqlc
Cs6td|tdtddtdtƒtdtƒtdtdƒƒƒdS©    Nr(r)Tr*rTrUÚzrWr.r/r2r2r3r4ºs  úz#PostCompileParamsTest.define_tablesc CsH| |jj ¡dddddœdddddœdddddœddd    d
dœg¡dS© Nr5rÚz1)r)rTrUrr Úz2rZÚz3rdÚz4r9r=r2r2r3r?Ås
    üþz!PostCompileParamsTest.insert_datacCs<|jj}t|jjƒ |jjtdddk¡}| |di¡dS)NrVT©Úliteral_executezKSELECT some_table.id FROM some_table WHERE some_table.x = __[POSTCOMPILE_q]©    r;r(rrLr)rÛrTrÚassert_compile©rFrrpr2r2r3Ú test_compileÑs ÿüz"PostCompileParamsTest.test_compilecCsB|jj}t|jjƒ |jjtddddk¡}|j|didddS)NrVrœTr
z<SELECT some_table.id FROM some_table WHERE some_table.x = 10)r¡r rr2r2r3Útest_compile_literal_bindsßs ÿüz0PostCompileParamsTest.test_compile_literal_bindsc
Csˆ|jj}t|jjƒ |jjtdddk¡}| ¡.}t    j
  ¡}|  |t dd¡W5QRXW5QRX| tdt    j
jjr|dniƒ¡dS)NrVTr
rœ©rVz>SELECT some_table.id 
FROM some_table 
WHERE some_table.x = 10r2)r;r(rrLr)rÛrTrÚsql_execution_asserterrrBrCr:ÚdictÚassert_r
r¢Ú
positional©rFrrpZasserterrHr2r2r3Ú test_executeís ÿ
 &ýÿz"PostCompileParamsTest.test_executec
Cs’|jj}t|jjƒ |jj tdddd¡¡}|     ¡4}t
j   ¡}|  |tdddgd¡W5QRXW5QRX| tdt
j jjr†d    niƒ¡dS)
NrVT©Ú    expandingr rdr|rfrzFSELECT some_table.id 
FROM some_table 
WHERE some_table.x IN (5, 6, 7)r2)r;r(rrLr)rÛrTr    rrrrBrCr:rrr
r¢rrr2r2r3Ú+test_execute_expanding_plus_literal_executes ÿ
 ,ýÿzAPostCompileParamsTest.test_execute_expanding_plus_literal_executec
Cs¬|jj}t|jjƒ t|jj|jjƒ     t
dddd¡¡}|  ¡2}t j  ¡}| |tddgd¡W5QRXW5QRX| tdt j jjrŽdnd    t j jjr d
niƒ¡dS) NrVTr)rdrœ)é érzbSELECT some_table.id 
FROM some_table 
WHERE (some_table.x, some_table.y) IN (%s(5, 10), (12, 18))úVALUES Úr2)r;r(rrLr)rÛr!rTrUr    rrrrBrCr:rrr
r¢Útuple_in_valuesrrr2r2r3Ú1test_execute_tuple_expanding_plus_literal_executes"  ÿÿ
 *ýûÿzGPostCompileParamsTest.test_execute_tuple_expanding_plus_literal_executec
Cs¬|jj}t|jjƒ t|jj|jjƒ     t
dddd¡¡}|  ¡2}t j  ¡}| |tddgd¡W5QRXW5QRX| tdt j jjrŽdnd    t j jjr d
niƒ¡dS) NrVTr)rdr)rrrzfSELECT some_table.id 
FROM some_table 
WHERE (some_table.x, some_table.z) IN (%s(5, 'z1'), (12, 'z3'))rrr2)r;r(rrLr)rÛr!rTrr    rrrrBrCr:rrr
r¢rrrr2r2r3Ú?test_execute_tuple_expanding_plus_literal_heterogeneous_execute+s"  ÿÿ
 *ýûÿzUPostCompileParamsTest.test_execute_tuple_expanding_plus_literal_heterogeneous_executeN)rNrOrPrQrwrRr4r?rrrrrrJÚtuple_inr r!r2r2r2r3r³s
 
 
 
rc@sreZdZdZedd„ƒZedd„ƒZdDdd„Zd    d
„Zd d „Z    e
j j d d„ƒZ e
j j dd„ƒZe
j j dd„ƒZe
j j dd„ƒZdd„Zdd„Zdd„Zdd„Zdd„Zdd „Ze
j jd!d"„ƒZe
j jd#d$„ƒZe
j jd%d&„ƒZe
j jd'd(„ƒZe
j jd)d*„ƒZe
j jd+d,„ƒZe
j jd-d.„ƒZd/d0„Zd1d2„Z d3d4„Z!d5d6„Z"d7d8„Z#d9d:„Z$d;d<„Z%d=d>„Z&d?d@„Z'dAdB„Z(dCS)EÚExpandingBoundInTestTc
Cs6td|tdtddtdtƒtdtƒtdtdƒƒƒdSrr.r/r2r2r3r4Gs  úz"ExpandingBoundInTest.define_tablesc CsH| |jj ¡dddddœdddddœdddddœddd    d
dœg¡dSrr9r=r2r2r3r?Rs
    üþz ExpandingBoundInTest.insert_datar2c    Cs0tj ¡}t| ||¡ ¡|ƒW5QRXdSr@rArr2r2r3rI^s z#ExpandingBoundInTest._assert_resultcCs`|jj}t|jjƒ |jj tdƒ¡¡ |jj     tdƒ¡¡ 
|jj¡}|j |gggdœddS)NrVrX)rVrXrª) r;r(rrLr)rÛrTr    rrUrKrIrr2r2r3Ú"test_multiple_empty_sets_bindparambs ÿþýÿz7ExpandingBoundInTest.test_multiple_empty_sets_bindparamcCsN|jj}t|jjƒ |jj g¡¡ |jj g¡¡     |jj¡}| 
|g¡dSr@) r;r(rrLr)rÛrTr    rUrKrIrr2r2r3Útest_multiple_empty_sets_directns  ÿ þýÿz4ExpandingBoundInTest.test_multiple_empty_sets_directcCsT|jj}t|jjƒ t|jj|jjƒ     t
dƒ¡¡  |jj¡}|j |gdgiddS©NrVrª© r;r(rrLr)rÛr!rTrr    rrKrIrr2r2r3Ú)test_empty_heterogeneous_tuples_bindparamzs ÿþÿz>ExpandingBoundInTest.test_empty_heterogeneous_tuples_bindparamcsDˆjj‰‡‡fdd„}|ggƒ|dddgdddgƒ|ggƒdS)    Ncs@tˆjjƒ tˆjjˆjjƒ |¡¡ ˆjj¡}ˆ     ||¡dSr@)
rrLr)rÛr!rTrr    rKrI©Úvalr˜rp©rFrr2r3Úgoˆs ÿþÿzGExpandingBoundInTest.test_empty_heterogeneous_tuples_direct.<locals>.go©rr©r r©rZr    r^r_rê©r;r(©rFr,r2r+r3Ú&test_empty_heterogeneous_tuples_direct„s
 
z;ExpandingBoundInTest.test_empty_heterogeneous_tuples_directcCsT|jj}t|jjƒ t|jj|jjƒ     t
dƒ¡¡  |jj¡}|j |gdgiddSr&© r;r(rrLr)rÛr!rTrUr    rrKrIrr2r2r3Ú'test_empty_homogeneous_tuples_bindparam”s ÿþÿz<ExpandingBoundInTest.test_empty_homogeneous_tuples_bindparamcsDˆjj‰‡‡fdd„}|ggƒ|dddgdddgƒ|ggƒdS)    Ncs@tˆjjƒ tˆjjˆjjƒ |¡¡ ˆjj¡}ˆ     ||¡dSr@)
rrLr)rÛr!rTrUr    rKrIr)r+r2r3r,¢s ÿþÿzEExpandingBoundInTest.test_empty_homogeneous_tuples_direct.<locals>.go)r5r©rr ©r rZr]r^r_r0r1r2r+r3Ú$test_empty_homogeneous_tuples_directžs
 
z9ExpandingBoundInTest.test_empty_homogeneous_tuples_directcCsV|jj}t|jjƒ |jj tdƒ¡¡     |jj¡}|j
|dddgddddgiddS)    NrVr^r_rêrr rZrª© r;r(rrLr)rÛrTr    rrKrIrr2r2r3Útest_bound_in_scalar_bindparam®s ÿþÿz3ExpandingBoundInTest.test_bound_in_scalar_bindparamcCsJ|jj}t|jjƒ |jj dddg¡¡ |jj¡}|     |dddg¡dS)Nrr rZr^r_rê©
r;r(rrLr)rÛrTr    rKrIrr2r2r3Útest_bound_in_scalar_direct·s ÿþÿz0ExpandingBoundInTest.test_bound_in_scalar_directcCsV|jj}t|jjƒ |jj ddg¡¡ |jj g¡¡     |jj¡}| 
|ddg¡dS)Nrr r^r_© r;r(rrLr)rÛrTr    Únot_inrKrIrr2r2r3Ú!test_nonempty_in_plus_empty_notinÀs ÿ þýÿz6ExpandingBoundInTest.test_nonempty_in_plus_empty_notincCsR|jj}t|jjƒ |jj g¡¡ |jj ddg¡¡     |jj¡}| 
|g¡dS)Nrr r<rr2r2r3Ú!test_empty_in_plus_notempty_notinÊs  ÿþýÿz6ExpandingBoundInTest.test_empty_in_plus_notempty_notincCs<tdƒ tdtdd¡}|j|dddgddd    d
gid d S) z†test related to #7292.
 
        as a type is given to the bound param, there is no ambiguity
        to the type of element.
 
        ú3select id FROM some_table WHERE z IN :q ORDER BY idrVT©Útype_rr^r_rêrrr    rªN)rÚ
bindparamsrrrI©rFrpr2r2r3Útest_typed_str_inÔsÿ þ ýz&ExpandingBoundInTest.test_typed_str_incCs:tdƒ tddd¡}|j|dddgddd    d
gid d S) zÂtest related to #7292.
 
        for untyped expression, we look at the types of elements.
        Test for Sequence to detect tuple in.  but not strings or bytes!
        as always....
 
        r@rVT©rr^r_rêrrr    rªN©rrCrrIrDr2r2r3Útest_untyped_str_inås    ÿ
þ ýz(ExpandingBoundInTest.test_untyped_str_incCs`|jj}t|jjƒ t|jj|jjƒ     t
dƒ¡¡  |jj¡}|j |dddgddddgiddS)    NrVr^r_rêr5r6©rZrdrªr3rr2r2r3Ú!test_bound_in_two_tuple_bindparam÷s ÿþÿ ÿz6ExpandingBoundInTest.test_bound_in_two_tuple_bindparamcCsT|jj}t|jjƒ t|jj|jjƒ     dddg¡¡ 
|jj¡}|  |dddg¡dS)Nr5r6rIr^r_rê) r;r(rrLr)rÛr!rTrUr    rKrIrr2r2r3Útest_bound_in_two_tuple_directs ÿþÿz3ExpandingBoundInTest.test_bound_in_two_tuple_directcCs`|jj}t|jjƒ t|jj|jjƒ     t
dƒ¡¡  |jj¡}|j |dddgddddgiddS)    NrVr^r_rêr-r.r/rªr'rr2r2r3Ú/test_bound_in_heterogeneous_two_tuple_bindparam s ÿþÿ ýzDExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_bindparamcCsT|jj}t|jjƒ t|jj|jjƒ     dddg¡¡ 
|jj¡}|  |dddg¡dS)Nr-r.r/r^r_rê) r;r(rrLr)rÛr!rTrr    rKrIrr2r2r3Ú,test_bound_in_heterogeneous_two_tuple_directs ÿþúÿ    þzAExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_directcCs:tdƒ tddd¡}|j|dddgddd    d
gid dS) Nú8select id FROM some_table WHERE (x, z) IN :q ORDER BY idrVTrFr^r_rêr-r.r/rªrGrDr2r2r3Ú4test_bound_in_heterogeneous_two_tuple_text_bindparam,sÿ
þ ýzIExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparamc    CsjGdd„dtjƒ}tdƒ tdttƒtƒƒdd¡}|j|ddd    gd|d
d ƒ|d d ƒ|ddƒgiddS)Nc@s,eZdZdd„Zdd„Zdd„Zdd„Zd    S)
zhExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple.<locals>.LikeATuplecWs
||_dSr@©Ú_data©rFr,r2r2r3Ú__init__<szqExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple.<locals>.LikeATuple.__init__cSs
t|jƒSr@©ÚiterrQ©rFr2r2r3Ú__iter__?szqExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple.<locals>.LikeATuple.__iter__cSs
|j|Sr@rP©rFÚidxr2r2r3Ú __getitem__BsztExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple.<locals>.LikeATuple.__getitem__cSs
t|jƒSr@©r}rQrVr2r2r3Ú__len__EszpExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple.<locals>.LikeATuple.__len__N©rNrOrPrSrWrZr\r2r2r2r3Ú
LikeATuple;sr^rNrVTrAr^r_rêrrr rrZr    rª)    Úcollections_abcÚSequencerrCrr"rrrI©rFr^rpr2r2r3Ú?test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuple9s( ÿ ÿýýÿýzTExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_typed_bindparam_non_tuplec    Cs^Gdd„dtjƒ}tdƒ tddd¡}|j|ddd    gd|d
d ƒ|d d ƒ|ddƒgiddS)Nc@s,eZdZdd„Zdd„Zdd„Zdd„Zd    S)
zgExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple.<locals>.LikeATuplecWs
||_dSr@rPrRr2r2r3rSaszpExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple.<locals>.LikeATuple.__init__cSs
t|jƒSr@rTrVr2r2r3rWdszpExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple.<locals>.LikeATuple.__iter__cSs
|j|Sr@rPrXr2r2r3rZgszsExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple.<locals>.LikeATuple.__getitem__cSs
t|jƒSr@r[rVr2r2r3r\jszoExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple.<locals>.LikeATuple.__len__Nr]r2r2r2r3r^`sr^rNrVTrFr^r_rêrrr rrZr    rª)r_r`rrCrrIrar2r2r3Ú>test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuple[s  ÿ
þýÿýzSExpandingBoundInTest.test_bound_in_heterogeneous_two_tuple_text_bindparam_non_tuplecCsJ|jj}t|jjƒ |jj tdƒ¡¡     |jj¡}|j
|gdgiddSr&r8rr2r2r3Ú(test_empty_set_against_integer_bindparam|s ÿþÿz=ExpandingBoundInTest.test_empty_set_against_integer_bindparamcCs>|jj}t|jjƒ |jj g¡¡ |jj¡}|     |g¡dSr@r:rr2r2r3Ú%test_empty_set_against_integer_direct…s&z:ExpandingBoundInTest.test_empty_set_against_integer_directcCsR|jj}t|jjƒ |jj tdƒ¡¡     |jj¡}|j
|ddddgdgiddS©NrVr]r^r_rêrª) r;r(rrLr)rÛrTr=rrKrIrr2r2r3Ú1test_empty_set_against_integer_negation_bindparamŠs ÿþÿzFExpandingBoundInTest.test_empty_set_against_integer_negation_bindparamcCsF|jj}t|jjƒ |jj g¡¡ |jj¡}|     |ddddg¡dS©Nr]r^r_rê)
r;r(rrLr)rÛrTr=rKrIrr2r2r3Ú.test_empty_set_against_integer_negation_direct“s$ÿzCExpandingBoundInTest.test_empty_set_against_integer_negation_directcCsJ|jj}t|jjƒ |jj tdƒ¡¡     |jj¡}|j
|gdgiddSr&) r;r(rrLr)rÛrr    rrKrIrr2r2r3Ú'test_empty_set_against_string_bindparamšs ÿþÿz<ExpandingBoundInTest.test_empty_set_against_string_bindparamcCs>|jj}t|jjƒ |jj g¡¡ |jj¡}|     |g¡dSr@)
r;r(rrLr)rÛrr    rKrIrr2r2r3Ú$test_empty_set_against_string_direct£s&z9ExpandingBoundInTest.test_empty_set_against_string_directcCsR|jj}t|jjƒ |jj tdƒ¡¡     |jj¡}|j
|ddddgdgiddSrf) r;r(rrLr)rÛrr=rrKrIrr2r2r3Ú0test_empty_set_against_string_negation_bindparam¨s ÿþÿzEExpandingBoundInTest.test_empty_set_against_string_negation_bindparamcCsF|jj}t|jjƒ |jj g¡¡ |jj¡}|     |ddddg¡dSrh)
r;r(rrLr)rÛrr=rKrIrr2r2r3Ú-test_empty_set_against_string_negation_direct±s$ÿzBExpandingBoundInTest.test_empty_set_against_string_negation_directcCsDtttƒ tddd¡tƒftƒdƒ}t| |¡ ¡ddƒdS)NÚfoor2)Úvalue©Zelse_r©Fr)    rrrr    rr rr:Úfetchone©rFr>rpr2r2r3Ú)test_null_in_empty_set_is_false_bindparam¸sþûÿ    z>ExpandingBoundInTest.test_null_in_empty_set_is_false_bindparamcCs<tttƒ g¡tƒftƒdƒ}t| |¡ ¡ddƒdS)Nrprrq)rrrr    r rr:rrrsr2r2r3Ú&test_null_in_empty_set_is_false_directÄs
þûÿ    z;ExpandingBoundInTest.test_null_in_empty_set_is_false_directN)r2))rNrOrPrQrRr4r?rIr$r%rrJZtuple_in_w_emptyr(r2r4r7r9r;r>r?rErHr"rJrKrLrMrOrbrcrdrergrirjrkrlrmrtrur2r2r2r3r#Ds\
 
 
 
 
    
 
    
        
 
 
 
    
 
 
 
!
                  r#c @s>eZdZdZdZdZedd„ƒZedd„ƒZdd    „Z    d
d „Z
d d „Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zejjd&d'„ƒZejjd(d)„ƒZejje d*d+d,d-d.hfd/d+d,d-d.d0hfd1d+d,d-d.d0hfd2d3hfd4ee d+d5ƒƒfd6ee d+d5ƒƒfd7eƒf¡d8d9„ƒƒZ!dS):ÚLikeFunctionsTestTÚonceNcCs&td|tdtddtdtdƒƒƒdS)Nr(r)Tr*r,rWr.r/r2r2r3r4×s   üzLikeFunctionsTest.define_tablescCsp| |jj ¡dddœdddœdddœdd    dœd
d dœd d dœdddœdddœdddœdddœdddœg ¡dS)Nr5Zabcdefgr7rzab/cdefgr zab%cdefgrZZab_cdefgrdzabcde/fgr|zabcde%fgrfzab#cdefgéZab9cdefgé    zabcde#fgrœZabcd9fgé r9r=r2r2r3r?às
õþzLikeFunctionsTest.insert_datac    CsN|jj}tj ¡(}dd„| t|jjƒ     |¡¡Dƒ}W5QRXt
||ƒdS)NcSsh|]
\}|’qSr2r2)rèror2r2r3Ú    <setcomp>÷sÿz*LikeFunctionsTest._test.<locals>.<setcomp>) r;r(rrBrCr:rrLr)rÛr)rFror˜r(rHÚrowsr2r2r3Ú_testós  þzLikeFunctionsTest._testc Cs6|jjjj}| | d¡dddddddd    d
d h
¡dS) Núab%cr5rr rZrdr|rfrxryrœ©r;r(rLr,r}Ú
startswith©rFÚcolr2r2r3Útest_startswith_unescapedþs z+LikeFunctionsTest.test_startswith_unescapedcCs(|jjjj}| |jddddh¡dS)Nr~T©Ú
autoescaper rrr2r2r3Útest_startswith_autoescapes z,LikeFunctionsTest.test_startswith_autoescapec Cs:|jjjj}| | tdƒ¡dddddddd    d
d h
¡dS) Nz'ab%c'r5rr rZrdr|rfrxryrœ)r;r(rLr,r}r€rrr2r2r3Útest_startswith_sqlexprs
  þz)LikeFunctionsTest.test_startswith_sqlexprcCs(|jjjj}| |jddddh¡dS)Nzab##cú#©Úescaperfrrr2r2r3Útest_startswith_escape s z(LikeFunctionsTest.test_startswith_escapecCsD|jjjj}| |jdddddh¡| |jdddddh¡dS)Nr~Trˆ©r…rŠr zab#crfrrr2r2r3Ú!test_startswith_autoescape_escapes z3LikeFunctionsTest.test_startswith_autoescape_escapec Cs4|jjjj}| | d¡dddddddd    d
h    ¡dS) Núe%fgr5rr rZrdr|rfrxry©r;r(rLr,r}Úendswithrr2r2r3Útest_endswith_unescapeds z)LikeFunctionsTest.test_endswith_unescapedc Cs8|jjjj}| | tdƒ¡dddddddd    d
h    ¡dS) Nz'e%fg'r5rr rZrdr|rfrxry)r;r(rLr,r}rrrr2r2r3Útest_endswith_sqlexprs
  ÿz'LikeFunctionsTest.test_endswith_sqlexprcCs(|jjjj}| |jddddh¡dS)NrŽTr„r|rrr2r2r3Útest_endswith_autoescape s z*LikeFunctionsTest.test_endswith_autoescapecCs(|jjjj}| |jddddh¡dS)Nze##fgrˆr‰ryrrr2r2r3Útest_endswith_escape$s z&LikeFunctionsTest.test_endswith_escapecCsD|jjjj}| |jdddddh¡| |jdddddh¡dS)NrŽTrˆrŒr|ze#fgryrrr2r2r3Útest_endswith_autoescape_escape(s z1LikeFunctionsTest.test_endswith_autoescape_escapec Cs4|jjjj}| | d¡dddddddd    d
h    ¡dS) Núb%cder5rr rZrdr|rfrxry©r;r(rLr,r}Úcontainsrr2r2r3Útest_contains_unescaped-s z)LikeFunctionsTest.test_contains_unescapedcCs(|jjjj}| |jddddh¡dS)Nr–Tr„r r—rr2r2r3Útest_contains_autoescape1s z*LikeFunctionsTest.test_contains_autoescapecCs(|jjjj}| |jddddh¡dS)Nzb##cderˆr‰rfr—rr2r2r3Útest_contains_escape5s z&LikeFunctionsTest.test_contains_escapecCsD|jjjj}| |jdddddh¡| |jdddddh¡dS)Nzb%cdTrˆrŒr zb#cdrfr—rr2r2r3Útest_contains_autoescape_escape9s z1LikeFunctionsTest.test_contains_autoescape_escapec    Cs0|jjjj}| | d¡ddddddh¡dS)Núa.cderr rZrfrxrœ©r;r(rLr,r}Ú regexp_matchrr2r2r3Útest_not_regexp_match>s z'LikeFunctionsTest.test_not_regexp_matchcCs2|jjjj}| | dd¡ d¡ddddh¡dS)NrZFOOr5rdr|ry)r;r(rLr,r}Úregexp_replacer˜rr2r2r3Útest_regexp_replaceCs
 
ÿz%LikeFunctionsTest.test_regexp_replacerr5rdr|ryÚabcrœz^abcZ9cderxz^arzz(b|c)z^(b|c)cCs"|jjjj}| | |¡|¡dSr@rž)rFrr˜r‚r2r2r3Útest_regexp_matchJs z#LikeFunctionsTest.test_regexp_match)"rNrOrPrQÚ run_insertsÚ run_deletesrRr4r?r}rƒr†r‡r‹rr‘r’r“r”r•r™ršr›rœrrJrŸr r¡r¢rÍr~Úranger¤r2r2r2r3rvÑsJ
 
 
 
ù    rvc@s<eZdZdZdZedd„ƒZedd„ƒZdd„Zd    d
„Z    d S) ÚComputedColumnTestT)Zcomputed_columnsc Cs>td|tdtddtdtƒtdttdƒƒtdttd    ƒƒƒdS)
NÚsquarer)Tr*ÚsideÚareaz side * sideÚ    perimeterz4 * side)r r rrr/r2r2r3r4]s úz ComputedColumnTest.define_tablescCs(| |jj ¡dddœdddœg¡dS)Nr5rœ)r)rªé*)r:r;r©r<r=r2r2r3r?hs
þzComputedColumnTest.insert_datac    CsVtj ¡B}| ttdƒƒ |jj¡     |jjj
j ¡¡  ¡}t |ddgƒW5QRXdS)NÚ*)r5rœr-rÈ)rœr­éäé¨)rrBrCr:rrrär;r©rKrLr)rDr©rFrHÚresr2r2r3Útest_select_allos  ÿ
þÿz"ComputedColumnTest.test_select_allc    Csdtj ¡P}| t|jjjj|jjjj    ƒ 
|jj¡  |jjjj ¡¡  ¡}t|ddgƒW5QRXdS)N)r-rÈ)r¯r°)rrBrCr:rr;r©rLr«r¬rärKr)rDrr±r2r2r3Útest_select_columnsxs 
 
ÿý
üÿz&ComputedColumnTest.test_select_columnsN)
rNrOrPrQrwrRr4r?r³r´r2r2r2r3r¨Ys
 
 
    r¨c@sTeZdZdZdZdZdZedd„ƒZedd„ƒZ    dd    „Z
d
d „Z e j jd d „ƒZdS)ÚIdentityColumnTestT)Zidentity_columnsrwc Csdtd|tdttdddddddtdtdƒƒƒtd    |tdttd
d d d d ddtdtdƒƒƒdS)NÚtbl_ar)Tr­)ÚalwaysÚstartZ
nominvalueZ
nomaxvaluer*rjr-Útbl_béûÿÿÿriüÿÿ)Ú    incrementr¸ZminvalueZmaxvalue©r r rrrr/r2r2r3r4Šs6ÿú õ ü ÷z IdentityColumnTest.define_tablescCs`| |jj ¡ddiddig¡| |jj ¡ddiddig¡| |jj ¡dddœg¡dS)Nrjrßràr­rL©r)rj)r:r;r¶r<r¹r=r2r2r3r?¥s
þ
þ
 
þzIdentityColumnTest.insert_datacCs~| ttdƒƒ |jj¡ |jjjj¡¡     ¡}t
|ddgƒ| ttdƒƒ |jj ¡ |jj jj¡¡     ¡}t
|dddgƒdS)Nr®)r­rß)é+rà)rºrà)rrß)r­rL) r:rrrär;r¶rKrLr)rDrr¹©rFr>r²r2r2r3r³´s  ÿ
þÿ ÿ
þÿz"IdentityColumnTest.test_select_allcCs:| t|jjjjƒ |jjjj¡¡ ¡}t|ddgƒdS)N)r­)r¾)    r:rr;r¶rLr)rKrDrr¿r2r2r3r´Ãsÿz&IdentityColumnTest.test_select_columnscs ‡‡fdd„}tttf|ƒdS)Ncs ˆ ˆjj ¡dddœg¡dS)NéÈrßr½)r:r;r¶r<r2©r>rFr2r3ÚfnÌs
 
þz7IdentityColumnTest.test_insert_always_error.<locals>.fn)rr%r&)rFr>rÂr2rÁr3Útest_insert_always_errorÊsz+IdentityColumnTest.test_insert_always_errorN)rNrOrPrQrwr¥r¦rRr4r?r³r´rrJZidentity_columns_standardrÃr2r2r2r3rµ„s
 
rµc@s(eZdZdZdZedd„ƒZdd„ZdS)ÚIdentityAutoincrementTestT)Zautoincrement_without_sequencec
Cs,td|tdttƒdddtdtdƒƒƒdS)NÚtblr)T)r+Z autoincrementrjr-r¼r/r2r2r3r4Ùsû öz'IdentityAutoincrementTest.define_tablescCs<| |jj ¡ddi¡}| |jj ¡¡ ¡}t|dƒdS)NrjÚrow)r5rÆ)r:r;rÅr<rr×rr¿r2r2r3Ú test_autoincrement_with_identityèsz:IdentityAutoincrementTest.test_autoincrement_with_identityN)rNrOrPrQrwrRr4rÇr2r2r2r3rÄÕs
 
rÄc@s8eZdZdZedd„ƒZedd„ƒZdd„Zdd    „Zd
S) Ú
ExistsTestTcCs&td|tdtddtdtdƒƒƒdS)NÚstuffr)Tr*r,rWr.r/r2r2r3r4ñs   üzExistsTest.define_tablesc    Cs8| |jj ¡dddœdddœdddœdddœg¡dS)Nr5ú    some datar7rr rZzsome other data)r:r;rÉr<r=r2r2r3r?ús
üþzExistsTest.insert_datac    Cs@|jj}t| ttdƒƒ tƒ |jj    dk¡¡¡ 
¡dgƒdS)Nr5rÊr]© r;rÉrr:rrrÛrrLr,rD©rFr>rÉr2r2r3Útest_select_existss ÿÿúzExistsTest.test_select_existsc    Cs>|jj}t| ttdƒƒ tƒ |jj    dk¡¡¡ 
¡gƒdS)Nr5zno datarËrÌr2r2r3Útest_select_exists_falses ÿÿúz#ExistsTest.test_select_exists_falseN)    rNrOrPrQrRr4r?rÍrÎr2r2r2r3rÈîs
 
 rÈc@s&eZdZdZe ejj¡dd„ƒZdS)ÚDistinctOnTestTc    CsBtdƒ tdƒ¡ tdƒ¡}t d¡| |d¡W5QRXdS)Nr®rVrnz:DISTINCT ON is currently supported only by the PostgreSQL zSELECT DISTINCT * FROM foo)rrþrrärrZexpect_deprecatedr )rFZstmr2r2r3Útest_distinct_on s
ÿzDistinctOnTest.test_distinct_onN)    rNrOrPrQrZfails_ifrJZsupports_distinct_onrÐr2r2r2r3rÏs rÏc    @s@eZdZdZdZedd„ƒZejddddd    d
d d d d„ƒZ    dS)ÚIsOrIsNotDistinctFromTestT)Zsupports_is_distinct_fromc
Cs2td|tdtddtdtddtdtddƒdS)NÚis_distinct_testr)Tr*Úcol_arÑÚcol_brzr/r2r2r3r4-s   ûz'IsOrIsNotDistinctFromTest.define_tables)Zboth_int_differentrr5r5)Z both_int_samer5r5r)Zone_null_firstNr5r5)Zone_null_secondrNr5)Z    both_nullNNrZiaaaz3col_a_value, col_b_value, expected_row_count_for_is)Zid_r—cCsž|jj}| | ¡d||dœg¡| | ¡ |jj |jj    ¡¡¡ 
¡}t t |ƒ|ƒ|dkrbdnd}| | ¡ |jj  |jj    ¡¡¡ 
¡}t t |ƒ|ƒdS)Nr5)r)rÓrÔr)r;rÒr:r<rrÛrLrÓZis_distinct_fromrÔrDrr}Zis_not_distinct_from)rFZ col_a_valueZ col_b_valueZexpected_row_count_for_isr>rÅrGZexpected_row_count_for_is_notr2r2r3Útest_is_or_is_not_distinct_from7s*  þÿþÿÿþz9IsOrIsNotDistinctFromTest.test_is_or_is_not_distinct_fromN)
rNrOrPrQrwrRr4rrÍrÕr2r2r2r3rÑ)s
    ù    rÑ)>Úcollections.abcr£r_rërrrrrZ
assertionsrrr    Z    assertsqlr
rÏr r rrrrrrrrrrrrrrrrrrr r!r"r#r$Úexcr%r&Z
TablesTestr'rSZTestBasersrxrÎrÞrñrr#rvr¨rµrÄrÈrÏrÑr2r2r2r3Ú<module>s€                                    &MJcdw
ÿ    +Q/