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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e1182c52
Commit
e1182c52
authored
May 04, 2004
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction of WL#1567: row_count() is -1 following non-insert/update/delete
statements.
parent
296ba0ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/sp.result
mysql-test/r/sp.result
+5
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+2
-0
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+20
-0
No files found.
mysql-test/r/sp.result
View file @
e1182c52
...
...
@@ -823,6 +823,11 @@ delete from t1|
select row_count()|
row_count()
0
select * from t1|
id data
select row_count()|
row_count()
-1
drop procedure rc|
create procedure bug822(a_id char(16), a_data int)
begin
...
...
mysql-test/t/sp.test
View file @
e1182c52
...
...
@@ -947,6 +947,8 @@ delete from t1|
select
row_count
()
|
delete
from
t1
|
select
row_count
()
|
select
*
from
t1
|
select
row_count
()
|
drop
procedure
rc
|
...
...
sql/sql_class.h
View file @
e1182c52
...
...
@@ -829,7 +829,7 @@ class THD :public ilink,
bool
charset_is_system_charset
,
charset_is_collation_connection
;
bool
slow_command
;
ulong
row_count_func
;
/* For the ROW_COUNT() function */
longlong
row_count_func
;
/* For the ROW_COUNT() function */
sp_rcontext
*
spcont
;
// SP runtime context
sp_cache
*
sp_proc_cache
;
sp_cache
*
sp_func_cache
;
...
...
sql/sql_parse.cc
View file @
e1182c52
...
...
@@ -3727,6 +3727,26 @@ mysql_execute_command(THD *thd)
}
thd
->
proc_info
=
"query end"
;
// QQ
/*
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.
*/
switch
(
lex
->
sql_command
)
{
case
SQLCOM_UPDATE
:
case
SQLCOM_UPDATE_MULTI
:
case
SQLCOM_REPLACE
:
case
SQLCOM_INSERT
:
case
SQLCOM_REPLACE_SELECT
:
case
SQLCOM_INSERT_SELECT
:
case
SQLCOM_DELETE
:
case
SQLCOM_DELETE_MULTI
:
case
SQLCOM_CALL
:
break
;
default:
thd
->
row_count_func
=
-
1
;
}
// We end up here if res == 0 and send_ok() has been done,
// or res != 0 and no send_error() has yet been done.
if
(
res
<
0
)
...
...
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