Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Bugfix: MySqlConnection::GetRowsProcessed() returns correct value after an sql update
Bugfix: MySqlConnection::GetRowsProcessed() returns correct value after an sql update [message #43214] Sun, 08 June 2014 18:58 Go to previous message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
The patch:
---------------------------- uppsrc/MySql/MySql.cpp ----------------------------
index 45bfc43..ee8d848 100644
@@ -361,16 +361,18 @@ bool MySqlConnection::Execute() {
 		lastid = (int)mysql_insert_id(mysql);
 		if(lastid) {
 			SqlColumnInfo& f = info.Add();
 			f.width = f.scale = f.precision = 0;
 			f.binary = false;
 			f.type = DOUBLE_V;
 			f.name = "LAST_INSERT_ID";
 			rows = 1;
+		}else{
+			rows = (int)mysql_affected_rows(mysql);
 		}
 	}
 	return true;
 }
 
 int  MySqlConnection::GetRowsProcessed() const {
 	return rows;
 }
 
Read Message
Read Message
Read Message
Previous Topic: Bugfix: MySql: Missing macros from schema
Next Topic: Sql Avg delivers String instead of double
Goto Forum:
  


Current Time: Sun Apr 28 11:29:25 CEST 2024

Total time taken to generate the page: 0.08238 seconds