Skip to content

Commit

Permalink
check plugin type earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
etern committed May 21, 2018
1 parent e2defcf commit 5f3a73c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 0 additions & 5 deletions plugins/proxy/proxy-plugin.c
Expand Up @@ -2202,11 +2202,6 @@ chassis_plugin_config *config;
chassis_plugin_config *
network_mysqld_proxy_plugin_new(void)
{
#ifndef SIMPLE_PARSER
g_critical("try loading proxy-plugin.so from shard-edition, exit");
exit(1);
#endif

config = g_new0(chassis_plugin_config, 1);

/* use negative values as defaults to make them ignored */
Expand Down
5 changes: 0 additions & 5 deletions plugins/shard/shard-plugin.c
Expand Up @@ -2040,11 +2040,6 @@ chassis_plugin_config *config;
static chassis_plugin_config *
network_mysqld_shard_plugin_new(void)
{
#ifdef SIMPLE_PARSER
g_critical("try loading shard-plugin.so from rw-edition, exit");
exit(1);
#endif

config = g_new0(chassis_plugin_config, 1);

/* use negative values as defaults to make them ignored */
Expand Down
11 changes: 11 additions & 0 deletions src/mysql-proxy-cli.c
Expand Up @@ -504,6 +504,17 @@ check_plugin_mode_valid(struct chassis_frontend_t *frontend, chassis *srv)
g_critical("shard & proxy is mutual exclusive");
return FALSE;
}
#ifdef SIMPLE_PARSER
if (sharding_mode) {
g_critical("try loading shard-plugin.so from rw-edition, exit");
return FALSE;
}
#else
if (proxy_mode) {
g_critical("try loading proxy-plugin.so from shard-edition, exit");
return FALSE;
}
#endif

return TRUE;
}
Expand Down

0 comments on commit 5f3a73c

Please sign in to comment.