summaryrefslogtreecommitdiff
path: root/storage/example
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-04-09 14:28:07 +0200
committerSergei Golubchik <sergii@pisem.net>2014-04-09 14:28:07 +0200
commit32b3c9f35de3e52695d7d8d6dc0b34ff9c097733 (patch)
tree618eda633ab098b1a432ec29b4ac2243ef8e552a /storage/example
parentab157e4556ef2c46de6d4a1f29a024ae58e4d4aa (diff)
downloadmariadb-git-32b3c9f35de3e52695d7d8d6dc0b34ff9c097733.tar.gz
Make THDVAR_INT variables to be signed in SELECT in SHOW
Diffstat (limited to 'storage/example')
-rw-r--r--storage/example/ha_example.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 74604ea3f56..83c923dc69f 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -1081,6 +1081,9 @@ static MYSQL_SYSVAR_ENUM(
0, // def
&enum_var_typelib); // typelib
+static MYSQL_THDVAR_INT(int_var, PLUGIN_VAR_RQCMDARG, "-1..1",
+ NULL, NULL, 0, -1, 1, 0);
+
static MYSQL_SYSVAR_ULONG(
ulong_var,
srv_ulong_var,
@@ -1119,6 +1122,7 @@ static MYSQL_THDVAR_DOUBLE(
static struct st_mysql_sys_var* example_system_variables[]= {
MYSQL_SYSVAR(enum_var),
MYSQL_SYSVAR(ulong_var),
+ MYSQL_SYSVAR(int_var),
MYSQL_SYSVAR(double_var),
MYSQL_SYSVAR(double_thdvar),
NULL
@@ -1131,9 +1135,10 @@ static int show_func_example(MYSQL_THD thd, struct st_mysql_show_var *var,
var->type= SHOW_CHAR;
var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
- "enum_var is %lu, ulong_var is %lu, "
+ "enum_var is %lu, ulong_var is %lu, int_var is %d, "
"double_var is %f, %.6b", // %b is a MySQL extension
- srv_enum_var, srv_ulong_var, srv_double_var, "really");
+ srv_enum_var, srv_ulong_var, THDVAR(thd, int_var),
+ srv_double_var, "really");
return 0;
}