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
6c1c27ea
Commit
6c1c27ea
authored
Sep 15, 2016
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't increment 'Empty_queries' for queries with errors.
parent
7ca60dd8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
mysql-test/r/empty_table.result
mysql-test/r/empty_table.result
+8
-0
mysql-test/t/empty_table.test
mysql-test/t/empty_table.test
+9
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
mysql-test/r/empty_table.result
View file @
6c1c27ea
...
...
@@ -7,4 +7,12 @@ select * from t1;
nr b str
select * from t1 limit 0;
nr b str
show status like "Empty_queries";
Variable_name Value
Empty_queries 2
drop table t1;
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
show status like "Empty_queries";
Variable_name Value
Empty_queries 2
mysql-test/t/empty_table.test
View file @
6c1c27ea
...
...
@@ -10,6 +10,15 @@ create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary
select
count
(
*
)
from
t1
;
select
*
from
t1
;
select
*
from
t1
limit
0
;
show
status
like
"Empty_queries"
;
drop
table
t1
;
#
# Accessing a non existing table should not increase Empty_queries
#
--
error
1146
select
*
from
t2
;
show
status
like
"Empty_queries"
;
# End of 4.1 tests
sql/sql_parse.cc
View file @
6c1c27ea
...
...
@@ -6359,7 +6359,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
}
}
/* Count number of empty select queries */
if
(
!
thd
->
get_sent_row_count
())
if
(
!
thd
->
get_sent_row_count
()
&&
!
res
)
status_var_increment
(
thd
->
status_var
.
empty_queries
);
else
status_var_add
(
thd
->
status_var
.
rows_sent
,
thd
->
get_sent_row_count
());
...
...
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