List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 18 2007 7:42am
Subject:Re: Patch: Nullable fields in SQLSS
View as plain text  
David A. Betz wrote:
> 
> I did not find mention in "8. Incompatible Library Changes" that the Query::success
> method had been obsoleted in favor of operator bool ().

I don't change that chapter until shortly before making a public 
release, whether beta or final.  Same for the ChangeLog.  I do it this 
way because I synthesize a narrative for these documents from the svn 
log, to make them easier to understand.  I need all the details in front 
of me to produce this higher-level picture.

Unfortunately, the only place to get a list of what's changed at the 
moment is by reading through the raw svn commit log.  Better to just fix 
'em as you find 'em.

> When using the patched version of mysql++, I was writing
> 
> 	row["assigned_staff_nid"].get_null<int,mysqlpp::NullisNull>()
> 
> Am I correct that with the svn version this becomes simply
> 
> 	row["assigned_staff_nid"]
> 
> and that this returns a mysqlpp::Null< Type, Behavior >::Null ?

Kind of, yes.

Row::operator[] doesn't return Null<T>.  What it does return is a 
mysqlpp::String.  (The Class Formerly Known As ColData (TM))  That class 
has a bunch of implicit conversion operators on it, one of which is 
Null<T, B>(), so this *should* work:

	Null<sql_mediumint> my_val = row["some_column"];

Whether it actually does work or not depends on how happy that code 
makes the compiler, because C++ only allows one layer of conversion.  If 
the compiler can't figure out how to get from mysqlpp::String to your 
desired data type with a single conversion, it will emit a veritable 
geyser of error messages in its state of discombobulation.

Case studies and snippets testing this, both positive and negative, are 
welcome.
Thread
Patch: Nullable fields in SQLSSWaba4 Feb
  • Re: Patch: Nullable fields in SQLSSChris Frey4 Feb
    • Re: Patch: Nullable fields in SQLSSWaba4 Feb
  • Re: Patch: Nullable fields in SQLSSWarren Young6 Feb
  • Re: Patch: Nullable fields in SQLSSWarren Young5 Nov
Re: Patch: Nullable fields in SQLSSddneilson7 Nov
  • Re: Patch: Nullable fields in SQLSSWarren Young7 Nov
Re: Patch: Nullable fields in SQLSSDavid A. Betz14 Nov
  • Re: Patch: Nullable fields in SQLSSWarren Young14 Nov
Re: Patch: Nullable fields in SQLSSDavid A. Betz17 Nov
  • Re: Patch: Nullable fields in SQLSSWarren Young18 Nov