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

SQL query does not appear in case of editing view where definer is not you on MySQL 8 #16194

Closed
Jay04653 opened this issue Jun 15, 2020 · 12 comments
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@Jay04653
Copy link

To Reproduce

Steps to reproduce the behavior:

  1. Create any View by user 1
  2. Login by user 2
  3. Open View for editing
  4. See empty AS text field (SQL query)

Expected behavior

This should be prefilled with original SQL query

Screenshots

image

Server configuration

  • Operating system: 18.04
  • Web server: Apache 2.4
  • Database version: 8.0.19
  • PHP version: 7.4
  • phpMyAdmin version: 5.0.2

Additional context

You can type your query from scratch and it will be overwritten.
Additionally, in the case of definer is removed, it should be overwritten by the current user but currently, it stores the last one.

@williamdes
Copy link
Member

Quite interesting !
Thank you for the report !
MySQL is breaking a lot of things recently 🤔
Confirmed on https://demo.phpmyadmin.net/QA_5_0/view_create.php?db=sakila&table=actor_info

@williamdes williamdes added this to the 5.0.3 milestone Jun 15, 2020
@williamdes williamdes added this to Needs triage in issues via automation Jun 15, 2020
@williamdes williamdes self-assigned this Jun 15, 2020
@williamdes williamdes added the Bug A problem or regression with an existing feature label Jun 15, 2020
@williamdes williamdes moved this from Needs triage to High priority in issues Jun 15, 2020
@williamdes williamdes removed their assignment Jun 22, 2020
@williamdes
Copy link
Member

@shahlin would you want to contribute to this issue ?

@williamdes
Copy link
Member

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html

An incompatibility resulting from this change is that the CREATE VIEW statement can no longer be recreated solely from the INFORMATION_SCHEMA VIEWS table, because the VIEW_DEFINITION value does not show the column name list. Instead, you must also consult the COLUMNS table to get the column name list. Alternatively (and more simply), use SHOW CREATE VIEW. (Bug #23265335, Bug #81377)

Maybe this comment can have some incidence for this issue

@shahlin
Copy link
Contributor

shahlin commented Jun 23, 2020

@williamdes I can give it a try it in about 2 days!

@shahlin
Copy link
Contributor

shahlin commented Jul 10, 2020

@williamdes Has this issue been fixed? Couldn't replicate it on QA_5_0 branch.

Tested on: elementary OS 5.1.2 Hera (Ubuntu 18.04)

@Jay04653
Copy link
Author

@shahlin Nope, the issue has not fixed yet. But it appears on MySQL 8 only.

@williamdes
Copy link
Member

I can confirm that the issue is not fixed @shahlin

@shahlin
Copy link
Contributor

shahlin commented Jul 10, 2020

@williamdes Right, I was testing with an older version of MySQL. Gonna try it again with version 8.0

@shahlin
Copy link
Contributor

shahlin commented Jul 10, 2020

@williamdes What branch should this be in? I had a look at QA_5_0, the file ViewCreateController isn't there whereas it's there in master

@williamdes
Copy link
Member

Hi @shahlin
You should use QA_5_0
I will merge/copy the fix when merging QA_5_0 to master

@shahlin
Copy link
Contributor

shahlin commented Jul 18, 2020

Hey, @williamdes! It's still not in QA_5_0? I don't see libraries/classes/Controllers/ViewCreateController.php

@williamdes
Copy link
Member

Hey, @williamdes! It's still not in QA_5_0? I don't see libraries/classes/Controllers/ViewCreateController.php

Hey @shahlin !
Nevermind about the file, just search for the same occurrence in the codebase, it maybe has been refactored on the master branch.

shahlin added a commit to shahlin/phpmyadmin that referenced this issue Jul 19, 2020
Signed-off-by: Shahlin <shahlin44@gmail.com>
@williamdes williamdes assigned williamdes and unassigned shahlin Jul 23, 2020
@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 Jul 23, 2020
williamdes added a commit that referenced this issue Jul 23, 2020
…ing view where definer is not you on MySQL 8

Pull-request: #16274
Fixes: #16194
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Jul 23, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from High priority to Closed Jul 23, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2021
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 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

3 participants