Skip to content

Commit a112a80

Browse files
committed
Merge 10.4 into 10.5
2 parents b69191b + f6f055a commit a112a80

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

include/mysql/plugin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, void *,
233233
#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
234234
#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
235235
#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
236+
#define PLUGIN_VAR_DEPRECATED 0x4000 /* Server variable is deprecated */
236237
#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
237238

238239
struct st_mysql_sys_var;
@@ -286,7 +287,8 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
286287
#define PLUGIN_VAR_MASK \
287288
(PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \
288289
PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \
289-
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC)
290+
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
291+
PLUGIN_VAR_DEPRECATED | PLUGIN_VAR_MEMALLOC)
290292

291293
#define MYSQL_PLUGIN_VAR_HEADER \
292294
int flags; \

mysql-test/main/plugin.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ a
4040
set global example_ulong_var=500;
4141
set global example_enum_var= e1;
4242
set session example_int_var= -1;
43+
set global example_deprecated_var=1;
44+
Warnings:
45+
Warning 1287 '@@example_deprecated_var' is deprecated and will be removed in a future release
4346
show status like 'example%';
4447
Variable_name Value
4548
Example_func_example enum_var is 0, ulong_var is 500, int_var is -1, double_var is 8.500000, really
4649
show variables like 'example%';
4750
Variable_name Value
51+
example_deprecated_var 0
4852
example_double_thdvar 8.500000
4953
example_double_var 8.500000
5054
example_enum_var e1

mysql-test/main/plugin.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ SELECT * FROM t1;
2727
set global example_ulong_var=500;
2828
set global example_enum_var= e1;
2929
set session example_int_var= -1;
30+
set global example_deprecated_var=1;
3031
show status like 'example%';
3132
show variables like 'example%';
3233

sql/sql_plugin.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ class sys_var_pluginvar: public sys_var, public Sql_alloc
311311
struct st_mysql_sys_var *plugin_var;
312312

313313
sys_var_pluginvar(sys_var_chain *chain, const char *name_arg,
314-
st_plugin_int *p, st_mysql_sys_var *plugin_var_arg);
314+
st_plugin_int *p, st_mysql_sys_var *plugin_var_arg,
315+
const char *substitute);
315316
sys_var_pluginvar *cast_pluginvar() { return this; }
316317
uchar* real_value_ptr(THD *thd, enum_var_type type) const;
317318
TYPELIB* plugin_var_typelib(void) const;
@@ -3412,11 +3413,11 @@ static int pluginvar_sysvar_flags(const st_mysql_sys_var *p)
34123413
}
34133414

34143415
sys_var_pluginvar::sys_var_pluginvar(sys_var_chain *chain, const char *name_arg,
3415-
st_plugin_int *p, st_mysql_sys_var *pv)
3416+
st_plugin_int *p, st_mysql_sys_var *pv, const char *substitute)
34163417
: sys_var(chain, name_arg, pv->comment, pluginvar_sysvar_flags(pv),
34173418
0, pv->flags & PLUGIN_VAR_NOCMDOPT ? -1 : 0, NO_ARG,
34183419
pluginvar_show_type(pv), 0,
3419-
NULL, VARIABLE_NOT_IN_BINLOG, NULL, NULL, NULL),
3420+
NULL, VARIABLE_NOT_IN_BINLOG, NULL, NULL, substitute),
34203421
plugin(p), plugin_var(pv)
34213422
{
34223423
plugin_var->name= name_arg;
@@ -4158,7 +4159,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
41584159
my_casedn_str(&my_charset_latin1, varname);
41594160
convert_dash_to_underscore(varname, len-1);
41604161
}
4161-
v= new (mem_root) sys_var_pluginvar(&chain, varname, tmp, o);
4162+
const char *s= o->flags & PLUGIN_VAR_DEPRECATED ? "" : NULL;
4163+
v= new (mem_root) sys_var_pluginvar(&chain, varname, tmp, o, s);
41624164
v->test_load= (var ? &var->loaded : &static_unload);
41634165
DBUG_ASSERT(static_unload == FALSE);
41644166

storage/example/ha_example.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,17 @@ static MYSQL_THDVAR_DOUBLE(
10601060
1000.5,
10611061
0);
10621062

1063+
static MYSQL_THDVAR_INT(
1064+
deprecated_var, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, "-1..1",
1065+
NULL, NULL, 0, -1, 1, 0);
1066+
10631067
static struct st_mysql_sys_var* example_system_variables[]= {
10641068
MYSQL_SYSVAR(enum_var),
10651069
MYSQL_SYSVAR(ulong_var),
10661070
MYSQL_SYSVAR(int_var),
10671071
MYSQL_SYSVAR(double_var),
10681072
MYSQL_SYSVAR(double_thdvar),
1073+
MYSQL_SYSVAR(deprecated_var),
10691074
MYSQL_SYSVAR(varopt_default),
10701075
NULL
10711076
};

storage/innobase/os/os0file.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,7 @@ static bool is_drive_on_ssd(DWORD nr)
40314031
sizeof storage_query, &seek_penalty, sizeof seek_penalty,
40324032
&bytes_written, nullptr))
40334033
{
4034-
on_ssd= seek_penalty.IncursSeekPenalty;
4034+
on_ssd= !seek_penalty.IncursSeekPenalty;
40354035
}
40364036
else
40374037
{

0 commit comments

Comments
 (0)