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
daa0587c
Commit
daa0587c
authored
Jan 23, 2006
by
reggie@linux.site
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #14354 - data directory and index directory not working for partitions
parent
3573c2cf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
13 deletions
+50
-13
mysql-test/r/partition_mgm_err.result
mysql-test/r/partition_mgm_err.result
+1
-0
mysql-test/t/partition_mgm_err.test
mysql-test/t/partition_mgm_err.test
+16
-0
sql/ha_partition.cc
sql/ha_partition.cc
+13
-3
sql/ha_partition.h
sql/ha_partition.h
+4
-2
sql/mysql_priv.h
sql/mysql_priv.h
+2
-0
sql/sql_parse.cc
sql/sql_parse.cc
+2
-4
sql/sql_partition.cc
sql/sql_partition.cc
+12
-4
No files found.
mysql-test/r/partition_mgm_err.result
View file @
daa0587c
...
...
@@ -107,3 +107,4 @@ ALTER TABLE t1 DROP PARTITION x1;
ALTER TABLE t1 DROP PARTITION x0;
ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
DROP TABLE t1;
DROP TABLE t1;
mysql-test/t/partition_mgm_err.test
View file @
daa0587c
...
...
@@ -158,3 +158,19 @@ ALTER TABLE t1 DROP PARTITION x1;
ALTER
TABLE
t1
DROP
PARTITION
x0
;
DROP
TABLE
t1
;
#
# BUG: 14354 Partitions: data directory clause fails
#
--
exec
rm
-
rf
$MYSQL_TEST_DIR
/
var
/
tmp
/
bug14354
--
exec
mkdir
$MYSQL_TEST_DIR
/
var
/
tmp
/
bug14354
disable_query_log
;
eval
CREATE
TABLE
t1
(
id
int
)
PARTITION
BY
RANGE
(
id
)
(
PARTITION
p1
VALUES
LESS
THAN
(
20
)
ENGINE
=
myiasm
DATA
DIRECTORY
=
"
$MYSQL_TEST_DIR
/var/tmp/bug14354"
INDEX
DIRECTORY
=
"
$MYSQL_TEST_DIR
/var/tmp/bug14354"
);
enable_query_log
;
--
exec
test
-
f
$MYSQL_TEST_DIR
/
var
/
tmp
/
bug14354
/
t1_p1
.
MYD
--
exec
test
-
f
$MYSQL_TEST_DIR
/
var
/
tmp
/
bug14354
/
t1_p1
.
MYI
DROP
TABLE
t1
;
--
exec
rm
-
rf
$MYSQL_TEST_DIR
/
var
/
tmp
/
bug14354
sql/ha_partition.cc
View file @
daa0587c
...
...
@@ -507,7 +507,7 @@ uint ha_partition::del_ren_cre_table(const char *from,
error
=
(
*
file
)
->
delete_table
((
const
char
*
)
from_buff
);
else
{
set_up_table_before_create
(
table_arg
,
create_info
,
i
);
set_up_table_before_create
(
table_arg
,
from_buff
,
create_info
,
i
);
error
=
(
*
file
)
->
create
(
from_buff
,
table_arg
,
create_info
);
}
name_buffer_ptr
=
strend
(
name_buffer_ptr
)
+
1
;
...
...
@@ -550,8 +550,9 @@ partition_element *ha_partition::find_partition_element(uint part_id)
void
ha_partition
::
set_up_table_before_create
(
TABLE
*
table
,
HA_CREATE_INFO
*
info
,
uint
part_id
)
const
char
*
partition_name_with_path
,
HA_CREATE_INFO
*
info
,
uint
part_id
)
{
/*
Set up
...
...
@@ -565,6 +566,15 @@ void ha_partition::set_up_table_before_create(TABLE *table,
return
;
// Fatal error
table
->
s
->
max_rows
=
part_elem
->
part_max_rows
;
table
->
s
->
min_rows
=
part_elem
->
part_min_rows
;
char
*
partition_name
=
strrchr
(
partition_name_with_path
,
FN_LIBCHAR
);
if
(
part_elem
->
index_file_name
)
append_file_to_dir
(
current_thd
,
(
const
char
**
)
&
part_elem
->
index_file_name
,
partition_name
+
1
);
if
(
part_elem
->
data_file_name
)
append_file_to_dir
(
current_thd
,
(
const
char
**
)
&
part_elem
->
data_file_name
,
partition_name
+
1
);
info
->
index_file_name
=
part_elem
->
index_file_name
;
info
->
data_file_name
=
part_elem
->
data_file_name
;
}
...
...
sql/ha_partition.h
View file @
daa0587c
...
...
@@ -197,8 +197,10 @@ private:
bool
new_handlers_from_part_info
();
bool
create_handlers
();
void
clear_handler_file
();
void
set_up_table_before_create
(
TABLE
*
table_arg
,
HA_CREATE_INFO
*
info
,
uint
part_id
);
void
set_up_table_before_create
(
TABLE
*
table_arg
,
const
char
*
partition_name_with_path
,
HA_CREATE_INFO
*
info
,
uint
part_id
);
partition_element
*
find_partition_element
(
uint
part_id
);
public:
...
...
sql/mysql_priv.h
View file @
daa0587c
...
...
@@ -636,6 +636,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char
*
packet
,
uint
packet_length
);
void
log_slow_statement
(
THD
*
thd
);
bool
check_dup
(
const
char
*
db
,
const
char
*
name
,
TABLE_LIST
*
tables
);
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
const
char
*
table_name
);
bool
table_cache_init
(
void
);
void
table_cache_free
(
void
);
...
...
sql/sql_parse.cc
View file @
daa0587c
...
...
@@ -68,8 +68,6 @@ static bool check_db_used(THD *thd,TABLE_LIST *tables);
static
bool
check_multi_update_lock
(
THD
*
thd
);
static
void
remove_escape
(
char
*
name
);
static
void
refresh_status
(
THD
*
thd
);
static
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
const
char
*
table_name
);
const
char
*
any_db
=
"*any*"
;
// Special symbol for check_access
...
...
@@ -6733,8 +6731,8 @@ static void refresh_status(THD *thd)
/* If pointer is not a null pointer, append filename to it */
static
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
const
char
*
table_name
)
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
const
char
*
table_name
)
{
char
buff
[
FN_REFLEN
],
*
ptr
,
*
end
;
if
(
!*
filename_ptr
)
...
...
sql/sql_partition.cc
View file @
daa0587c
...
...
@@ -1936,13 +1936,18 @@ static int add_int(File fptr, longlong number)
}
static
int
add_keyword_string
(
File
fptr
,
const
char
*
keyword
,
bool
should_use_quotes
,
const
char
*
keystr
)
{
int
err
=
add_string
(
fptr
,
keyword
);
err
+=
add_space
(
fptr
);
err
+=
add_equal
(
fptr
);
err
+=
add_space
(
fptr
);
if
(
should_use_quotes
)
err
+=
add_string
(
fptr
,
"'"
);
err
+=
add_string
(
fptr
,
keystr
);
if
(
should_use_quotes
)
err
+=
add_string
(
fptr
,
"'"
);
return
err
+
add_space
(
fptr
);
}
...
...
@@ -1968,7 +1973,8 @@ static int add_partition_options(File fptr, partition_element *p_elem)
{
int
err
=
0
;
if
(
p_elem
->
tablespace_name
)
err
+=
add_keyword_string
(
fptr
,
"TABLESPACE"
,
p_elem
->
tablespace_name
);
err
+=
add_keyword_string
(
fptr
,
"TABLESPACE"
,
FALSE
,
p_elem
->
tablespace_name
);
if
(
p_elem
->
nodegroup_id
!=
UNDEF_NODEGROUP
)
err
+=
add_keyword_int
(
fptr
,
"NODEGROUP"
,(
longlong
)
p_elem
->
nodegroup_id
);
if
(
p_elem
->
part_max_rows
)
...
...
@@ -1976,11 +1982,13 @@ static int add_partition_options(File fptr, partition_element *p_elem)
if
(
p_elem
->
part_min_rows
)
err
+=
add_keyword_int
(
fptr
,
"MIN_ROWS"
,(
longlong
)
p_elem
->
part_min_rows
);
if
(
p_elem
->
data_file_name
)
err
+=
add_keyword_string
(
fptr
,
"DATA DIRECTORY"
,
p_elem
->
data_file_name
);
err
+=
add_keyword_string
(
fptr
,
"DATA DIRECTORY"
,
TRUE
,
p_elem
->
data_file_name
);
if
(
p_elem
->
index_file_name
)
err
+=
add_keyword_string
(
fptr
,
"INDEX DIRECTORY"
,
p_elem
->
index_file_name
);
err
+=
add_keyword_string
(
fptr
,
"INDEX DIRECTORY"
,
TRUE
,
p_elem
->
index_file_name
);
if
(
p_elem
->
part_comment
)
err
+=
add_keyword_string
(
fptr
,
"COMMENT"
,
p_elem
->
part_comment
);
err
+=
add_keyword_string
(
fptr
,
"COMMENT"
,
FALSE
,
p_elem
->
part_comment
);
return
err
+
add_engine
(
fptr
,
p_elem
->
engine_type
);
}
...
...
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