connected

Testing conversions...
Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "2"...
Result set:
0

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "-2"...
Result set:
1

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "2"...
Result set:
0

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-2"...
Result set:
1

Testing "SELECT 2.2 > ?" with SQL_C_CHAR -> SQL_FLOAT param "2.3"...
Result set:
0

Testing "SELECT 3.3 > ?" with SQL_C_CHAR -> SQL_DOUBLE param "3.01"...
Result set:
1

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_CHAR param "5 escapes: \ and '"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type integer: "5 escapes: \ and '";
Error while executing the query

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "32767"...
Result set:
0

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-32768"...
Result set:
1


Testing conversions whose result depend on whether the
parameter is treated as a string or an integer...
Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_INTEGER param "6"...
Result set:
1

Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_SMALLINT param "6"...
Result set:
1

Testing "SELECT '555' > ?" with SQL_C_CHAR -> SQL_CHAR param "6"...
Result set:
0

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "99999999999999999999999"...
SQLExecDirect failed
22003=ERROR: value "99999999999999999999999" is out of range for type integer;
Error while executing the query


Testing conversions with invalid values...
Testing "SELECT 2 > ?" with SQL_C_CHAR -> SQL_INTEGER param "2, 'injected, BAD!'"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type integer: "2, 'injected, BAD!'";
Error while executing the query

Testing "SELECT 2 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "2, 'injected, BAD!'"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type smallint: "2, 'injected, BAD!'";
Error while executing the query

Testing "SELECT 1.3 > ?" with SQL_C_CHAR -> SQL_FLOAT param "3', 'injected, BAD!', '1"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type numeric: "3', 'injected, BAD!', '1";
Error while executing the query

Testing "SELECT 1.4 > ?" with SQL_C_CHAR -> SQL_FLOAT param "4 \'bad', '1"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type numeric: "4 \'bad', '1";
Error while executing the query

Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_INTEGER param "-1"...
Result set:
2

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param "-"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type integer: "-";
Error while executing the query

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_INTEGER param ""...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type integer: "";
Error while executing the query

Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_SMALLINT param "-1"...
Result set:
2

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param "-"...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type smallint: "-";
Error while executing the query

Testing "SELECT 1 > ?" with SQL_C_CHAR -> SQL_SMALLINT param ""...
SQLExecDirect failed
22P02=ERROR: invalid input syntax for type smallint: "";
Error while executing the query

Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_INTEGER param 1234...
Result set:
-1234

Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_INTEGER param -1234...
Result set:
1234

Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_SMALLINT param 1234...
Result set:
-1234

Testing "SELECT 0-?" with SQL_C_SLONG -> SQL_SMALLINT param -1234...
Result set:
1234


Testing bytea conversions
Testing "SELECT ?" with SQL_C_BINARY -> SQL_BINARY param...
Result set:
666f6f0a5c62617200

Testing "SELECT ?" with SQL_C_CHAR -> SQL_BINARY param "666f6f0001"...
Result set:
666f6f0001

Testing "SELECT ?::text" with SQL_C_BINARY -> SQL_CHAR param...
Result set:
foo
\bar


Testing datetime conversions
Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIMESTAMP param "04-22-2011 01:23:45"...
Result set:
2011-04-22 01:23:45

Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIMESTAMP param "{ts '2011-04-22 01:23:45'}"...
Result set:
2011-04-22 01:23:45

Testing "SELECT ?" with SQL_C_CHAR -> SQL_TIME param "{t '01:23:45'}"...
Result set:
01:23:45

Testing "SELECT ?" with SQL_C_CHAR -> SQL_DATE param "{d '2011-04-22'}"...
Result set:
2011-04-22

disconnecting
