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:
authorJurijs Klopovskis <jurijs.klopovskis@zabbix.com>2021-09-06 11:42:14 +0300
committerJurijs Klopovskis <jurijs.klopovskis@zabbix.com>2021-09-08 09:25:14 +0300
commit0d21a1d827a942fefbc99768207c9b87e326a2ed (patch)
treef62e4a32c452671443d1ba7f20f82071c9f13382 /include/zbxdb.h
parent5d14722e0cb4ad8189d1131dda3fc747aa0f3a65 (diff)
.......PS. [DEV-1952] implmented AllowUnsupportedDbVersions
Diffstat (limited to 'include/zbxdb.h')
-rw-r--r--include/zbxdb.h78
1 files changed, 55 insertions, 23 deletions
diff --git a/include/zbxdb.h b/include/zbxdb.h
index e106d8052ce..acd328ed5b3 100644
--- a/include/zbxdb.h
+++ b/include/zbxdb.h
@@ -147,48 +147,80 @@ 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"
+#ifdef HAVE_SQLITE3
+#define ZBX_DB_NAME_STR "Sqlite3"
+#endif
-#define ZBX_POSTGRESQL_MIN_VERSION 100900
-#define ZBX_POSTGRESQL_MIN_VERSION_FRIENDLY "10.9"
-#define ZBX_POSTGRESQL_MAX_VERSION 139999
-#define ZBX_POSTGRESQL_MAX_VERSION_FRIENDLY "13.x"
+#ifdef HAVE_MYSQL
+#define ZBX_DB_NAME_STR "MySQL"
+#endif
-#define ZBX_ORACLE_MIN_VERSION 1201000200
-#define ZBX_ORACLE_MIN_VERSION_FRIENDLY "Database 12c Release 12.01.00.02.x"
-#define ZBX_ORACLE_MAX_VERSION 1999000000
-#define ZBX_ORACLE_MAX_VERSION_FRIENDLY "Database 19c Release 19.x.x"
+#ifdef HAVE_POSTGRESQL
+#define ZBX_DB_NAME_STR "PostgreSQL"
+#endif
-#define ZBX_ELASTIC_MIN_VERSION 70000
-#define ZBX_ELASTIC_MIN_VERSION_FRIENDLY "7.x"
+#ifdef HAVE_ORACLE
+#define ZBX_DB_NAME_STR "Oracle"
+#endif
-#define ZBX_DBVERSION_UNDEFINED 0
+#define ZBX_MYSQL_MIN_VERSION 50728
+#define ZBX_MYSQL_MIN_VERSION_FRIENDLY "5.07.28"
+#define ZBX_MYSQL_MIN_SUPPORTED_VERSION 80000
+#define ZBX_MYSQL_MIN_SUPPORTED_VERSION_FRIENDLY "8.00.0"
+#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_MIN_SUPPORTED_VERSION 100600
+#define ZBX_MARIA_MIN_SUPPORTED_VERSION_FRIENDLY "10.6.00"
+#define ZBX_MARIA_MAX_VERSION 100699
+#define ZBX_MARIA_MAX_VERSION_FRIENDLY "10.6.xx"
+
+#define ZBX_POSTGRESQL_MIN_VERSION 100900
+#define ZBX_POSTGRESQL_MIN_VERSION_FRIENDLY "10.9"
+#define ZBX_POSTGRESQL_MIN_SUPPORTED_VERSION 130000
+#define ZBX_POSTGRESQL_MIN_SUPPORTED_VERSION_FRIENDLY "13.0"
+#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 "Database 12c Release 12.01.00.02.x"
+#define ZBX_ORACLE_MIN_SUPPORTED_VERSION 1900000000
+#define ZBX_ORACLE_MIN_SUPPORTED_VERSION_FRIENDLY "Database 19c Release 19.x.x"
+#define ZBX_ORACLE_MAX_VERSION 2199000000
+#define ZBX_ORACLE_MAX_VERSION_FRIENDLY "Database 21c Release 21.x.x"
+
+#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_FAILED_TO_RETRIEVE,
+ DB_VERSION_LOWER_THAN_SUPPORTED
} zbx_db_version_status_t;
zbx_uint32_t zbx_dbms_version_get(void);
-zbx_uint32_t zbx_dbms_version_extract(struct zbx_json *json);
+
+struct zbx_db_version_info_t
+{
+ zbx_uint32_t version;
+ zbx_db_version_status_t version_status;
+};
+
+void zbx_dbms_version_info_extract(struct zbx_db_version_info_t *version_info, 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);
+ zbx_uint32_t max_version, zbx_uint32_t min_supported_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);