|
1 | 1 | -- Literal parsing |
2 | 2 |
|
3 | 3 | -- null |
4 | | -select null; |
| 4 | +select null, Null, nUll; |
5 | 5 |
|
6 | 6 | -- boolean |
7 | | -select true, false; |
| 7 | +select true, tRue, false, fALse; |
8 | 8 |
|
9 | 9 | -- byte (tinyint) |
10 | | -select 1Y, 127Y, -127Y; |
| 10 | +select 1Y; |
| 11 | +select 127Y, -128Y; |
| 12 | + |
| 13 | +-- out of range byte |
11 | 14 | select 128Y; |
12 | 15 |
|
13 | 16 | -- short (smallint) |
14 | | -select 1S, 32767S, -32767S; |
| 17 | +select 1S; |
| 18 | +select 32767S, -32768S; |
| 19 | + |
| 20 | +-- out of range short |
15 | 21 | select 32768S; |
16 | 22 |
|
17 | 23 | -- long (bigint) |
18 | | -select 1L, 2147483648L, 9223372036854775807L; |
| 24 | +select 1L, 2147483648L; |
| 25 | +select 9223372036854775807L, -9223372036854775808L; |
| 26 | + |
| 27 | +-- out of range long |
19 | 28 | select 9223372036854775808L; |
20 | 29 |
|
21 | 30 | -- integral parsing |
22 | 31 |
|
23 | 32 | -- parse int |
24 | 33 | select 1, -1; |
25 | 34 |
|
26 | | --- parse int max and min value |
| 35 | +-- parse int max and min value as int |
27 | 36 | select 2147483647, -2147483648; |
28 | 37 |
|
29 | | --- parse as longs (Int.MaxValue + 1, and Int.MinValue - 1) |
30 | | -select 2147483648, -2147483649; |
31 | | - |
32 | | --- parse long max and min value |
| 38 | +-- parse long max and min value as long |
33 | 39 | select 9223372036854775807, -9223372036854775808; |
34 | 40 |
|
35 | 41 | -- parse as decimals (Long.MaxValue + 1, and Long.MinValue - 1) |
36 | 42 | select 9223372036854775808, -9223372036854775809; |
37 | 43 |
|
| 44 | +-- out of range decimal numbers |
| 45 | +select 1234567890123456789012345678901234567890; |
| 46 | +select 1234567890123456789012345678901234567890.0; |
| 47 | + |
38 | 48 | -- double |
39 | | -select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5; |
| 49 | +select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1; |
| 50 | +select -1D, -1.2D, -1e10, -1.5e5, -.10D, -0.10D, -.1e5; |
| 51 | +-- negative double |
| 52 | +select .e3; |
| 53 | +-- inf and -inf |
| 54 | +select 1E309, -1E309; |
40 | 55 |
|
41 | 56 | -- decimal parsing |
42 | 57 | select 0.3, -0.8, .5, -.18, 0.1111, .1111; |
43 | 58 |
|
44 | | --- super large decimal numbers |
45 | | -select 1234567890123456789012345678901234567890; |
46 | | -select 1234567890123456789012345678901234567890.0; |
47 | | - |
48 | 59 | -- super large scientific notation numbers should still be valid doubles |
49 | 60 | select 123456789012345678901234567890123456789e10, 123456789012345678901234567890123456789.1e10; |
50 | 61 |
|
51 | 62 | -- string |
52 | | -select "Hello Peter!"; |
| 63 | +select "Hello Peter!", 'hello lee!'; |
| 64 | +-- multi string |
| 65 | +select 'hello' 'world', 'hello' " " 'lee'; |
| 66 | +-- single quote within double quotes |
| 67 | +select "hello 'peter'"; |
| 68 | +select 'pattern%', 'no-pattern\%', 'pattern\\%', 'pattern\\\%'; |
| 69 | +select '\0', '\'', '"', '\b', '\n', '\r', '\t', 'Z'; |
| 70 | +-- "Hello!" in octals |
| 71 | +select '\110\145\154\154\157\041'; |
| 72 | +-- "World :)" in unicode |
| 73 | +select '\u0057\u006F\u0072\u006C\u0064\u0020\u003A\u0029'; |
| 74 | + |
| 75 | +-- date |
| 76 | +select dAte '2016-03-12'; |
| 77 | +-- invalid date |
| 78 | +select date 'mar 11 2016'; |
| 79 | + |
| 80 | +-- timestamp |
| 81 | +select tImEstAmp '2016-03-11 20:54:00.000'; |
| 82 | +-- invalid timestamp |
| 83 | +select timestamp '2016-33-11 20:54:00.000'; |
| 84 | + |
| 85 | +-- internal |
| 86 | +select interval 13.123456789 seconds, interval -13.123456789 second; |
| 87 | +select interval 1 year 2 month 3 week 4 day 5 hour 6 minute 7 seconds 8 millisecond, 9 microsecond; |
| 88 | +-- ns is not supported |
| 89 | +select interval 10 nanoseconds; |
| 90 | + |
| 91 | +-- unsupported data type |
| 92 | +select GEO '(10,-6)'; |
0 commit comments