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
f8d8548a
Commit
f8d8548a
authored
Sep 19, 2005
by
pappa@c-1309e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #13323
Select count(*) returned 2 on empty table where handler used exact count
parent
b6b2ede2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
mysql-test/r/partition.result
mysql-test/r/partition.result
+3
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+5
-0
sql/ha_partition.cc
sql/ha_partition.cc
+9
-2
No files found.
mysql-test/r/partition.result
View file @
f8d8548a
...
...
@@ -5,6 +5,9 @@ b int not null,
c int not null,
primary key(a,b))
partition by key (a);
select count(*) from t1;
count(*)
0
drop table t1;
CREATE TABLE t1 (
a int not null,
...
...
mysql-test/t/partition.test
View file @
f8d8548a
...
...
@@ -18,6 +18,11 @@ c int not null,
primary
key
(
a
,
b
))
partition
by
key
(
a
);
#
# Bug 13323: Select count(*) on empty table returns 2
#
select
count
(
*
)
from
t1
;
drop
table
t1
;
#
# Partition by key no partition, list of fields
...
...
sql/ha_partition.cc
View file @
f8d8548a
...
...
@@ -81,6 +81,9 @@ static handlerton partition_hton = {
NULL
,
/* recover */
NULL
,
/* commit_by_xid */
NULL
,
/* rollback_by_xid */
NULL
,
NULL
,
NULL
,
HTON_NO_FLAGS
};
...
...
@@ -2305,9 +2308,13 @@ void ha_partition::info(uint flag)
if
(
file
->
check_time
>
check_time
)
check_time
=
file
->
check_time
;
}
while
(
*
(
++
file_array
));
if
(
records
<
2
)
if
(
records
<
2
&&
m_table_flags
&
HA_NOT_EXACT_COUNT
)
records
=
2
;
if
(
records
>
0
)
mean_rec_length
=
(
ulong
)
(
data_file_length
/
records
);
else
mean_rec_length
=
1
;
//? What should we set here
}
if
(
flag
&
HA_STATUS_CONST
)
{
...
...
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