List:MySQL++« Previous MessageNext Message »
From:David Sward Date:October 1 2004 5:59pm
Subject:RE: Patches for Solaris 2.8 with gcc 3.3.2
View as plain text  
Warren,

Here's another patch, which actually tripped me up for a while due to
issues
with our gcc 3.3.2 installation.  It's no fun when gdb itself dumps core
when
just loading the executable.


*** sql_query.cc        Fri Oct  1 13:50:09 2004
--- /csa/share/build/extern/orig/mysql++-1.7.18/sqlplusint/sql_query.cc
Fri Oct  1 12:52:27 2004
***************
*** 92,99 ****
    SQLQuery *const_this = const_cast<SQLQuery *>(this);
    if (!parsed.empty())
const_this->proc(const_cast<SQLQueryParms&>(p));
    *const_this << std::ends;
!   const std::stringstream* string_this = const_cast<const
SQLQuery*>(const_this);
!   return string_this->str();
  }

  std::string SQLQuery::str(const SQLQueryParms &p, query_reset r) {
--- 92,98 ----
    SQLQuery *const_this = const_cast<SQLQuery *>(this);
    if (!parsed.empty())
const_this->proc(const_cast<SQLQueryParms&>(p));
    *const_this << std::ends;
!   return const_this->str();
  }

  std::string SQLQuery::str(const SQLQueryParms &p, query_reset r) {


Essentially, the const_this->str() call is being routed to the default
for
SQLQuery::str(), which then in turn calls SQLQuery::this(def).  This
sets
up an infinite loop, which eventually blows up the stack.  My original
fix
tried this, which is why I ended up using rdbuf()->str() instead.  The
cast
to std::stringstream was the only way I could think to force the
function
call to go to the parent class's function, while still maintaining the
use
of const_this.  It could be

	std::stringstream::str()

otherwise.

David


-----Original Message-----
From: Sward, David [mailto:dsward@stripped] 
Sent: Friday, October 01, 2004 1:38 PM
To: MySQL++ Mailing List
Subject: RE: Patches for Solaris 2.8 with gcc 3.3.2

Thanks for replying so quickly.  I patched both configure and
configure.in
on the theory of patching everything that was included in the
distribution.

With the pcount() changes, the goal was to get it working first and
pretty
second.  :)

By the way, you are including some CVS directories in the tarball:

	./doc/CVS
	./doc/man-html/CVS
	./doc/man-text/CVS
	./devel/CVS

David

-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped] 
Sent: Friday, October 01, 2004 1:07 PM
To: MySQL++ Mailing List
Subject: Re: Patches for Solaris 2.8 with gcc 3.3.2

Sward, David wrote:
>  
> 1. configure and configure.in needed quotes around the value assigned
to
> MYSQL_lib_check
> and MYSQL_inc_check, or else the specification of --with-mysql would
> cause this to be
> executed:

For future reference, configure is a generated file, shipped with the 
tarball only for convenience.  You regenerate configure from 
configure.in by running the bootstrap script.

I've applied the change.

> 2. Replaced inclusion of <strstream> with <sstream>.

This was on the Wishlist, but I've been putting off doing it to give 
people a breather before breaking something again.  I guess it's been 
over a month since I've broken something, so it's time.  :)

Ditto for items 3 and 4.

> 5. Replaced call to pcount() with "rdbuf()->str().size()".

That change is avoidable because the whole function boils down to 
something that doesn't need something like pcount() when you use 
stringstream.  Study the code in 1.7.18 when it comes out if this isn't 
clear.

> 6. Removed call to ostrstream::freeze().

Yes, I agree that's not needed, because it returns a copy.

> I don't know whether these changes will cause problems on other
systems.

I've tested them on recent Linuxes, and will release them soon.  Thanks 
for the patches, and for getting me off the dime on the stringstream
issue.


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

Thread
Patches for Solaris 2.8 with gcc 3.3.2David Sward1 Oct
  • Re: Patches for Solaris 2.8 with gcc 3.3.2Warren Young1 Oct
RE: Patches for Solaris 2.8 with gcc 3.3.2David Sward1 Oct
RE: Patches for Solaris 2.8 with gcc 3.3.2David Sward1 Oct
  • Re: Patches for Solaris 2.8 with gcc 3.3.2Warren Young1 Oct