[MDEV-21115] CHANGE MASTER TO MASTER_DELAY = XXX only accepts a numeric value not an experession Created: 2019-11-21  Updated: 2020-01-23

Status: Open
Project: MariaDB Server
Component/s: Replication
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Simon Mudd Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 10.3.15


 Description   

Seen on 10.3.15.

Maybe not a big thing but it is somewhat surprising. I could not set the replication delay using MASTER_DELAY = xxx with an expression. It has to be a numeric value. The docs do say this but usually where a numeric value is allowed an expression can be used.

In this particular case I wanted to set a 24 hour delay which is easy to express as 24 * 60 * 60, but that did not work.

Suggestion would be to allow for a numeric expression and then use the value that is derived from that as now.



 Comments   
Comment by Simon Mudd [ 2019-11-21 ]

Use of the following syntax failed for me:

root@host [(none)]> change master to master_delay = 24 * 60 * 60;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* 60 * 60' at line 1

root@host [(none)]> change master to master_delay = ( 24 * 60 * 60 );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '( 24 * 60 * 60 )' at line 1

This works (as documented):

root@host [(none)]> stop slave; change master to master_delay = 86400;
Query OK, 0 rows affected, 1 warning (0.000 sec)

So maybe it's just a master of modifying the syntax that's handled here and allowing for a numeric expression to be accepted.

Generated at Thu Feb 08 09:04:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.