Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.36, 10.0.9
    • Fix Version/s: 10.0, 5.5
    • Component/s: None
    • Labels:
      None

      Description

      This script:

      DROP TABLE IF EXISTS t1,t2;
      CREATE TABLE t1 (a DATE, b DATE);
      CREATE TABLE t2 AS SELECT COALESCE(a,b), NULLIF(a,b) FROM t1; 
      SHOW COLUMNS FROM t2;
      

      creates these columns:

      +---------------+-------------+------+-----+---------+-------+
      | Field         | Type        | Null | Key | Default | Extra |
      +---------------+-------------+------+-----+---------+-------+
      | COALESCE(a,b) | date        | YES  |     | NULL    |       |
      | NULLIF(a,b)   | varchar(10) | YES  |     | NULL    |       |
      +---------------+-------------+------+-----+---------+-------+
      

      NULLIF erroneously created a VARCHAR column.

      Notice, on the contrary, COALESCE correctly created a DATE column.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: