Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
86beb208
Commit
86beb208
authored
Nov 23, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix result of ROW_COUNT() after 'EXECUTE prepstmt'. (Bug #14956)
parent
15df2c22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
mysql-test/r/ps.result
mysql-test/r/ps.result
+7
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+12
-0
sql/sql_parse.cc
sql/sql_parse.cc
+8
-4
No files found.
mysql-test/r/ps.result
View file @
86beb208
...
...
@@ -806,3 +806,10 @@ execute stmt;
@@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;
mysql-test/t/ps.test
View file @
86beb208
...
...
@@ -843,3 +843,15 @@ execute stmt;
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
sql/sql_parse.cc
View file @
86beb208
...
...
@@ -4822,11 +4822,15 @@ end_with_restore_list:
/*
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment