CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog_sql.cc File Reference
#include "cvmfs_config.h"
#include "catalog_sql.h"
#include <cstdlib>
#include <cstring>
#include "catalog.h"
#include "globals.h"
#include "logging.h"
#include "util/posix.h"
#include "xattr.h"
Include dependency graph for catalog_sql.cc:

Go to the source code of this file.

Namespaces

 catalog
 

Macros

#define DB_FIELDS_LT_V2_1
 
#define DB_FIELDS_GE_V2_1_LT_R2
 
#define DB_FIELDS_GE_V2_1_GE_R2
 
#define MAKE_STATEMENT(STMT_TMPL, REV)
 
#define MAKE_STATEMENTS(STMT_TMPL)
 
#define DEFERRED_INIT(DB, REV)   DeferredInit((DB).sqlite_db(), (REV).c_str())
 
#define DEFERRED_INITS(DB)
 

Macro Definition Documentation

#define DB_FIELDS_GE_V2_1_GE_R2
Value:
"catalog.hash, catalog.hardlinks, catalog.size, " \
"catalog.mode, catalog.mtime, catalog.flags, " \
"catalog.name, catalog.symlink, catalog.md5path_1, " \
"catalog.md5path_2, catalog.parent_1, catalog.parent_2, " \
"catalog.rowid, catalog.uid, catalog.gid, " \
"catalog.xattr IS NOT NULL"

Definition at line 653 of file catalog_sql.cc.

#define DB_FIELDS_GE_V2_1_LT_R2
Value:
"catalog.hash, catalog.hardlinks, catalog.size, " \
"catalog.mode, catalog.mtime, catalog.flags, " \
"catalog.name, catalog.symlink, catalog.md5path_1, " \
"catalog.md5path_2, catalog.parent_1, catalog.parent_2, " \
"catalog.rowid, catalog.uid, catalog.gid, " \
"0"

Definition at line 646 of file catalog_sql.cc.

#define DB_FIELDS_LT_V2_1
Value:
"catalog.hash, catalog.inode, catalog.size, " \
"catalog.mode, catalog.mtime, catalog.flags, " \
"catalog.name, catalog.symlink, catalog.md5path_1, " \
"catalog.md5path_2, catalog.parent_1, catalog.parent_2, " \
"catalog.rowid"

Definition at line 640 of file catalog_sql.cc.

#define DEFERRED_INIT (   DB,
  REV 
)    DeferredInit((DB).sqlite_db(), (REV).c_str())

Definition at line 670 of file catalog_sql.cc.

#define DEFERRED_INITS (   DB)
Value:
if ((DB).schema_version() < 2.1 - CatalogDatabase::kSchemaEpsilon) { \
DEFERRED_INIT((DB), LT_V2_1); \
} else if ((DB).schema_revision() < 2) { \
DEFERRED_INIT((DB), GE_V2_1_LT_R2); \
} else { \
DEFERRED_INIT((DB), GE_V2_1_GE_R2); \
}
#define DEFERRED_INIT(DB, REV)
Definition: catalog_sql.cc:670

Definition at line 673 of file catalog_sql.cc.

Referenced by catalog::SqlListing::SqlListing(), catalog::SqlLookupDanglingMountpoints::SqlLookupDanglingMountpoints(), catalog::SqlLookupInode::SqlLookupInode(), and catalog::SqlLookupPathHash::SqlLookupPathHash().

#define MAKE_STATEMENT (   STMT_TMPL,
  REV 
)
Value:
static const std::string REV = \
ReplaceAll(STMT_TMPL, "@DB_FIELDS@", DB_FIELDS_ ## REV)
string ReplaceAll(const string &haystack, const string &needle, const string &replace_by)
Definition: string.cc:453

Definition at line 661 of file catalog_sql.cc.

#define MAKE_STATEMENTS (   STMT_TMPL)
Value:
MAKE_STATEMENT(STMT_TMPL, LT_V2_1); \
MAKE_STATEMENT(STMT_TMPL, GE_V2_1_LT_R2); \
MAKE_STATEMENT(STMT_TMPL, GE_V2_1_GE_R2)
#define MAKE_STATEMENT(STMT_TMPL, REV)
Definition: catalog_sql.cc:661

Definition at line 665 of file catalog_sql.cc.

Referenced by catalog::SqlListing::SqlListing(), catalog::SqlLookupDanglingMountpoints::SqlLookupDanglingMountpoints(), catalog::SqlLookupInode::SqlLookupInode(), and catalog::SqlLookupPathHash::SqlLookupPathHash().