#3693 (ok 3.5.4) Invalid SELECT statement when enum field present


A table has the following fields (among others)

nr int(6)
kundetype enum('normal', 'reseller') utf8_bin

When searching for a record using the search window and using the primary key nr only, the following statement was generated

SELECT * FROM `kunder` WHERE `nr` = 415 AND `kundetype` = 'null'

It should have been

SELECT * FROM `kunder` WHERE `nr` = 415'


  • Jørgen Thomsen

    Jørgen Thomsen - 2012-10-11
    • priority: 5 --> 6
    • milestone: --> 3.5.3
  • Anonymous

    Anonymous - 2012-10-12

    This is true of any table with ENUM fields. When searching the table using the Search tab you MUST specify a value for all ENUM fields or you will get no results. You can no longer simply ignore ENUM fields if they aren't needed in your filter expression. I just now noticed this on 3.5.3 but it may have existed earlier.

  • Jørgen Thomsen

    Jørgen Thomsen - 2012-10-12

    It must be a fairly recently introduced bug. I have never had to specify the enum field before. Anyway generating this
    AND `kundetype` = 'null'
    is obviously a bug.

  • Atul Pratap Singh

    • assigned_to: nobody --> atul5
  • Atul Pratap Singh

    The bug was fixed in the repository and will be part of a future release.
    Thanks for reporting.

  • Atul Pratap Singh

    • priority: 6 --> 1
    • summary: Invalid SELECT statement when enum field present --> (ok 3.5.4) Invalid SELECT statement when enum field present
    • status: open --> open-fixed
  • Marc Delisle

    Marc Delisle - 2012-11-16
    • status: open-fixed --> closed-fixed
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed