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

Analyze Explain at mariadb.org doesn't have a redirect link #17006

Closed
liviuconcioiu opened this issue Jul 11, 2021 · 7 comments
Closed

Analyze Explain at mariadb.org doesn't have a redirect link #17006

liviuconcioiu opened this issue Jul 11, 2021 · 7 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@liviuconcioiu
Copy link
Contributor

Describe the bug

Analyze Explain at mariadb.org doesn't work as expected.

For simple queries like EXPLAIN SELECT actor_id FROM sakila.actor works.

For complex queries like EXPLAIN SELECT actor_id AS actor_id, (SELECT first_name FROM sakila.actor WHERE actor_id = actor_id ORDER BY actor_id DESC LIMIT 1) AS first_name FROM sakila.actor GROUP BY actor_id it doesn't work. The supposed redirect link is empty.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://demo.phpmyadmin.net/QA_5_1/index.php?route=/sql&db=sakila&table=actor
  2. Execute this query EXPLAIN SELECT actor_id AS actor_id, (SELECT first_name FROM sakila.actor WHERE actor_id = actor_id ORDER BY actor_id DESC LIMIT 1) AS first_name FROM sakila.actor GROUP BY actor_id
  3. Hover the mouse or click on Analyze Explain at mariadb.org
  4. See error

Expected behavior

It should be redirected to mariadb.org with the query.

Screenshots

mariadb

Client configuration

  • Browser: Firefox
  • Operating system: Windows
@williamdes
Copy link
Member

Thank you!
I was trying to reproduce it after seeing it in production and I could not

Bug confirmed, seems like the url is wrong for some reason

@williamdes williamdes added the Bug A problem or regression with an existing feature label Jul 12, 2021
@williamdes williamdes added this to Needs triage in issues via automation Jul 12, 2021
@iifawzi
Copy link
Contributor

iifawzi commented Jul 13, 2021

Thank you!
I was trying to reproduce it after seeing it in production and I could not

Bug confirmed, seems like the url is wrong for some reason

I'm trying to fix this, but I'm not able to reproduce it, is it sometime work and sometime not? @williamdes
I've tested with the same steps mentioned above, it works.
image

the exception is that i'm using mac, but It doesn't matter I think.

@liviuconcioiu
Copy link
Contributor Author

liviuconcioiu commented Jul 14, 2021

I'm trying to fix this, but I'm not able to reproduce it, is it sometime work and sometime not?

Hi @iifawzi , you can't reproduce it, because you've selected the MariaDB. You have &server=1 in url. This can be reproduced on MySQL only.

@iifawzi
Copy link
Contributor

iifawzi commented Jul 14, 2021

I've found that the cause of the error is this check

if (
($urlLength > $GLOBALS['cfg']['LinkLengthLimit'])

The maximum is set to 1000:

/**
* Limit for length of URL in links. When length would be above this limit, it
* is replaced by form with button.
* This is required as some web servers (IIS) have problems with long URLs.
* The recommended limit is 2000
* (see https://www.boutell.com/newfaq/misc/urllength.html) but we put
* 1000 to accommodate Suhosin, see bug #3358750.
*/
$cfg['LinkLengthLimit'] = 1000;

I've tested with 2000 and it worked, but I couldn't find any details about the mentioned bug to take a look. @williamdes

@williamdes
Copy link
Member

Thank you all for your comments and work !
I will try to search once more to fix this issue

@williamdes
Copy link
Member

I could confirm the bug by changing

EXPLAIN SELECT actor_id AS actor_id, (SELECT first_name FROM sakila.actor WHERE actor_id = actor_id ORDER BY actor_id DESC LIMIT 1) AS first_name FROM sakila.actor GROUP BY actor_id;

into

EXPLAIN SELECT actor_id AS actor_id, (SELECT first_name FROM sakila.actor WHERE actor_id = actor_id ORDER BY actor_id DESC LIMIT 1) AS first_name, (SELECT first_name FROM sakila.actor WHERE actor_id = actor_id ORDER BY actor_id DESC LIMIT 1) AS first_name2 FROM sakila.actor GROUP BY actor_id;

(just adding more length)

@williamdes
Copy link
Member

williamdes commented Jul 15, 2021

We could probably use https://mariadb.com/kb/en/explain-analyzer-api/
Edit: it seems to just redirect to the website

williamdes added a commit that referenced this issue Jul 15, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes self-assigned this Jul 15, 2021
@williamdes williamdes added this to the 5.1.2 milestone Jul 15, 2021
issues automation moved this from Needs triage to Closed Jul 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2022
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
Projects
issues
  
Closed
Development

No branches or pull requests

3 participants