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

Wrong Results from query

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.5.7, 10.5.9
    • N/A
    • Parser
    • Centos7, MariaDB standalone

    Description

      Hi

      I came across this behavior in 10.5.7 (and also verified with 10.5.9) and am wondering if it's a BUG or if it has to do with any parameter configuration.

      MariaDB [test]> select version();
      +----------------+
      | version()      |
      +----------------+
      | 10.5.6-MariaDB |
      +----------------+

      (This issue happens with and without primary key)

      MariaDB [test]> create table test(id bigint, name varchar(10), location varchar(10));
      Query OK, 0 rows affected (0.038 sec)
       
      MariaDB [test]> insert into test values (1,'John','Dublin'), (2, 'Ann', 'London'), (3, 'Pat', 'Paris'), (3, 'Maria', 'Tokyo');
      Query OK, 4 rows affected (0.006 sec)
      Records: 4  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> select * from test;
      +------+-------+----------+
      | id   | name  | location |
      +------+-------+----------+
      |    1 | John  | Dublin   |
      |    2 | Ann   | London   |
      |    3 | Pat   | Paris    |
      |    3 | Maria | Tokyo    |
      +------+-------+----------+

      Now whatever values I provide in the WHERE condition along with the ID, it returns the row that matches the first column (ID) in the query

      MariaDB [test]> select * from test where id='1 Thomas Edison';
      +------+------+----------+
      | id   | name | location |
      +------+------+----------+
      |    1 | John | Dublin   |
      +------+------+----------+
      1 row in set, 1 warning (0.001 sec)
       
      MariaDB [test]> select * from test where id='1@Thomas£Edison';
      +------+------+----------+
      | id   | name | location |
      +------+------+----------+
      |    1 | John | Dublin   |
      +------+------+----------+
      1 row in set, 1 warning (0.001 sec)
       
      MariaDB [test]> select * from test where id='2 is it a bug';
      +------+------+----------+
      | id   | name | location |
      +------+------+----------+
      |    2 | Ann  | London   |
      +------+------+----------+
       
      MariaDB [test]> select * from test where id='whoever';
      Empty set, 1 warning (0.001 sec)
       
      MariaDB [test]> select * from test where id='whoever3';
      Empty set, 1 warning (0.001 sec)
       
      MariaDB [test]> select * from test where id='3whoever';
      +------+-------+----------+
      | id   | name  | location |
      +------+-------+----------+
      |    3 | Pat   | Paris    |
      |    3 | Maria | Tokyo    |
      +------+-------+----------+

      Attachments

        Activity

          People

            Unassigned Unassigned
            venkatb Venkat
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.