[MDEV-653] LP:827299 - NOW('2011-07-20 11:44:51') not working, crashing replication Created: 2011-08-16  Updated: 2012-10-10  Resolved: 2012-10-10

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: floyd (Inactive) Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug827299.xml    

 Description   

select NOW('2011-07-20 11:44:51'); gives an error in mariadb 5.3, but works on 5.2.7. Thus a slave with 5.3 connected to a 5.2 master crashes as soon as such an INSERT is in the binlog.

5.3 beta:

MariaDB [master]> select  @@version;select NOW('2011-07-20 11:44:51');
+---------------------------------------+
| @@version                             |
+---------------------------------------+
| 5.3.0-MariaDB-beta-mariadb101~squeeze |
+---------------------------------------+
1 row in set (0.00 sec)
 
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2011-07-20 11:44:51')' at line 1

old 5.2.7 version:

MariaDB [master]>  select  @@version;select NOW('2011-07-20 11:44:51');
+--------------------------------------+
| @@version                            |
+--------------------------------------+
| 5.2.7-MariaDB-mariadb101~squeeze-log |
+--------------------------------------+
1 row in set (0.00 sec)
 
+----------------------------+
| NOW('2011-07-20 11:44:51') |
+----------------------------+
| 2011-08-16 14:01:41        |
+----------------------------+
1 row in set (0.00 sec)
 
MariaDB [master]>



 Comments   
Comment by Philip Stoev (Inactive) [ 2011-08-16 ]

Re: NOW('2011-07-20 11:44:51') not working, crashing replication
Hi,

according to the documentation, the function NOW() does not take an argument:

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_now

What do you intend to achieve by supplying an argument to NOW(). Maybe it is some other date/time function that you actually need.

When you say "slave crashes", I assume you mean that replication stops, is that correct? The slave mysqld process continues to run, right?

Comment by floyd (Inactive) [ 2011-08-16 ]

Re: NOW('2011-07-20 11:44:51') not working, crashing replication
sorry,

replication stops with the error:
Slave SQL: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax ...

The source of the query I looked after is an old version phpmyadmin, but in some other cases in seems like the came from an odbc/ms-access application.
I'm not sure if the NOW(<DATE>) comes from phpmyadmin or if this is only written into the binlog this way the ensure the right timestamp on the slaves?

The fact is: the query is OK on the master, is being replicated, and all slaves in 5.3 stop.

Comment by Rasmus Johansson (Inactive) [ 2011-08-16 ]

Launchpad bug id: 827299

Comment by Philip Stoev (Inactive) [ 2011-08-16 ]

Re: NOW('2011-07-20 11:44:51') not working, crashing replication
Sending this to Serg for a definitive verdict.

Comment by Sergei Golubchik [ 2012-10-10 ]

The fact that NOW(X) seemed to work was a bug, it was never documented as a supported syntax, and the argument of NOW was ignored.

Starting from 5.3 NOW(X) is supported and documented syntax, X being the precision of the result. One can write NOW(0) or NOW(2) or NOW(6), for example. That's why the old undocumented syntax NOW(arbitrary_unused_expression) can no longer be recognized.

Generated at Thu Feb 08 06:30:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.