Bug #46019 | ERROR 1356 When selecting from within another view that has Group By | ||
---|---|---|---|
Submitted: | 7 Jul 2009 19:21 | Modified: | 20 Dec 2009 0:50 |
Reporter: | Reza Rahmaty | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Views | Severity: | S3 (Non-critical) |
Version: | 5.1.35, 5.0, 5.1, 5.4 bzr | OS: | Linux (Fedora Core 11) |
Assigned to: | Martin Hansson | CPU Architecture: | Any |
Tags: | Aggregate Function, create view, GROUP BY, regression |
[7 Jul 2009 19:21]
Reza Rahmaty
[8 Jul 2009 7:08]
Sveta Smirnova
Thank you for the report. Verified as described. Bug was introduced after version 5.1.9
[14 Jul 2009 9:44]
Sveta Smirnova
test case
Attachment: bug46019.test (application/octet-stream, text), 2.50 KiB.
[14 Jul 2009 9:46]
Sveta Smirnova
log file
Attachment: bug46019.log (application/octet-stream, text), 2.49 KiB.
[14 Jul 2009 9:46]
Sveta Smirnova
Test case failed with: CURRENT_TEST: main.bug46019 mysqltest: At line 69: query 'select * from `GeneralLedgerOnly`' failed: 1356: View 'db1.generalledgeronly' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
[14 Jul 2009 16:03]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/78656 2781 Georgi Kodinov 2009-07-14 Bug #46019: ERROR 1356 When selecting from within another view that has Group By Table access rights checking function check_grant() assumed that no view is opened when it's called. This is not true with nested views where the inner view needs materialization. In this case the view is already materialized when check_grant() is called for it. This caused check_grant() to not look for table level grants on the materialized view table. Fixed by checking if a view is already materialized and if it is check table level grants using the original table name (not the ones of the materialized temp table).
[14 Jul 2009 17:09]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/78670 2805 Georgi Kodinov 2009-07-14 Bug #46019: ERROR 1356 When selecting from within another view that has Group By Table access rights checking function check_grant() assumed that no view is opened when it's called. This is not true with nested views where the inner view needs materialization. In this case the view is already materialized when check_grant() is called for it. This caused check_grant() to not look for table level grants on the materialized view table. Fixed by checking if a view is already materialized and if it is check table level grants using the original table name (not the ones of the materialized temp table).
[19 Aug 2009 12:15]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81065 2781 Georgi Kodinov 2009-08-19 Bug #46019: ERROR 1356 When selecting from within another view that has Group By Table access rights checking function check_grant() assumed that no view is opened when it's called. This is not true with nested views where the inner view needs materialization. In this case the view is already materialized when check_grant() is called for it. This caused check_grant() to not look for table level grants on the materialized view table. Fixed by checking if a view is already materialized and if it is check table level grants using the original table name (not the ones of the materialized temp table).
[19 Aug 2009 15:37]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81097 2791 Georgi Kodinov 2009-08-19 Bug #46019: ERROR 1356 When selecting from within another view that has Group By Table access rights checking function check_grant() assumed that no view is opened when it's called. This is not true with nested views where the inner view needs materialization. In this case the view is already materialized when check_grant() is called for it. This caused check_grant() to not look for table level grants on the materialized view table. Fixed by checking if a view is already materialized and if it is check table level grants using the original table name (not the ones of the materialized temp table).
[20 Aug 2009 14:12]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81176 3074 Georgi Kodinov 2009-08-20 [merge] merge of bug #46019 to 5.1-bugteam
[21 Aug 2009 14:11]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81302 2792 Georgi Kodinov 2009-08-21 Revert of the fix for bug #46019.
[21 Aug 2009 14:43]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81309 3077 Georgi Kodinov 2009-08-21 [merge] reverted the fix for bug #46019 from 5.1-bugteam
[1 Sep 2009 14:43]
Martin Hansson
Can't fix this bug until Bug#35996 is fixed.
[2 Sep 2009 10:25]
Bugs System
Pushed into 5.0.86 (revid:joro@sun.com-20090902102337-n5rw8227wwp5cpx8) (version source revid:joro@sun.com-20090821141055-qy0hzbrj0kgkhirs) (merge vers: 5.0.86) (pib:11)
[2 Sep 2009 16:42]
Bugs System
Pushed into 5.1.39 (revid:joro@sun.com-20090902154533-8actmfcsjfqovgsb) (version source revid:joro@sun.com-20090821144148-lo8rbehf04x094bz) (merge vers: 5.1.39) (pib:11)
[14 Sep 2009 16:04]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha) (pib:11)
[30 Sep 2009 11:53]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/85195 3142 Martin Hansson 2009-09-30 Bug#46019: ERROR 1356 When selecting from within another view that has Group By In order to fix bug number 36086 it was necessary to add some hacks in order to make the tangled error handling work as before: Table level access checking was turned off for materialized views since if it were done, the error message would be downgraded to a warning by code that was meant to handle a different scenario, but could not distinguish the two as it explicitly manipulated error messages. It makes more sense to look at the reson for the error and take appropriate action. After view error handling got straightened out by bug number 35996 we don't need the hack anymore and the bug goes away. @ mysql-test/r/view_grant.result Bug#46019: Test result. @ mysql-test/t/view_grant.test Bug#46019: Test case. @ sql/sql_parse.cc Bug#46019: fix.
[1 Oct 2009 5:59]
Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25]
Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25]
Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50]
Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[12 Oct 2009 12:29]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/86569 3142 Martin Hansson 2009-10-12 Bug#46019: ERROR 1356 When selecting from within another view that has Group By When SELECT'ing from a view that mentions another, materialized, view, access was being denied. The issue was resolved by lifting a special case which avoided such access checking in check_single_table_access. In the past, this was necessary since if such a check were performed, the error message would be downgraded to a warning in the case of SHOW CREATE VIEW. The dowgrading of errors was meant to handle only that scenario, but could not distinguish the two as it read only the error messages. The special case was needed in the fix of bug no 36086. Before that, views were confused with derived tables. After bug no 35996 was fixed, the manipulation of errors during SHOW CREATE VIEW execution is not dependent on the actual error messages in the queue, it rather looks at the actual cause of the error and takes appropriate action. Hence the aforementioned special case is now superfluous and the bug is fixed. @ mysql-test/r/view_grant.result Bug#46019: Test result. @ mysql-test/t/view_grant.test Bug#46019: Test case. @ sql/sql_parse.cc Bug#46019: fix.
[12 Oct 2009 12:34]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/86570 3142 Martin Hansson 2009-10-12 Bug#46019: ERROR 1356 When selecting from within another view that has Group By When SELECT'ing from a view that mentions another, materialized, view, access was being denied. The issue was resolved by lifting a special case which avoided such access checking in check_single_table_access. In the past, this was necessary since if such a check were performed, the error message would be downgraded to a warning in the case of SHOW CREATE VIEW. The downgrading of errors was meant to handle only that scenario, but could not distinguish the two as it read only the error messages. The special case was needed in the fix of bug no 36086. Before that, views were confused with derived tables. After bug no 35996 was fixed, the manipulation of errors during SHOW CREATE VIEW execution is not dependent on the actual error messages in the queue, it rather looks at the actual cause of the error and takes appropriate action. Hence the aforementioned special case is now superfluous and the bug is fixed. @ mysql-test/r/view_grant.result Bug#46019: Test result. @ mysql-test/t/view_grant.test Bug#46019: Test case. @ sql/sql_parse.cc Bug#46019: fix.
[13 Oct 2009 9:55]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/86684 3162 Martin Hansson 2009-10-13 [merge] Merge of Bug#46019
[15 Oct 2009 8:38]
Martin Hansson
It appears both reviewers are done.
[16 Oct 2009 11:12]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/87105 3177 Martin Hansson 2009-10-16 Bug#46019: ERROR 1356 When selecting from within another view that has Group By When SELECT'ing from a view that mentions another, materialized, view, access was being denied. The issue was resolved by lifting a special case which avoided such access checking in check_single_table_access. In the past, this was necessary since if such a check were performed, the error message would be downgraded to a warning in the case of SHOW CREATE VIEW. The downgrading of errors was meant to handle only that scenario, but could not distinguish the two as it read only the error messages. The special case was needed in the fix of bug no 36086. Before that, views were confused with derived tables. After bug no 35996 was fixed, the manipulation of errors during SHOW CREATE VIEW execution is not dependent on the actual error messages in the queue, it rather looks at the actual cause of the error and takes appropriate action. Hence the aforementioned special case is now superfluous and the bug is fixed. @ mysql-test/r/view_grant.result Bug#46019: Test result. @ mysql-test/t/view_grant.test Bug#46019: Test case. @ sql/sql_parse.cc Bug#46019: fix.
[16 Oct 2009 11:21]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/87107 3665 Martin Hansson 2009-10-16 [merge] Merge 5.1 -> pe - Bug#46019 - Upmerge a merge changeset - no contents change.
[22 Oct 2009 6:35]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version source revid:alik@sun.com-20091019135554-s1pvptt6i750lfhv) (merge vers: 6.0.14-alpha) (pib:13)
[4 Nov 2009 9:25]
Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source revid:joro@sun.com-20091016131121-z9puhuiqhl2mucfi) (merge vers: 5.1.41) (pib:13)
[11 Nov 2009 7:01]
Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version source revid:alik@sun.com-20091105084806-dalnvu9fkwdfei19) (merge vers: 5.5.0-beta) (pib:13)
[18 Dec 2009 10:32]
Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:48]
Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:03]
Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:18]
Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)