dbTalk Databases Forums  

Re: A couple of patches

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Re: A couple of patches in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Warren Young
 
Posts: n/a

Default Re: A couple of patches - 12-22-2006 , 08:05 AM






Matt Dargavel wrote:
Quote:
The const_string.h one undefines min and defines NOMINMAX. An
alternative to this is to define NOMINMAX in the bakefile project
creation, but this doesn’t fix problems when people include
const_string.h in their projects.

The README patch adds a little extra info.

The query.ccp patch presents the alternative solution
for the memory leak, that we talked about some time ago.
Sorry for the delay in getting back to you on this. I just set it aside
for consideration, and only later realized that the patches aren't
actually attached.

Don't bother with the min/max one. I know what's going on there, and am
taking that up separately.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Matt Dargavel
 
Posts: n/a

Default RE: A couple of patches - 12-22-2006 , 10:23 AM






------=_NextPart_000_0035_01C725E5.5A189F10
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

No worries about the delay- took me long enough to get them done! :-)
According to my sent items the patches were there, but here's the query
patch and README patch again. Let me know if they don't arrive. These
patches are based on today's svn, although I don't think they've changed
from the last lot.

Merry Christmas!

Matt.


Quote:
-----Original Message-----
From: Warren Young [mailto:mysqlpp (AT) etr-usa (DOT) com]
Sent: 22 December 2006 14:05
To: MySQL++ Mailing List
Subject: Re: A couple of patches

Matt Dargavel wrote:

The const_string.h one undefines min and defines NOMINMAX. An
alternative to this is to define NOMINMAX in the bakefile project
creation, but this doesn't fix problems when people include
const_string.h in their projects.

The README patch adds a little extra info.

The query.ccp patch presents the alternative solution
for the memory leak, that we talked about some time ago.

Sorry for the delay in getting back to you on this. I just set it
aside
for consideration, and only later realized that the patches aren't
actually attached.

Don't bother with the min/max one. I know what's going on there, and
am
taking that up separately.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=matt@shout-
telecoms.com

------=_NextPart_000_0035_01C725E5.5A189F10
Content-Type: text/plain; charset=us-ascii


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw
------=_NextPart_000_0035_01C725E5.5A189F10--



Reply With Quote
  #3  
Old   
Matt Dargavel
 
Posts: n/a

Default RE: A couple of patches - 12-22-2006 , 10:36 AM



Hmm, I see- no patches on the delivered message for some reason. Here they
are inline:

README.diff:

Index: C:/Documents and Settings/Matt Dargavel/My
Documents/svn/mysqlpp/README
================================================== =================
--- C:/Documents and Settings/Matt Dargavel/My Documents/svn/mysqlpp/README
(revision 1344)
+++ C:/Documents and Settings/Matt Dargavel/My Documents/svn/mysqlpp/README
(working copy)
@@ -64,6 +64,9 @@
which has licensing ramifications. See README.mingw
for details.

+ To get bakefile to create the makefiles necessary for each
+ platform, simply run bakefile_gen in the project root.
+

Example Programs
~~~~~~~~~~~~~~~~


query.ccp.diff:

Index: C:/Documents and Settings/Matt Dargavel/My
Documents/svn/mysqlpp/lib/query.cpp
================================================== =================
--- C:/Documents and Settings/Matt Dargavel/My
Documents/svn/mysqlpp/lib/query.cpp (revision 1344)
+++ C:/Documents and Settings/Matt Dargavel/My
Documents/svn/mysqlpp/lib/query.cpp (working copy)
@@ -31,11 +31,7 @@
namespace mysqlpp {

Query::Query(Connection* c, bool te) :
-#if defined(_MSC_VER)
-std:stream(std::_Noinit), // prevents a double-init memory leak in RTL
-#else
-std:stream(0),
-#endif
+std:stream(&sbuffer_),
OptionalExceptions(te),
Lockable(false),
def(this),
@@ -42,7 +38,6 @@
conn_(c),
success_(false)
{
- init(&sbuffer_);
success_ = true;
}

@@ -47,11 +42,7 @@
}

Query::Query(const Query& q) :
-#if defined(_MSC_VER)
-std:stream(std::_Noinit), // prevents a double-init memory leak in RTL
-#else
-std:stream(0),
-#endif
+std:stream(&sbuffer_),
OptionalExceptions(q.throw_exceptions()),
Lockable(q.locked()),
def(q.def),
@@ -58,7 +49,6 @@
conn_(q.conn_),
success_(q.success_)
{
- init(&sbuffer_);
}



Quote:
-----Original Message-----
From: Matt Dargavel [mailto:matt (AT) shout-telecoms (DOT) com]
Sent: 22 December 2006 16:22
To: plusplus (AT) lists (DOT) mysql.com
Subject: RE: A couple of patches

No worries about the delay- took me long enough to get them done! :-)
According to my sent items the patches were there, but here's the query
patch and README patch again. Let me know if they don't arrive. These
patches are based on today's svn, although I don't think they've
changed from the last lot.

Merry Christmas!

Matt.


-----Original Message-----
From: Warren Young [mailto:mysqlpp (AT) etr-usa (DOT) com]
Sent: 22 December 2006 14:05
To: MySQL++ Mailing List
Subject: Re: A couple of patches

Matt Dargavel wrote:

The const_string.h one undefines min and defines NOMINMAX. An
alternative to this is to define NOMINMAX in the bakefile project
creation, but this doesn't fix problems when people include
const_string.h in their projects.

The README patch adds a little extra info.

The query.ccp patch presents the alternative
solution for the memory leak, that we talked about some time ago.

Sorry for the delay in getting back to you on this. I just set it
aside for consideration, and only later realized that the patches
aren't actually attached.

Don't bother with the min/max one. I know what's going on there, and
am taking that up separately.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=matt@shout-
telecoms.com


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: A couple of patches - 12-22-2006 , 01:32 PM



Matt Dargavel wrote:
Quote:
Hmm, I see- no patches on the delivered message for some reason.
Yeah, they must be getting stripped. Another option you have besides
attaching them is to add them to the patch tracker on gna.org:

https://gna.org/bugs/?func=additem&group=mysqlpp

As soon as you submit something there, I get an email, so you don't have
to mention it on this list unless you want to spark public discussion.

Quote:
+ To get bakefile to create the makefiles necessary for each
+ platform, simply run bakefile_gen in the project root.
No, this isn't right.

First off, bakefile_gen shouldn't ever be run directly. Use the rebake
or bootstrap wrapper scripts instead.

Second, documentation for things like bootstrap belongs in the HACKERS
file, because only people working from svn ever see MySQL++ without any
project or Makefiles present. The README is for the average end user
who doesn't mess around with the MySQL++ build system, because the
distribution packages come with the files they need already. The only
time the average end user will ever care about the build system is if it
breaks, in which case they either need to fix it -- and hence, read the
HACKERS file first -- or submit an error report to the list to be
handled by someone who has read the HACKERS file.

What problem are you trying to solve here? Is it the "I just checked
out from svn and it doesn't work" case? If so, that's handled by
running the bootstrap script, which is already covered in the HACKERS file.

Quote:
Query::Query(Connection* c, bool te) :
-#if defined(_MSC_VER)
-std:stream(std::_Noinit), // prevents a double-init memory leak in RTL
-#else
-std:stream(0),
-#endif
+std:stream(&sbuffer_),
OptionalExceptions(te),
Lockable(false),
def(this),
@@ -42,7 +38,6 @@
conn_(c),
success_(false)
{
- init(&sbuffer_);
I thought we shot this one down because it's technically illegal in C++.
It's not guaranteed that sbuffer_ is initialized before the base class
ctors are called. It may work on current compilers, but what about the
future?

Yes, the current code is ugly. But it's legal, and we know why it works
and thus why it should continue to work.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Matt Dargavel
 
Posts: n/a

Default Re: A couple of patches - 01-02-2007 , 07:37 AM



Quote:
+ To get bakefile to create the makefiles necessary for each +
platform, simply run bakefile_gen in the project root.

No, this isn't right.

First off, bakefile_gen shouldn't ever be run directly. Use the
rebake or bootstrap wrapper scripts instead.

What problem are you trying to solve here? Is it the "I just checked
out from svn and it doesn't work" case? If so, that's handled by
running the bootstrap script, which is already covered in the HACKERS
file.
Sorry, my mistake. When I first downloaded and built MySQL++ a while
ago there was a different procedure to build the project file, I'd never
used bakefile before so I did a quick Google search and the bakefile_gen
script seemed to do everything required.
Quote:
I thought we shot this one down because it's technically illegal in
C++. It's not guaranteed that sbuffer_ is initialized before the base
class ctors are called. It may work on current compilers, but what
about the future?
Yes, I'm not entirely sure of the best way. The reason I suggested this
was:

"Having trawled through the VC++ and gcc std lib source code a bit
more, I think this might be the better solution. Mainly because in the
_Uninitialised::_NoInit constructor in VC++ it calls
ios_base::_Addstd(this) whereas, unless you specify a second param of
true in the other constructor, it doesn't. Unfortunately, I have no
idea what _Addstd does, except that it's "special handling for standard
streams". Also, taking this approach it's the same across platforms,
even if it does rely on all implementations doing nothing with the
pointer you pass in, except for storing it."

Perhaps it's better to leave the current source as it is, and consider
this patch archived in case there's ever a problem with the "special
handling"?

Cheers,

Matt.




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.