Timestamp gives backtrace in oracle module
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4818
Reported by Marcus Wellhardh wellhard@roxen.com
The timestamp datatype in the oracle module does not work.
The following code:
void test_timestamp(Sql.Sql db)
{
catch {
db->query("DROP TABLE dbtest");
};
db->query("CREATE TABLE dbtest ("
" id NUMBER, "
" my_varchar2 VARCHAR2(255), "
" my_timestamp TIMESTAMP"
")");
array(mapping) res =
db->query("SELECT * "
"FROM dbtest");
}
void main()
{
Sql.Sql db = Sql.Sql("oracle://scott:tiger@SNIGEL");
test_timestamp(db);
}
Gives the following backtrace:
OCIStmtFetch:code=-1:ORA-00932: inconsistent datatypes: expected BINARY got TIMESTAMP
src/modules/Oracle/oracle.c:2591:
Sql.oracle()->compile_query()->big_typed_query()->fetch_row()
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Oracle.pmod:65:
Sql.oracle()->big_query()->fetch_row()
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/Sql.pike:372:
Sql.Sql()->res_obj_to_array(Sql.oracle()->big_query())
/home/wellhard/projects/dbtest/dbtest.pike:26:
/main()->test_timestamp(Sql.Sql())
/home/wellhard/projects/dbtest/dbtest.pike:77: /main()->main()
Tested with roxen-5.0.352-test-cms-rhel5_x86.sh on lemmings.roxen.com