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

UUID comparison with malformed UUID silently returns 0 rows instead of warning or correct results

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.8.2, 11.8.5, 12.1.2
    • None
    • Data types, Optimizer
    • None

    Description

      MariaDB silently accepts malformed UUIDs in WHERE clauses and returns incorrect results.

      *Steps to reproduce:*

      CREATE TABLE test_items (
          id UUID NOT NULL PRIMARY KEY
      );
       
      -- Insert some test data
      INSERT INTO test_items (id) VALUES
          ('1f073854-2fa2-62e2-a017-45b695424f53'),
          ('2f073854-2fa2-62e2-a017-45b695424f53'),
          ('3f073854-2fa2-62e2-a017-45b695424f53');
       
      -- This query uses a MALFORMED UUID (missing leading '1')
      SELECT * FROM test_items 
      WHERE id != 'f073854-2fa2-62e2-a017-45b695424f53';
      

      Example: https://onecompiler.com/mariadb/44bxngh22

      *Expected behavior:*
      Either:

      • A warning/error about the invalid UUID format, OR
      • 3 results returned since no row equals the malformed UUID

      *Actual behavior:*

      • Silently returns 0 rows with no warning

      *Additional context:*
      The correct query with a valid UUID returns expected results:

      -- Correct query returns 2 rows as expected
      SELECT * FROM test_items 
      WHERE id != '1f073854-2fa2-62e2-a017-45b695424f53';
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            karsten684 Karsten Nilsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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