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

Inserting NULL into base column breaks NATURAL_SORT_KEY column

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.7.1
    • Component/s: Server
    • Labels:
      None

      Description

      create or replace table t (a varchar(8), b varchar(8) as (natural_sort_key(a)));
      insert into t (a) values ('a2'),(NULL),('a11');
      select * from t order by b;
      select a, b from t order by b;
      

      preview-10.7-MDEV-4742-natural-sort deac988668

      MariaDB [test]> select * from t order by b;
      +------+------+
      | a    | b    |
      +------+------+
      | NULL | NULL |
      | a11  | NULL |
      | a2   | a02  |
      +------+------+
      3 rows in set (0.001 sec)
       
      MariaDB [test]> select a, b from t order by b;
      +------+------+
      | a    | b    |
      +------+------+
      | a2   | NULL |
      | NULL | NULL |
      | a11  | NULL |
      +------+------+
      3 rows in set (0.001 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wlad Vladislav Vaintroub
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration