]> git.sur5r.net Git - bacula/bacula/commitdiff
Use the sqlite3_changes to implement sql_affected_rows()
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 6 Aug 2009 12:27:07 +0000 (14:27 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 6 Aug 2009 12:28:12 +0000 (14:28 +0200)
bacula/src/cats/cats.h

index 2ff803fbd24466408b31fcff1a05b2c746e4cd60..0d6d0d5b8c5e925060947307a9fc1818b8c54f89 100644 (file)
@@ -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)