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

FROM_UNIXTIME(0) used in WHERE gives warning and results in no data being returned

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 11.7.2
    • N/A
    • Temporal Types
    • None
    • OS: Archlinux x64
      mariadb from 11.7.2-MariaDB

    Description

      Using FROM_UNIXTIME(0) in WHERE results in warning with no data returned. The code worked correctly in mariadb 11.6.2

      Example query:
      SELECT * FROM `some_table` WHERE (`timestamp` >= FROM_UNIXTIME(0) OR `timestamp` IS NULL)

      Example result:
      /* Warning: (1292) Truncated incorrect unixtime value: '0.0' */
      /* Affected rows: 0 Found rows: 0 Warnings: 1 Duration for 1 query: 0.000 sec. */

      db-fiddle to assist reproduction
      https://www.db-fiddle.com/f/cmPANek4oQkNfFMRLrfYSA/0

      The same problem exist with the invers function:

      MariaDB [test]> select unix_timestamp("1970-01-01 02:00:00");

      +---------------------------------------+
      | unix_timestamp("1970-01-01 02:00:00") |
      +---------------------------------------+
      |                                  NULL |
      +---------------------------------------+
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              itsonlybinary ItsOnlyBinary
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.