diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-09 23:27:24 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-09 23:27:24 +0200 |
commit | 5f293dd694f9b1b4a0bdf73bb6ae80cda70f21d4 (patch) | |
tree | 24dde5c436f3c2687619de02e4ab5f4f957ff789 /storage/example | |
parent | 7d3288129f6e5b52c7377ff68295f51606c7f002 (diff) | |
download | mariadb-git-5f293dd694f9b1b4a0bdf73bb6ae80cda70f21d4.tar.gz |
MDEV-4022 table attributes with sysvar as a default value
Diffstat (limited to 'storage/example')
-rw-r--r-- | storage/example/ha_example.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index dac1ff81c10..bcf934b6b1c 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -118,6 +118,8 @@ static HASH example_open_tables; /* The mutex used to init the hash; variable for example share methods */ mysql_mutex_t example_mutex; +static MYSQL_THDVAR_ULONG(varopt_default, PLUGIN_VAR_RQCMDARG, + "default value of the VAROPT table option", NULL, NULL, 5, 0, 100, 0); /** Structure for CREATE TABLE options (table options). @@ -133,6 +135,7 @@ struct ha_table_option_struct ulonglong ullparam; uint enumparam; bool boolparam; + ulonglong varparam; }; @@ -179,6 +182,12 @@ ha_create_table_option example_table_option_list[]= The default is 1, that is true, yes, on. */ HA_TOPTION_BOOL("YESNO", boolparam, 1), + /* + one option defined by the system variable. The type, the range, or + a list of allowed values is the same as for the system variable. + */ + HA_TOPTION_SYSVAR("VAROPT", varparam, varopt_default), + HA_TOPTION_END }; @@ -1089,6 +1098,7 @@ static MYSQL_SYSVAR_ULONG( static struct st_mysql_sys_var* example_system_variables[]= { MYSQL_SYSVAR(enum_var), MYSQL_SYSVAR(ulong_var), + MYSQL_SYSVAR(varopt_default), NULL }; |