~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1_30237_bool;
520.1.8 by Brian Aker
Updating tests.
2
create table t1_30237_bool(A char, B char, C char);
1 by brian
clean slate
3
insert into t1_30237_bool values
4
(FALSE, FALSE, FALSE),
5
(FALSE, FALSE, NULL),
6
(FALSE, FALSE, TRUE),
7
(FALSE, NULL, FALSE),
8
(FALSE, NULL, NULL),
9
(FALSE, NULL, TRUE),
10
(FALSE, TRUE, FALSE),
11
(FALSE, TRUE, NULL),
12
(FALSE, TRUE, TRUE),
13
(NULL, FALSE, FALSE),
14
(NULL, FALSE, NULL),
15
(NULL, FALSE, TRUE),
16
(NULL, NULL, FALSE),
17
(NULL, NULL, NULL),
18
(NULL, NULL, TRUE),
19
(NULL, TRUE, FALSE),
20
(NULL, TRUE, NULL),
21
(NULL, TRUE, TRUE),
22
(TRUE, FALSE, FALSE),
23
(TRUE, FALSE, NULL),
24
(TRUE, FALSE, TRUE),
25
(TRUE, NULL, FALSE),
26
(TRUE, NULL, NULL),
27
(TRUE, NULL, TRUE),
28
(TRUE, TRUE, FALSE),
29
(TRUE, TRUE, NULL),
30
(TRUE, TRUE, TRUE) ;
31
Testing OR, XOR, AND
32
select A, B, A OR B, A XOR B, A AND B
33
from t1_30237_bool where C is null order by A, B;
34
A	B	A OR B	A XOR B	A AND B
520.1.8 by Brian Aker
Updating tests.
35
1 by brian
clean slate
36
NULL	NULL	NULL	NULL	NULL
37
NULL	0	NULL	NULL	0
38
NULL	1	1	NULL	NULL
39
0	NULL	NULL	NULL	0
40
0	0	0	0	0
41
0	1	1	1	0
42
1	NULL	1	NULL	NULL
43
1	0	1	1	0
44
1	1	1	0	1
45
Testing that OR is associative 
46
select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C
47
from t1_30237_bool order by A, B, C;
48
A	B	C	(A OR B) OR C	A OR (B OR C)	A OR B OR C
520.1.8 by Brian Aker
Updating tests.
49
1 by brian
clean slate
50
NULL	NULL	NULL	NULL	NULL	NULL
51
NULL	NULL	0	NULL	NULL	NULL
52
NULL	NULL	1	1	1	1
53
NULL	0	NULL	NULL	NULL	NULL
54
NULL	0	0	NULL	NULL	NULL
55
NULL	0	1	1	1	1
56
NULL	1	NULL	1	1	1
57
NULL	1	0	1	1	1
58
NULL	1	1	1	1	1
59
0	NULL	NULL	NULL	NULL	NULL
60
0	NULL	0	NULL	NULL	NULL
61
0	NULL	1	1	1	1
62
0	0	NULL	NULL	NULL	NULL
63
0	0	0	0	0	0
64
0	0	1	1	1	1
65
0	1	NULL	1	1	1
66
0	1	0	1	1	1
67
0	1	1	1	1	1
68
1	NULL	NULL	1	1	1
69
1	NULL	0	1	1	1
70
1	NULL	1	1	1	1
71
1	0	NULL	1	1	1
72
1	0	0	1	1	1
73
1	0	1	1	1	1
74
1	1	NULL	1	1	1
75
1	1	0	1	1	1
76
1	1	1	1	1	1
77
select count(*) from t1_30237_bool
78
where ((A OR B) OR C) != (A OR (B OR C));
79
count(*)
80
0
81
Testing that XOR is associative 
82
select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C
83
from t1_30237_bool order by A, B, C;
84
A	B	C	(A XOR B) XOR C	A XOR (B XOR C)	A XOR B XOR C
520.1.8 by Brian Aker
Updating tests.
85
1 by brian
clean slate
86
NULL	NULL	NULL	NULL	NULL	NULL
87
NULL	NULL	0	NULL	NULL	NULL
88
NULL	NULL	1	NULL	NULL	NULL
89
NULL	0	NULL	NULL	NULL	NULL
90
NULL	0	0	NULL	NULL	NULL
91
NULL	0	1	NULL	NULL	NULL
92
NULL	1	NULL	NULL	NULL	NULL
93
NULL	1	0	NULL	NULL	NULL
94
NULL	1	1	NULL	NULL	NULL
95
0	NULL	NULL	NULL	NULL	NULL
96
0	NULL	0	NULL	NULL	NULL
97
0	NULL	1	NULL	NULL	NULL
98
0	0	NULL	NULL	NULL	NULL
99
0	0	0	0	0	0
100
0	0	1	1	1	1
101
0	1	NULL	NULL	NULL	NULL
102
0	1	0	1	1	1
103
0	1	1	0	0	0
104
1	NULL	NULL	NULL	NULL	NULL
105
1	NULL	0	NULL	NULL	NULL
106
1	NULL	1	NULL	NULL	NULL
107
1	0	NULL	NULL	NULL	NULL
108
1	0	0	1	1	1
109
1	0	1	0	0	0
110
1	1	NULL	NULL	NULL	NULL
111
1	1	0	0	0	0
112
1	1	1	1	1	1
113
select count(*) from t1_30237_bool
114
where ((A XOR B) XOR C) != (A XOR (B XOR C));
115
count(*)
116
0
117
Testing that AND is associative 
118
select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C
119
from t1_30237_bool order by A, B, C;
120
A	B	C	(A AND B) AND C	A AND (B AND C)	A AND B AND C
520.1.8 by Brian Aker
Updating tests.
121
1 by brian
clean slate
122
NULL	NULL	NULL	NULL	NULL	NULL
123
NULL	NULL	0	0	0	0
124
NULL	NULL	1	NULL	NULL	NULL
125
NULL	0	NULL	0	0	0
126
NULL	0	0	0	0	0
127
NULL	0	1	0	0	0
128
NULL	1	NULL	NULL	NULL	NULL
129
NULL	1	0	0	0	0
130
NULL	1	1	NULL	NULL	NULL
131
0	NULL	NULL	0	0	0
132
0	NULL	0	0	0	0
133
0	NULL	1	0	0	0
134
0	0	NULL	0	0	0
135
0	0	0	0	0	0
136
0	0	1	0	0	0
137
0	1	NULL	0	0	0
138
0	1	0	0	0	0
139
0	1	1	0	0	0
140
1	NULL	NULL	NULL	NULL	NULL
141
1	NULL	0	0	0	0
142
1	NULL	1	NULL	NULL	NULL
143
1	0	NULL	0	0	0
144
1	0	0	0	0	0
145
1	0	1	0	0	0
146
1	1	NULL	NULL	NULL	NULL
147
1	1	0	0	0	0
148
1	1	1	1	1	1
149
select count(*) from t1_30237_bool
150
where ((A AND B) AND C) != (A AND (B AND C));
151
count(*)
152
0
153
Testing that AND has precedence over OR
154
select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C
155
from t1_30237_bool order by A, B, C;
156
A	B	C	(A OR B) AND C	A OR (B AND C)	A OR B AND C
520.1.8 by Brian Aker
Updating tests.
157
1 by brian
clean slate
158
NULL	NULL	NULL	NULL	NULL	NULL
159
NULL	NULL	0	0	NULL	NULL
160
NULL	NULL	1	NULL	NULL	NULL
161
NULL	0	NULL	NULL	NULL	NULL
162
NULL	0	0	0	NULL	NULL
163
NULL	0	1	NULL	NULL	NULL
164
NULL	1	NULL	NULL	NULL	NULL
165
NULL	1	0	0	NULL	NULL
166
NULL	1	1	1	1	1
167
0	NULL	NULL	NULL	NULL	NULL
168
0	NULL	0	0	0	0
169
0	NULL	1	NULL	NULL	NULL
170
0	0	NULL	0	0	0
171
0	0	0	0	0	0
172
0	0	1	0	0	0
173
0	1	NULL	NULL	NULL	NULL
174
0	1	0	0	0	0
175
0	1	1	1	1	1
176
1	NULL	NULL	NULL	1	1
177
1	NULL	0	0	1	1
178
1	NULL	1	1	1	1
179
1	0	NULL	NULL	1	1
180
1	0	0	0	1	1
181
1	0	1	1	1	1
182
1	1	NULL	NULL	1	1
183
1	1	0	0	1	1
184
1	1	1	1	1	1
185
select count(*) from t1_30237_bool
186
where (A OR (B AND C)) != (A OR B AND C);
187
count(*)
188
0
189
select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C
190
from t1_30237_bool order by A, B, C;
191
A	B	C	(A AND B) OR C	A AND (B OR C)	A AND B OR C
520.1.8 by Brian Aker
Updating tests.
192
1 by brian
clean slate
193
NULL	NULL	NULL	NULL	NULL	NULL
194
NULL	NULL	0	NULL	NULL	NULL
195
NULL	NULL	1	1	NULL	1
196
NULL	0	NULL	NULL	NULL	NULL
197
NULL	0	0	0	0	0
198
NULL	0	1	1	NULL	1
199
NULL	1	NULL	NULL	NULL	NULL
200
NULL	1	0	NULL	NULL	NULL
201
NULL	1	1	1	NULL	1
202
0	NULL	NULL	NULL	0	NULL
203
0	NULL	0	0	0	0
204
0	NULL	1	1	0	1
205
0	0	NULL	NULL	0	NULL
206
0	0	0	0	0	0
207
0	0	1	1	0	1
208
0	1	NULL	NULL	0	NULL
209
0	1	0	0	0	0
210
0	1	1	1	0	1
211
1	NULL	NULL	NULL	NULL	NULL
212
1	NULL	0	NULL	NULL	NULL
213
1	NULL	1	1	1	1
214
1	0	NULL	NULL	NULL	NULL
215
1	0	0	0	0	0
216
1	0	1	1	1	1
217
1	1	NULL	1	1	1
218
1	1	0	1	1	1
219
1	1	1	1	1	1
220
select count(*) from t1_30237_bool
221
where ((A AND B) OR C) != (A AND B OR C);
222
count(*)
223
0
224
Testing that AND has precedence over XOR
225
select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C
226
from t1_30237_bool order by A, B, C;
227
A	B	C	(A XOR B) AND C	A XOR (B AND C)	A XOR B AND C
520.1.8 by Brian Aker
Updating tests.
228
1 by brian
clean slate
229
NULL	NULL	NULL	NULL	NULL	NULL
230
NULL	NULL	0	0	NULL	NULL
231
NULL	NULL	1	NULL	NULL	NULL
232
NULL	0	NULL	NULL	NULL	NULL
233
NULL	0	0	0	NULL	NULL
234
NULL	0	1	NULL	NULL	NULL
235
NULL	1	NULL	NULL	NULL	NULL
236
NULL	1	0	0	NULL	NULL
237
NULL	1	1	NULL	NULL	NULL
238
0	NULL	NULL	NULL	NULL	NULL
239
0	NULL	0	0	0	0
240
0	NULL	1	NULL	NULL	NULL
241
0	0	NULL	0	0	0
242
0	0	0	0	0	0
243
0	0	1	0	0	0
244
0	1	NULL	NULL	NULL	NULL
245
0	1	0	0	0	0
246
0	1	1	1	1	1
247
1	NULL	NULL	NULL	NULL	NULL
248
1	NULL	0	0	1	1
249
1	NULL	1	NULL	NULL	NULL
250
1	0	NULL	NULL	1	1
251
1	0	0	0	1	1
252
1	0	1	1	1	1
253
1	1	NULL	0	NULL	NULL
254
1	1	0	0	1	1
255
1	1	1	0	0	0
256
select count(*) from t1_30237_bool
257
where (A XOR (B AND C)) != (A XOR B AND C);
258
count(*)
259
0
260
select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C
261
from t1_30237_bool order by A, B, C;
262
A	B	C	(A AND B) XOR C	A AND (B XOR C)	A AND B XOR C
520.1.8 by Brian Aker
Updating tests.
263
1 by brian
clean slate
264
NULL	NULL	NULL	NULL	NULL	NULL
265
NULL	NULL	0	NULL	NULL	NULL
266
NULL	NULL	1	NULL	NULL	NULL
267
NULL	0	NULL	NULL	NULL	NULL
268
NULL	0	0	0	0	0
269
NULL	0	1	1	NULL	1
270
NULL	1	NULL	NULL	NULL	NULL
271
NULL	1	0	NULL	NULL	NULL
272
NULL	1	1	NULL	0	NULL
273
0	NULL	NULL	NULL	0	NULL
274
0	NULL	0	0	0	0
275
0	NULL	1	1	0	1
276
0	0	NULL	NULL	0	NULL
277
0	0	0	0	0	0
278
0	0	1	1	0	1
279
0	1	NULL	NULL	0	NULL
280
0	1	0	0	0	0
281
0	1	1	1	0	1
282
1	NULL	NULL	NULL	NULL	NULL
283
1	NULL	0	NULL	NULL	NULL
284
1	NULL	1	NULL	NULL	NULL
285
1	0	NULL	NULL	NULL	NULL
286
1	0	0	0	0	0
287
1	0	1	1	1	1
288
1	1	NULL	NULL	NULL	NULL
289
1	1	0	1	1	1
290
1	1	1	0	0	0
291
select count(*) from t1_30237_bool
292
where ((A AND B) XOR C) != (A AND B XOR C);
293
count(*)
294
0
295
Testing that XOR has precedence over OR
296
select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C
297
from t1_30237_bool order by A, B, C;
298
A	B	C	(A XOR B) OR C	A XOR (B OR C)	A XOR B OR C
520.1.8 by Brian Aker
Updating tests.
299
1 by brian
clean slate
300
NULL	NULL	NULL	NULL	NULL	NULL
301
NULL	NULL	0	NULL	NULL	NULL
302
NULL	NULL	1	1	NULL	1
303
NULL	0	NULL	NULL	NULL	NULL
304
NULL	0	0	NULL	NULL	NULL
305
NULL	0	1	1	NULL	1
306
NULL	1	NULL	NULL	NULL	NULL
307
NULL	1	0	NULL	NULL	NULL
308
NULL	1	1	1	NULL	1
309
0	NULL	NULL	NULL	NULL	NULL
310
0	NULL	0	NULL	NULL	NULL
311
0	NULL	1	1	1	1
312
0	0	NULL	NULL	NULL	NULL
313
0	0	0	0	0	0
314
0	0	1	1	1	1
315
0	1	NULL	1	1	1
316
0	1	0	1	1	1
317
0	1	1	1	1	1
318
1	NULL	NULL	NULL	NULL	NULL
319
1	NULL	0	NULL	NULL	NULL
320
1	NULL	1	1	0	1
321
1	0	NULL	1	NULL	1
322
1	0	0	1	1	1
323
1	0	1	1	0	1
324
1	1	NULL	NULL	0	NULL
325
1	1	0	0	0	0
326
1	1	1	1	0	1
327
select count(*) from t1_30237_bool
328
where ((A XOR B) OR C) != (A XOR B OR C);
329
count(*)
330
0
331
select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C
332
from t1_30237_bool order by A, B, C;
333
A	B	C	(A OR B) XOR C	A OR (B XOR C)	A OR B XOR C
520.1.8 by Brian Aker
Updating tests.
334
1 by brian
clean slate
335
NULL	NULL	NULL	NULL	NULL	NULL
336
NULL	NULL	0	NULL	NULL	NULL
337
NULL	NULL	1	NULL	NULL	NULL
338
NULL	0	NULL	NULL	NULL	NULL
339
NULL	0	0	NULL	NULL	NULL
340
NULL	0	1	NULL	1	1
341
NULL	1	NULL	NULL	NULL	NULL
342
NULL	1	0	1	1	1
343
NULL	1	1	0	NULL	NULL
344
0	NULL	NULL	NULL	NULL	NULL
345
0	NULL	0	NULL	NULL	NULL
346
0	NULL	1	NULL	NULL	NULL
347
0	0	NULL	NULL	NULL	NULL
348
0	0	0	0	0	0
349
0	0	1	1	1	1
350
0	1	NULL	NULL	NULL	NULL
351
0	1	0	1	1	1
352
0	1	1	0	0	0
353
1	NULL	NULL	NULL	1	1
354
1	NULL	0	1	1	1
355
1	NULL	1	0	1	1
356
1	0	NULL	NULL	1	1
357
1	0	0	1	1	1
358
1	0	1	0	1	1
359
1	1	NULL	NULL	1	1
360
1	1	0	1	1	1
361
1	1	1	0	1	1
362
select count(*) from t1_30237_bool
363
where (A OR (B XOR C)) != (A OR B XOR C);
364
count(*)
365
0
366
drop table t1_30237_bool;
367
Testing that NOT has precedence over OR
368
select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE;
369
(NOT FALSE) OR TRUE	NOT (FALSE OR TRUE)	NOT FALSE OR TRUE
370
1	0	1
371
Testing that NOT has precedence over XOR
372
select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE;
373
(NOT FALSE) XOR FALSE	NOT (FALSE XOR FALSE)	NOT FALSE XOR FALSE
374
1	1	1
375
Testing that NOT has precedence over AND
376
select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
377
(NOT FALSE) AND FALSE	NOT (FALSE AND FALSE)	NOT FALSE AND FALSE
378
0	1	0
379
Testing that NOT is associative
380
select NOT NOT TRUE, NOT NOT NOT FALSE;
381
NOT NOT TRUE	NOT NOT NOT FALSE
382
1	1
383
Testing that IS has precedence over NOT
384
select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
385
(NOT NULL) IS TRUE	NOT (NULL IS TRUE)	NOT NULL IS TRUE
386
0	1	1
387
select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE;
388
(NOT NULL) IS NOT TRUE	NOT (NULL IS NOT TRUE)	NOT NULL IS NOT TRUE
389
1	0	0
390
select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE;
391
(NOT NULL) IS FALSE	NOT (NULL IS FALSE)	NOT NULL IS FALSE
392
0	1	1
393
select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE;
394
(NOT NULL) IS NOT FALSE	NOT (NULL IS NOT FALSE)	NOT NULL IS NOT FALSE
395
1	0	0
396
select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN;
397
(NOT TRUE) IS UNKNOWN	NOT (TRUE IS UNKNOWN)	NOT TRUE IS UNKNOWN
398
0	1	1
399
select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN;
400
(NOT TRUE) IS NOT UNKNOWN	NOT (TRUE IS NOT UNKNOWN)	NOT TRUE IS NOT UNKNOWN
401
1	0	0
402
select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL;
403
(NOT TRUE) IS NULL	NOT (TRUE IS NULL)	NOT TRUE IS NULL
404
0	1	1
405
select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL;
406
(NOT TRUE) IS NOT NULL	NOT (TRUE IS NOT NULL)	NOT TRUE IS NOT NULL
407
1	0	0
408
Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative
409
select TRUE IS TRUE IS TRUE IS TRUE;
629.2.6 by Monty
Updated test output with new and improved error messages.
410
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS TRUE IS TRUE' at line 1
1 by brian
clean slate
411
select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE;
629.2.6 by Monty
Updated test output with new and improved error messages.
412
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS NOT TRUE IS NOT TRUE' at line 1
1 by brian
clean slate
413
select NULL IS FALSE IS FALSE IS FALSE;
629.2.6 by Monty
Updated test output with new and improved error messages.
414
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS FALSE IS FALSE' at line 1
1 by brian
clean slate
415
select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE;
629.2.6 by Monty
Updated test output with new and improved error messages.
416
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS NOT FALSE IS NOT FALSE' at line 1
1 by brian
clean slate
417
select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN;
629.2.6 by Monty
Updated test output with new and improved error messages.
418
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS UNKNOWN IS UNKNOWN' at line 1
1 by brian
clean slate
419
select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN;
629.2.6 by Monty
Updated test output with new and improved error messages.
420
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1
1 by brian
clean slate
421
Testing that IS [NOT] NULL predicates are associative
422
select FALSE IS NULL IS NULL IS NULL;
423
FALSE IS NULL IS NULL IS NULL
424
0
425
select TRUE IS NOT NULL IS NOT NULL IS NOT NULL;
426
TRUE IS NOT NULL IS NOT NULL IS NOT NULL
427
1
428
Testing that comparison operators are left associative
429
select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2);
430
1 <=> 2 <=> 2	(1 <=> 2) <=> 2	1 <=> (2 <=> 2)
431
0	0	1
432
select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2);
433
1 = 2 = 2	(1 = 2) = 2	1 = (2 = 2)
434
0	0	1
435
select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3);
436
1 != 2 != 3	(1 != 2) != 3	1 != (2 != 3)
437
1	1	0
438
select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3);
439
1 <> 2 <> 3	(1 <> 2) <> 3	1 <> (2 <> 3)
440
1	1	0
441
select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3);
442
1 < 2 < 3	(1 < 2) < 3	1 < (2 < 3)
443
1	1	0
444
select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1);
445
3 <= 2 <= 1	(3 <= 2) <= 1	3 <= (2 <= 1)
446
1	1	0
447
select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3);
448
1 > 2 > 3	(1 > 2) > 3	1 > (2 > 3)
449
0	0	1
450
select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3);
451
1 >= 2 >= 3	(1 >= 2) >= 3	1 >= (2 >= 3)
452
0	0	1
453
Testing that binary + is associative
454
select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3);
455
1 + 2 + 3	(1 + 2) + 3	1 + (2 + 3)
456
6	6	6
457
Testing that binary - is left associative
458
select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3);
459
1 - 2 - 3	(1 - 2) - 3	1 - (2 - 3)
460
-4	-4	2
461
Testing that binary + and binary - have the same precedence
462
select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3);
463
1 + 2 - 3	(1 + 2) - 3	1 + (2 - 3)
464
0	0	0
465
select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3);
466
1 - 2 + 3	(1 - 2) + 3	1 - (2 + 3)
467
2	2	-4
468
Testing that * is associative
469
select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4);
470
2 * 3 * 4	(2 * 3) * 4	2 * (3 * 4)
471
24	24	24
472
Testing that * has precedence over binary +
473
select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4);
474
2 * 3 + 4	(2 * 3) + 4	2 * (3 + 4)
475
10	10	14
476
select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4);
477
2 + 3 * 4	(2 + 3) * 4	2 + (3 * 4)
478
14	20	14
479
Testing that * has precedence over binary -
480
select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2);
481
4 * 3 - 2	(4 * 3) - 2	4 * (3 - 2)
482
10	10	4
483
select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2);
484
4 - 3 * 2	(4 - 3) * 2	4 - (3 * 2)
485
-2	2	-2
486
Testing that / is left associative
487
select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3);
488
15 / 5 / 3	(15 / 5) / 3	15 / (5 / 3)
489
1.00000000	1.00000000	9.0000
490
Testing that / has precedence over binary +
491
select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2);
492
0x80 / 2 + 2	(0x80 / 2) + 2	0x80 / (2 + 2)
493
66.0000	66.0000	32.0000
494
select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2);
495
0x80 + 2 / 2	(0x80 + 2) / 2	0x80 + (2 / 2)
496
129.0000	65.0000	129.0000
497
Testing that / has precedence over binary -
498
select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2);
499
0x80 / 4 - 2	(0x80 / 4) - 2	0x80 / (4 - 2)
500
30.0000	30.0000	64.0000
501
select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2);
502
0x80 - 4 / 2	(0x80 - 4) / 2	0x80 - (4 / 2)
503
126.0000	62.0000	126.0000