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

ALLOW_INVALID_DATE and >= <= don´t working

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.25
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      mariadb 5.5.23 linux

      Description

      hi guys i´m running a simple query with

      date_field>="2001-07-06 00:00:00" AND
      date_field<"2012-07-31 24:00:00"

      the second part is 'invalid' "2012-07-31 24:00:00" since hour 24:00:00 don´t exists for this date...
      but, i´m using
      sql_mode=PIPES_AS_CONCAT,ALLOW_INVALID_DATES
      what it should do? convert 24:00:00 to "2012-08-01 00:00:00" ? or just compare as string?

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rspadim roberto spadim added a comment -

            nice, in others words i would rewrite it to:
            SELECT * FROM t WHERE (data_compensacao_origem || "")<"2012-11-31 24:00:00"

            does i will have problems with index optimizations?

            could check if leap second will work in mariadb? i didn´t tryed and nobody talked it as an error, maybe never will talk since nobody is using my system at 23:59:60 they normally use between 08:00:00 and 20:00:00, at test 23:59:60 returned a warning (and no result) and it´s a 'legal' datetime value at least to UTC timezone

            Show
            rspadim roberto spadim added a comment - nice, in others words i would rewrite it to: SELECT * FROM t WHERE (data_compensacao_origem || "")<"2012-11-31 24:00:00" does i will have problems with index optimizations? could check if leap second will work in mariadb? i didn´t tryed and nobody talked it as an error, maybe never will talk since nobody is using my system at 23:59:60 they normally use between 08:00:00 and 20:00:00, at test 23:59:60 returned a warning (and no result) and it´s a 'legal' datetime value at least to UTC timezone
            Hide
            elenst Elena Stepanova added a comment -

            http://dev.mysql.com/doc/refman//5.5/en/time-zone-leap-seconds.html
            "Leap second values are returned with a time part that ends with :59:59. This means that a function such as NOW() can return the same value for two or three consecutive seconds during the leap second. It remains true that literal temporal values having a time part that ends with :59:60 or :59:61 are considered invalid."

            Show
            elenst Elena Stepanova added a comment - http://dev.mysql.com/doc/refman//5.5/en/time-zone-leap-seconds.html "Leap second values are returned with a time part that ends with :59:59. This means that a function such as NOW() can return the same value for two or three consecutive seconds during the leap second. It remains true that literal temporal values having a time part that ends with :59:60 or :59:61 are considered invalid."
            Hide
            rspadim roberto spadim added a comment -

            nice, but they are for timestamp fields, what about datetime fields? i´m asking because i read some parts of manual and didn´t found the information (i agree with you that mysql isn´t like manual but for a user changing from mysql to maria maybe this could be a problem to port code, for me no problem i can rewrite the query but for someone that have many queries this can be a problem)

            Show
            rspadim roberto spadim added a comment - nice, but they are for timestamp fields, what about datetime fields? i´m asking because i read some parts of manual and didn´t found the information (i agree with you that mysql isn´t like manual but for a user changing from mysql to maria maybe this could be a problem to port code, for me no problem i can rewrite the query but for someone that have many queries this can be a problem)
            Hide
            rspadim roberto spadim added a comment -

            in others words...
            to allow a easy user port from mysql to mariadb, could we add a new sql_mode option? (feature request)
            maybe COMPARE_DATETIME_AS_STRING to make things easier?

            i´m considering this as a feature request instead of a bug

            Show
            rspadim roberto spadim added a comment - in others words... to allow a easy user port from mysql to mariadb, could we add a new sql_mode option? (feature request) maybe COMPARE_DATETIME_AS_STRING to make things easier? i´m considering this as a feature request instead of a bug
            Hide
            rspadim roberto spadim added a comment -

            please close this bug, i reported a feature request since i understood that mysql isn´t doing a datetime comparision, it´s doing string comparision... \o/ mariadb rocks =)
            new feature request id is MDEV-391

            Show
            rspadim roberto spadim added a comment - please close this bug, i reported a feature request since i understood that mysql isn´t doing a datetime comparision, it´s doing string comparision... \o/ mariadb rocks =) new feature request id is MDEV-391

              People

              • Assignee:
                Unassigned
                Reporter:
                rspadim roberto spadim
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: