From: Eric Bollengier Date: Tue, 14 Jul 2009 16:09:48 +0000 (+0000) Subject: Fix postgresql driver bug that displayed rows from time to time. X-Git-Tag: Release-3.0.2~73 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c7b1d397082191bd4296229cf0831652a07bfb39;p=bacula%2Fbacula Fix postgresql driver bug that displayed rows from time to time. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8993 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 9ff87f4187..d5b9879392 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -402,7 +402,7 @@ POSTGRESQL_ROW my_postgresql_fetch_row(B_DB *mdb) } // if still within the result set - if (mdb->row_number < mdb->num_rows) { + if (mdb->row_number >= 0 && mdb->row_number < mdb->num_rows) { Dmsg2(500, "my_postgresql_fetch_row row number '%d' is acceptable (0..%d)\n", mdb->row_number, mdb->num_rows); // get each value from this row for (j = 0; j < mdb->num_fields; j++) { @@ -538,7 +538,8 @@ int my_postgresql_query(B_DB *mdb, const char *query) mdb->num_rows = PQntuples(mdb->result); Dmsg1(500, "we have %d rows\n", mdb->num_rows); - mdb->status = 0; /* succeed */ + mdb->row_number = 0; /* we can start to fetch something */ + mdb->status = 0; /* succeed */ } else { Dmsg1(50, "Result status failed: %s\n", query); goto bail_out; diff --git a/bacula/technotes b/bacula/technotes index 52699994bd..4d0c98ec0d 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,7 @@ General: 14Jul09 +ebl Fix postgresql driver bug that displayed rows from time to time. kes More cleanup of bootstrap ebl Implement the project 'restore' menu: enter a JobId, automatically select dependents