List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:February 15 2008 6:33am
Subject:Re: minor compile-time issue with mysqlpp::null
View as plain text  
Andrej van der Zee wrote:
> First of all, thanks for this release (candidate)! I
> expected more effort for upgrading my project to
> mysqlpp 3.0, but it was done without pain in a few
> hours!

Thanks for the report.

> Where volume is the SSQLS struct:
> 
> sql_create_complete_5(volume, 1, 5,
>   mysqlpp::sql_bigint_unsigned, _volume_id,
> "volume_id",
>   mysqlpp::sql_smallint_unsigned, _session_id,
> "session_id",
>   mysqlpp::Null<mysqlpp::sql_int_unsigned>, _msr_id,
> "msr_id",
>   mysqlpp::Null<mysqlpp::sql_bigint_unsigned>,
> _report_id, "report_id",
>   mysqlpp::sql_varchar, _name, "name"
> );

I see you're already using new MySQL++ features.  Or, were you using the 
Waba Null<T>-for-SSQLS patch against v2.0?

> error: passing ‘const mysqlpp::null_type’ as ‘this’
> argument of ‘mysqlpp::null_type::operator Type() [with
> Type = unsigned int]’ discards qualifiers
> 
> Note that the following construct works perfectly
> fine:
> 
> volume vol(volume_id, session_id, mysqlpp::null,
> report_id, name);

It's clear what it wants.  You just have to declare null_type::operator 
Type() as const.  There's no reason for it to be any other way.  Good 
thing you caught it when you did, though: the fix breaks the ABI, so it 
might not have been possible to fix it after release.
Thread
minor compile-time issue with mysqlpp::nullAndrej van der Zee15 Feb
  • Re: minor compile-time issue with mysqlpp::nullWarren Young15 Feb
    • Re: minor compile-time issue with mysqlpp::nullAndrej van der Zee15 Feb
      • Re: minor compile-time issue with mysqlpp::nullWarren Young15 Feb
        • Re: minor compile-time issue with mysqlpp::nullAndrej van der Zee17 Feb
          • Re: minor compile-time issue with mysqlpp::nullWarren Young19 Feb