List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 19 2008 6:59pm
Subject:Re: Here goes nothing.
View as plain text  
Rick Gutleber wrote:
> 
> It's the latter.  I'll submit it as a separate patch later.  Of course, 
> the test suite doesn't seem to call this and it's not "silent" like 
> tests are supposed to be.  It's more of an example.  Perhaps it should 
> be moved into examples and called by dtest.  I think it would be a good 
> addition for dtest.  If so, then test/sqlstream.cpp should be moved too.
> Let me know what you think if you'd like me to make any changes.

Let's just keep on the same path, get the patch(es) into a functional 
state, and I can then think about refactoring or moving files around 
then.  I'll be able to make a better decision when I have all the pieces 
in front of me.

>>         stock_vector.push_back(stock(strings[0], strings[1]...);
> 
> I didn't do this because it won't take that line without casts for at 
> least some of those arguments

Probably just stock.sdate.  It's easy to fix: just wrap it in Date().

> I would have expected implicit casts to 
> kick in since the arguments are of type mysqlpp::String.  Am I missing 
> something?

We had implicit conversion from stringish types to Date, DateTime and 
Time in v2, but it conflicted with the SSQLS extensions in v3.

With the SSQLS stuff in place, even the most innocent code would end up 
causing an ambiguous conversion error.  I never did analyze it fully, 
but I believe it's due to the fact that with String and SQLTypeAdapter 
each offering the compiler so many conversion options and so many 
MySQL++ classes taking or returning these types, it's easy to end up 
giving the compiler all the rope it needs to hang itself, allowing 
conversion from anything to anything.  C++ can't cope with that, due to 
the compile-time predictability requirements of its static type system.

If you want to see it yourself, remove the 'explicit' from the ctors in 
these classes, then watch MySQL++ blow up.  Er, I mean, asplode.

We may restore these implicit conversion ctors in v4, if SSQLS v2 fixes 
the core problem, but for now, we have to live with it.
Thread
Re: Here goes nothing.Warren Young17 Nov
  • Re: Here goes nothing.Rick Gutleber19 Nov
    • Re: Here goes nothing.Warren Young19 Nov
      • Re: Here goes nothing.Rick Gutleber19 Nov
        • Re: Here goes nothing.Jonathan Wakely20 Nov
      • Unexpected results with stock (was Re: Here goes nothing.)Rick Gutleber19 Nov
Re: Here goes nothing.Warren Young17 Nov