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

ORDER BY does not always work in ZIP CONNECT tables

Details

    Description

      A table is created from 2 zip files ( 1.zip and 2.zip, attached, each contain one simple CSV file) and it shows error "Can't find record" while using ORDER BY clause.
      But it works, if I add DISTINCT to my select.

      --------------
      CREATE TABLE `c1` (
      	`n1` varchar(255)  NOT NULL,
       	`n2` varchar(255)  NOT NULL,
       	`n3` varchar(255)  NOT NULL,
       	`n4` varchar(255)  NOT NULL,
       	`n5` varchar(255)  NOT NULL
      ) ENGINE=CONNECT  `table_type`=CSV `file_name`='/home/alice/Downloads/*.zip' zipped=1 sep_char="-" MULTIPLE=1 header=1
      --------------
      Query OK, 0 rows affected (0.05 sec)
       
      --------------
      select  * from c1 order by n4  limit 5
      --------------
       
      ERROR 1032 (HY000) at line 13 in file: '/home/alice/t/c.sql': Can't find record in 'c1'
      --------------
      select DISTINCT * from c1 order by n4  limit 5
      --------------
       
      +--------+------------+-------+---------+---------+
      | n1     | n2         | n3    | n4      | n5      |
      +--------+------------+-------+---------+---------+
      | Amos   | "(972) 845 | 8251" | Aaron   | Jakeem  |
      | Armand | "(318) 908 | 8237" | Aaron   | Wallace |
      | Ali    | "(351) 986 | 2800" | Abdul   | Zachary |
      | Upton  | "(410) 693 | 5824" | Abdul   | Ryder   |
      | Paul   | "(816) 747 | 5961" | Abraham | Alan    |
      +--------+------------+-------+---------+---------+
      5 rows in set (0.00 sec)
      

      Attachments

        1. 1.zip
          3 kB
        2. 2.zip
          3 kB

        Issue Links

          Activity

            Probably the same problem found in MDEV-651

            By the way, the CREATE TABLE should specify QUOTED=1 as the second field is quoted because containing the separator character.

            bertrandop Olivier Bertrand added a comment - Probably the same problem found in MDEV-651 By the way, the CREATE TABLE should specify QUOTED=1 as the second field is quoted because containing the separator character.

            Cannot reproduce.

            bertrandop Olivier Bertrand added a comment - Cannot reproduce.

            Indeed, it looks like a variant of MDEV-12651.
            I assume "cannot reproduce" refers to ob-10.1 tree – instead of ER_KEY_NOT_FOUND it now returns ERROR 1105 (HY000): Not supported by this table type which makes more sense (see my comment in MDEV-12651, though).
            The change was introduced by cd337a3730828e3287b0b291430940209bc52594 (and its follow-up 2d85b10060c5ea63dc61561407a6f784db8841ef), particularly by this change:

            -  } else
            -    rc= HA_ERR_KEY_NOT_FOUND;
            +       } else {
            +               PGLOBAL g = GetPlug((table) ? table->in_use : NULL, xp);
            +               strcpy(g->Message, "Not supported by this table type");
            +               my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
            +               rc= HA_ERR_INTERNAL_ERROR;
            +       }       // endif SetRecpos
            

            elenst Elena Stepanova added a comment - Indeed, it looks like a variant of MDEV-12651 . I assume "cannot reproduce" refers to ob-10.1 tree – instead of ER_KEY_NOT_FOUND it now returns ERROR 1105 (HY000): Not supported by this table type which makes more sense (see my comment in MDEV-12651 , though). The change was introduced by cd337a3730828e3287b0b291430940209bc52594 (and its follow-up 2d85b10060c5ea63dc61561407a6f784db8841ef), particularly by this change: - } else - rc= HA_ERR_KEY_NOT_FOUND; + } else { + PGLOBAL g = GetPlug((table) ? table->in_use : NULL, xp); + strcpy(g->Message, "Not supported by this table type"); + my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); + rc= HA_ERR_INTERNAL_ERROR; + } // endif SetRecpos

            People

              bertrandop Olivier Bertrand
              alice Alice Sherepa
              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.