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
0c0201c9
Commit
0c0201c9
authored
Jun 05, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B28488-5.1-opt
parents
76b580b8
f081188f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
8 deletions
+58
-8
mysql-test/r/partition.result
mysql-test/r/partition.result
+10
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+17
-0
sql/mysql_priv.h
sql/mysql_priv.h
+2
-0
sql/sql_partition.cc
sql/sql_partition.cc
+3
-6
sql/sql_table.cc
sql/sql_table.cc
+26
-2
No files found.
mysql-test/r/partition.result
View file @
0c0201c9
...
...
@@ -1235,4 +1235,14 @@ aaa 2
drop table t1;
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
drop table t1;
CREATE TABLE t1(a INT NOT NULL, b TINYBLOB, KEY(a))
PARTITION BY RANGE(a) ( PARTITION p0 VALUES LESS THAN (32));
INSERT INTO t1 VALUES (1, REPEAT('a', 10));
INSERT INTO t1 SELECT a + 1, b FROM t1;
INSERT INTO t1 SELECT a + 2, b FROM t1;
INSERT INTO t1 SELECT a + 4, b FROM t1;
INSERT INTO t1 SELECT a + 8, b FROM t1;
ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64));
ALTER TABLE t1 DROP PARTITION p1;
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/partition.test
View file @
0c0201c9
...
...
@@ -1448,4 +1448,21 @@ drop table t1;
create
table
t1
(
s1
bigint
)
partition
by
list
(
s1
)
(
partition
p1
values
in
(
-
9223372036854775808
));
drop
table
t1
;
#
# Bug #28488: Incorrect information in file: './test/t1_test#.frm'
#
CREATE
TABLE
t1
(
a
INT
NOT
NULL
,
b
TINYBLOB
,
KEY
(
a
))
PARTITION
BY
RANGE
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
32
));
INSERT
INTO
t1
VALUES
(
1
,
REPEAT
(
'a'
,
10
));
INSERT
INTO
t1
SELECT
a
+
1
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
2
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
4
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
8
,
b
FROM
t1
;
ALTER
TABLE
t1
ADD
PARTITION
(
PARTITION
p1
VALUES
LESS
THAN
(
64
));
ALTER
TABLE
t1
DROP
PARTITION
p1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/mysql_priv.h
View file @
0c0201c9
...
...
@@ -1925,6 +1925,8 @@ uint filename_to_tablename(const char *from, char *to, uint to_length);
uint
tablename_to_filename
(
const
char
*
from
,
char
*
to
,
uint
to_length
);
uint
build_table_filename
(
char
*
buff
,
size_t
bufflen
,
const
char
*
db
,
const
char
*
table
,
const
char
*
ext
,
uint
flags
);
uint
build_table_shadow_filename
(
char
*
buff
,
size_t
bufflen
,
ALTER_PARTITION_PARAM_TYPE
*
lpt
);
/* Flags for conversion functions. */
#define FN_FROM_IS_TMP (1 << 0)
#define FN_TO_IS_TMP (1 << 1)
...
...
sql/sql_partition.cc
View file @
0c0201c9
...
...
@@ -5459,8 +5459,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
char
shadow_path
[
FN_LEN
];
DBUG_ENTER
(
"write_log_drop_shadow_frm"
);
build_table_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
->
db
,
lpt
->
table_name
,
"#"
,
0
);
build_table_shadow_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
);
pthread_mutex_lock
(
&
LOCK_gdl
);
if
(
write_log_replace_delete_frm
(
lpt
,
0UL
,
NULL
,
(
const
char
*
)
shadow_path
,
FALSE
))
...
...
@@ -5508,8 +5507,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
part_info
->
first_log_entry
=
NULL
;
build_table_filename
(
path
,
sizeof
(
path
),
lpt
->
db
,
lpt
->
table_name
,
""
,
0
);
build_table_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
->
db
,
lpt
->
table_name
,
"#"
,
0
);
build_table_shadow_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
);
pthread_mutex_lock
(
&
LOCK_gdl
);
if
(
write_log_replace_delete_frm
(
lpt
,
0UL
,
shadow_path
,
path
,
TRUE
))
goto
error
;
...
...
@@ -5674,8 +5672,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
part_info
->
first_log_entry
=
NULL
;
build_table_filename
(
path
,
sizeof
(
path
),
lpt
->
db
,
lpt
->
table_name
,
""
,
0
);
build_table_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
->
db
,
lpt
->
table_name
,
"#"
,
0
);
build_table_shadow_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
);
pthread_mutex_lock
(
&
LOCK_gdl
);
if
(
write_log_dropped_partitions
(
lpt
,
&
next_entry
,
(
const
char
*
)
path
,
lpt
->
alter_info
->
flags
&
ALTER_REORGANIZE_PARTITION
))
...
...
sql/sql_table.cc
View file @
0c0201c9
...
...
@@ -1161,6 +1161,31 @@ void release_ddl_log()
*/
/**
@brief construct a temporary shadow file name.
@details Make a shadow file name used by ALTER TABLE to construct the
modified table (with keeping the original). The modified table is then
moved back as original table. The name must start with the temp file
prefix so it gets filtered out by table files listing routines.
@param[out] buff buffer to receive the constructed name
@param bufflen size of buff
@param lpt alter table data structure
@retval path length
*/
uint
build_table_shadow_filename
(
char
*
buff
,
size_t
bufflen
,
ALTER_PARTITION_PARAM_TYPE
*
lpt
)
{
char
tmp_name
[
FN_REFLEN
];
my_snprintf
(
tmp_name
,
sizeof
(
tmp_name
),
"%s-%s"
,
tmp_file_prefix
,
lpt
->
table_name
);
return
build_table_filename
(
buff
,
bufflen
,
lpt
->
db
,
tmp_name
,
""
,
FN_IS_TMP
);
}
/*
SYNOPSIS
mysql_write_frm()
...
...
@@ -1201,8 +1226,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
/*
Build shadow frm file name
*/
build_table_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
->
db
,
lpt
->
table_name
,
"#"
,
0
);
build_table_shadow_filename
(
shadow_path
,
sizeof
(
shadow_path
),
lpt
);
strxmov
(
shadow_frm_name
,
shadow_path
,
reg_ext
,
NullS
);
if
(
flags
&
WFRM_WRITE_SHADOW
)
{
...
...
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