Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CROSS JOIN clause is removed on export #15316

Closed
domenk opened this issue Jun 9, 2019 · 4 comments
Closed

CROSS JOIN clause is removed on export #15316

domenk opened this issue Jun 9, 2019 · 4 comments
Assignees
Labels
Bug A problem or regression with an existing feature duplicate has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@domenk
Copy link
Contributor

domenk commented Jun 9, 2019

Describe the bug

CROSS JOIN clause is removed from the query when trying to export query results to CSV, CSV for MS Excel or OpenDocument Spreadsheet (I haven't tested the other formats). Consequently query fails.

To Reproduce

  1. Create a table:
CREATE TABLE `crossjoin_test` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
);
  1. Insert some rows:
INSERT INTO `crossjoin_test` (`id`) VALUES (NULL), (NULL), (NULL);
  1. Run query with CROSS JOIN:
SELECT * FROM `crossjoin_test` AS `t1` CROSS JOIN `crossjoin_test` AS `t2` WHERE `t1`.`id` > 1 AND `t2`.`id` > 1;
  1. Export query results in CSV, CSV for MS Excel or OpenDocument Spreadsheet format.

  2. Exported file (in any of the mentioned formats) contains HTML code for the error. Error mentions that the query is:

SELECT * FROM `crossjoin_test` WHERE crossjoin_test.`id` > 1 AND `t2`.`id` > 1

Expected behavior

Query should not be rewritten and query results should be normally exported.

Server configuration

  • Operating system: Windows
  • Web server: Apache 2.4.39
  • Database version: MySQL 8.0.16
  • PHP version: 7.3.6
  • phpMyAdmin version: 4.9.0.1 (also tested on demo server with master 9102b98)

Additional context

If CROSS JOIN is replaced with INNER JOIN, export works as expected.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Jun 9, 2019
@williamdes williamdes added this to Needs triage in issues via automation Jun 9, 2019
@williamdes williamdes moved this from Needs triage to Reproduced in issues Jun 9, 2019
@williamdes
Copy link
Member

You can also see that the alias is removed, see: #14691

@williamdes
Copy link
Member

@Tithugues Can you have a look at this one if you want?

@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Nov 3, 2019
@williamdes williamdes moved this from Reproduced to ready to merge in issues Nov 10, 2019
@williamdes williamdes self-assigned this Nov 10, 2019
@williamdes williamdes added this to the 4.9.2 milestone Nov 10, 2019
@williamdes
Copy link
Member

Duplicate of #12241

@williamdes williamdes marked this as a duplicate of #12241 Nov 10, 2019
@williamdes
Copy link
Member

Will be fixed as #12241

issues automation moved this from ready to merge to Closed Nov 10, 2019
williamdes added a commit that referenced this issue Nov 10, 2019
…join

Fixes: #12241
Fixes: #15316
Fixes: #14691
Fixes: #13187
Fixes: #14612
Fixes: #13222
Closes: #13296

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Nov 10, 2019
Ref: #14691
Ref: #13187
Ref: #14612
Ref: #13222

Signed-off-by: William Desportes <williamdes@wdes.fr>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature duplicate has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants