1connected
2
3Testing conversions...
4Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "2"...
5Result set:
60
7
8Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "-2"...
9Result set:
101
11
12Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "2"...
13Result set:
140
15
16Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-2"...
17Result set:
181
19
20Testing "SELECT 2.2 > ?" with SQL_C_CHAR -> SQL_FLOAT param "2.3"...
21Result set:
220
23
24Testing "SELECT 3.3 > ?" with SQL_C_CHAR -> SQL_DOUBLE param "3.01"...
25Result set:
261
27
28Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_CHAR param "5 escapes: \ and '"...
29SQLExecDirect failed
3022P02=ERROR: invalid input syntax for integer: "5 escapes: \ and '";
31Error while executing the query
32
33Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "32767"...
34Result set:
350
36
37Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-32768"...
38Result set:
391
40
41
42Testing conversions whose result depend on whether the
43parameter is treated as a string or an integer...
44Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_INTEGER param "6"...
45Result set:
461
47
48Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_SMALLINT param "6"...
49Result set:
501
51
52Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_CHAR param "6"...
53Result set:
540
55
56Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "99999999999999999999999"...
57SQLExecDirect failed
5822003=ERROR: value "99999999999999999999999" is out of range for type integer;
59Error while executing the query
60
61
62Testing conversions with invalid values...
63Testing "SELECT 2 > ?" with SQL_C_CHAR -> SQL_INTEGER param "2, 'injected, BAD!'"...
64SQLExecDirect failed
6522P02=ERROR: invalid input syntax for integer: "2, 'injected, BAD!'";
66Error while executing the query
67
68Testing "SELECT 2 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "2, 'injected, BAD!'"...
69SQLExecDirect failed
7022P02=ERROR: invalid input syntax for integer: "2, 'injected, BAD!'";
71Error while executing the query
72
73Testing "SELECT 1.3 > ?" with SQL_C_CHAR -> SQL_FLOAT param "3', 'injected, BAD!', '1"...
74SQLExecDirect failed
7522P02=ERROR: invalid input syntax for type numeric: "3', 'injected, BAD!', '1";
76Error while executing the query
77
78Testing "SELECT 1.4 > ?" with SQL_C_CHAR -> SQL_FLOAT param "4 \'bad', '1"...
79SQLExecDirect failed
8022P02=ERROR: invalid input syntax for type numeric: "4 \'bad', '1";
81Error while executing the query
82
83Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_INTEGER param "-1"...
84Result set:
852
86
87Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "-"...
88SQLExecDirect failed
8922P02=ERROR: invalid input syntax for integer: "-";
90Error while executing the query
91
92Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param ""...
93SQLExecDirect failed
9422P02=ERROR: invalid input syntax for integer: "";
95Error while executing the query
96
97Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_SMALLINT param "-1"...
98Result set:
992
100
101Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-"...
102SQLExecDirect failed
10322P02=ERROR: invalid input syntax for integer: "-";
104Error while executing the query
105
106Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param ""...
107SQLExecDirect failed
10822P02=ERROR: invalid input syntax for integer: "";
109Error while executing the query
110
111Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_INTEGER param 1234...
112Result set:
113-1234
114
115Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_INTEGER param -1234...
116Result set:
1171234
118
119Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_SMALLINT param 1234...
120Result set:
121-1234
122
123Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_SMALLINT param -1234...
124Result set:
1251234
126
127
128Testing bytea conversions
129Testing "SELECT ?" with SQL_C_BINARY -> SQL_BINARY param...
130Result set:
131666f6f0a5c62617200
132
133Testing "SELECT ?" with SQL_C_CHAR -> SQL_BINARY param "666f6f0001"...
134Result set:
135666f6f0001
136
137Testing "SELECT ?::text" with SQL_C_BINARY -> SQL_CHAR param...
138Result set:
139foo
140\bar
141
142
143Testing datetime conversions
144Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIMESTAMP param "04-22-2011 01:23:45"...
145Result set:
1462011-04-22 01:23:45
147
148Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIMESTAMP param "{ts '2011-04-22 01:23:45'}"...
149Result set:
1502011-04-22 01:23:45
151
152Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIME param "{t '01:23:45'}"...
153Result set:
15401:23:45
155
156Testing "SELECT ?" with SQL_C_CHAR -> SQL_DATE param "{d '2011-04-22'}"...
157Result set:
1582011-04-22
159
160disconnecting
161