@@ -478,6 +478,7 @@ int ido2db_get_cached_object_ids(ido2db_idi *idi) {
#ifdef USE_LIBDBI
unsigned long offset, stride;
char *buf = NULL;
char *name2 = NULL;
#endif
#ifdef USE_ORACLE
...
...
@@ -487,21 +488,17 @@ int ido2db_get_cached_object_ids(ido2db_idi *idi) {
/* find all the object definitions we already have */
#ifdef USE_LIBDBI /* everything else will be libdbi */
offset = 0;
stride = 2500;
for (;;) {
if (asprintf(&buf, "SELECT object_id, objecttype_id, name1, name2 FROM %s WHERE instance_id=%lu LIMIT %lu, %lu", ido2db_db_tablenames[IDO2DB_DBTABLE_OBJECTS], idi->dbinfo.instance_id, offset, stride) == -1)
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_PGSQL:
/* postgresql works well with dbi_result_next_now() */
if (asprintf(&buf, "SELECT object_id, objecttype_id, name1, name2 FROM %s WHERE instance_id=%lu", ido2db_db_tablenames[IDO2DB_DBTABLE_OBJECTS], idi->dbinfo.instance_id) == -1)
buf = NULL;
if ((result = ido2db_db_query(idi, buf)) == IDO_OK) {
if (dbi_result_get_numrows(idi->dbinfo.dbi_result) == 0)
break;
while (idi->dbinfo.dbi_result) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {