dbTalk Databases Forums  

Re: Regarding: Patch: Nullable fields in SQLSS

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


Discuss Re: Regarding: Patch: Nullable fields in SQLSS in the mailing.database.mysql-plusplus forum.



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

Default Re: Regarding: Patch: Nullable fields in SQLSS - 05-11-2006 , 05:57 AM






Ok,

After stepping through the code for a while, I found a call to

strip_all_blanks(strbuf);

in coldata.h:343, ColDta_Tmpl<Str>::conv()

May I ask to what purpose this call is made?
When I stop and think for it a minute and realize
that this same function will be used to convert int's, dates and what
not I can see the use, but for strings.. it makes no sense.

Bug?

Regards,
Andreas


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

Default Re: Regarding: Patch: Nullable fields in SQLSS - 05-11-2006 , 06:13 AM






And finally,

I added a little if-statement to not strip blanks when
converting to std::string. Works for me in this case, see
if it'll blow up in my face in other situations later..

template <class Str> template <class Type>
Type ColData_Tmpl<Str>::conv(Type /* dummy */) const
{
std::string strbuf = buf_;
+ if( typeid(Type) != typeid(std::string) )
- strip_all_blanks(strbuf);
+ strip_all_blanks(strbuf);
size_t len = strbuf.size();
const char* str = strbuf.c_str();


Sorry for the extra noise..

Andreas Stenius skrev:
Quote:
Ok,

After stepping through the code for a while, I found a call to

strip_all_blanks(strbuf);

in coldata.h:343, ColDta_Tmpl<Str>::conv()

May I ask to what purpose this call is made?
When I stop and think for it a minute and realize
that this same function will be used to convert int's, dates and what
not I can see the use, but for strings.. it makes no sense.

Bug?

Regards,
Andreas



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