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

Inconsistent Comparison Results for DATETIME and String Values Between MySQL 5.7 and MariaDB

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.9.0
    • N/A
    • Temporal Types
    • None

    Description

      There is a discrepancy between MySQL 5.7 and MariaDB when performing a SELECT query involving a comparison between a DATETIME column and a non-date string.

      Create the table and insert the values:

      CREATE TABLE t0 (c DATETIME);
      INSERT INTO t0 VALUES ('2021-09-10 06:35:35.000000');
      

      Execute the following query:

      SELECT t0.c FROM t0 WHERE t0.c > 'k3dHE';
      

      MariaDB Results:
      2021-09-10 06:35:35

      MySQL 5.7 Results:
      empty set

      Attachments

        Activity

          People

            Unassigned Unassigned
            dwenking Wenqian Deng
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.