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
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
/* "Generic" names for easier conversion */
#define sql_store_result(x) mysql_store_result((x)->db)
#define sql_use_result(x) mysql_use_result((x)->db)
-#define sql_free_result(x) mysql_free_result((x)->result)
+#define sql_free_result(x) my_mysql_free_result(x)
#define sql_fetch_row(x) mysql_fetch_row((x)->result)
#define sql_query(x, y) mysql_query((x)->db, (y))
-#define sql_close(x) mysql_close((x)->db)
#define sql_strerror(x) mysql_error((x)->db)
#define sql_num_rows(x) mysql_num_rows((x)->result)
#define sql_data_seek(x, i) mysql_data_seek((x)->result, (i))
extern char* my_mysql_batch_unlock_tables_query;
extern char* my_mysql_batch_fill_filename_query;
extern char* my_mysql_batch_fill_path_query;
+extern void my_mysql_free_result(B_DB *mdb);
#else
POSTGRESQL_ROW row;
POSTGRESQL_FIELD *fields;
int num_rows;
+ int row_size; /* size of malloced rows */
int num_fields;
- int row_number; /* what row number did we get via my_postgresql_data_seek? */
- int field_number; /* what field number did we get via my_postgresql_field_seek? */
+ int fields_size; /* size of malloced fields */
+ int row_number; /* row number from my_postgresql_data_seek */
+ int field_number; /* field number from my_postgresql_field_seek */
int ref_count;
char *db_name;
char *db_user;
#endif /* __SQL_C */
+/* ==============================================================
+ *
+ * What follows are definitions that are used "globally" for all
+ * the different SQL engines and both inside and external to the
+ * cats directory.
+ */
+
extern uint32_t bacula_db_version;
-/* ***FIXME*** FileId_t should *really* be uint64_t
- * but at the current time, this breaks MySQL.
+/*
+ * These are the sizes of the current definitions of database
+ * Ids. In general, FileId_t can be set to uint64_t and it
+ * *should* work. Users have reported back that it does work
+ * for PostgreSQL. For the other types, all places in Bacula
+ * have been converted, but no one has actually tested it.
+ * In principle, the only field that really should need to be
+ * 64 bits is the FileId_t
*/
typedef uint32_t FileId_t;
typedef uint32_t DBId_t; /* general DB id type */
#define faddr_t long
+/*
+ * Structure used when calling db_get_query_ids()
+ * allows the subroutine to return a list of ids.
+ */
+class dbid_list : public SMARTALLOC {
+public:
+ DBId_t *DBId; /* array of DBIds */
+ char *PurgedFiles; /* Array of PurgedFile flags */
+ int num_ids; /* num of ids actually stored */
+ int max_ids; /* size of id array */
+ int num_seen; /* number of ids processed */
+ int tot_ids; /* total to process */
+
+ dbid_list(); /* in sql.c */
+ ~dbid_list(); /* in sql.c */
+};
+
+
+
/* Job information passed to create job record and update
* job record at end of job. Note, although this record