X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fcats.h;h=e180cef198ebf9683a7d24e89e34ddc779a005c7;hb=ab75c2027cd5cbbee384761dc315f480868d3f25;hp=423004ebd3780c8945a9bfeff955e2ddb99b62a8;hpb=4702a9fcc31d1decf663e09bf9cd7a3447187c68;p=bacula%2Fbacula diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 423004ebd3..e180cef198 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -6,7 +6,7 @@ The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public + modify it under the terms of version three of the GNU Affero General Public License as published by the Free Software Foundation and included in the file LICENSE. @@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -85,12 +85,14 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **); #ifdef __SQL_C +/* Current database version number for all drivers */ +#define BDB_VERSION 13 + + #if defined(BUILDING_CATS) #ifdef HAVE_SQLITE #error "SQLite2 is now deprecated, use SQLite3 instead." -#define BDB_VERSION 12 - #include /* Define opaque structure for sqlite */ @@ -149,6 +151,7 @@ struct B_DB { POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ + POOLMEM *esc_obj; /* Escaped restore object */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -209,9 +212,6 @@ extern const char* my_sqlite_batch_fill_path_query; #ifdef HAVE_SQLITE3 - -#define BDB_VERSION 12 - #include /* Define opaque structure for sqlite */ @@ -270,6 +270,7 @@ struct B_DB { POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ + POOLMEM *esc_obj; /* Escaped restore object */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -336,8 +337,6 @@ extern const char* my_sqlite_batch_fill_path_query; #ifdef HAVE_MYSQL -#define BDB_VERSION 12 - #include /* @@ -374,6 +373,7 @@ struct B_DB { POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ + POOLMEM *esc_obj; /* Escaped restore object */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -420,8 +420,6 @@ extern int my_mysql_insert_autokey_record(B_DB *mdb, const char *query, const ch #ifdef HAVE_POSTGRESQL -#define BDB_VERSION 12 - #include /* TEMP: the following is taken from select OID, typname from pg_type; */ @@ -478,6 +476,7 @@ struct B_DB { POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ + unsigned char *esc_obj; /* Escaped restore object */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -535,12 +534,9 @@ extern const char* my_pg_batch_fill_path_query; #ifdef HAVE_INGRES #include "myingres.h" -#include "lib/breg.h" -#define BDB_VERSION 12 - -/* TEMP: the following is taken from select OID, typname from pg_type; */ /*SRE: huh? */ -#define IS_NUM(x) ((x) == 20 || (x) == 21 || (x) == 23 || (x) == 700 || (x) == 701) +/* TEMP: the following is taken from $(II_SYSTEM)/ingres/files/eqsqlda.h IISQ_ types */ +#define IS_NUM(x) ((x) == 10 || (x) == 30 || (x) == 31) #define IS_NOT_NULL(x) ((x) == 1) typedef char **INGRES_ROW; @@ -582,12 +578,13 @@ struct B_DB { uint32_t cached_path_id; bool allow_transactions; /* transactions allowed */ bool transaction; /* transaction started */ + bool explicit_commit; /* do an explicit commit after each query */ int changes; /* changes made to db */ POOLMEM *fname; /* Filename only */ POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ - BREGEXP *limit_filter; /* Filter LIMIT function in queries into supported SQL */ + alist *query_filters; /* Filters to convert sql queries into supported Ingres SQL */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -645,8 +642,6 @@ extern const char* my_ingres_batch_fill_path_query; #ifdef HAVE_DBI -#define BDB_VERSION 12 - #include #ifdef HAVE_BATCH_FILE_INSERT @@ -715,6 +710,7 @@ struct B_DB { POOLMEM *path; /* Path only */ POOLMEM *esc_name; /* Escaped file name */ POOLMEM *esc_path; /* Escaped path name */ + POOLMEM *esc_obj; /* Escaped restore object */ int fnl; /* file name length */ int pnl; /* path name length */ }; @@ -940,13 +936,13 @@ struct ATTR_DBR { }; struct ROBJECT_DBR { - char *full_fname; - char *fname; - char *path; - char *plugin_name; + char *object_name; char *object; + char *plugin_name; uint32_t object_len; - uint32_t ObjectIndex; + uint32_t object_full_len; + uint32_t object_index; + int32_t object_compression; uint32_t FileIndex; uint32_t Stream; uint32_t FileType; @@ -1133,9 +1129,18 @@ public: POOLMEM *list; /* list */ int count; /* number of values seen */ - db_list_ctx() { list = get_pool_memory(PM_FNAME); *list = 0; count = 0; } + db_list_ctx() { list = get_pool_memory(PM_FNAME); reset(); } ~db_list_ctx() { free_pool_memory(list); list = NULL; } - + void reset() { *list = 0; count = 0;} + void cat(const db_list_ctx &str) { + if (str.count > 0) { + if (*list) { + pm_strcat(list, ","); + } + pm_strcat(list, str.list); + count += str.count; + } + } private: db_list_ctx(const db_list_ctx&); /* prohibit pass by value */ db_list_ctx &operator=(const db_list_ctx&); /* prohibit class assignment */