List:MySQL++« Previous MessageNext Message »
From:James Vanns Date:August 10 2007 11:26am
Subject:Re: Using Result, Query::store, Query::store_next and
Connection::opt_multi_statements with INSERT, UPDATE, DELETE etc.
View as plain text  
> As far as the 'affected rows' thing is concerned I'm dead serious.
> Both with this version and the one I used previous (2.1) I can do
> this:
> 
> query << "UPDATE blah;DELETE foo;INSERT whatever;SELECT something";
> 
> run the algorithm previously posted and have 0 rows affected returned
> by Connection::affected_rows(). Running the exact same statements
> through a mysql shell against the same result set - it returns 2 rows
> affected for the update, 1 for delete etc.
> 
> Sometimes it even manages to return UINT_MAX ;) This is on an Intel
> 32-bit Fedora 6 machine. The documentation suggests it returns a type
> of 'my_ulonglong'. This is simply an unsigned long long? Which, on my
> machine would be a ULONG_MAX anyway.
> 
> Reading
> 
> http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html
> 
> is confusing - it says a -1 can be returned even though the type is an
> unsigned integer! Granted this particular caveat isn't the fault of
> MySQL++!

Scratch that - I'm being a dick!! Sorry. First part still stands though (checking for
multi-statement errors).

-- 
James Vanns
Systems Programmer
Framestore CFC Ltd.

Thread
Using Result, Query::store, Query::store_next andConnection::opt_multi_statements with INSERT, UPDATE, DELETE etc.James Vanns9 Aug
  • Re: Using Result, Query::store, Query::store_next and Connection::opt_multi_statementswith INSERT, UPDATE, DELETE etc.Warren Young9 Aug
  • Re: Using Result, Query::store, Query::store_next and Connection::opt_multi_statementswith INSERT, UPDATE, DELETE etc.Warren Young9 Aug
    • Re: Using Result, Query::store, Query::store_next andConnection::opt_multi_statements with INSERT, UPDATE, DELETE etc.James Vanns10 Aug
      • Re: Using Result, Query::store, Query::store_next andConnection::opt_multi_statements with INSERT, UPDATE, DELETE etc.James Vanns10 Aug
      • Re: Using Result, Query::store, Query::store_next and Connection::opt_multi_statementswith INSERT, UPDATE, DELETE etc.Warren Young10 Aug