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
0c342270
Commit
0c342270
authored
Aug 12, 2009
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
manual merge
parents
475c6423
89b9fbd4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
1 deletion
+66
-1
mysql-test/r/partition.result
mysql-test/r/partition.result
+37
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+25
-0
mysql-test/t/partition_disabled.test
mysql-test/t/partition_disabled.test
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+3
-0
No files found.
mysql-test/r/partition.result
View file @
0c342270
drop table if exists t1, t2;
CREATE TABLE t1 (
a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
b varchar(10),
PRIMARY KEY (a)
)
PARTITION BY RANGE (to_days(a)) (
PARTITION p1 VALUES LESS THAN (733407),
PARTITION pmax VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES ('2007-07-30 17:35:48', 'p1');
INSERT INTO t1 VALUES ('2009-07-14 17:35:55', 'pmax');
INSERT INTO t1 VALUES ('2009-09-21 17:31:42', 'pmax');
SELECT * FROM t1;
a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
PARTITION p3 VALUES LESS THAN (733969),
PARTITION pmax VALUES LESS THAN MAXVALUE);
SELECT * FROM t1;
a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`b` varchar(10) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (to_days(a))
(PARTITION p1 VALUES LESS THAN (733407) ENGINE = MyISAM,
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
DROP TABLE t1;
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
ENGINE=MyISAM
PARTITION BY HASH (a);
...
...
mysql-test/t/partition.test
View file @
0c342270
...
...
@@ -14,6 +14,31 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
#
# Bug#46478: timestamp field incorrectly defaulted when partition is reorganized
#
CREATE
TABLE
t1
(
a
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
b
varchar
(
10
),
PRIMARY
KEY
(
a
)
)
PARTITION
BY
RANGE
(
to_days
(
a
))
(
PARTITION
p1
VALUES
LESS
THAN
(
733407
),
PARTITION
pmax
VALUES
LESS
THAN
MAXVALUE
);
INSERT
INTO
t1
VALUES
(
'2007-07-30 17:35:48'
,
'p1'
);
INSERT
INTO
t1
VALUES
(
'2009-07-14 17:35:55'
,
'pmax'
);
INSERT
INTO
t1
VALUES
(
'2009-09-21 17:31:42'
,
'pmax'
);
SELECT
*
FROM
t1
;
ALTER
TABLE
t1
REORGANIZE
PARTITION
pmax
INTO
(
PARTITION
p3
VALUES
LESS
THAN
(
733969
),
PARTITION
pmax
VALUES
LESS
THAN
MAXVALUE
);
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug#36001: Partitions: spelling and using some error messages
#
...
...
mysql-test/t/partition_disabled.test
View file @
0c342270
...
...
@@ -15,7 +15,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
# Bug#39893: Crash if select on a partitioned table,
# when partitioning is disabled
FLUSH
TABLES
;
--
copy_file
$MYSQLTEST_VARDIR
/
std_data
_ln
/
parts
/
t1
.
frm
$MYSQLD_DATADIR
/
test
/
t1
.
frm
--
copy_file
$MYSQLTEST_VARDIR
/
std_data
/
parts
/
t1
.
frm
$MYSQLD_DATADIR
/
test
/
t1
.
frm
SELECT
*
FROM
t1
;
TRUNCATE
TABLE
t1
;
ANALYZE
TABLE
t1
;
...
...
sql/sql_partition.cc
View file @
0c342270
...
...
@@ -6077,6 +6077,9 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt
->
pack_frm_len
=
0
;
thd
->
work_part_info
=
part_info
;
/* Never update timestamp columns when alter */
table
->
timestamp_field_type
=
TIMESTAMP_NO_AUTO_SET
;
if
(
fast_alter_partition
&
HA_PARTITION_ONE_PHASE
)
{
/*
...
...
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