maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #04477
Re: MYSQL_THDVAR and SET GLOBAL
Hi, MARK!
On Nov 29, MARK CALLAGHAN wrote:
> Is there an easy way to prevent SET GLOBAL ... from being done for
> plugin variables declared via MYSQL_THDVAR_...? For the following
> variable I can do SET GLOBAL innodb_fake_changes=1 and that sets a
> global variable.
>
> static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
> "In the transaction after enabled, UPDATE, INSERT and DELETE only
> move the cursor to the records "
> "and do nothing other operations (no changes, no ibuf, no undo, no
> transaction log) in the transaction. "
> "This is to cause replication prefetch IO. ATTENTION: the
> transaction started after enabled is affected.",
> check_fake_changes, NULL, FALSE);
I couldn't find a proper solution, but here's a workaround. Provide an
update function for your variable:
- check_fake_changes, NULL, FALSE);
+ check_fake_changes, update_fake_changes, FALSE);
+
+ void update_fake_changes(MYSQL_THD thd, struct st_mysql_sys_var *var,
+ void *var_ptr, const void *save)
+ {
+ if (var_ptr != THDVAR(0, fake_changes))
+ *(my_bool *) var_ptr= *(my_bool *) save ? TRUE : FALSE;
+ }
it isn't very cool, because one is supposed to do all the checks in the
check function, not in the update. but it'll work.
Regards,
Sergei
References