File tree 2 files changed +78
-0
lines changed
2 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 2
2
-- NUMEROLOGY
3
3
-- Test various combinations of numeric types and functions.
4
4
--
5
+ --
6
+ -- Trailing junk in numeric literals
7
+ --
8
+ SELECT 123abc;
9
+ abc
10
+ -----
11
+ 123
12
+ (1 row)
13
+
14
+ SELECT 0x0o;
15
+ x0o
16
+ -----
17
+ 0
18
+ (1 row)
19
+
20
+ SELECT 1_2_3;
21
+ _2_3
22
+ ------
23
+ 1
24
+ (1 row)
25
+
26
+ SELECT 0.a;
27
+ a
28
+ ---
29
+ 0
30
+ (1 row)
31
+
32
+ SELECT 0.0a;
33
+ a
34
+ -----
35
+ 0.0
36
+ (1 row)
37
+
38
+ SELECT .0a;
39
+ a
40
+ -----
41
+ 0.0
42
+ (1 row)
43
+
44
+ SELECT 0.0e1a;
45
+ a
46
+ ---
47
+ 0
48
+ (1 row)
49
+
50
+ SELECT 0.0e;
51
+ e
52
+ -----
53
+ 0.0
54
+ (1 row)
55
+
56
+ SELECT 0.0e+a;
57
+ ERROR: syntax error at or near "+"
58
+ LINE 1: SELECT 0.0e+a;
59
+ ^
60
+ PREPARE p1 AS SELECT $1a;
61
+ EXECUTE p1(1);
62
+ a
63
+ ---
64
+ 1
65
+ (1 row)
66
+
5
67
--
6
68
-- Test implicit type conversions
7
69
-- This fails for Postgres v6.1 (and earlier?)
Original file line number Diff line number Diff line change 3
3
-- Test various combinations of numeric types and functions.
4
4
--
5
5
6
+ --
7
+ -- Trailing junk in numeric literals
8
+ --
9
+
10
+ SELECT 123abc;
11
+ SELECT 0x0o;
12
+ SELECT 1_2_3;
13
+ SELECT 0 .a;
14
+ SELECT 0 .0a;
15
+ SELECT .0a;
16
+ SELECT 0 .0e1a;
17
+ SELECT 0 .0e;
18
+ SELECT 0 .0e+ a;
19
+ PREPARE p1 AS SELECT $1a;
20
+ EXECUTE p1(1 );
21
+
6
22
--
7
23
-- Test implicit type conversions
8
24
-- This fails for Postgres v6.1 (and earlier?)
You can’t perform that action at this time.
0 commit comments