summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-05-14 09:28:51 +0400
committerAlexander Nozdrin <alik@sun.com>2010-05-14 09:28:51 +0400
commit4333980a493e7062e108899b34cc809b03862c34 (patch)
treef19fd6d634984242eb5cb0583cf805e7ec43ebc9 /sql/item_func.cc
parentf9101d98b73f8353bc1de0959c6a1a35a91a9f7b (diff)
downloadmariadb-git-4333980a493e7062e108899b34cc809b03862c34.tar.gz
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.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 4d0dec25e64..26c802b8057 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -6030,7 +6030,7 @@ longlong Item_func_row_count::val_int()
DBUG_ASSERT(fixed == 1);
THD *thd= current_thd;
- return thd->row_count_func;
+ return thd->get_row_count_func();
}