From: Jim Winstead Date: November 16 2005 2:16am Subject: bk commit into 5.0 tree (jimw:1.1958) BUG#14956 List-Archive: http://lists.mysql.com/internals/32296 X-Bug: 14956 Message-Id: <20051116021624.03685A9296@rama.trainedmonkey.com> 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/15 18:16:19 jimw@stripped +3 -0 Fix result of ROW_COUNT() after 'EXECUTE prepstmt'. (Bug #14956) sql/sql_parse.cc 1.513 05/11/15 18:16:15 jimw@stripped +2 -1 Don't reset row_count after processing EXECUTE statement. mysql-test/t/ps.test 1.55 05/11/15 18:16:15 jimw@stripped +12 -0 Add new test mysql-test/r/ps.result 1.54 05/11/15 18:16:15 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-15 18:16:15 -08:00 @@ -4826,7 +4826,8 @@ the statement is not DELETE, INSERT or UPDATE (or a CALL executing such a statement), but -1 is what JDBC and ODBC wants. */ - 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-15 18:16:15 -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-15 18:16:15 -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