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
libraries/classes/Display/Results.php not guarding against null metadata in getHeaderTablesForColumns #17046
Comments
|
After experimenting further, I looked at the 'column visibility' drop-down menu, and only those first two columns were selected, so (even though I don't know how the others got turned off) it appears that the headers were properly following the selections, while the column data was not. So, somehow, the column visibility metadata can get into a strange state where the data columns are still viewable while the headers are not. |
|
I got the same error, and the only thing I did different was swapping two columns in the browsing view. Now I can't fix it. Edit: I swapped back the column but the error continues, so I guess that was not it.. |
|
Hi @sparcbr |
|
This error only occurs if I use a join: |
|
I couldn't log to the demo server with the credentials provided (root without a password). Tried both 5.1.x-dev and 5.2.0-dev |
|
I couldn't either. I'm going to try sparcbr's suggestion about changing the order of columns (because I think I was also doing that before this issue happened), and, if I can replicate the issue, I'll post a SQL file with some specific instructions on how to make the problem happen. |
|
@sparcbr I have fixed the demo server. Thanks for pointing out that there was a problem. |
Can you try limiting your columns (instead of "SELECT *", if that's what you're doing) to just a single one, and see if you can gradually add more columns? |
|
Hi @sparcbr I truly believe there is a bug give the traces that where sent here, but I can not figure out how to reproduce this I could push a fix but this would not cover all the other possible cases in our code base :) |
Signed-off-by: William Desportes <williamdes@wdes.fr>
|
I pushed 8f4514c to remove the error, can someone confirm that it also works fine ? |
Describe the bug
I was getting a red popup about a 500 error when trying to browse just a certain table in a certain db. I eventually tracked it down to this in the logs:
It looks like, in getHeaderTablesForColumns, $fields_meta is fetched, and there's no subsequent guard against fields being null (in this case ->name field being null for one of the entries).
As an experiment, I cloned the table, and phpmyadmin does fine with the cloned table.
Here's where things got weird. Suspecting the problem was with a particular table column, I started trying "SELECT col1 FROM ...", then "SELECT col1, col2 FROM ...", etc. expecting to eventually include a column to make it crash. In fact, I was able to enumerate all of the columns without encountering an error. And then I was able to do a regular browse of the table (no more red popup). Now, however, I'm only being shown the first two column headers.
To Reproduce
I'm not sure what metadata is causing this. From looking through the functions along the stack trace, I suspect that the original cause was a preference (like default sort column?) referencing a column that was no longer there. This bug happened sometime around when I upgraded from PHP 7.2 to 7.4 but and did some table alterations.
My next diagnostic step would be to delete as many of the preferences referencing the table that I can find in the pma_* tables, but I wanted to hold off on that in case the engineers want me to test something else, first.
Expected behavior
One clicks on a table name and sees the rows and columns. Even after I got this to happen, many of the column headers were missing.
Screenshots
Server configuration
CentOS 7
MariaDB 10.5.11
PHP 7.4.22
Apache 2.4.6
phpMyAdmin 5.1.1
Client configuration
Chrome 92.0.4515.107
MacOS 11.4 (Intel)
The text was updated successfully, but these errors were encountered: