List:MySQL++« Previous MessageNext Message »
From:James Vanns Date:February 13 2007 10:12am
Subject:Affected rows not reported in 2.1 or 2.2?
View as plain text  
This doesn't work, or to be precise doesn't tell me the true no. of affected rows:

The server is 5.0.22 and the problem arises using either MySQL++ 2.1 or 2.2. The statement
is a 'multi query' but consists of either use, create, insert, update or delete commands -
no selects.

Because of the multi query I have to use this kind of loop:

Query query = m_db->query ();
query << "use db_name;delete from table_name where..."

for (Result result = () ; query.more_results () ; result = query.store_next
   if (query.success ())
      results += m_db->affected_rows (); // Always 0!

Even though I really want to use execute() so I can check the returned ResNSel object - I
can't because these are multi-statements.

Shouldn't affected rows be working here? As I said - it (affected_rows) doesn't appear to
work when anything is prepended by a use db_statement. Neither does calling the num_rows
method of Result.

Anyone else had this? Or does anyone else have any recommendations - I've tried a myriad
of things now whilst checking the reference manual and user guide.

Jim Vanns

James Vanns
Systems Programmer
Framestore CFC Ltd.

MySQL++ Mailing List
For list archives:
To unsubscribe:

James Vanns
Systems Programmer
Framestore CFC Ltd.

2.2/2.1 bug?James Vanns5 Feb
  • Affected rows not reported in 2.1 or 2.2?James Vanns13 Feb
    • Re: Affected rows not reported in 2.1 or 2.2James Vanns13 Feb