4 messages in com.mysql.lists.plusplusRe: Mismatch between query results an...
FromSent OnAttachments
Drew M.06 Dec 2007 23:47 
Warren Young07 Dec 2007 15:37 
Drew M.10 Dec 2007 01:08 
Warren Young10 Dec 2007 19:58 
Subject:Re: Mismatch between query results and SSQLS column count
From:Warren Young (mysq@etr-usa.com)
Date:12/07/2007 03:37:02 PM
List:com.mysql.lists.plusplus

Drew M. wrote:

I had a strange issue that I eventually tracked down to a mismatch between the number of columns included in the results of a select query and the number of columns my SSQLS structure expected.

This problem is touched upon (obliquely) in the user manual: http://tangentsoft.net/mysql++/doc/html/userman/ssqls.html#id2899055

One idea I have to catch this at run-time would be to assert that the number of columns in a result set matched the size of the ssqls structure

No, this just replaces one form of rigidity with another.

What I had planned for SSQLSv2 is that it would populate fields based on name, not position in the Row object. Row already knows how to look up fields by name, so this is no big trick.

This has many benefits in addition to solving your particular problem. See the repository version of the Wishlist for the current plan:

http://svn.gna.org/viewcvs/*checkout*/mysqlpp/trunk/Wishlist

(It's down in the "v3.1 Tentative Plan" section.)

This can be done in the context of the current implementation of SSQLS; it doesn't have to wait for SSQLS v2. I only made it part of v2 because this release cycle has dragged on long enough already. If a patch happened to appear (*cough* *cough*) before I freeze MySQL++ v3.0, I'd be rather likely to accept it, or at least riff on it.