diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-09-18 13:07:31 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-09-18 13:07:31 +0200 |
commit | 4ec2e9d7eda78d409d1b017ef4d8928fe9055438 (patch) | |
tree | 6c3a74a740d3c1c5f3a7d1f8154d8a791b435b3f /storage/example | |
parent | 1a2a9d74fe1256554eceb09bbc6752a6376df87d (diff) | |
parent | 197bdbae4db78ba65f3668803bebd3c4a4509ae5 (diff) | |
download | mariadb-git-4ec2e9d7eda78d409d1b017ef4d8928fe9055438.tar.gz |
5.5 merge and fixes for compiler/test errors
Diffstat (limited to 'storage/example')
-rw-r--r-- | storage/example/ha_example.cc | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 0dc8e27fe61..d445f66e7c2 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -1061,6 +1061,7 @@ struct st_mysql_storage_engine example_storage_engine= static ulong srv_enum_var= 0; static ulong srv_ulong_var= 0; +static double srv_double_var= 0; const char *enum_var_names[]= { @@ -1095,9 +1096,34 @@ static MYSQL_SYSVAR_ULONG( 1000, 0); +static MYSQL_SYSVAR_DOUBLE( + double_var, + srv_double_var, + PLUGIN_VAR_RQCMDARG, + "0.500000..1000.500000", + NULL, + NULL, + 8.5, + 0.5, + 1000.5, + 0); // reserved always 0 + +static MYSQL_THDVAR_DOUBLE( + double_thdvar, + PLUGIN_VAR_RQCMDARG, + "0.500000..1000.500000", + NULL, + NULL, + 8.5, + 0.5, + 1000.5, + 0); + static struct st_mysql_sys_var* example_system_variables[]= { MYSQL_SYSVAR(enum_var), MYSQL_SYSVAR(ulong_var), + MYSQL_SYSVAR(double_var), + MYSQL_SYSVAR(double_thdvar), MYSQL_SYSVAR(varopt_default), NULL }; @@ -1110,8 +1136,9 @@ 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, %.6b", // %b is MySQL extension - srv_enum_var, srv_ulong_var, "really"); + "enum_var is %lu, ulong_var is %lu, " + "double_var is %f, %.6b", // %b is a MySQL extension + srv_enum_var, srv_ulong_var, srv_double_var, "really"); return 0; } |