dbTalk Databases Forums  

MySQL++: Result()/ResUse() copy constructor

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


Discuss MySQL++: Result()/ResUse() copy constructor in the mailing.database.mysql-plusplus forum.



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

Default MySQL++: Result()/ResUse() copy constructor - 06-22-2006 , 05:01 PM






--------------080505040309020800050409
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,


I have some issues concerning the use of exceptions in the MySQL++ library:


_ISSUE 1:_
When you have exceptions_ = false in Result and you do:

Result a = query.store();
a.disable_exceptions(); // Exceptions disabled...

Result b = a;

Then exceptions are enabled again in 'b'. I understand people might want
to work with exceptions, but is this not a flaw in the design? If a has
exceptions disabled, I would expect b to have them disabled too...


_ISSUE 2:_
If you have a connections where the exceptions are disabled, and you
create a query and stuff... And then you store (like the example above),
the Result you get back have exceptions enabled again... Which is a
little unlogical as well...



Greetings,
Steven

--------------080505040309020800050409--

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: MySQL++: Result()/ResUse() copy constructor - 06-23-2006 , 12:12 AM






Steven Van Ingelgem wrote:
Quote:
Result b = a;

Then exceptions are enabled again in 'b'. I understand people might want
to work with exceptions, but is this not a flaw in the design?
Not a flaw in the design, a flaw in the implementation. Submit a patch,
or wait for it to be fixed. Thanks for the bug report.

Quote:
If you have a connections where the exceptions are disabled, and you
create a query and stuff... And then you store (like the example above),
the Result you get back have exceptions enabled again... Which is a
little unlogical as well...
Yes, the flag is supposed to propagate from any parent to any child that
understands the exception flag. Same advice as above.

--
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
  #3  
Old   
AT
 
Posts: n/a

Default Re: MySQL++: Result()/ResUse() copy constructor - 06-23-2006 , 03:09 PM



--------------080202030601070306040205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,


In a follow-up to my previous mail I hereby submit the patch to get rid
of this behaviour (non-propagation of exception throwing or not).

It was if you got a result that was correct (for example
"INSERT"-result), then other.result_ == 0 -> So it never gets to the
point where you can set the exception throwing...


Greetings,
Steven

--------------080202030601070306040205
Content-Type: text/x-patch;
name="exception_throwing_propagation.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="exception_throwing_propagation.patch"

Index: result.cpp
================================================== =================
--- result.cpp (revision 64)
+++ result.cpp (working copy)
@@ -75,6 +75,8 @@
purge();
}

+ set_exceptions(other.throw_exceptions());
+
if (!other.result_) {
result_ = 0;
types_ = 0;
@@ -83,7 +85,6 @@
return;
}

- set_exceptions(other.throw_exceptions());
result_ = other.result_;
fields_ = Fields(this);



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

Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: MySQL++: Result()/ResUse() copy constructor - 06-26-2006 , 01:31 PM



Steven Van Ingelgem wrote:
Quote:
In a follow-up to my previous mail I hereby submit the patch to get rid
of this behaviour (non-propagation of exception throwing or not).
Thanks for the patch. 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

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.