1
drop table if exists t1_30237_bool;
2
create table t1_30237_bool(A boolean, B boolean, C boolean);
3
insert into t1_30237_bool values
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
35
NULL NULL NULL NULL NULL
44
Testing that OR is associative
45
select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C
46
from t1_30237_bool order by A, B, C;
47
A B C (A OR B) OR C A OR (B OR C) A OR B OR C
48
NULL NULL NULL NULL NULL NULL
49
NULL NULL 0 NULL NULL NULL
51
NULL 0 NULL NULL NULL NULL
52
NULL 0 0 NULL NULL NULL
57
0 NULL NULL NULL NULL NULL
58
0 NULL 0 NULL NULL NULL
60
0 0 NULL NULL NULL NULL
75
select count(*) from t1_30237_bool
76
where ((A OR B) OR C) != (A OR (B OR C));
79
Testing that XOR is associative
80
select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C
81
from t1_30237_bool order by A, B, C;
82
A B C (A XOR B) XOR C A XOR (B XOR C) A XOR B XOR C
83
NULL NULL NULL NULL NULL NULL
84
NULL NULL 0 NULL NULL NULL
85
NULL NULL 1 NULL NULL NULL
86
NULL 0 NULL NULL NULL NULL
87
NULL 0 0 NULL NULL NULL
88
NULL 0 1 NULL NULL NULL
89
NULL 1 NULL NULL NULL NULL
90
NULL 1 0 NULL NULL NULL
91
NULL 1 1 NULL NULL NULL
92
0 NULL NULL NULL NULL NULL
93
0 NULL 0 NULL NULL NULL
94
0 NULL 1 NULL NULL NULL
95
0 0 NULL NULL NULL NULL
98
0 1 NULL NULL NULL NULL
101
1 NULL NULL NULL NULL NULL
102
1 NULL 0 NULL NULL NULL
103
1 NULL 1 NULL NULL NULL
104
1 0 NULL NULL NULL NULL
107
1 1 NULL NULL NULL NULL
110
select count(*) from t1_30237_bool
111
where ((A XOR B) XOR C) != (A XOR (B XOR C));
114
Testing that AND is associative
115
select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C
116
from t1_30237_bool order by A, B, C;
117
A B C (A AND B) AND C A AND (B AND C) A AND B AND C
118
NULL NULL NULL NULL NULL NULL
120
NULL NULL 1 NULL NULL NULL
124
NULL 1 NULL NULL NULL NULL
126
NULL 1 1 NULL NULL NULL
136
1 NULL NULL NULL NULL NULL
138
1 NULL 1 NULL NULL NULL
142
1 1 NULL NULL NULL NULL
145
select count(*) from t1_30237_bool
146
where ((A AND B) AND C) != (A AND (B AND C));
149
Testing that AND has precedence over OR
150
select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C
151
from t1_30237_bool order by A, B, C;
152
A B C (A OR B) AND C A OR (B AND C) A OR B AND C
153
NULL NULL NULL NULL NULL NULL
154
NULL NULL 0 0 NULL NULL
155
NULL NULL 1 NULL NULL NULL
156
NULL 0 NULL NULL NULL NULL
158
NULL 0 1 NULL NULL NULL
159
NULL 1 NULL NULL NULL NULL
162
0 NULL NULL NULL NULL NULL
164
0 NULL 1 NULL NULL NULL
168
0 1 NULL NULL NULL NULL
180
select count(*) from t1_30237_bool
181
where (A OR (B AND C)) != (A OR B AND C);
184
select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C
185
from t1_30237_bool order by A, B, C;
186
A B C (A AND B) OR C A AND (B OR C) A AND B OR C
187
NULL NULL NULL NULL NULL NULL
188
NULL NULL 0 NULL NULL NULL
190
NULL 0 NULL NULL NULL NULL
193
NULL 1 NULL NULL NULL NULL
194
NULL 1 0 NULL NULL NULL
196
0 NULL NULL NULL 0 NULL
205
1 NULL NULL NULL NULL NULL
206
1 NULL 0 NULL NULL NULL
208
1 0 NULL NULL NULL NULL
214
select count(*) from t1_30237_bool
215
where ((A AND B) OR C) != (A AND B OR C);
218
Testing that AND has precedence over XOR
219
select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C
220
from t1_30237_bool order by A, B, C;
221
A B C (A XOR B) AND C A XOR (B AND C) A XOR B AND C
222
NULL NULL NULL NULL NULL NULL
223
NULL NULL 0 0 NULL NULL
224
NULL NULL 1 NULL NULL NULL
225
NULL 0 NULL NULL NULL NULL
227
NULL 0 1 NULL NULL NULL
228
NULL 1 NULL NULL NULL NULL
230
NULL 1 1 NULL NULL NULL
231
0 NULL NULL NULL NULL NULL
233
0 NULL 1 NULL NULL NULL
237
0 1 NULL NULL NULL NULL
240
1 NULL NULL NULL NULL NULL
242
1 NULL 1 NULL NULL NULL
249
select count(*) from t1_30237_bool
250
where (A XOR (B AND C)) != (A XOR B AND C);
253
select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C
254
from t1_30237_bool order by A, B, C;
255
A B C (A AND B) XOR C A AND (B XOR C) A AND B XOR C
256
NULL NULL NULL NULL NULL NULL
257
NULL NULL 0 NULL NULL NULL
258
NULL NULL 1 NULL NULL NULL
259
NULL 0 NULL NULL NULL NULL
262
NULL 1 NULL NULL NULL NULL
263
NULL 1 0 NULL NULL NULL
265
0 NULL NULL NULL 0 NULL
274
1 NULL NULL NULL NULL NULL
275
1 NULL 0 NULL NULL NULL
276
1 NULL 1 NULL NULL NULL
277
1 0 NULL NULL NULL NULL
280
1 1 NULL NULL NULL NULL
283
select count(*) from t1_30237_bool
284
where ((A AND B) XOR C) != (A AND B XOR C);
287
Testing that XOR has precedence over OR
288
select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C
289
from t1_30237_bool order by A, B, C;
290
A B C (A XOR B) OR C A XOR (B OR C) A XOR B OR C
291
NULL NULL NULL NULL NULL NULL
292
NULL NULL 0 NULL NULL NULL
294
NULL 0 NULL NULL NULL NULL
295
NULL 0 0 NULL NULL NULL
297
NULL 1 NULL NULL NULL NULL
298
NULL 1 0 NULL NULL NULL
300
0 NULL NULL NULL NULL NULL
301
0 NULL 0 NULL NULL NULL
303
0 0 NULL NULL NULL NULL
309
1 NULL NULL NULL NULL NULL
310
1 NULL 0 NULL NULL NULL
318
select count(*) from t1_30237_bool
319
where ((A XOR B) OR C) != (A XOR B OR C);
322
select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C
323
from t1_30237_bool order by A, B, C;
324
A B C (A OR B) XOR C A OR (B XOR C) A OR B XOR C
325
NULL NULL NULL NULL NULL NULL
326
NULL NULL 0 NULL NULL NULL
327
NULL NULL 1 NULL NULL NULL
328
NULL 0 NULL NULL NULL NULL
329
NULL 0 0 NULL NULL NULL
331
NULL 1 NULL NULL NULL NULL
334
0 NULL NULL NULL NULL NULL
335
0 NULL 0 NULL NULL NULL
336
0 NULL 1 NULL NULL NULL
337
0 0 NULL NULL NULL NULL
340
0 1 NULL NULL NULL NULL
352
select count(*) from t1_30237_bool
353
where (A OR (B XOR C)) != (A OR B XOR C);
356
drop table t1_30237_bool;
357
Testing that NOT has precedence over OR
358
select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE;
359
(NOT FALSE) OR TRUE NOT (FALSE OR TRUE) NOT FALSE OR TRUE
361
Testing that NOT has precedence over XOR
362
select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE;
363
(NOT FALSE) XOR FALSE NOT (FALSE XOR FALSE) NOT FALSE XOR FALSE
365
Testing that NOT has precedence over AND
366
select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
367
(NOT FALSE) AND FALSE NOT (FALSE AND FALSE) NOT FALSE AND FALSE
369
Testing that NOT is associative
370
select NOT NOT TRUE, NOT NOT NOT FALSE;
371
NOT NOT TRUE NOT NOT NOT FALSE
373
Testing that IS has precedence over NOT
374
select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
375
(NOT NULL) IS TRUE NOT (NULL IS TRUE) NOT NULL IS TRUE
377
select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE;
378
(NOT NULL) IS NOT TRUE NOT (NULL IS NOT TRUE) NOT NULL IS NOT TRUE
380
select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE;
381
(NOT NULL) IS FALSE NOT (NULL IS FALSE) NOT NULL IS FALSE
383
select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE;
384
(NOT NULL) IS NOT FALSE NOT (NULL IS NOT FALSE) NOT NULL IS NOT FALSE
386
select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN;
387
(NOT TRUE) IS UNKNOWN NOT (TRUE IS UNKNOWN) NOT TRUE IS UNKNOWN
389
select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN;
390
(NOT TRUE) IS NOT UNKNOWN NOT (TRUE IS NOT UNKNOWN) NOT TRUE IS NOT UNKNOWN
392
select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL;
393
(NOT TRUE) IS NULL NOT (TRUE IS NULL) NOT TRUE IS NULL
395
select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL;
396
(NOT TRUE) IS NOT NULL NOT (TRUE IS NOT NULL) NOT TRUE IS NOT NULL
398
Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative
399
select TRUE IS TRUE IS TRUE IS TRUE;
400
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS TRUE IS TRUE' at line 1
401
select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE;
402
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT TRUE IS NOT TRUE' at line 1
403
select NULL IS FALSE IS FALSE IS FALSE;
404
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS FALSE IS FALSE' at line 1
405
select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE;
406
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT FALSE IS NOT FALSE' at line 1
407
select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN;
408
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS UNKNOWN IS UNKNOWN' at line 1
409
select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN;
410
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1
411
Testing that IS [NOT] NULL predicates are associative
412
select FALSE IS NULL IS NULL IS NULL;
413
FALSE IS NULL IS NULL IS NULL
415
select TRUE IS NOT NULL IS NOT NULL IS NOT NULL;
416
TRUE IS NOT NULL IS NOT NULL IS NOT NULL
418
Testing that comparison operators are left associative
419
select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2);
420
1 <=> 2 <=> 2 (1 <=> 2) <=> 2 1 <=> (2 <=> 2)
422
select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2);
423
1 = 2 = 2 (1 = 2) = 2 1 = (2 = 2)
425
select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3);
426
1 != 2 != 3 (1 != 2) != 3 1 != (2 != 3)
428
select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3);
429
1 <> 2 <> 3 (1 <> 2) <> 3 1 <> (2 <> 3)
431
select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3);
432
1 < 2 < 3 (1 < 2) < 3 1 < (2 < 3)
434
select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1);
435
3 <= 2 <= 1 (3 <= 2) <= 1 3 <= (2 <= 1)
437
select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3);
438
1 > 2 > 3 (1 > 2) > 3 1 > (2 > 3)
440
select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3);
441
1 >= 2 >= 3 (1 >= 2) >= 3 1 >= (2 >= 3)
443
Testing that | is associative
444
select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55);
445
0xF0 | 0x0F | 0x55 (0xF0 | 0x0F) | 0x55 0xF0 | (0x0F | 0x55)
447
Testing that & is associative
448
select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55);
449
0xF5 & 0x5F & 0x55 (0xF5 & 0x5F) & 0x55 0xF5 & (0x5F & 0x55)
451
Testing that << is left associative
452
select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2);
453
4 << 3 << 2 (4 << 3) << 2 4 << (3 << 2)
455
Testing that >> is left associative
456
select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2);
457
256 >> 3 >> 2 (256 >> 3) >> 2 256 >> (3 >> 2)
459
Testing that & has precedence over |
460
select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55);
461
0xF0 & 0x0F | 0x55 (0xF0 & 0x0F) | 0x55 0xF0 & (0x0F | 0x55)
463
select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F);
464
0x55 | 0xF0 & 0x0F (0x55 | 0xF0) & 0x0F 0x55 | (0xF0 & 0x0F)
466
Testing that << has precedence over |
467
select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F);
468
0x0F << 4 | 0x0F (0x0F << 4) | 0x0F 0x0F << (4 | 0x0F)
470
select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4);
471
0x0F | 0x0F << 4 (0x0F | 0x0F) << 4 0x0F | (0x0F << 4)
473
Testing that >> has precedence over |
474
select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF);
475
0xF0 >> 4 | 0xFF (0xF0 >> 4) | 0xFF 0xF0 >> (4 | 0xFF)
477
select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4);
478
0xFF | 0xF0 >> 4 (0xFF | 0xF0) >> 4 0xFF | (0xF0 >> 4)
480
Testing that << has precedence over &
481
select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0);
482
0x0F << 4 & 0xF0 (0x0F << 4) & 0xF0 0x0F << (4 & 0xF0)
484
select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4);
485
0xF0 & 0x0F << 4 (0xF0 & 0x0F) << 4 0xF0 & (0x0F << 4)
487
Testing that >> has precedence over &
488
select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55);
489
0xF0 >> 4 & 0x55 (0xF0 >> 4) & 0x55 0xF0 >> (4 & 0x55)
491
select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4);
492
0x0F & 0xF0 >> 4 (0x0F & 0xF0) >> 4 0x0F & (0xF0 >> 4)
494
Testing that >> and << have the same precedence
495
select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2);
496
0xFF >> 4 << 2 (0xFF >> 4) << 2 0xFF >> (4 << 2)
498
select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2);
499
0x0F << 4 >> 2 (0x0F << 4) >> 2 0x0F << (4 >> 2)
501
Testing that binary + is associative
502
select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3);
503
1 + 2 + 3 (1 + 2) + 3 1 + (2 + 3)
505
Testing that binary - is left associative
506
select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3);
507
1 - 2 - 3 (1 - 2) - 3 1 - (2 - 3)
509
Testing that binary + and binary - have the same precedence
510
select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3);
511
1 + 2 - 3 (1 + 2) - 3 1 + (2 - 3)
513
select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3);
514
1 - 2 + 3 (1 - 2) + 3 1 - (2 + 3)
516
Testing that binary + has precedence over |
517
select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55);
518
0xF0 + 0x0F | 0x55 (0xF0 + 0x0F) | 0x55 0xF0 + (0x0F | 0x55)
520
select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F);
521
0x55 | 0xF0 + 0x0F (0x55 | 0xF0) + 0x0F 0x55 | (0xF0 + 0x0F)
523
Testing that binary + has precedence over &
524
select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55);
525
0xF0 + 0x0F & 0x55 (0xF0 + 0x0F) & 0x55 0xF0 + (0x0F & 0x55)
527
select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F);
528
0x55 & 0xF0 + 0x0F (0x55 & 0xF0) + 0x0F 0x55 & (0xF0 + 0x0F)
530
Testing that binary + has precedence over <<
531
select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4);
532
2 + 3 << 4 (2 + 3) << 4 2 + (3 << 4)
534
select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2);
535
3 << 4 + 2 (3 << 4) + 2 3 << (4 + 2)
537
Testing that binary + has precedence over >>
538
select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2);
539
4 + 3 >> 2 (4 + 3) >> 2 4 + (3 >> 2)
541
select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1);
542
3 >> 2 + 1 (3 >> 2) + 1 3 >> (2 + 1)
544
Testing that binary - has precedence over |
545
select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55);
546
0xFF - 0x0F | 0x55 (0xFF - 0x0F) | 0x55 0xFF - (0x0F | 0x55)
548
select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0);
549
0x55 | 0xFF - 0xF0 (0x55 | 0xFF) - 0xF0 0x55 | (0xFF - 0xF0)
551
Testing that binary - has precedence over &
552
select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55);
553
0xFF - 0xF0 & 0x55 (0xFF - 0xF0) & 0x55 0xFF - (0xF0 & 0x55)
555
select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0);
556
0x55 & 0xFF - 0xF0 (0x55 & 0xFF) - 0xF0 0x55 & (0xFF - 0xF0)
558
Testing that binary - has precedence over <<
559
select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2);
560
16 - 3 << 2 (16 - 3) << 2 16 - (3 << 2)
562
select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2);
563
4 << 3 - 2 (4 << 3) - 2 4 << (3 - 2)
565
Testing that binary - has precedence over >>
566
select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2);
567
16 - 3 >> 2 (16 - 3) >> 2 16 - (3 >> 2)
569
select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2);
570
16 >> 3 - 2 (16 >> 3) - 2 16 >> (3 - 2)
572
Testing that * is associative
573
select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4);
574
2 * 3 * 4 (2 * 3) * 4 2 * (3 * 4)
576
Testing that * has precedence over |
577
select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F);
578
2 * 0x40 | 0x0F (2 * 0x40) | 0x0F 2 * (0x40 | 0x0F)
580
select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40);
581
0x0F | 2 * 0x40 (0x0F | 2) * 0x40 0x0F | (2 * 0x40)
583
Testing that * has precedence over &
584
select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55);
585
2 * 0x40 & 0x55 (2 * 0x40) & 0x55 2 * (0x40 & 0x55)
587
select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40);
588
0xF0 & 2 * 0x40 (0xF0 & 2) * 0x40 0xF0 & (2 * 0x40)
590
Testing that * has precedence over <<
591
select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4);
592
5 * 3 << 4 (5 * 3) << 4 5 * (3 << 4)
594
select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4);
595
2 << 3 * 4 (2 << 3) * 4 2 << (3 * 4)
597
Testing that * has precedence over >>
598
select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2);
599
3 * 4 >> 2 (3 * 4) >> 2 3 * (4 >> 2)
601
select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3);
602
4 >> 2 * 3 (4 >> 2) * 3 4 >> (2 * 3)
604
Testing that * has precedence over binary +
605
select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4);
606
2 * 3 + 4 (2 * 3) + 4 2 * (3 + 4)
608
select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4);
609
2 + 3 * 4 (2 + 3) * 4 2 + (3 * 4)
611
Testing that * has precedence over binary -
612
select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2);
613
4 * 3 - 2 (4 * 3) - 2 4 * (3 - 2)
615
select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2);
616
4 - 3 * 2 (4 - 3) * 2 4 - (3 * 2)
618
Testing that / is left associative
619
select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3);
620
15 / 5 / 3 (15 / 5) / 3 15 / (5 / 3)
621
1.00000000 1.00000000 9.0000
622
Testing that / has precedence over |
623
select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2);
624
105 / 5 | 2 (105 / 5) | 2 105 / (5 | 2)
626
select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5);
627
105 | 2 / 5 (105 | 2) / 5 105 | (2 / 5)
629
Testing that / has precedence over &
630
select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F);
631
105 / 5 & 0x0F (105 / 5) & 0x0F 105 / (5 & 0x0F)
633
select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5);
634
0x0F & 105 / 5 (0x0F & 105) / 5 0x0F & (105 / 5)
636
Testing that / has precedence over <<
637
select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2);
638
0x80 / 4 << 2 (0x80 / 4) << 2 0x80 / (4 << 2)
640
select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2);
641
0x80 << 4 / 2 (0x80 << 4) / 2 0x80 << (4 / 2)
643
Testing that / has precedence over >>
644
select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2);
645
0x80 / 4 >> 2 (0x80 / 4) >> 2 0x80 / (4 >> 2)
647
select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2);
648
0x80 >> 4 / 2 (0x80 >> 4) / 2 0x80 >> (4 / 2)
650
Testing that / has precedence over binary +
651
select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2);
652
0x80 / 2 + 2 (0x80 / 2) + 2 0x80 / (2 + 2)
653
66.0000 66.0000 32.0000
654
select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2);
655
0x80 + 2 / 2 (0x80 + 2) / 2 0x80 + (2 / 2)
656
129.0000 65.0000 129.0000
657
Testing that / has precedence over binary -
658
select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2);
659
0x80 / 4 - 2 (0x80 / 4) - 2 0x80 / (4 - 2)
660
30.0000 30.0000 64.0000
661
select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2);
662
0x80 - 4 / 2 (0x80 - 4) / 2 0x80 - (4 / 2)
663
126.0000 62.0000 126.0000
664
Testing that ^ is associative
665
select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F);
666
0xFF ^ 0xF0 ^ 0x0F (0xFF ^ 0xF0) ^ 0x0F 0xFF ^ (0xF0 ^ 0x0F)
668
select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55);
669
0xFF ^ 0xF0 ^ 0x55 (0xFF ^ 0xF0) ^ 0x55 0xFF ^ (0xF0 ^ 0x55)
671
Testing that ^ has precedence over |
672
select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F);
673
0xFF ^ 0xF0 | 0x0F (0xFF ^ 0xF0) | 0x0F 0xFF ^ (0xF0 | 0x0F)
675
select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0);
676
0xF0 | 0xFF ^ 0xF0 (0xF0 | 0xFF) ^ 0xF0 0xF0 | (0xFF ^ 0xF0)
678
Testing that ^ has precedence over &
679
select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F);
680
0xFF ^ 0xF0 & 0x0F (0xFF ^ 0xF0) & 0x0F 0xFF ^ (0xF0 & 0x0F)
682
select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0);
683
0x0F & 0xFF ^ 0xF0 (0x0F & 0xFF) ^ 0xF0 0x0F & (0xFF ^ 0xF0)
685
Testing that ^ has precedence over <<
686
select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2);
687
0xFF ^ 0xF0 << 2 (0xFF ^ 0xF0) << 2 0xFF ^ (0xF0 << 2)
689
select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF);
690
0x0F << 2 ^ 0xFF (0x0F << 2) ^ 0xFF 0x0F << (2 ^ 0xFF)
692
Testing that ^ has precedence over >>
693
select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2);
694
0xFF ^ 0xF0 >> 2 (0xFF ^ 0xF0) >> 2 0xFF ^ (0xF0 >> 2)
696
select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0);
697
0xFF >> 2 ^ 0xF0 (0xFF >> 2) ^ 0xF0 0xFF >> (2 ^ 0xF0)
699
Testing that ^ has precedence over binary +
700
select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F);
701
0xFF ^ 0xF0 + 0x0F (0xFF ^ 0xF0) + 0x0F 0xFF ^ (0xF0 + 0x0F)
703
select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0);
704
0x0F + 0xFF ^ 0xF0 (0x0F + 0xFF) ^ 0xF0 0x0F + (0xFF ^ 0xF0)
706
Testing that ^ has precedence over binary -
707
select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1);
708
0xFF ^ 0xF0 - 1 (0xFF ^ 0xF0) - 1 0xFF ^ (0xF0 - 1)
710
select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55);
711
0x55 - 0x0F ^ 0x55 (0x55 - 0x0F) ^ 0x55 0x55 - (0x0F ^ 0x55)
713
Testing that ^ has precedence over *
714
select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2);
715
0xFF ^ 0xF0 * 2 (0xFF ^ 0xF0) * 2 0xFF ^ (0xF0 * 2)
717
select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0);
718
2 * 0xFF ^ 0xF0 (2 * 0xFF) ^ 0xF0 2 * (0xFF ^ 0xF0)
720
Testing that ^ has precedence over /
721
select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2);
722
0xFF ^ 0xF0 / 2 (0xFF ^ 0xF0) / 2 0xFF ^ (0xF0 / 2)
724
select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0);
725
0xF2 / 2 ^ 0xF0 (0xF2 / 2) ^ 0xF0 0xF2 / (2 ^ 0xF0)
727
Testing that ^ has precedence over %
728
select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20);
729
0xFF ^ 0xF0 % 0x20 (0xFF ^ 0xF0) % 0x20 0xFF ^ (0xF0 % 0x20)
731
select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0);
732
0xFF % 0x20 ^ 0xF0 (0xFF % 0x20) ^ 0xF0 0xFF % (0x20 ^ 0xF0)
734
Testing that ^ has precedence over DIV
735
select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2);
736
0xFF ^ 0xF0 DIV 2 (0xFF ^ 0xF0) DIV 2 0xFF ^ (0xF0 DIV 2)
738
select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0);
739
0xF2 DIV 2 ^ 0xF0 (0xF2 DIV 2) ^ 0xF0 0xF2 DIV (2 ^ 0xF0)
741
Testing that ^ has precedence over MOD
742
select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20);
743
0xFF ^ 0xF0 MOD 0x20 (0xFF ^ 0xF0) MOD 0x20 0xFF ^ (0xF0 MOD 0x20)
745
select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0);
746
0xFF MOD 0x20 ^ 0xF0 (0xFF MOD 0x20) ^ 0xF0 0xFF MOD (0x20 ^ 0xF0)