Subject: | Oddness with pg_lo_import_with_oid |
The test for pg_lo_import_with_oid is sporadically failing. Seems to work sometimes on subsequence runs but a fresh test run always gives this:
t/03dbmethod.t ...... 125/538
# Failed test 'DB handle method "pg_lo_import_with_oid" works with high number'
# at t/03dbmethod.t line 1512.
# got: undef
# expected: '345167'
# Failed test 'DB handle method "pg_lo_import_with_oid" works with high number'
# at t/03dbmethod.t line 1513.
Use of uninitialized value $thandle in concatenation (.) or string at t/03dbmethod.t line 1516.
DBD::Pg::db selectall_arrayref failed: ERROR: syntax error at end of input
LINE 1: SELECT data FROM pg_largeobject where loid =
^ at t/03dbmethod.t line 1517.
The Postgres logs show tha lo_create is being called without the correct args:
2013-11-15 22:08:27.165 EST [8474] LOG: statement: begin
2013-11-15 22:08:27.166 EST [8474] LOG: fastpath function call: "lo_create" (OID 3457)
2013-11-15 22:08:27.166 EST [8474] ERROR: function call message contains 1 arguments but function requires 2
2013-11-15 22:08:27.167 EST [8474] ERROR: syntax error at end of input at character 46
2013-11-15 22:08:27.167 EST [8474] STATEMENT: SELECT data FROM pg_largeobject where loid =
2013-11-15 22:08:27.167 EST [8474] LOG: statement: ROLLBACK
Bumping DBI_TRACE shows we are at least passing the oid in as far as DBD::Pg and DBI
are concerned:
Begin PGTransactionStatusType
PQtransactionStatus
_sqlstate txn_status is 0
End _sqlstate (status: 1)
PQclear
End _result
End pg_db_rollback_commit (result: 1)
<- commit= ( 1 ) [1 items] at t/03dbmethod.t line 1510
Calling with file /tmp/h3OSoQun1h and highnumber 345167
Show quoted text
>> pg_lo_import_with_oid DISPATCH (DBI::db=HASH(0xa153ba4) rc1/1 @3 g2 ima0 pid#8891) at t/03dbmethod.t line 1512
-> pg_lo_import_with_oid for DBD::Pg::db (DBI::db=HASH(0xa153ba4)~0xa153ac8 '/tmp/h3OSoQun1h' 345167) thr#9db2008
Begin pg_db_lo_import_with_oid (filename: /tmp/h3OSoQun1h, oid: 345167)
Begin pg_db_start_txn
Begin _result (sql: begin)
A libpq bug? Hard to say - near as I can tell, the call to pg_lo_import_with_oid inside
Pg.xs is passing the oid, and after that it becomes libpq's domain.