3c7a0656f98136df2c2b6c2d5e36baea9e3bf8bc braney Wed Jan 1 14:10:09 2020 -0800 add version number to trackDb cache so if the trackDb structure changes, the "wrong" cached values won't be used. diff --git src/hg/inc/trackDb.h src/hg/inc/trackDb.h index 8bb95d6..e259b58 100644 --- src/hg/inc/trackDb.h +++ src/hg/inc/trackDb.h @@ -23,81 +23,90 @@ #ifndef CART_H #include "cart.h" #endif #define TRACKDB_NUM_COLS 21 // Forward definitions struct tdbExtras; // A structure to keep track of our min and max values if we're a wig struct minMax { double min, max; }; +/* DO NOT CHANGE THE TRACKDB STRUCTURE WITHOUT INCREMENTING THE VERSION NUMBER */ +/* This number is tacked onto the end of cached trackDb entries to make sure we + * don't use a cached structure that has different contents. */ +#define TRACKDB_VERSION 1 + struct trackDb /* This describes an annotation track. */ +/* DO NOT CHANGE THE TRACKDB STRUCTURE WITHOUT INCREMENTING THE VERSION NUMBER */ { struct trackDb *next; /* Next in singly linked list. Next sibling in tree. */ char *track; /* Symbolic ID of Track - used in cart. Is tableName in database historically. */ char *table; /* Symbolic ID of Table - used in database. Same as track usually. */ char *shortLabel; /* Short label displayed on left */ char *type; /* Track type: bed, psl, genePred, etc. */ char *longLabel; /* Long label displayed in middle */ unsigned char visibility; /* 0=hide, 1=dense, 2=full, 3=pack, 4=squish */ float priority; /* 0-100 - where to position. 0 is top */ unsigned char colorR; /* Color red component 0-255 */ unsigned char colorG; /* Color green component 0-255 */ unsigned char colorB; /* Color blue component 0-255 */ unsigned char altColorR; /* Light color red component 0-255 */ unsigned char altColorG; /* Light color green component 0-255 */ unsigned char altColorB; /* Light color blue component 0-255 */ unsigned char useScore; /* 1 if use score, 0 if not */ +/* DO NOT CHANGE THE TRACKDB STRUCTURE WITHOUT INCREMENTING THE VERSION NUMBER */ #ifndef __cplusplus unsigned char private; /* 1 if only want to show it on test site */ #else unsigned char priv; /* don't conflict with C++ keyword */ #endif int restrictCount; /* Number of chromosomes this is on (0=all though!) */ char **restrictList; /* List of chromosomes this is on */ char *url; /* URL to link to when they click on an item */ char *html; /* Some html to display when they click on an item */ char *grp; /* Which group track belongs to */ unsigned char canPack; /* 1 if can pack track display, 0 otherwise */ char *settings; /* Name/value pairs for track-specific stuff */ struct hash *viewHash; /* Hash for settings. Not saved in database.*/ struct hash *settingsHash; /* Hash for settings. Not saved in database. * Don't use directly, rely on trackDbSetting to access. */ /* additional info, determined from settings */ +/* DO NOT CHANGE THE TRACKDB STRUCTURE WITHOUT INCREMENTING THE VERSION NUMBER */ char treeNodeType; // bit map containing defining supertrack, composite and children // of same (may be parent & child) struct trackDb *parent; // parent of composite or superTracks struct trackDb *subtracks; // children of composite not supers. NOTE: only in one sl at a time! struct slRef *children; // children of folders (superTracks) only. // Needed as slRef since these children are on the main trackList // and can't be in 2 sl's at once char *parentName; // set if this is a supertrack member boolean isShow; // for supertracks: true if supertrack with pseudo-vis 'show' struct hash *overrides; /* If not NULL, this is an override * entry. It contains the names, but not the * values of the fields and settings that were * specified in the entry. */ struct tdbExtras *tdbExtras;// This struct allows storing extra values which may be used // multiple times within a single cgi. An example is the metadata // looked up once in the metaDb and used again and again. boolean isNewFilterType; // are we using the new filter variables on this track +/* DO NOT CHANGE THE TRACKDB STRUCTURE WITHOUT INCREMENTING THE VERSION NUMBER */ }; #define FOLDER_MASK 0x10 #define COMPOSITE_MASK 0x20 #define MULTI_TRACK_MASK 0x80 #define FOLDER_CHILD_MASK 0x01 #define COMPOSITE_CHILD_MASK 0x02 #define COMPOSITE_VIEW_MASK 0x04 #define MULTI_TRACK_CHILD_MASK 0x08 #define PARENT_MASK 0xF0 #define CHILD_MASK 0x0F #define TREETYPE_MASK 0xFF #define PARENT_NODE(nodeType) ((nodeType) & PARENT_MASK) #define CHILD_NODE(nodeType) ((nodeType) & CHILD_MASK) #define FOLDER_NODE(nodeType) ((nodeType) & FOLDER_MASK)