From a3cf78ca3bf34e70ec6dfa618835aa8c6e73bd8a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 6 Aug 2009 14:27:07 +0200 Subject: [PATCH] Use the sqlite3_changes to implement sql_affected_rows() --- bacula/src/cats/cats.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 2ff803fbd2..0d6d0d5b8c 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -166,14 +166,15 @@ struct B_DB { #ifdef HAVE_SQLITE3 #define sql_insert_id(x,y) sqlite3_last_insert_rowid((x)->db) #define sql_close(x) sqlite3_close((x)->db) +#define sql_affected_rows(x) sqlite3_changes((x)->db) #else #define sql_insert_id(x,y) sqlite_last_insert_rowid((x)->db) #define sql_close(x) sqlite_close((x)->db) +#define sql_affected_rows(x) 1 #endif #define sql_strerror(x) (x)->sqlite_errmsg?(x)->sqlite_errmsg:"unknown" #define sql_num_rows(x) (x)->nrow #define sql_data_seek(x, i) (x)->row = (i) -#define sql_affected_rows(x) 1 #define sql_field_seek(x, y) my_sqlite_field_seek((x), (y)) #define sql_fetch_field(x) my_sqlite_fetch_field(x) #define sql_num_fields(x) ((x)->ncolumn) @@ -304,7 +305,7 @@ struct B_DB { #define sql_strerror(x) (x)->sqlite_errmsg?(x)->sqlite_errmsg:"unknown" #define sql_num_rows(x) (x)->nrow #define sql_data_seek(x, i) (x)->row = (i) -#define sql_affected_rows(x) 1 +#define sql_affected_rows(x) sqlite3_changes((x)->db) #define sql_field_seek(x, y) my_sqlite_field_seek((x), (y)) #define sql_fetch_field(x) my_sqlite_fetch_field(x) #define sql_num_fields(x) ((x)->ncolumn) -- 2.39.5