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

Inconsistent field flags for int_field and COALESCE(int_field)

    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

      Run "mysql --column-type-info test" and execute this script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a tinyint);
      INSERT INTO t1 VALUES(1);
       SELECT a, COALESCE(a) FROM t1;
      

      The output is:

      Field   1:  `a`
      Catalog:    `def`
      Database:   `test`
      Table:      `t1`
      Org_table:  `t1`
      Type:       TINY
      Collation:  binary (63)
      Length:     4
      Max_length: 1
      Decimals:   0
      Flags:      NUM 
      
      Field   2:  `COALESCE(a)`
      Catalog:    `def`
      Database:   ``
      Table:      ``
      Org_table:  ``
      Type:       TINY
      Collation:  binary (63)
      Length:     4
      Max_length: 1
      Decimals:   0
      Flags:      BINARY NUM 
      
      +------+-------------+
      | a    | COALESCE(a) |
      +------+-------------+
      |    1 |           1 |
      +------+-------------+
      1 row in set (0.00 sec)
      

      Notice, "Flags" is NUM for the field, but "BINARY NUM" for the function.

      It should be fixed to return the same flag sets.

        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: