Move version entry point into MODULE_INFO

The MODULE_INFO can easily hold the version information of the
module. This removes the need for a explicit version entry point.
This commit is contained in:
Markus Mäkelä
2017-01-03 11:48:55 +02:00
parent d3907882d6
commit 7df29aa1ec
49 changed files with 127 additions and 700 deletions

View File

@ -85,6 +85,7 @@ typedef struct
MODULE_STATUS status;
MODULE_VERSION api_version;
const char *description;
const char *version;
} MODULE_INFO;
MXS_END_DECLS

View File

@ -41,15 +41,13 @@ MXS_BEGIN_DECLS
typedef struct modules
{
char *module; /**< The name of the module */
char *type; /**< The module type */
char *version; /**< Module version */
void *handle; /**< The handle returned by dlopen */
void *modobj; /**< The module "object" this is the set of entry points */
MODULE_INFO
*info; /**< The module information */
struct modules
*next; /**< Next module in the linked list */
char *module; /**< The name of the module */
char *type; /**< The module type */
char *version; /**< Module version */
void *handle; /**< The handle returned by dlopen */
void *modobj; /**< The module "object" this is the set of entry points */
MODULE_INFO *info; /**< The module information */
struct modules *next; /**< Next module in the linked list */
} MODULES;
/**

View File

@ -111,16 +111,10 @@ extern "C"
MODULE_API_QUERY_CLASSIFIER,
MODULE_IN_DEVELOPMENT,
QUERY_CLASSIFIER_VERSION,
const_cast<char*>("Dummy Query Classifier"),
"Dummy Query Classifier",
"V1.0.0"
};
static char version_string[] = "V1.0.0";
char* version()
{
return const_cast<char*>(version_string);
}
static QUERY_CLASSIFIER qc =
{
qc_init,

View File

@ -2557,8 +2557,6 @@ void qc_thread_end(void)
extern "C"
{
static char version_string[] = "V1.0.0";
static QUERY_CLASSIFIER qc =
{
qc_init,
@ -2589,14 +2587,10 @@ MODULE_INFO info =
MODULE_API_QUERY_CLASSIFIER,
MODULE_IN_DEVELOPMENT,
QUERY_CLASSIFIER_VERSION,
const_cast<char*>("Query classifier based upon MySQL Embedded"),
"Query classifier based upon MySQL Embedded",
"V1.0.0"
};
char* version()
{
return const_cast<char*>(version_string);
}
void ModuleInit()
{
}

View File

@ -3172,8 +3172,6 @@ void qc_sqlite_get_field_info(GWBUF* query, const QC_FIELD_INFO** infos, size_t*
* EXPORTS
*/
static char version_string[] = "V1.0.0";
static QUERY_CLASSIFIER qc =
{
qc_sqlite_init,
@ -3202,13 +3200,9 @@ MODULE_INFO info =
MODULE_BETA_RELEASE,
QUERY_CLASSIFIER_VERSION,
"Query classifier using sqlite.",
"V1.0.0"
};
char* version()
{
return version_string;
}
void ModuleInit()
{
}

View File

@ -51,7 +51,6 @@ static MODULES *find_module(const char *module);
static void register_module(const char *module,
const char *type,
void *dlhandle,
char *version,
void *modobj,
MODULE_INFO *info);
static void unregister_module(const char *module);
@ -145,19 +144,6 @@ void *load_module(const char *module, const char *type)
void *sym;
if ((sym = dlsym(dlhandle, "version")) == NULL)
{
MXS_ERROR("Version interface not supported by "
"module: %s\n\t\t\t %s.",
module,
dlerror());
dlclose(dlhandle);
return NULL;
}
char *(*ver)() = sym;
char *version = ver();
/*
* If the module has a ModuleInit function cal it now.
*/
@ -230,8 +216,8 @@ void *load_module(const char *module, const char *type)
void *(*entry_point)() = sym;
modobj = entry_point();
MXS_NOTICE("Loaded module %s: %s from %s", module, version, fname);
register_module(module, type, dlhandle, version, modobj, mod_info);
MXS_NOTICE("Loaded module %s: %s from %s", module, mod_info->version, fname);
register_module(module, type, dlhandle, modobj, mod_info);
}
else
{
@ -310,13 +296,12 @@ static void
register_module(const char *module,
const char *type,
void *dlhandle,
char *version,
void *modobj,
MODULE_INFO *mod_info)
{
module = MXS_STRDUP(module);
type = MXS_STRDUP(type);
version = MXS_STRDUP(version);
char *version = MXS_STRDUP(mod_info->version);
MODULES *mod = (MODULES *)MXS_MALLOC(sizeof(MODULES));

View File

@ -47,11 +47,10 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The CDC client to MaxScale authenticator implementation"
"The CDC client to MaxScale authenticator implementation",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static int cdc_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool cdc_auth_is_client_ssl_capable(DCB *dcb);
static int cdc_auth_authenticate(DCB *dcb);
@ -90,16 +89,6 @@ static int cdc_auth_set_client_data(
int client_auth_packet_size
);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char* version()
{
return version_str;
}
/**
* @brief Add a new CDC user
*

View File

@ -616,19 +616,10 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"GSSAPI authenticator"
"GSSAPI authenticator",
"V1.0.0"
};
static char version_str[] = "V1.0.0";
/**
* Version string entry point
*/
char* version()
{
return version_str;
}
/**
* Module initialization entry point
*/

View File

@ -280,19 +280,10 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"GSSAPI backend authenticator"
"GSSAPI backend authenticator",
"V1.0.0"
};
static char *version_str = "V1.0.0";
/**
* Version string entry point
*/
char* version()
{
return version_str;
}
/**
* Module initialization entry point
*/

View File

@ -43,12 +43,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The MaxScale HTTP BA authenticator"
"The MaxScale HTTP BA authenticator",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static int http_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool http_auth_is_client_ssl_capable(DCB *dcb);
static int http_auth_authenticate(DCB *dcb);
@ -75,20 +74,6 @@ typedef struct http_auth
char* pw;
}HTTP_AUTH;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -43,12 +43,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The MaxScale Admin client authenticator implementation"
"The MaxScale Admin client authenticator implementation",
"V2.1.0"
};
/*lint +e14 */
static char *version_str = "V2.1.0";
static int max_admin_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool max_admin_auth_is_client_ssl_capable(DCB *dcb);
static int max_admin_auth_authenticate(DCB *dcb);
@ -69,20 +68,6 @@ static GWAUTHENTICATOR MyObject =
users_default_loadusers /* Load generic users */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -52,12 +52,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The MySQL client to MaxScale authenticator implementation"
"The MySQL client to MaxScale authenticator implementation",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static void* mysql_auth_init(char **options);
static int mysql_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool mysql_auth_is_client_ssl_capable(DCB *dcb);
@ -94,20 +93,6 @@ static int mysql_auth_set_client_data(
MySQLProtocol *protocol,
GWBUF *buffer);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -157,12 +157,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The MySQL MaxScale to backend server authenticator"
"The MySQL MaxScale to backend server authenticator",
"V1.0.0"
};
/*lint +e14 */
static char *version_str = "V1.0.0";
/*
* The "module object" for mysql client authenticator module.
*/
@ -178,20 +177,6 @@ static GWAUTHENTICATOR MyObject =
NULL /* We don't need to load users */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -45,12 +45,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The Null client authenticator implementation"
"The Null client authenticator implementation",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static int null_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool null_auth_is_client_ssl_capable(DCB *dcb);
static int null_auth_authenticate(DCB *dcb);
@ -71,20 +70,6 @@ static GWAUTHENTICATOR MyObject =
users_default_loadusers /* Load generic users */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -42,12 +42,11 @@ MODULE_INFO info =
MODULE_API_AUTHENTICATOR,
MODULE_GA,
GWAUTHENTICATOR_VERSION,
"The Null client authenticator implementation"
"The Null client authenticator implementation",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static int null_auth_set_protocol_data(DCB *dcb, GWBUF *buf);
static bool null_auth_is_client_ssl_capable(DCB *dcb);
static int null_auth_authenticate(DCB *dcb);
@ -68,20 +67,6 @@ static GWAUTHENTICATOR MyObject =
users_default_loadusers /* Load generic users */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -198,14 +198,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A caching filter that is capable of caching and returning cached data."
"A caching filter that is capable of caching and returning cached data.",
VERSION_STRING
};
extern "C" char *version()
{
return VERSION_STRING;
}
extern "C" void ModuleInit()
{
static modulecmd_arg_type_t show_argv[] =

View File

@ -51,11 +51,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A routing hint filter that send queries to the master after data modification"
"A routing hint filter that send queries to the master after data modification",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -117,17 +116,6 @@ typedef struct
time_t last_modification; /*< Time of the last data modifying operation */
} CCR_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialization routine, called when the module
* is first loaded.

View File

@ -96,11 +96,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"Firewall Filter"
"Firewall Filter",
"V1.2.0"
};
static char *version_str = "V1.2.0";
/*
* The filter entry points
*/
@ -793,15 +792,6 @@ bool dbfw_show_rules(const MODULECMD_ARG *argv)
return true;
}
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char * version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module

View File

@ -28,11 +28,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_ALPHA_RELEASE,
FILTER_VERSION,
"A hint parsing filter"
"A hint parsing filter",
"V1.0.0"
};
static char *version_str = "V1.0.0";
static FILTER *createInstance(const char* name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -58,17 +57,6 @@ static FILTER_OBJECT MyObject =
NULL, // No destroyInstance
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialization routine, called when the module
* is first loaded.

View File

@ -55,22 +55,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_EXPERIMENTAL,
FILTER_VERSION,
"Lua Filter"
"Lua Filter",
"V1.0.0"
};
static const char *version_str = "V1.0.0";
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return (char*) version_str;
}
/*
* The filter entry points
*/

View File

@ -14,13 +14,6 @@
#define MXS_MODULE_NAME "masking"
#include "maskingfilter.hh"
namespace
{
char VERSION_STRING[] = "V1.0.0";
}
//
// Global symbols of the Module
//
@ -30,23 +23,19 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A masking filter that is capable of masking/obfuscating returned column values."
"A masking filter that is capable of masking/obfuscating returned column values.",
"V1.0.0"
};
extern "C" char *version()
{
return VERSION_STRING;
}
extern "C" void ModuleInit()
{
MXS_NOTICE("Initialized masking module %s.\n", VERSION_STRING);
MXS_NOTICE("Initialized masking module.");
}
extern "C" FILTER_OBJECT *GetModuleObject()
{
return &MaskingFilter::s_object;
};
}
//
// MaskingFilter

View File

@ -46,8 +46,6 @@
#include <maxscale/debug.h>
#include "maxrows.h"
static char VERSION_STRING[] = "V1.0.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *sdata);
@ -66,14 +64,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_IN_DEVELOPMENT,
FILTER_VERSION,
"A filter that is capable of limiting the resultset number of rows."
"A filter that is capable of limiting the resultset number of rows.",
"V1.0.0"
};
char *version()
{
return VERSION_STRING;
}
/**
* The module initialization functions, called when the module has
* been loaded.

View File

@ -83,10 +83,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_ALPHA_RELEASE,
FILTER_VERSION,
"A RabbitMQ query logging filter"
"A RabbitMQ query logging filter",
"V1.0.2"
};
static char *version_str = "V1.0.2";
static int uid_gen;
static int hktask_id = 0;
/*
@ -262,17 +262,6 @@ typedef struct
void sendMessage(void* data);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -45,11 +45,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A routing hint filter that uses regular expressions to direct queries"
"A routing hint filter that uses regular expressions to direct queries",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -98,17 +97,6 @@ typedef struct
int active; /* Is filter active */
} REGEXHINT_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -55,11 +55,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A simple query logging filter"
"A simple query logging filter",
"V1.1.1"
};
static char *version_str = "V1.1.1";
/** Date string buffer size */
#define QLA_DATE_BUFFER_SIZE 20
@ -157,17 +156,6 @@ static FILE* open_log_file(uint32_t, QLA_INSTANCE *, const char *);
static int write_log_entry(uint32_t, FILE*, QLA_INSTANCE*, QLA_SESSION*, const char*,
const char*, size_t);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -45,11 +45,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A query rewrite filter that uses regular expressions to rewite queries"
"A query rewrite filter that uses regular expressions to rewrite queries",
"V1.1.0"
};
static char *version_str = "V1.1.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -107,17 +106,6 @@ typedef struct
void log_match(REGEX_INSTANCE* inst, char* re, char* old, char* new);
void log_nomatch(REGEX_INSTANCE* inst, char* re, char* old);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -99,11 +99,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A tee piece in the filter plumbing"
"A tee piece in the filter plumbing",
"V1.0.0"
};
static char *version_str = "V1.0.0";
/*
* The filter entry points
*/
@ -306,17 +305,6 @@ orphan_free(void* data)
#endif
}
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -34,11 +34,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_BETA_RELEASE,
FILTER_VERSION,
"A simple query counting filter"
"A simple query counting filter",
"V2.0.0"
};
static char *version_str = "V2.0.0";
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
@ -83,17 +82,6 @@ typedef struct
int count;
} TEST_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -50,11 +50,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"A top N query logging filter"
"A top N query logging filter",
"V1.0.1"
};
static char *version_str = "V1.0.1";
/*
* The filter entry points
*/
@ -141,17 +140,6 @@ typedef struct
struct timeval disconnect;
} TOPN_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -69,10 +69,10 @@ MODULE_INFO info =
MODULE_API_FILTER,
MODULE_GA,
FILTER_VERSION,
"Transaction Performance Monitoring filter"
"Transaction Performance Monitoring filter",
"V1.0.1"
};
static char *version_str = "V1.0.1";
static size_t buf_size = 10;
static size_t sql_size_limit = 64 * 1024 *
1024; /* The maximum size for query statements in a transaction (64MB) */
@ -158,17 +158,6 @@ typedef struct
size_t max_sql_size;
} TPM_SESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -22,15 +22,14 @@
#include <maxscale/alloc.h>
#include <maxscale/debug.h>
static char *version_str = (char*)"V1.0.0";
/*lint -e14 */
MODULE_INFO info =
{
MODULE_API_MONITOR,
MODULE_BETA_RELEASE,
MONITOR_VERSION,
"Aurora monitor"
"Aurora monitor",
"V1.0.0"
};
/*lint +e14 */
@ -42,18 +41,6 @@ typedef struct aurora_monitor
bool events[MAX_MONITOR_EVENT]; /**< Enabled monitor events */
} AURORA_MONITOR;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
/*lint -e14 */
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module is first loaded.
*/

View File

@ -40,8 +40,6 @@
static void monitorMain(void *);
static char *version_str = "V2.0.0";
/** Log a warning when a bad 'wsrep_local_index' is found */
static bool warn_erange_on_local_index = true;
@ -54,7 +52,8 @@ MODULE_INFO info =
MODULE_API_MONITOR,
MODULE_GA,
MONITOR_VERSION,
"A Galera cluster monitor"
"A Galera cluster monitor",
"V2.0.0"
};
/*lint +e14 */
@ -73,21 +72,6 @@ static MONITOR_OBJECT MyObject =
diagnostics
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -97,7 +81,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise the MySQL Galera Monitor module %s.", version_str);
MXS_NOTICE("Initialise the MySQL Galera Monitor module.");
}
/*lint +e14 */
@ -336,7 +320,7 @@ monitorDatabase(MONITOR *mon, MONITOR_SERVERS *database)
{
mysql_free_result(result);
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE 'wsrep_local_state'\". "
"Expected 2 columns. MySQL Version: %s", version_str);
"Expected 2 columns. MySQL Version: %s", server_string);
return;
}
@ -359,7 +343,7 @@ monitorDatabase(MONITOR *mon, MONITOR_SERVERS *database)
mysql_free_result(result2);
MXS_ERROR("Unexpected result for \"SHOW VARIABLES LIKE "
"'wsrep_sst_method'\". Expected 2 columns."
" MySQL Version: %s", version_str);
" MySQL Version: %s", server_string);
return;
}
while ((row = mysql_fetch_row(result2)))
@ -386,7 +370,7 @@ monitorDatabase(MONITOR *mon, MONITOR_SERVERS *database)
{
mysql_free_result(result);
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE 'wsrep_local_index'\". "
"Expected 2 columns. MySQL Version: %s", version_str);
"Expected 2 columns. MySQL Version: %s", server_string);
return;
}

View File

@ -31,8 +31,6 @@
static void monitorMain(void *);
static char *version_str = "V1.1.1";
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
@ -42,7 +40,8 @@ MODULE_INFO info =
MODULE_API_MONITOR,
MODULE_BETA_RELEASE,
MONITOR_VERSION,
"A Multi-Master Multi Master monitor"
"A Multi-Master Multi Master monitor",
"V1.1.1"
};
/*lint +e14 */
@ -60,21 +59,6 @@ static MONITOR_OBJECT MyObject =
diagnostics
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -82,7 +66,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise the Multi-Master Monitor module %s.", version_str);
MXS_NOTICE("Initialise the Multi-Master Monitor module.");
}
/**
@ -304,7 +288,7 @@ monitorDatabase(MONITOR* mon, MONITOR_SERVERS *database)
{
mysql_free_result(result);
MXS_ERROR("Unexpected result for 'SELECT @@server_id'. Expected 1 column."
" MySQL Version: %s", version_str);
" MySQL Version: %s", server_string);
return;
}
@ -340,7 +324,7 @@ monitorDatabase(MONITOR* mon, MONITOR_SERVERS *database)
mysql_free_result(result);
MXS_ERROR("\"SHOW ALL SLAVES STATUS\" returned less than the expected"
" amount of columns. Expected 42 columns MySQL Version: %s",
version_str);
server_string);
return;
}
@ -404,7 +388,7 @@ monitorDatabase(MONITOR* mon, MONITOR_SERVERS *database)
MXS_ERROR("\"SHOW SLAVE STATUS\" "
" for versions less than 5.5 does not have master_server_id, "
"replication tree cannot be resolved for server %s."
" MySQL Version: %s", database->server->unique_name, version_str);
" MySQL Version: %s", database->server->unique_name, server_string);
database->log_version_err = false;
}
}
@ -412,7 +396,7 @@ monitorDatabase(MONITOR* mon, MONITOR_SERVERS *database)
{
MXS_ERROR("\"SHOW SLAVE STATUS\" "
"returned less than the expected amount of columns. "
"Expected 40 columns. MySQL Version: %s", version_str);
"Expected 40 columns. MySQL Version: %s", server_string);
}
return;
}
@ -456,7 +440,7 @@ monitorDatabase(MONITOR* mon, MONITOR_SERVERS *database)
{
mysql_free_result(result);
MXS_ERROR("Unexpected result for \"SHOW GLOBAL VARIABLES LIKE 'read_only'\". "
"Expected 2 columns. MySQL Version: %s", version_str);
"Expected 2 columns. MySQL Version: %s", server_string);
return;
}

View File

@ -72,8 +72,6 @@
static void monitorMain(void *);
static char *version_str = "V1.5.0";
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
@ -83,7 +81,8 @@ MODULE_INFO info =
MODULE_API_MONITOR,
MODULE_GA,
MONITOR_VERSION,
"A MySQL Master/Slave replication monitor"
"A MySQL Master/Slave replication monitor",
"V1.5.0"
};
/*lint +e14 */
@ -108,21 +107,6 @@ static MONITOR_OBJECT MyObject =
diagnostics
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -130,7 +114,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise the MySQL Monitor module %s.", version_str);
MXS_NOTICE("Initialise the MySQL Monitor module.");
}
/**
@ -479,7 +463,7 @@ static inline void monitor_mysql_db(MONITOR_SERVERS* database, MYSQL_SERVER_INFO
{
mysql_free_result(result);
MXS_ERROR("\"%s\" returned less than the expected amount of columns. "
"Expected %d columns. MySQL Version: %s", query, columns, version_str);
"Expected %d columns.", query, columns);
return;
}
@ -590,7 +574,7 @@ static MONITOR_SERVERS *build_mysql51_replication_tree(MONITOR *mon)
mysql_free_result(result);
MXS_ERROR("\"SHOW SLAVE HOSTS\" "
"returned less than the expected amount of columns. "
"Expected 4 columns. MySQL Version: %s", version_str);
"Expected 4 columns.");
return NULL;
}
@ -755,7 +739,7 @@ monitorDatabase(MONITOR *mon, MONITOR_SERVERS *database)
{
mysql_free_result(result);
MXS_ERROR("Unexpected result for 'SELECT @@server_id, @@read_only'. Expected 2 columns."
" MySQL Version: %s", version_str);
" MySQL Version: %s", server_string);
return;
}

View File

@ -31,8 +31,6 @@
static void monitorMain(void *);
static char *version_str = "V2.1.0";
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
@ -42,7 +40,8 @@ MODULE_INFO info =
MODULE_API_MONITOR,
MODULE_BETA_RELEASE,
MONITOR_VERSION,
"A MySQL cluster SQL node monitor"
"A MySQL cluster SQL node monitor",
"V2.1.0"
};
/*lint +e14 */
@ -58,21 +57,6 @@ static MONITOR_OBJECT MyObject =
diagnostics
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -80,7 +64,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise the MySQL Cluster Monitor module %s.", version_str);
MXS_NOTICE("Initialise the MySQL Cluster Monitor module.");
}
/**
@ -270,7 +254,7 @@ monitorDatabase(MONITOR_SERVERS *database, char *defaultUser, char *defaultPassw
mysql_free_result(result);
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE "
"'Ndb_number_of_ready_data_nodes'\". Expected 2 columns."
" MySQL Version: %s", version_str);
" MySQL Version: %s", server_string);
return;
}
@ -293,7 +277,7 @@ monitorDatabase(MONITOR_SERVERS *database, char *defaultUser, char *defaultPassw
mysql_free_result(result);
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE 'Ndb_cluster_node_id'\". "
"Expected 2 columns."
" MySQL Version: %s", version_str);
" MySQL Version: %s", server_string);
return;
}

View File

@ -43,12 +43,12 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval"
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0"
};
#define ISspace(x) isspace((int)(x))
#define CDC_SERVER_STRING "MaxScale(c) v.1.0.0"
static char *version_str = "V1.0.0";
static int cdc_read_event(DCB* dcb);
static int cdc_write_event(DCB *dcb);
@ -88,17 +88,6 @@ static GWPROTOCOL MyObject =
cdc_default_auth /* default authentication */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -49,13 +49,13 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration"
"An experimental HTTPD implementation for use in administration",
"V1.2.0"
};
/*lint +e14 */
#define ISspace(x) isspace((int)(x))
#define HTTP_SERVER_STRING "MaxScale(c) v.1.0.0"
static char *version_str = "V1.2.0";
static int httpd_read_event(DCB* dcb);
static int httpd_write_event(DCB *dcb);
@ -89,20 +89,6 @@ static GWPROTOCOL MyObject =
NULL /**< Connection limit reached */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -60,11 +60,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"The MySQL to backend server protocol"
"The MySQL to backend server protocol",
"V2.0.0"
};
/*lint +e14 */
static char *version_str = "V2.0.0";
static int gw_create_backend_connection(DCB *backend, SERVER *server, SESSION *in_session);
static int gw_read_backend_event(DCB* dcb);
static int gw_write_backend_event(DCB *dcb);
@ -112,20 +112,6 @@ static GWPROTOCOL MyObject =
NULL /* Connection limit reached */
};
/*
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/*
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -69,12 +69,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"The client to MaxScale MySQL protocol implementation"
"The client to MaxScale MySQL protocol implementation",
"V1.1.0"
};
/*lint +e14*/
static char *version_str = "V1.1.0";
static int gw_MySQLAccept(DCB *listener);
static int gw_MySQLListener(DCB *listener, char *config_bind);
static int gw_read_client_event(DCB* dcb);
@ -115,20 +114,6 @@ static GWPROTOCOL MyObject =
gw_connection_limit /* Send error connection limit */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -46,7 +46,8 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"A maxscale protocol for the administration interface"
"A maxscale protocol for the administration interface",
"V2.0.0"
};
/*lint +e14 */
@ -64,8 +65,6 @@ MODULE_INFO info =
* @endverbatim
*/
static char *version_str = "V2.0.0";
#define GETPWUID_BUF_LEN 255
static int maxscaled_read_event(DCB* dcb);
@ -192,20 +191,6 @@ static GWPROTOCOL MyObject =
NULL /**< Connection limit reached */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -42,7 +42,8 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_GA,
GWPROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface"
"A telnet deamon protocol for simple administration interface",
"V1.1.1"
};
/*lint +e14 */
@ -68,8 +69,6 @@ MODULE_INFO info =
* @endverbatim
*/
static char *version_str = "V1.1.1";
static int telnetd_read_event(DCB* dcb);
static int telnetd_write_event(DCB *dcb);
static int telnetd_write(DCB *dcb, GWBUF *queue);
@ -103,20 +102,6 @@ static GWPROTOCOL MyObject =
static void telnetd_command(DCB *, unsigned char *cmd);
static void telnetd_echo(DCB *dcb, int enable);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -39,12 +39,11 @@ MODULE_INFO info =
MODULE_API_PROTOCOL,
MODULE_IN_DEVELOPMENT,
GWPROTOCOL_VERSION,
"Test protocol"
"Test protocol",
"V1.1.0"
};
/*lint +e14 */
static char *version_str = "V1.1.0";
static int test_read(DCB* dcb){ return 1;}
static int test_write(DCB *dcb, GWBUF* buf){ return 1;}
static int test_write_ready(DCB *dcb){ return 1;}
@ -78,21 +77,6 @@ static GWPROTOCOL MyObject =
test_connection_limit /**< Connection limit */
};
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*
* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
/*lint -e14 */
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -41,16 +41,15 @@
#include <maxscale/log_manager.h>
MODULE_INFO info =
MODULE_INFO info =
{
MODULE_API_ROUTER,
MODULE_GA,
ROUTER_VERSION,
"The admin user interface"
"The admin user interface",
"V1.0.0"
};
static char *version_str = "V1.0.0";
/* The router entry points */
static ROUTER *createInstance(SERVICE *service, char **options);
static void *newSession(ROUTER *instance, SESSION *session);
@ -80,17 +79,6 @@ extern int execute_cmd(CLI_SESSION *cli);
static SPINLOCK instlock;
static CLI_INSTANCE *instances;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -98,7 +86,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise CLI router module %s.", version_str);
MXS_NOTICE("Initialise CLI router module");
spinlock_init(&instlock);
instances = NULL;
}

View File

@ -45,11 +45,10 @@ MODULE_INFO info =
MODULE_API_ROUTER,
MODULE_GA,
ROUTER_VERSION,
"The debug user interface"
"The debug user interface",
"V1.1.1"
};
static char *version_str = "V1.1.1";
/* The router entry points */
static ROUTER *createInstance(SERVICE *service, char **options);
static void *newSession(ROUTER *instance, SESSION *session);
@ -79,17 +78,6 @@ extern int execute_cmd(CLI_SESSION *cli);
static SPINLOCK instlock;
static CLI_INSTANCE *instances;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -97,7 +85,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise debug CLI router module %s.", version_str);
MXS_NOTICE("Initialise debug CLI router module.");
spinlock_init(&instlock);
instances = NULL;
}
@ -181,8 +169,7 @@ newSession(ROUTER *instance, SESSION *session)
session->state = SESSION_STATE_READY;
dcb_printf(session->client_dcb, "Welcome to the MariaDB Corporation MaxScale Debug Interface (%s).\n",
version_str);
dcb_printf(session->client_dcb, "Welcome to the MariaDB Corporation MaxScale Debug Interface.\n");
dcb_printf(session->client_dcb, "Type help for a list of available commands.\n\n");
return (void *)client;

View File

@ -57,13 +57,12 @@ MODULE_INFO info =
MODULE_API_ROUTER,
MODULE_ALPHA_RELEASE,
ROUTER_VERSION,
"The MaxScale Information Schema"
"The MaxScale Information Schema",
"V1.0.0"
};
extern char *create_hex_sha1_sha1_passwd(char *passwd);
static char *version_str = "V1.0.0";
static int maxinfo_statistics(INFO_INSTANCE *, INFO_SESSION *, GWBUF *);
static int maxinfo_ping(INFO_INSTANCE *, INFO_SESSION *, GWBUF *);
static int maxinfo_execute_query(INFO_INSTANCE *, INFO_SESSION *, char *);
@ -103,17 +102,6 @@ static ROUTER_OBJECT MyObject =
static SPINLOCK instlock;
static INFO_INSTANCE *instances;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -121,7 +109,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise MaxInfo router module %s.", version_str);
MXS_NOTICE("Initialise MaxInfo router module.");
spinlock_init(&instlock);
instances = NULL;
}

View File

@ -95,11 +95,10 @@ MODULE_INFO info =
MODULE_API_ROUTER,
MODULE_GA,
ROUTER_VERSION,
"A connection based router to load balance based on connections"
"A connection based router to load balance based on connections",
"V1.1.0"
};
static char *version_str = "V1.1.0";
/* The router entry points */
static ROUTER *createInstance(SERVICE *service, char **options);
static void *newSession(ROUTER *instance, SESSION *session);
@ -138,17 +137,6 @@ static int handle_state_switch(DCB* dcb, DCB_REASON reason, void * routersession
static SPINLOCK instlock;
static ROUTER_INSTANCE *instances;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.
@ -156,7 +144,7 @@ version()
void
ModuleInit()
{
MXS_NOTICE("Initialise readconnroute router module %s.", version_str);
MXS_NOTICE("Initialise readconnroute router module.");
spinlock_init(&instlock);
instances = NULL;
}

View File

@ -31,7 +31,8 @@
MODULE_INFO info =
{
MODULE_API_ROUTER, MODULE_GA, ROUTER_VERSION,
"A Read/Write splitting router for enhancement read scalability"
"A Read/Write splitting router for enhancement read scalability",
"V1.1.0"
};
/**
@ -68,8 +69,6 @@ MODULE_INFO info =
/** Maximum number of slaves */
#define MAX_SLAVE_COUNT 255
static char *version_str = "V1.1.0";
/*
* The functions that implement the router module API
*/
@ -126,15 +125,6 @@ static bool handle_error_new_connection(ROUTER_INSTANCE *inst,
static bool have_enough_servers(ROUTER_CLIENT_SES *rses, const int min_nsrv,
int router_nsrv, ROUTER_INSTANCE *router);
static bool create_backends(ROUTER_CLIENT_SES *rses, backend_ref_t** dest, int* n_backend);
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *version()
{
return version_str;
}
/**
* The module initialization routine, called when the module

View File

@ -45,7 +45,8 @@ MODULE_INFO info =
MODULE_API_ROUTER,
MODULE_BETA_RELEASE,
ROUTER_VERSION,
"A database sharding router for simple sharding"
"A database sharding router for simple sharding",
"V1.0.0"
};
@ -64,8 +65,6 @@ MODULE_INFO info =
* @endverbatim
*/
static char *version_str = "V1.0.0";
static ROUTER* createInstance(SERVICE *service, char **options);
static void* newSession(ROUTER *instance, SESSION *session);
static void closeSession(ROUTER *instance, void *session);
@ -608,16 +607,6 @@ bool check_shard_status(ROUTER_INSTANCE* router, char* shard)
return false;
}
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char* version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.

View File

@ -15,14 +15,13 @@
#include <maxscale/router.h>
#include <maxscale/modinfo.h>
static char *version_str = "V1.0.0";
MODULE_INFO info =
{
MODULE_API_ROUTER,
MODULE_IN_DEVELOPMENT,
ROUTER_VERSION,
"A test router - not for use in real systems"
"A test router - not for use in real systems",
"V1.0.0"
};
static ROUTER *createInstance(SERVICE *service, char **options);
@ -62,17 +61,6 @@ typedef struct
{
} TESTSESSION;
/**
* Implementation of the mandatory version entry point
*
* @return version string of the module
*/
char *
version()
{
return version_str;
}
/**
* The module initialisation routine, called when the module
* is first loaded.