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
ad366845
Commit
ad366845
authored
Dec 01, 2009
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
91c81a16
e7c0d277
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
9 deletions
+60
-9
mysql-test/r/partition_archive.result
mysql-test/r/partition_archive.result
+22
-0
mysql-test/t/partition_archive.test
mysql-test/t/partition_archive.test
+21
-0
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+17
-9
No files found.
mysql-test/r/partition_archive.result
View file @
ad366845
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE PARTITION BY RANGE (TO_DAYS(f1))
(partition p1 values less than (733751),
partition p2 values less than MAXVALUE);
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
190 0
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
190 0
DROP TABLE t1;
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE;
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
8658 0
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
8658 0
DROP TABLE t1;
drop database if exists db99;
drop table if exists t1;
create database db99;
...
...
mysql-test/t/partition_archive.test
View file @
ad366845
...
...
@@ -10,6 +10,27 @@
--
source
include
/
have_partition
.
inc
--
source
include
/
have_archive
.
inc
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
#
# Bug#44622: Using PARTITIONs with ARCHIVE engine reports 0 bytes in i_s.TABLES
#
CREATE
TABLE
t1
(
f1
DATE
NOT
NULL
)
ENGINE
=
ARCHIVE
PARTITION
BY
RANGE
(
TO_DAYS
(
f1
))
(
partition
p1
values
less
than
(
733751
),
partition
p2
values
less
than
MAXVALUE
);
INSERT
INTO
t1
VALUES
(
CURRENT_DATE
);
SELECT
DATA_LENGTH
,
INDEX_LENGTH
FROM
information_schema
.
TABLES
WHERE
TABLE_SCHEMA
=
'test'
AND
TABLE_NAME
=
't1'
;
SELECT
DATA_LENGTH
,
INDEX_LENGTH
FROM
information_schema
.
TABLES
WHERE
TABLE_SCHEMA
=
'test'
AND
TABLE_NAME
=
't1'
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
DATE
NOT
NULL
)
ENGINE
=
ARCHIVE
;
INSERT
INTO
t1
VALUES
(
CURRENT_DATE
);
SELECT
DATA_LENGTH
,
INDEX_LENGTH
FROM
information_schema
.
TABLES
WHERE
TABLE_SCHEMA
=
'test'
AND
TABLE_NAME
=
't1'
;
SELECT
DATA_LENGTH
,
INDEX_LENGTH
FROM
information_schema
.
TABLES
WHERE
TABLE_SCHEMA
=
'test'
AND
TABLE_NAME
=
't1'
;
DROP
TABLE
t1
;
#
# Bug 17310 Partitions: Bugs with archived partitioned tables
...
...
storage/archive/ha_archive.cc
View file @
ad366845
...
...
@@ -1489,21 +1489,29 @@ int ha_archive::info(uint flag)
DBUG_PRINT
(
"ha_archive"
,
(
"Stats rows is %d
\n
"
,
(
int
)
stats
.
records
));
/* Costs quite a bit more to get all information */
if
(
flag
&
HA_STATUS_TIME
)
if
(
flag
&
(
HA_STATUS_TIME
|
HA_STATUS_CONST
|
HA_STATUS_VARIABLE
)
)
{
MY_STAT
file_stat
;
// Stat information for the data file
(
void
)
my_stat
(
share
->
data_file_name
,
&
file_stat
,
MYF
(
MY_WME
));
stats
.
data_file_length
=
file_stat
.
st_size
;
stats
.
create_time
=
(
ulong
)
file_stat
.
st_ctime
;
if
(
flag
&
HA_STATUS_TIME
)
stats
.
update_time
=
(
ulong
)
file_stat
.
st_mtime
;
stats
.
mean_rec_length
=
stats
.
records
?
stats
.
data_file_length
/
stats
.
records
:
table
->
s
->
reclength
;
if
(
flag
&
HA_STATUS_CONST
)
{
stats
.
max_data_file_length
=
share
->
rows_recorded
*
stats
.
mean_rec_length
;
stats
.
max_data_file_length
=
MAX_FILE_SIZE
;
stats
.
create_time
=
(
ulong
)
file_stat
.
st_ctime
;
}
if
(
flag
&
HA_STATUS_VARIABLE
)
{
stats
.
delete_length
=
0
;
stats
.
data_file_length
=
file_stat
.
st_size
;
stats
.
index_file_length
=
0
;
stats
.
mean_rec_length
=
stats
.
records
?
stats
.
data_file_length
/
stats
.
records
:
table
->
s
->
reclength
;
}
}
if
(
flag
&
HA_STATUS_AUTO
)
{
...
...
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