Bug #15228 | "invalid access to non-static data member" warnings in sql/sql_trigger.cc | ||
---|---|---|---|
Submitted: | 24 Nov 2005 14:54 | Modified: | 2 Nov 2006 14:27 |
Reporter: | Dmitry Lenev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S3 (Non-critical) |
Version: | 5.0.17-bk | OS: | Linux (Linux) |
Assigned to: | Dmitry Lenev | CPU Architecture: | Any |
[24 Nov 2005 14:54]
Dmitry Lenev
[18 Oct 2006 11:25]
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/13856 ChangeSet@1.2238, 2006-10-18 15:28:20+04:00, dlenev@mockturtle.local +3 -0 Proposed fix for bug#15228 "'invalid access to non-static data member' warnings in sql_trigger.cc and sql_view.cc". According to the current version of C++ stnadard offsetof() macro can't be used for non-POD types. So warnings were emitted when we tried to use this macro for TABLE_LIST and Table_triggers_list classes. Note that despite of these warnings it was probably safe thing to do. This fix tries to circumvent this limitation by using dummy instances of these classes (we assume that all instances of those classes has same offsets for same members). This hack should go away once we will refactor File_parser class. Alternative approaches such as disabling this warning for sql_trigger.cc/sql_view.cc or for the whole server were considered less explicit. Also I was unable to find a way to disable particular warning for particular _part_ of file in GCC.
[19 Oct 2006 7:48]
Konstantin Osipov
Approved by email with a comment.
[19 Oct 2006 10:39]
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/13963 ChangeSet@1.2238, 2006-10-19 14:42:22+04:00, dlenev@mockturtle.local +3 -0 Fix for bug#15228 "'invalid access to non-static data member' warnings in sql_trigger.cc and sql_view.cc". According to the current version of C++ stnadard offsetof() macro can't be used for non-POD types. So warnings were emitted when we tried to use this macro for TABLE_LIST and Table_triggers_list classes. Note that despite of these warnings it was probably safe thing to do. This fix tries to circumvent this limitation by using dummy instances of these classes (we assume that all instances of those classes has same offsets for same members). This hack should go away once we will refactor File_parser class. Alternative approaches such as disabling this warning for sql_trigger.cc/sql_view.cc or for the whole server were considered less explicit. Also I was unable to find a way to disable particular warning for particular _part_ of file in GCC.
[20 Oct 2006 11:44]
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/14048 ChangeSet@1.2271, 2006-10-20 15:47:52+04:00, dlenev@mockturtle.local +3 -0 Fix for bug#15228 "'invalid access to non-static data member' warnings in sql_trigger.cc and sql_view.cc". According to the current version of C++ standard offsetof() macro can't be used for non-POD types. So warnings were emitted when we tried to use this macro for TABLE_LIST and Table_triggers_list classes. Note that despite of these warnings it was probably safe thing to do. This fix tries to circumvent this limitation by implementing custom version of offsetof() macro to be used with these classes. This hack should go away once we will refactor File_parser class. Alternative approaches such as disabling this warning for sql_trigger.cc/sql_view.cc or for the whole server were considered less explicit. Also I was unable to find a way to disable particular warning for particular _part_ of file in GCC.
[2 Nov 2006 14:27]
Dmitry Lenev
Fixed in 5.0.29 and 5.1.13 No ChangeLog note required as this bug had no user-visible effects.