Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-653

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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]>
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            philipstoev Philip Stoev added a comment -

            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?

            Show
            philipstoev Philip Stoev added a comment - 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?
            Hide
            floyd floyd added a comment -

            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.

            Show
            floyd floyd added a comment - 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.
            Hide
            philipstoev Philip Stoev added a comment -

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

            Show
            philipstoev Philip Stoev added a comment - Re: NOW('2011-07-20 11:44:51') not working, crashing replication Sending this to Serg for a definitive verdict.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 827299

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 827299
            Hide
            serg Sergei Golubchik added a comment -

            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.

            Show
            serg Sergei Golubchik added a comment - 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.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                floyd floyd
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: