From 4333980a493e7062e108899b34cc809b03862c34 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 14 May 2010 09:28:51 +0400 Subject: Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect for ALTER TABLE, LOAD DATA). ROW_COUNT is now assigned according to the following rules: - In my_ok(): - for DML statements: to the number of affected rows; - for DDL statements: to 0. - In my_eof(): to -1 to indicate that there was a result set. We derive this semantics from the JDBC specification, where int java.sql.Statement.getUpdateCount() is defined to (sic) "return the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned". - In my_error(): to -1 to be compatible with the MySQL C API and MySQL ODBC driver. - For SIGNAL statements: to 0 per WL#2110 specification. Zero is used since that's the "default" value of ROW_COUNT in the diagnostics area. sql/protocol.cc: Fix a typo. sql/sql_class.h: - Introduce THD::get_row_count_func() / THD::set_row_count_func(); - Remove the CF_HAS_ROW_COUNT define sql/sql_parse.cc: CF_HAS_ROW_COUNT was eliminated. --- sql/protocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/protocol.cc') diff --git a/sql/protocol.cc b/sql/protocol.cc index e036f255960..fd01e4a8885 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -210,7 +210,7 @@ net_send_ok(THD *thd, NET *net= &thd->net; uchar buff[MYSQL_ERRMSG_SIZE+10],*pos; bool error= FALSE; - DBUG_ENTER("my_ok"); + DBUG_ENTER("net_send_ok"); if (! net->vio) // hack for re-parsing queries { -- cgit v1.2.1