diff --git a/include/maxscale/query_classifier.h b/include/maxscale/query_classifier.h index ff36205d9..0d4b91800 100644 --- a/include/maxscale/query_classifier.h +++ b/include/maxscale/query_classifier.h @@ -379,21 +379,19 @@ typedef struct query_classifier * is classified. Note that the server version is maintained separately * for each thread. * - * @param major The major version. - * @param minor The minor version. - * @param patch The patch version. + * @param version Version encoded as MariaDB encodes the version, i.e.: + * version = major * 10000 + minor * 100 + patch */ - void (*qc_set_server_version)(uint32_t major, uint32_t minor, uint32_t patch); + void (*qc_set_server_version)(uint64_t version); /** * Get the thread specific version assumed of the server. If the version has * not been set, all values are 0. * - * @param major The major version. - * @param minor The minor version. - * @param patch The patch version. + * @param version The version encoded as MariaDB encodes the version, i.e.: + * version = major * 10000 + minor * 100 + patch */ - void (*qc_get_server_version)(uint32_t* major, uint32_t* minor, uint32_t* patch); + void (*qc_get_server_version)(uint64_t* version); } QUERY_CLASSIFIER; /** @@ -784,20 +782,18 @@ char* qc_typemask_to_string(uint32_t typemask); * is classified. Note that the server version is maintained separately * for each thread. * - * @param major The major version. - * @param minor The minor version. - * @param patch The patch version. + * @param version Version encoded as MariaDB encodes the version, i.e.: + * version = major * 10000 + minor * 100 + patch */ -void qc_set_server_version(uint32_t major, uint32_t minor, uint32_t patch); +void qc_set_server_version(uint64_t version); /** * Get the thread specific version assumed of the server. If the version has * not been set, all values are 0. * - * @param major The major version. - * @param minor The minor version. - * @param patch The patch version. + * @return The version as MariaDB encodes the version, i.e: + * version = major * 10000 + minor * 100 + patch */ -void qc_get_server_version(uint32_t* major, uint32_t* minor, uint32_t* patch); +uint64_t qc_get_server_version(); MXS_END_DECLS diff --git a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc index 77597fc4d..a5ef760bd 100644 --- a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc +++ b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc @@ -99,9 +99,7 @@ static thread_local struct // The version information is not used; the embedded library parses according // to the version of the embedded library it has been linked with. However, we // need to store the information so that qc_[get|set]_server_version will work. - uint32_t version_major; - uint32_t version_minor; - uint32_t version_patch; + uint64_t version; } this_thread; #define QTYPE_LESS_RESTRICTIVE_THAN_WRITE(t) (tqc_set_server_version(major, minor, patch); + classifier->qc_set_server_version(version); } -void qc_get_server_version(uint32_t* major, uint32_t* minor, uint32_t* patch) +uint64_t qc_get_server_version() { QC_TRACE(); ss_dassert(classifier); - classifier->qc_get_server_version(major, minor, patch); + uint64_t version; + + classifier->qc_get_server_version(&version); + + return version; }