char *ret=NULL;
/* try to lookup the type in the resource list */
- snprintf(hashed_oid_key,31,"pgsql_oid_%ld", oid);
+ snprintf(hashed_oid_key,31,"pgsql_oid_%u", oid);
hashed_oid_key[31]=0;
if (zend_hash_find(list,hashed_oid_key,strlen(hashed_oid_key)+1,(void **) &field_type)==SUCCESS) {
RETURN_FALSE;
} else if (oid > LONG_MAX) {
oid_str = (char *)emalloc(PGSQL_MAX_LENGTH_OF_LONG+1);
- sprintf(oid_str, "%ld", oid);
+ sprintf(oid_str, "%u", oid);
RETURN_STRING(oid_str, 0);
}
RETURN_LONG((long)oid);
}
if (pgsql_oid > LONG_MAX) {
oid_str = (char *)emalloc(PGSQL_MAX_LENGTH_OF_LONG+1);
- sprintf(oid_str, "%ld", pgsql_oid);
+ sprintf(oid_str, "%u", pgsql_oid);
RETURN_STRING(oid_str, 0);
}
RETURN_LONG((long)pgsql_oid);
Oid pgsql_oid;
int id = -1;
+ /* FIXME: Does not work when OID is larger than LONG_MAX */
switch(ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1, &oid)==FAILURE) {
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (lo_unlink(pgsql, pgsql_oid) == -1) {
- php_error(E_WARNING, "%s() unable to delete PostgreSQL large object %d",
- get_active_function_name(TSRMLS_C), (int) pgsql_oid);
+ php_error(E_WARNING, "%s() unable to delete PostgreSQL large object %u",
+ get_active_function_name(TSRMLS_C), pgsql_oid);
RETURN_FALSE;
}
RETURN_TRUE;
char *mode_string=NULL;
pgLofp *pgsql_lofp;
+ /* FIXME: Does not work when OID is larger than LONG_MAX */
switch(ZEND_NUM_ARGS()) {
case 2:
if (zend_get_parameters_ex(2, &oid, &mode)==FAILURE) {
}
if (oid > LONG_MAX) {
oid_str = (char *)emalloc(PGSQL_MAX_LENGTH_OF_LONG+1);
- sprintf(oid_str, "%ld", oid);
+ sprintf(oid_str, "%u", oid);
RETURN_STRING(oid_str, 0);
}
RETURN_LONG((long)oid);
int argc = ZEND_NUM_ARGS();
Oid oid;
PGconn *pgsql;
-
+
+ /* FIXME: Does not work when OID is larger than LONG_MAX */
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
"rls", &pgsql_link, &oid_id, &file_out, &name_len) == SUCCESS) {
;