[MDEV-12661] ORDER BY does not always work in ZIP CONNECT tables Created: 2017-05-02  Updated: 2017-05-11  Resolved: 2017-05-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Alice Sherepa Assignee: Olivier Bertrand
Resolution: Duplicate Votes: 0
Labels: connect-engine
Environment:

10.1.22


Attachments: Zip Archive 1.zip     Zip Archive 2.zip    
Issue Links:
Duplicate
is duplicated by MDEV-12651 ORDER BY in DIR CONNECT tables does n... Closed

 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)



 Comments   
Comment by Olivier Bertrand [ 2017-05-04 ]

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.

Comment by Olivier Bertrand [ 2017-05-04 ]

Cannot reproduce.

Comment by Elena Stepanova [ 2017-05-11 ]

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

Generated at Thu Feb 08 07:59:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.