From: Kern Sibbald Date: Wed, 25 Apr 2007 09:13:10 +0000 (+0000) Subject: Fix important bug in db_sql_query() in mysql.c apparently recently X-Git-Tag: Release-7.0.0~6500 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce297008b6c2f0b7c07aa7f346290c3865816308;p=bacula%2Fbacula Fix important bug in db_sql_query() in mysql.c apparently recently introduced. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4628 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index cabbf3bda8..0834c5392a 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -350,7 +350,7 @@ int db_sql_query(B_DB *mdb, const char *query, DB_RESULT_HANDLER *result_handler } if (result_handler != NULL) { if ((mdb->result = sql_use_result(mdb)) != NULL) { - int num_fields = 0; + int num_fields = sql_num_fields(mdb); /* We *must* fetch all rows */ while ((row = sql_fetch_row(mdb)) != NULL) { @@ -359,7 +359,6 @@ int db_sql_query(B_DB *mdb, const char *query, DB_RESULT_HANDLER *result_handler * seen all the data it wants. However, we * loop to the end of the data. */ - num_fields++; if (result_handler(ctx, num_fields, row)) { send = false; } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 004e870426..81d8cbc29a 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,9 @@ Technical notes on version 2.1 General: +25Apr07 +kes Fix important bug in db_sql_query() in mysql.c apparently recently + introduced. 24Apr07 ebl Cleanup file relocation, using char *RegexWhere instead of char *where + bool where_use_regexp