Skip to content

Commit 79246eb

Browse files
committed
Partial code tidy: move plugin description to end with other items, and added status variable for debug.
1 parent 13e30c0 commit 79246eb

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

storage/oqgraph/ha_oqgraph.cc

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
-----------------------
2929
* Removed compatibility hacks for 5.5.32 and 10.0.4.
3030
I expect no issues building oqgraph into Mariadb 5.5.40 but I think the better approach is maintain a separate fork / patches.
31+
* Added status variable to report if verbose debug is on
3132
3233
*/
3334

@@ -62,8 +63,6 @@
6263
#define DBUG_PRINT(x ...)
6364
#endif
6465

65-
using namespace open_query;
66-
6766
#ifdef RETAIN_INT_LATCH_COMPATIBILITY
6867
/* In normal operation, no new tables using an integer latch can be created,
6968
* but they can still be used if they already exist, to allow for upgrades.
@@ -74,12 +73,10 @@ using namespace open_query;
7473
*/
7574

7675
static my_bool g_allow_create_integer_latch = FALSE;
77-
78-
static MYSQL_SYSVAR_BOOL(allow_create_integer_latch, g_allow_create_integer_latch,
79-
PLUGIN_VAR_RQCMDARG, "Allow creation of integer latches "
80-
"so the upgrade logic can be tested", NULL, NULL, FALSE);
8176
#endif
8277

78+
using namespace open_query;
79+
8380
// Table of varchar latch operations.
8481
// In the future this needs to be refactactored to live somewhere else
8582
struct oqgraph_latch_op_table { const char *key; int latch; };
@@ -127,10 +124,6 @@ static const ha_create_table_option oqgraph_table_option_list[]=
127124
HA_TOPTION_END
128125
};
129126

130-
static const char oqgraph_description[]=
131-
"Open Query Graph Computation Engine "
132-
"(http://openquery.com/graph)";
133-
134127
static bool oqgraph_init_done= 0;
135128

136129
static handler* oqgraph_create_handler(handlerton *hton, TABLE_SHARE *table,
@@ -1203,24 +1196,55 @@ void ha_oqgraph::update_create_info(HA_CREATE_INFO *create_info)
12031196
table->file->info(HA_STATUS_AUTO);
12041197
}
12051198

1199+
// --------------------
1200+
// Handler description.
1201+
// --------------------
1202+
1203+
1204+
static const char oqgraph_description[]=
1205+
"Open Query Graph Computation Engine "
1206+
"(http://openquery.com/graph)";
1207+
12061208
struct st_mysql_storage_engine oqgraph_storage_engine=
12071209
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
12081210

12091211
extern "C" const char* const oqgraph_boost_version;
12101212

1213+
static const char *oqgraph_status_verbose_debug =
1214+
#ifdef VERBOSE_DEBUG
1215+
"Verbose Debug is enabled. Performance may be adversely impacted.";
1216+
#else
1217+
"Verbose Debug is not enabled.";
1218+
#endif
1219+
1220+
static const char *oqgraph_status_latch_compat_mode =
1221+
#ifdef RETAIN_INT_LATCH_COMPATIBILITY
1222+
"Legacy tables with integer latches are supported.";
1223+
#else
1224+
"Legacy tables with integer latches are not supported.";
1225+
#endif
1226+
12111227
static struct st_mysql_show_var oqgraph_status[]=
12121228
{
12131229
{ "OQGraph_Boost_Version", (char*) &oqgraph_boost_version, SHOW_CHAR_PTR },
12141230
/* We thought about reporting the Judy version, but there seems to be no way to get that from code in the first place. */
1231+
{ "OQGraph_Verbose_Debug", (char*) &oqgraph_status_verbose_debug, SHOW_CHAR_PTR },
1232+
{ "OQGraph_Compat_mode", (char*) &oqgraph_status_latch_compat_mode, SHOW_CHAR_PTR },
12151233
{ 0, 0, SHOW_UNDEF }
12161234
};
12171235

12181236
#ifdef RETAIN_INT_LATCH_COMPATIBILITY
1237+
static MYSQL_SYSVAR_BOOL( allow_create_integer_latch, g_allow_create_integer_latch, PLUGIN_VAR_RQCMDARG,
1238+
"Allow creation of integer latches so the upgrade logic can be tested. Not for normal use.",
1239+
NULL, NULL, FALSE);
1240+
#endif
1241+
12191242
static struct st_mysql_sys_var* oqgraph_sysvars[]= {
1243+
#ifdef RETAIN_INT_LATCH_COMPATIBILITY
12201244
MYSQL_SYSVAR(allow_create_integer_latch),
1245+
#endif
12211246
0
12221247
};
1223-
#endif
12241248

12251249
maria_declare_plugin(oqgraph)
12261250
{
@@ -1234,11 +1258,7 @@ maria_declare_plugin(oqgraph)
12341258
oqgraph_fini, /* Plugin Deinit */
12351259
0x0300, /* Version: 3s.0 */
12361260
oqgraph_status, /* status variables */
1237-
#ifdef RETAIN_INT_LATCH_COMPATIBILITY
1238-
oqgraph_sysvars, /* system variables */
1239-
#else
1240-
NULL,
1241-
#endif
1261+
oqgraph_sysvars, /* system variables */
12421262
"3.0",
12431263
MariaDB_PLUGIN_MATURITY_BETA
12441264
}

0 commit comments

Comments
 (0)