Bug #100284 | Querying a VIEW fails unless there is a default database | ||
---|---|---|---|
Submitted: | 22 Jul 2020 8:07 | Modified: | 23 Jul 2020 12:29 |
Reporter: | Niranjan R | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.7.16, 5.7.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Deafult database, Views |
[22 Jul 2020 8:07]
Niranjan R
[22 Jul 2020 12:52]
MySQL Verification Team
Hi Mr. R, Thank you for your bug report. From what I can see, you have a table with the same name as the view. Am I correct or not ??? Also, do you have that schema `northwind` with that table and is your filesystem case sensitive or not ??? If it is , is the case of the schema title correct ????? You have concluded that this is fixed in MySQL 8.0. Hence, we will also have to check whether this is fixable in 5.7 as well. Your feedback is truly welcome.
[22 Jul 2020 15:20]
Niranjan R
== From what I can see, you have a table with the same name as the view. Am I correct or not ??? >> No. I do not have a table name with the same name as the view. View name : "testview" I do not have any table with the same name. == do you have that schema `northwind` with that table? >> Like i told, schema does not have the table. It has other tables, using which I have created a VIEW named "testview" == is your filesystem case sensitive or not? >> It is not case sensitive. That being said, the case of the schema title is indeed correct. == You have concluded that this is fixed in MySQL 8.0 >> just to re-iterate, the issue persists in 8.0.11, and is fixed in 8.0.13 and above == If my repro steps aren't clear, then just to put it in simple words, create a view with derived tables. I hope this answers all your queries. Let me know if you need more information. I'm okay to attach the SQL script.
[23 Jul 2020 12:29]
MySQL Verification Team
HI Mr. R, I have managed to reproduce your test case, but only on 5.7. Verified as reported.
[23 Jul 2020 13:07]
MySQL Verification Team
Changing category.
[8 Nov 2021 12:04]
Najam Saqib
I want to ask that whether this issue has been fixed or not and if fixed than in which version of MySql 5.7. Currently I am using 5.7.33 and getting this error while updating MySql to 8.0.26. I am using AWS RDS to update MySql and their routine exists with following error log. Issues reported by 'check table x for upgrade' command barfeemart.180_day_retention - No database selected barfeemart.30_day_repurchase_rate - No database selected barfeemart.30_day_repurchase_rate - Corrupt Regards
[8 Nov 2021 12:40]
MySQL Verification Team
Hi Mr. Saqib, Whenever some bug report is in the "Verified" state, it means that it has not been fixed, unless by fixing some other bug report. Hence, you can easily check it by using the latest 5.7 release, which is 5.7.36. Otherwise, you will have to wait that this bug report changes its status to "Closed".
[8 Nov 2021 12:40]
MySQL Verification Team
Needless to say, the workaround for this bug is very easy, which is why this bug is not a high priority one.
[8 Nov 2021 13:34]
Najam Saqib
Can you please tell me the workaround, I can only recall that we can drop views and then create again, may be I am missing some thing. Regards
[8 Nov 2021 13:47]
MySQL Verification Team
Your user should be logged in and using any of the existing schemas, for which the user has privileges.
[26 May 2023 9:22]
Sai Kumar G
I have the same issue while upgrading AWS RDS MySQL version from 5.7 to 8.0 through Cloud Formation template. Could you please provide a fix for this?
[26 May 2023 12:38]
MySQL Verification Team
Hi, Unfortunately, we can not provide a fix , since there is no progress made on this bug. You could do two things. One is to switch to the latest available 5.7 on dev.mysql.com. Second one is to make a backup and try starting 8.0.33, for the upgrade, over that same datadir and see if the bug is fixed there. To our knowledge, this bug is not in the works yet, nor is it known when will it be. Any way, a severity of the bug is quite low. That does not mean that it is , may be, fixed by a patch for some other bug.