Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -3083,15 +3083,11 @@ PHP_FUNCTION(pg_lo_tell)
pgsql = Z_PGSQL_LOB_P(pgsql_id);
CHECK_PGSQL_LOB(pgsql);

#ifdef VE_PG_LO64
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would definitely prefer to have this as only path so we can deal with small and large objects all alike. same for lo_truncate part

} else {
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
}
#else
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
#endif
RETURN_LONG(offset);
}
/* }}} */
Expand All @@ -3112,15 +3108,11 @@ PHP_FUNCTION(pg_lo_truncate)
pgsql = Z_PGSQL_LOB_P(pgsql_id);
CHECK_PGSQL_LOB(pgsql);

#ifdef VE_PG_LO64
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
} else {
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
}
#else
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
#endif
if (!result) {
RETURN_TRUE;
} else {
Expand Down
Loading