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

Add support for WITH clause (enhancement for syntax highlighter) #331

Closed
stevenwdv opened this issue Aug 25, 2017 · 10 comments · Fixed by #334
Closed

Add support for WITH clause (enhancement for syntax highlighter) #331

stevenwdv opened this issue Aug 25, 2017 · 10 comments · Fixed by #334
Assignees
Milestone

Comments

@stevenwdv
Copy link
Contributor

Currently the SQL syntax highlighter marks the WITH keyword as Unrecognized statement type.
MariaDB supports a WITH clause in combination with a SELECT statement since version 10.2.1 (stable=10.2.8), see https://mariadb.com/kb/en/the-mariadb-library/with/

phpMyAdmin version: 4.7.4

Sort of relates to phpmyadmin/phpmyadmin#13615 (but not really)

@ibennetch
Copy link
Member

'WITH' will also be a part of MySQL beginning with 8.0 [1] [2] [3]

@ibennetch
Copy link
Member

ibennetch commented Aug 26, 2017

I opened a bug against sql-parser for this: #165

@stevenwdv
Copy link
Contributor Author

@ibennetch Ah, I looked at the MySQL 8.0 SELECT syntax but apparently it wasn't updated yet to include WITH. Sorry for reporting the bug in the wrong location!

@ibennetch
Copy link
Member

@stevenwdv No need to be sorry, this is great. I appreciate you taking the time to let us know about it. And since MySQL 8 is still under heavy development it's not surprising that the docs didn't have that section. Sometimes I can be a bit concise and I'm just adding some information I found during my research of your report.

No one would know to report anything to sql-parser; since it's bundled in the distribution it really just looks like part of phpMyAdmin. We appreciate your report!

@stevenwdv
Copy link
Contributor Author

@ibennetch I didn't interpret your previous comments as concise, but thanks for your nice reaction! I think i came across phpmyadmin/sql-parser some time ago, but I indeed forgot about it.

@williamdes williamdes transferred this issue from phpmyadmin/phpmyadmin Feb 14, 2021
@williamdes
Copy link
Member

Related to #165

@sturtevant
Copy link

sturtevant commented Mar 5, 2021

I believe this issue is also disrupting the way phpMyAdmin result pagination works. Any query using a CTE ("WITH" clause) will return all results to the browser (even while the interface says "Showing rows 0 - 24"). This typically results in an HTTP timeout for large tables / queries.

To reproduce (any table of sufficient length will do):

SELECT id FROM mytable; -- pagination works for this query

WITH my_cte AS ( SELECT id FROM mytable ) SELECT id FROM my_cte; -- pagination doesn't work (all rows returned)

@soyuka
Copy link
Contributor

soyuka commented Mar 10, 2021

Can we close this one as duplicate from #165 ?

@williamdes
Copy link
Member

Can we close this one as duplicate from #165 ?

Now that a PR is done I would say this one can stay open

@williamdes williamdes self-assigned this May 16, 2021
@williamdes williamdes added this to the 5.5.0 milestone May 16, 2021
williamdes added a commit that referenced this issue May 16, 2021
Pull-request: #334
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

This will be part of 5.5.0
Implemented in: #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants