Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1958 05/11/23 14:57:26 jimw@stripped +3 -0
Fix result of ROW_COUNT() after 'EXECUTE prepstmt'. (Bug #14956)
sql/sql_parse.cc
1.513 05/11/23 14:57:22 jimw@stripped +8 -4
Don't reset row_count after processing EXECUTE statement.
mysql-test/t/ps.test
1.55 05/11/23 14:57:22 jimw@stripped +12 -0
Add new test
mysql-test/r/ps.result
1.54 05/11/23 14:57:22 jimw@stripped +7 -0
Add new results
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-14956
--- 1.512/sql/sql_parse.cc 2005-11-14 06:41:59 -08:00
+++ 1.513/sql/sql_parse.cc 2005-11-23 14:57:22 -08:00
@@ -4822,11 +4822,15 @@
/*
- The return value for ROW_COUNT() is "implementation dependent" if
- the statement is not DELETE, INSERT or UPDATE (or a CALL executing
- such a statement), but -1 is what JDBC and ODBC wants.
+ The return value for ROW_COUNT() is "implementation dependent" if the
+ statement is not DELETE, INSERT or UPDATE, but -1 is what JDBC and ODBC
+ wants.
+
+ We do not change the value for a CALL or EXECUTE statement, so the value
+ generated by the last called (or executed) statement is preserved.
*/
- if (lex->sql_command != SQLCOM_CALL &&
uc_update_queries[lex->sql_command]<2)
+ if (lex->sql_command != SQLCOM_CALL && lex->sql_command != SQLCOM_EXECUTE
&&
+ uc_update_queries[lex->sql_command]<2)
thd->row_count_func= -1;
goto cleanup;
--- 1.53/mysql-test/r/ps.result 2005-09-08 12:29:51 -07:00
+++ 1.54/mysql-test/r/ps.result 2005-11-23 14:57:22 -08:00
@@ -806,3 +806,10 @@
@@tx_isolation
REPEATABLE-READ
deallocate prepare stmt;
+create table t1 (id int);
+prepare ins_call from "insert into t1 (id) values (1)";
+execute ins_call;
+select row_count();
+row_count()
+1
+drop table t1;
--- 1.54/mysql-test/t/ps.test 2005-09-08 12:29:52 -07:00
+++ 1.55/mysql-test/t/ps.test 2005-11-23 14:57:22 -08:00
@@ -843,3 +843,15 @@
deallocate prepare stmt;
# End of 4.1 tests
+
+#
+# Bug #14956: ROW_COUNT() returns incorrect result after EXECUTE of prepared
+# statement
+#
+create table t1 (id int);
+prepare ins_call from "insert into t1 (id) values (1)";
+execute ins_call;
+select row_count();
+drop table t1;
+
+# End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.0 tree (jimw:1.1958) BUG#14956 | Jim Winstead | 23 Nov |