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
cb10b77c
Commit
cb10b77c
authored
Feb 21, 2006
by
reggie@linux.site
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG #15408 - Partitions: subpartition names are not unique
parent
336c0ba4
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
43 deletions
+37
-43
libmysqld/Makefile.am
libmysqld/Makefile.am
+1
-1
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
+1
-0
sql/Makefile.am
sql/Makefile.am
+3
-3
sql/partition_element.h
sql/partition_element.h
+1
-1
sql/partition_info.cc
sql/partition_info.cc
+23
-31
sql/partition_info.h
sql/partition_info.h
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+4
-4
sql/sql_partition.h
sql/sql_partition.h
+1
-1
win/cmakefiles/sql
win/cmakefiles/sql
+1
-1
No files found.
libmysqld/Makefile.am
View file @
cb10b77c
...
@@ -67,7 +67,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
...
@@ -67,7 +67,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
event_executor.cc event.cc event_timed.cc
\
event_executor.cc event.cc event_timed.cc
\
rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc
\
rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc
\
sql_tablespace.cc
\
sql_tablespace.cc
\
rpl_injector.cc my_user.c partition_info.c
pp
rpl_injector.cc my_user.c partition_info.c
c
libmysqld_int_a_SOURCES
=
$(libmysqld_sources)
$(libmysqlsources)
$(sqlsources)
libmysqld_int_a_SOURCES
=
$(libmysqld_sources)
$(libmysqlsources)
$(sqlsources)
EXTRA_libmysqld_a_SOURCES
=
ha_innodb.cc ha_berkeley.cc ha_archive.cc
\
EXTRA_libmysqld_a_SOURCES
=
ha_innodb.cc ha_berkeley.cc ha_archive.cc
\
...
...
mysql-test/r/partition_mgm_err.result
View file @
cb10b77c
...
@@ -142,6 +142,7 @@ t1 CREATE TABLE `t1` (
...
@@ -142,6 +142,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
DROP TABLE t1;
CREATE TABLE t1 (s1 int, s2 int) PARTITION BY LIST (s1) (
CREATE TABLE t1 (s1 int, s2 int) PARTITION BY LIST (s1) (
PARTITION p1 VALUES IN (0) (SUBPARTITION p1b),
PARTITION p1 VALUES IN (0) (SUBPARTITION p1b),
PARTITION p2 VALUES IN (2) (SUBPARTITION p1b)
PARTITION p2 VALUES IN (2) (SUBPARTITION p1b)
...
...
mysql-test/t/partition_mgm_err.test
View file @
cb10b77c
...
@@ -216,6 +216,7 @@ DROP TABLE t1;
...
@@ -216,6 +216,7 @@ DROP TABLE t1;
#
#
CREATE
TABLE
t1
(
a
INT
)
PARTITION
BY
HASH
(
a
);
CREATE
TABLE
t1
(
a
INT
)
PARTITION
BY
HASH
(
a
);
ALTER
TABLE
t1
ADD
PARTITION
PARTITIONS
4
;
ALTER
TABLE
t1
ADD
PARTITION
PARTITIONS
4
;
DROP
TABLE
t1
;
#
#
#BUG 15408: Partitions: subpartition names are not unique
#BUG 15408: Partitions: subpartition names are not unique
...
...
sql/Makefile.am
View file @
cb10b77c
...
@@ -65,8 +65,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
...
@@ -65,8 +65,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h
\
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h
\
parse_file.h sql_view.h sql_trigger.h
\
parse_file.h sql_view.h sql_trigger.h
\
sql_array.h sql_cursor.h event.h event_priv.h
\
sql_array.h sql_cursor.h event.h event_priv.h
\
sql_plugin.h authors.h sql_partition.h
partition_info.h
\
sql_plugin.h authors.h sql_partition.h
\
partition_element.h
partition_info.h
partition_element.h
mysqld_SOURCES
=
sql_lex.cc sql_handler.cc sql_partition.cc
\
mysqld_SOURCES
=
sql_lex.cc sql_handler.cc sql_partition.cc
\
item.cc item_sum.cc item_buff.cc item_func.cc
\
item.cc item_sum.cc item_buff.cc item_func.cc
\
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc
\
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc
\
...
@@ -102,7 +102,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
...
@@ -102,7 +102,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
sp_cache.cc parse_file.cc sql_trigger.cc
\
sp_cache.cc parse_file.cc sql_trigger.cc
\
event_executor.cc event.cc event_timed.cc
\
event_executor.cc event.cc event_timed.cc
\
sql_plugin.cc sql_binlog.cc
\
sql_plugin.cc sql_binlog.cc
\
handlerton.cc sql_tablespace.cc partition_info.c
pp
handlerton.cc sql_tablespace.cc partition_info.c
c
EXTRA_mysqld_SOURCES
=
ha_innodb.cc ha_berkeley.cc ha_archive.cc
\
EXTRA_mysqld_SOURCES
=
ha_innodb.cc ha_berkeley.cc ha_archive.cc
\
ha_innodb.h ha_berkeley.h ha_archive.h
\
ha_innodb.h ha_berkeley.h ha_archive.h
\
ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc
\
ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc
\
...
...
sql/partition_element.h
View file @
cb10b77c
/* Copyright (C) 2000,200
4
MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (C) 2000,200
666666
MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
...
sql/partition_info.c
pp
→
sql/partition_info.c
c
View file @
cb10b77c
/* Copyright (C) 200
5
MySQL AB
/* Copyright (C) 200
6
MySQL AB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -14,23 +14,6 @@
...
@@ -14,23 +14,6 @@
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
This file was introduced as a container for general functionality related
to partitioning introduced in MySQL version 5.1. It contains functionality
used by all handlers that support partitioning, which in the first version
is the partitioning handler itself and the NDB handler.
The first version was written by Mikael Ronstrom.
This version supports RANGE partitioning, LIST partitioning, HASH
partitioning and composite partitioning (hereafter called subpartitioning)
where each RANGE/LIST partitioning is HASH partitioned. The hash function
can either be supplied by the user or by only a list of fields (also
called KEY partitioning, where the MySQL server will use an internal
hash function.
There are quite a few defaults that can be used as well.
*/
/* Some general useful functions */
/* Some general useful functions */
#include "mysql_priv.h"
#include "mysql_priv.h"
...
@@ -164,6 +147,7 @@ end:
...
@@ -164,6 +147,7 @@ end:
DBUG_RETURN
(
result
);
DBUG_RETURN
(
result
);
}
}
/*
/*
Set up all the default subpartitions not set-up by the user in the SQL
Set up all the default subpartitions not set-up by the user in the SQL
statement. Also perform a number of checks that the default partitioning
statement. Also perform a number of checks that the default partitioning
...
@@ -235,6 +219,7 @@ end:
...
@@ -235,6 +219,7 @@ end:
DBUG_RETURN
(
result
);
DBUG_RETURN
(
result
);
}
}
/*
/*
Support routine for check_partition_info
Support routine for check_partition_info
...
@@ -272,6 +257,7 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file,
...
@@ -272,6 +257,7 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file,
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
/*
/*
A support function to check if a partition element's name is unique
A support function to check if a partition element's name is unique
...
@@ -283,6 +269,7 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file,
...
@@ -283,6 +269,7 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file,
TRUE Has unique name
TRUE Has unique name
FALSE Doesn't
FALSE Doesn't
*/
*/
bool
partition_info
::
has_unique_name
(
partition_element
*
element
)
bool
partition_info
::
has_unique_name
(
partition_element
*
element
)
{
{
DBUG_ENTER
(
"partition_info::has_unique_name"
);
DBUG_ENTER
(
"partition_info::has_unique_name"
);
...
@@ -297,9 +284,10 @@ bool partition_info::has_unique_name(partition_element *element)
...
@@ -297,9 +284,10 @@ bool partition_info::has_unique_name(partition_element *element)
name_to_check
))
&&
el
!=
element
)
name_to_check
))
&&
el
!=
element
)
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
if
(
el
->
subpartitions
.
is_empty
())
continue
;
if
(
!
el
->
subpartitions
.
is_empty
())
List_iterator
<
partition_element
>
subparts_it
(
el
->
subpartitions
);
{
partition_element
*
sub_el
;
partition_element
*
sub_el
;
List_iterator
<
partition_element
>
subparts_it
(
el
->
subpartitions
);
while
(
sub_el
=
(
subparts_it
++
))
while
(
sub_el
=
(
subparts_it
++
))
{
{
if
(
!
(
my_strcasecmp
(
system_charset_info
,
sub_el
->
partition_name
,
if
(
!
(
my_strcasecmp
(
system_charset_info
,
sub_el
->
partition_name
,
...
@@ -307,6 +295,7 @@ bool partition_info::has_unique_name(partition_element *element)
...
@@ -307,6 +295,7 @@ bool partition_info::has_unique_name(partition_element *element)
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
}
}
}
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
...
@@ -326,6 +315,7 @@ bool partition_info::has_unique_name(partition_element *element)
...
@@ -326,6 +315,7 @@ bool partition_info::has_unique_name(partition_element *element)
Checks that the list of names in the partitions doesn't contain any
Checks that the list of names in the partitions doesn't contain any
duplicated names.
duplicated names.
*/
*/
char
*
partition_info
::
has_unique_names
()
char
*
partition_info
::
has_unique_names
()
{
{
DBUG_ENTER
(
"partition_info::has_unique_names"
);
DBUG_ENTER
(
"partition_info::has_unique_names"
);
...
@@ -338,7 +328,8 @@ char *partition_info::has_unique_names()
...
@@ -338,7 +328,8 @@ char *partition_info::has_unique_names()
if
(
!
has_unique_name
(
el
))
if
(
!
has_unique_name
(
el
))
DBUG_RETURN
(
el
->
partition_name
);
DBUG_RETURN
(
el
->
partition_name
);
if
(
el
->
subpartitions
.
is_empty
())
continue
;
if
(
!
el
->
subpartitions
.
is_empty
())
{
List_iterator
<
partition_element
>
subparts_it
(
el
->
subpartitions
);
List_iterator
<
partition_element
>
subparts_it
(
el
->
subpartitions
);
partition_element
*
subel
;
partition_element
*
subel
;
while
(
subel
=
(
subparts_it
++
))
while
(
subel
=
(
subparts_it
++
))
...
@@ -347,6 +338,7 @@ char *partition_info::has_unique_names()
...
@@ -347,6 +338,7 @@ char *partition_info::has_unique_names()
DBUG_RETURN
(
subel
->
partition_name
);
DBUG_RETURN
(
subel
->
partition_name
);
}
}
}
}
}
DBUG_RETURN
(
NULL
);
DBUG_RETURN
(
NULL
);
}
}
...
...
sql/partition_info.h
View file @
cb10b77c
/* Copyright (C) 2000,200
4
MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (C) 2000,200
6
MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
...
sql/sql_partition.cc
View file @
cb10b77c
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
/*
This file
was introduced a
s a container for general functionality related
This file
i
s a container for general functionality related
to partitioning introduced in MySQL version 5.1. It contains functionality
to partitioning introduced in MySQL version 5.1. It contains functionality
used by all handlers that support partitioning,
which in the first version
used by all handlers that support partitioning,
such as
is
the partitioning handler itself and the NDB handler.
the partitioning handler itself and the NDB handler.
The first version was written by Mikael Ronstrom.
The first version was written by Mikael Ronstrom.
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
partitioning and composite partitioning (hereafter called subpartitioning)
partitioning and composite partitioning (hereafter called subpartitioning)
where each RANGE/LIST partitioning is HASH partitioned. The hash function
where each RANGE/LIST partitioning is HASH partitioned. The hash function
can either be supplied by the user or by only a list of fields (also
can either be supplied by the user or by only a list of fields (also
called KEY partitioning, where the MySQL server will use an internal
called KEY partitioning
)
, where the MySQL server will use an internal
hash function.
hash function.
There are quite a few defaults that can be used as well.
There are quite a few defaults that can be used as well.
*/
*/
...
...
sql/sql_partition.h
View file @
cb10b77c
/* Copyright (C) 200
5
MySQL AB
/* Copyright (C) 200
6
MySQL AB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
...
win/cmakefiles/sql
View file @
cb10b77c
...
@@ -40,7 +40,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.
...
@@ -40,7 +40,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.
sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
sql_update.cc sql_view.cc sql_yacc.h sql_yacc.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
sql_update.cc sql_view.cc sql_yacc.h sql_yacc.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.c
pp
event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.c
c
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
...
...
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