]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix important bug in db_sql_query() in mysql.c apparently recently
authorKern Sibbald <kern@sibbald.com>
Wed, 25 Apr 2007 09:13:10 +0000 (09:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 25 Apr 2007 09:13:10 +0000 (09:13 +0000)
     introduced.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4628 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/mysql.c
bacula/technotes-2.1

index cabbf3bda8fab8d73db3d5bee0f74267e0519b21..0834c5392a1d3eed570f32c32f7c616cb4e87749 100644 (file)
@@ -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;
                }
index 004e87042669a18fc47393c6ce50c3e87f26fd36..81d8cbc29a1e121ac45c77149bbfcbb941fd8634 100644 (file)
@@ -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