[MCOL-3801] SELECT... LIMIT 0 returns a row Created: 2020-02-18 Updated: 2023-10-25 Resolved: 2023-10-25 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MariaDB Server |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Minor |
| Reporter: | Assen Totin (Inactive) | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Accidentally stumbled onto this while testing some machine-generated SQL with ColumnStore from X4.
As a comparison, with InnoDB:
"SELECT * ... LIMIT 0" is used by the client software as a generic way to determine columns and datatypes. May not be super smart and a bit to the side of how we do things manually, but is generic and works with many databases. ColumnStore should respect the LIMIT 0 properly, because the same stanza can also be seen in "CREATE TABLE AS SELECT... LIMIT 0" (again, we would have probably written just "CREATE TABLE LIKE..." manually) - in whcih case we obviously don't want anything going into the newly created table. I have even seen MaxScale used to automatically append "LIMIT 0" to "CREATE TABLE AS SELECT" to prevent performance-sensitive setups (e.g., a Galera cluster) from being hosed for hours by such a query. |