[PATCH] Fix query overwrite bug

This is a discussion on [PATCH] Fix query overwrite bug within the mysql forums in Other Databases category; Hi folks, I browsed through the Wishlist and found this item that needed attention. I've only tested this in my own test program, as I don't have Bakefile working yet. But I'm fairly confident this is the correct fix. :-) Patch is in git-format-patch format, but should apply cleanly with any patch. - Chris From 96fc7622889e1fd252de10ef968af2b95762f673 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Wed, 27 Aug 2008 05:18:40 -0400 Subject: [PATCH] Fix query overwrite bug After initializing the stream and setting the streambuf, the stream's position as reported by tellp() ...

Go Back   Database Forum > Other Databases > mysql

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 06:19 AM
Default [PATCH] Fix query overwrite bug

Hi folks,

I browsed through the Wishlist and found this item that needed attention.
I've only tested this in my own test program, as I don't have Bakefile
working yet. But I'm fairly confident this is the correct fix. :-)

Patch is in git-format-patch format, but should apply cleanly with any patch.

- Chris


From 96fc7622889e1fd252de10ef968af2b95762f673 Mon Sep 17 00:00:00 2001
From: Chris Frey
Date: Wed, 27 Aug 2008 05:18:40 -0400
Subject: [PATCH] Fix query overwrite bug

After initializing the stream and setting the streambuf, the stream's
position as reported by tellp() is 0. So seek to the end, so any further
operator<<() operations will work as expected.
---
lib/query.cpp | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/query.cpp b/lib/query.cpp
index 3824d77..5f0537a 100644
--- a/lib/query.cpp
+++ b/lib/query.cpp
@@ -47,6 +47,7 @@ copacetic_(true)
init(&sbuffer_);
if (qstr) {
sbuffer_.str(qstr);
+ seekp(0, std::ios::end);
}
}

--
1.5.4.4


--
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 08-27-2008, 03:24 PM
Default Re: [PATCH] Fix query overwrite bug

Chris Frey wrote:
>
> I browsed through the Wishlist and found this item that needed attention.


Thanks, it's applied!

--
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



All times are GMT -4. The time now is 06:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.