From: Eric Bollengier Date: Fri, 1 Oct 2010 13:09:21 +0000 (+0200) Subject: Update BVFS file versions browser X-Git-Tag: Release-7.0.0~1533 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=432ce57ac7b216acc3c9c88f2668beddb886c461;p=bacula%2Fbacula Update BVFS file versions browser --- diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index 95d77d9053..cc00ca2bf3 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -63,7 +63,7 @@ Bvfs::Bvfs(JCR *j, B_DB *mdb) { pattern = get_pool_memory(PM_NAME); *jobids = *prev_dir = *pattern = 0; dir_filenameid = pwd_id = offset = 0; - see_copies = see_all_version = false; + see_copies = see_all_versions = false; limit = 1000; attr = new_attr(jcr); list_entries = result_handler; @@ -497,9 +497,11 @@ void Bvfs::get_all_file_versions(DBId_t pathid, DBId_t fnid, const char *client) POOL_MEM query; - Mmsg(query,// 1 2 3 4 -"SELECT 'V', File.FileId, File.Md5, File.JobId, File.LStat, " -// 5 6 + Mmsg(query,// 1 2 3 +"SELECT 'V', File.PathId, File.FilenameId, File.Md5, " +// 4 5 6 + "File.JobId, File.LStat, File.FileId, " +// 7 8 "Media.VolumeName, Media.InChanger " "FROM File, Job, Client, JobMedia, Media " "WHERE File.FilenameId = %s " diff --git a/bacula/src/cats/bvfs.h b/bacula/src/cats/bvfs.h index 9fb29d094b..fa4f6c2f53 100644 --- a/bacula/src/cats/bvfs.h +++ b/bacula/src/cats/bvfs.h @@ -62,8 +62,8 @@ typedef enum { /* Only if File Version record */ BVFS_Md5 = 3, - BVFS_VolName = 4, - BVFS_VolInchanger = 5 + BVFS_VolName = 7, + BVFS_VolInchanger = 8 } bvfs_row_index; class Bvfs { @@ -117,8 +117,8 @@ public: void update_cache(); - void set_see_all_version(bool val) { - see_all_version = val; + void set_see_all_versions(bool val) { + see_all_versions = val; } void set_see_copies(bool val) { @@ -169,7 +169,7 @@ private: POOLMEM *prev_dir; /* ls_dirs query returns all versions, take the 1st one */ ATTR *attr; /* Can be use by handler to call decode_stat() */ - bool see_all_version; + bool see_all_versions; bool see_copies; DBId_t get_dir_filenameid(); @@ -180,6 +180,8 @@ private: #define bvfs_is_dir(row) ((row)[BVFS_Type][0] == BVFS_DIR_RECORD) #define bvfs_is_file(row) ((row)[BVFS_Type][0] == BVFS_FILE_RECORD) +#define bvfs_is_version(row) ((row)[BVFS_Type][0] == BVFS_FILE_VERSION) + void bvfs_update_path_hierarchy_cache(JCR *jcr, B_DB *mdb, char *jobids); void bvfs_update_cache(JCR *jcr, B_DB *mdb);