diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2021-06-01 14:26:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 14:26:22 +0300 |
commit | 37bee1d197229a4de1d6eac9942fc626f1da8ee3 (patch) | |
tree | f975420d4f6cd6c47dbd5c8735a71e649041a281 /database/sqlite/sqlite_functions.h | |
parent | 0d96e0a187ee3419a9939b56970248356d05c1e7 (diff) |
Store uuid_t metric_uuid in the dimension state structure instead of uuid_t * (#11212)
Diffstat (limited to 'database/sqlite/sqlite_functions.h')
-rw-r--r-- | database/sqlite/sqlite_functions.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/database/sqlite/sqlite_functions.h b/database/sqlite/sqlite_functions.h index b5a435674f..fe1b2acb69 100644 --- a/database/sqlite/sqlite_functions.h +++ b/database/sqlite/sqlite_functions.h @@ -34,9 +34,10 @@ struct node_instance_list { #define SQL_STORE_DIMENSION \ "INSERT OR REPLACE into dimension (dim_id, chart_id, id, name, multiplier, divisor , algorithm) values (?0001,?0002,?0003,?0004,?0005,?0006,?0007);" -#define SQL_FIND_DIMENSION_UUID "select dim_id from dimension where chart_id=@chart and id=@id and name=@name;" +#define SQL_FIND_DIMENSION_UUID \ + "select dim_id from dimension where chart_id=@chart and id=@id and name=@name and length(dim_id)=16;" -#define SQL_STORE_ACTIVE_DIMENSION \ +#define SQL_STORE_ACTIVE_DIMENSION \ "insert or replace into dimension_active (dim_id, date_created) values (@id, strftime('%s'));" extern int sql_init_database(void); extern void sql_close_database(void); @@ -49,8 +50,7 @@ extern int sql_store_chart( extern int sql_store_dimension(uuid_t *dim_uuid, uuid_t *chart_uuid, const char *id, const char *name, collected_number multiplier, collected_number divisor, int algorithm); -extern uuid_t *find_dimension_uuid(RRDSET *st, RRDDIM *rd); -extern uuid_t *create_dimension_uuid(RRDSET *st, RRDDIM *rd); +extern int find_dimension_uuid(RRDSET *st, RRDDIM *rd, uuid_t *store_uuid); extern void store_active_dimension(uuid_t *dimension_uuid); extern uuid_t *find_chart_uuid(RRDHOST *host, const char *type, const char *id, const char *name); |