![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi, I've noticed a serious bug that was introduced in MySQL++ v2.0.0 when the Query class was changed to derive from std: stream.Per the C++ standard, regardless of the order of statements in a constructor's initialization list, base classes are initialized before the members of the current class are. |
#2
| |||
| |||
|
|
basic_ifstream() : __istream_type(NULL), _M_filebuf() { this->init(&_M_filebuf); } |
#3
| |||
| |||
|
|
Thanks for this bug report and patch! I believe this will affect the ABI, so I'm waiting for Warren's comments. I think a better way to handle this would be to use the protected init() member. Regular streams like fstream and stringstream need to behave the same way as our Query, since they need to controll their own buf objects. For example, they do (from g++ headers): basic_ifstream() : __istream_type(NULL), _M_filebuf() { this->init(&_M_filebuf); } This would prevent a change in the ABI. - Chris |
#4
| |||
| |||
|
|
On Sun, Nov 20, 2005 at 09:08:50PM -0500, Chris Frey wrote: basic_ifstream() : __istream_type(NULL), _M_filebuf() { this->init(&_M_filebuf); } I've commited this style of fix to SVN. Please give it a test on your platform. |
#5
| |||
| |||
|
|
Chris Frey wrote: On Sun, Nov 20, 2005 at 09:08:50PM -0500, Chris Frey wrote: basic_ifstream() : __istream_type(NULL), _M_filebuf() { this->init(&_M_filebuf); } I've commited this style of fix to SVN. Please give it a test on your platform. Thanks for fixing this, Chris, and for reporting it, Kristofer. The only problem with this change is that I prefer using 0 instead of NULL, since they're guaranteed to be the same thing in C++, unlike in C. Just an FYI for any future changes you might make. |
![]() |
| Thread Tools | |
| Display Modes | |
| |