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
4e47db3a
Commit
4e47db3a
authored
Jan 26, 2011
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
15f635fd
9ecf3156
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
1 deletion
+59
-1
mysql-test/r/partition_error.result
mysql-test/r/partition_error.result
+13
-0
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/r/ndb_basic.result
+2
-0
mysql-test/suite/ndb/t/ndb_basic.test
mysql-test/suite/ndb/t/ndb_basic.test
+7
-0
mysql-test/t/partition_error.test
mysql-test/t/partition_error.test
+15
-1
sql/sql_partition.cc
sql/sql_partition.cc
+22
-0
No files found.
mysql-test/r/partition_error.result
View file @
4e47db3a
drop table if exists t1;
#
# Bug#57924: crash when creating partitioned table with
# multiple columns in the partition key
#
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
PARTITION BY KEY(a, b, a);
ERROR HY000: Field in list of fields for partition function not found in table
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
PARTITION BY KEY(A, b);
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
PARTITION BY KEY(a, b, A);
ERROR HY000: Field in list of fields for partition function not found in table
#
# Bug#54483: valgrind errors when making warnings for multiline inserts
# into partition
#
...
...
mysql-test/suite/ndb/r/ndb_basic.result
View file @
4e47db3a
...
...
@@ -585,6 +585,8 @@ c127 int,
c128 int,
primary key using hash(c1)) engine=ndb partition by key(c1);
drop table t1;
create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`);
ERROR HY000: Field in list of fields for partition function not found in table
create table t1 (
a1234567890123456789012345678901234567890 int primary key,
a12345678901234567890123456789a1234567890 int,
...
...
mysql-test/suite/ndb/t/ndb_basic.test
View file @
4e47db3a
...
...
@@ -547,6 +547,13 @@ c128 int,
primary
key
using
hash
(
c1
))
engine
=
ndb
partition
by
key
(
c1
);
drop
table
t1
;
#
# test bug#53354 - crash when creating partitioned table with multiple columns in the partition key
#
--
error
ER_FIELD_NOT_FOUND_PART_ERROR
create
table
`t1`
(
`a`
int
,
b
int
,
primary
key
(
a
,
b
))
engine
=
ndb
partition
by
key
(
`a`
,
`b`
,
`a`
);
#
# test max size of attribute name and truncation
#
...
...
mysql-test/t/partition_error.test
View file @
4e47db3a
...
...
@@ -10,6 +10,21 @@ drop table if exists t1;
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
--
echo
#
--
echo
# Bug#57924: crash when creating partitioned table with
--
echo
# multiple columns in the partition key
--
echo
#
--
error
ER_FIELD_NOT_FOUND_PART_ERROR
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
PRIMARY
KEY
(
a
,
b
))
PARTITION
BY
KEY
(
a
,
b
,
a
);
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
PRIMARY
KEY
(
a
,
b
))
PARTITION
BY
KEY
(
A
,
b
);
DROP
TABLE
t1
;
--
error
ER_FIELD_NOT_FOUND_PART_ERROR
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
PRIMARY
KEY
(
a
,
b
))
PARTITION
BY
KEY
(
a
,
b
,
A
);
--
echo
#
--
echo
# Bug#54483: valgrind errors when making warnings for multiline inserts
--
echo
# into partition
...
...
@@ -673,7 +688,6 @@ PARTITION BY HASH (TIME_TO_SEC(a));
CREATE
TABLE
t1
(
a
INT
)
PARTITION
BY
HASH
(
TIME_TO_SEC
(
a
));
--
echo
#
--
echo
# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
--
echo
#
...
...
sql/sql_partition.cc
View file @
4e47db3a
...
...
@@ -761,6 +761,9 @@ static bool handle_list_of_fields(List_iterator<char> it,
bool
result
;
char
*
field_name
;
bool
is_list_empty
=
TRUE
;
int
fields_handled
=
0
;
char
*
field_name_array
[
MAX_KEY
];
DBUG_ENTER
(
"handle_list_of_fields"
);
while
((
field_name
=
it
++
))
...
...
@@ -776,6 +779,25 @@ static bool handle_list_of_fields(List_iterator<char> it,
result
=
TRUE
;
goto
end
;
}
/*
Check for duplicate fields in the list.
Assuming that there are not many fields in the partition key list.
If there were, it would be better to replace the for-loop
with a more efficient algorithm.
*/
field_name_array
[
fields_handled
]
=
field_name
;
for
(
int
i
=
0
;
i
<
fields_handled
;
++
i
)
{
if
(
my_strcasecmp
(
system_charset_info
,
field_name_array
[
i
],
field_name
)
==
0
)
{
my_error
(
ER_FIELD_NOT_FOUND_PART_ERROR
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
}
fields_handled
++
;
}
if
(
is_list_empty
)
{
...
...
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