Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Veksler <Mihails.Vekslers@zabbix.com>2021-04-06 09:30:34 +0300
committerMichael Veksler <Mihails.Vekslers@zabbix.com>2021-04-06 09:30:34 +0300
commit0804ec4ad052749e218ee464f927097321c06143 (patch)
treee36ed8534cca54f3a1eb602c381d62a6bdf2d12f /include
parentf2a5cd0f37f6813a275c8f997cbb6e711204b6cb (diff)
........S. [DEV-1836] refactoring the name of functions and variables
Diffstat (limited to 'include')
-rw-r--r--include/common.h12
-rw-r--r--include/db.h3
-rw-r--r--include/zbxdb.h52
-rw-r--r--include/zbxjson.h3
4 files changed, 47 insertions, 23 deletions
diff --git a/include/common.h b/include/common.h
index aeec930086d..8691b752cf6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -1741,16 +1741,4 @@ int zbx_open_xml(char *data, int options, int maxerrlen, void **xml_doc, void **
int zbx_check_xml_memory(char *mem, int maxerrlen, char **errmsg);
#endif
-#define DBVERSION_UNDEFINED 0
-#define VERSION_REQUIREMENT_NOT_DEFINED_FRIENDLY ""
-typedef enum
-{
- DB_VERSION_SUPPORTED,
- DB_VERSION_LOWER_THAN_MINIMUM,
- DB_VERSION_HIGHER_THAN_MAXIMUM,
- DB_VERSION_FAILED_TO_RETRIEVE
-} db_version_status_flags_shared_with_FRONTEND;
-
-int zbx_check_DBversion(char *database, unsigned long current_version, unsigned long min_version,
- unsigned long max_version);
#endif
diff --git a/include/db.h b/include/db.h
index 96950bc5654..9876eff4c03 100644
--- a/include/db.h
+++ b/include/db.h
@@ -502,7 +502,7 @@ const ZBX_FIELD *DBget_field(const ZBX_TABLE *table, const char *fieldname);
#define DBget_maxid(table) DBget_maxid_num(table, 1)
zbx_uint64_t DBget_maxid_num(const char *tablename, int num);
-unsigned long DBextract_DBversion(struct zbx_json *json);
+zbx_uint32_t DBextract_version(struct zbx_json *json);
void DBflush_version_requirements(const char *version);
int DBcheck_capabilities(zbx_uint32_t db_version);
@@ -876,4 +876,5 @@ void zbx_lld_override_operation_free(zbx_lld_override_operation_t *override_oper
void zbx_load_lld_override_operations(const zbx_vector_uint64_t *overrideids, char **sql, size_t *sql_alloc,
zbx_vector_ptr_t *ops);
+
#endif
diff --git a/include/zbxdb.h b/include/zbxdb.h
index c6eece6d7b8..d4d6cec66b9 100644
--- a/include/zbxdb.h
+++ b/include/zbxdb.h
@@ -97,13 +97,6 @@ int zbx_db_txn_error(void);
int zbx_db_txn_end_error(void);
const char *zbx_db_last_strerr(void);
-unsigned long zbx_dbms_get_version(void);
-unsigned long zbx_dbms_extract_version(struct zbx_json *json);
-
-#ifdef HAVE_MYSQL
-int zbx_dbms_mariadb_used(void);
-#endif
-
#ifdef HAVE_POSTGRESQL
int zbx_tsdb_get_version(void);
#define ZBX_DB_TSDB_V1 (20000 > zbx_tsdb_get_version())
@@ -154,4 +147,49 @@ char *zbx_db_dyn_escape_like_pattern(const char *src);
int zbx_db_strlen_n(const char *text_loc, size_t maxlen);
+#define ZBX_MYSQL_MIN_VERSION 50728
+#define ZBX_MYSQL_MIN_VERSION_FRIENDLY "5.07.28"
+#define ZBX_MYSQL_MAX_VERSION 80099
+#define ZBX_MYSQL_MAX_VERSION_FRIENDLY "8.00.x"
+
+#define ZBX_MARIA_MIN_VERSION 100037
+#define ZBX_MARIA_MIN_VERSION_FRIENDLY "10.00.37"
+#define ZBX_MARIA_MAX_VERSION 100599
+#define ZBX_MARIA_MAX_VERSION_FRIENDLY "10.05.x"
+
+#define ZBX_POSTGRESQL_MIN_VERSION 100900
+#define ZBX_POSTGRESQL_MIN_VERSION_FRIENDLY "10.09"
+#define ZBX_POSTGRESQL_MAX_VERSION 139999
+#define ZBX_POSTGRESQL_MAX_VERSION_FRIENDLY "13.x"
+
+#define ZBX_ORACLE_MIN_VERSION 1201000200
+#define ZBX_ORACLE_MIN_VERSION_FRIENDLY "12.01.00.02.x"
+#define ZBX_ORACLE_MAX_VERSION 1202000399
+#define ZBX_ORACLE_MAX_VERSION_FRIENDLY "12.02.00.03.x" /* Oracle Database 19c 19.1.0 */
+
+#define ZBX_ELASTIC_MIN_VERSION 70000
+#define ZBX_ELASTIC_MIN_VERSION_FRIENDLY "7.x"
+
+#define ZBX_DBVERSION_UNDEFINED 0
+
+typedef enum
+{ /* db version status flags shared with FRONTEND */
+ DB_VERSION_SUPPORTED,
+ DB_VERSION_LOWER_THAN_MINIMUM,
+ DB_VERSION_HIGHER_THAN_MAXIMUM,
+ DB_VERSION_FAILED_TO_RETRIEVE
+} db_version_status_t;
+
+zbx_uint32_t zbx_dbms_version_get(void);
+zbx_uint32_t zbx_dbms_version_extract(struct zbx_json *json);
+
+#ifdef HAVE_MYSQL
+int zbx_dbms_mariadb_used(void);
+#endif
+
+int zbx_db_version_check(const char *database, zbx_uint32_t current_version, zbx_uint32_t min_version,
+ zbx_uint32_t max_version);
+void zbx_db_version_json_create(struct zbx_json *json, const char *database, const char *friendly_current_version,
+ const char *friendly_min_version, const char *friendly_max_version, int flag);
+
#endif
diff --git a/include/zbxjson.h b/include/zbxjson.h
index 9bee550dd8d..62c4f1b52e1 100644
--- a/include/zbxjson.h
+++ b/include/zbxjson.h
@@ -297,7 +297,4 @@ void zbx_jsonpath_clear(zbx_jsonpath_t *jsonpath);
int zbx_jsonpath_compile(const char *path, zbx_jsonpath_t *jsonpath);
int zbx_jsonpath_query(const struct zbx_json_parse *jp, const char *path, char **output);
-void zbx_json_create_entry_for_DBversion(struct zbx_json *json, char *database, char *friendly_current_version,
- char *friendly_min_version, char *friendly_max_version, int flag);
-
#endif /* ZABBIX_ZJSON_H */