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
c0f5fd27
Commit
c0f5fd27
authored
Feb 03, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
parent
a450d58a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
mysql-test/main/partition_exchange.result
mysql-test/main/partition_exchange.result
+11
-0
mysql-test/main/partition_exchange.test
mysql-test/main/partition_exchange.test
+13
-0
sql/sql_table.cc
sql/sql_table.cc
+2
-1
No files found.
mysql-test/main/partition_exchange.result
View file @
c0f5fd27
...
@@ -1239,3 +1239,14 @@ DROP TABLE t1, t2;
...
@@ -1239,3 +1239,14 @@ DROP TABLE t1, t2;
#
#
# End of 10.3 tests
# End of 10.3 tests
#
#
#
# MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
#
CREATE TABLE t1 (a INT, KEY(a DESC)) PARTITION BY KEY(a) PARTITIONS 4;
CREATE TABLE t2 (a INT, KEY(a));
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
#
# End of 10.8 tests
#
mysql-test/main/partition_exchange.test
View file @
c0f5fd27
...
@@ -535,3 +535,16 @@ DROP TABLE t1, t2;
...
@@ -535,3 +535,16 @@ DROP TABLE t1, t2;
--
echo
#
--
echo
#
--
echo
# End of 10.3 tests
--
echo
# End of 10.3 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
KEY
(
a
DESC
))
PARTITION
BY
KEY
(
a
)
PARTITIONS
4
;
CREATE
TABLE
t2
(
a
INT
,
KEY
(
a
));
--
error
ER_TABLES_DIFFERENT_METADATA
ALTER
TABLE
t1
EXCHANGE
PARTITION
p0
WITH
TABLE
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# End of 10.8 tests
--
echo
#
sql/sql_table.cc
View file @
c0f5fd27
...
@@ -7147,7 +7147,8 @@ bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
...
@@ -7147,7 +7147,8 @@ bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
are equal. Comparing field numbers is sufficient.
are equal. Comparing field numbers is sufficient.
*/
*/
if
((
table_part
->
length
!=
new_part
->
length
)
||
if
((
table_part
->
length
!=
new_part
->
length
)
||
(
table_part
->
fieldnr
-
1
!=
new_part
->
fieldnr
))
(
table_part
->
fieldnr
-
1
!=
new_part
->
fieldnr
)
||
((
table_part
->
key_part_flag
^
new_part
->
key_part_flag
)
&
HA_REVERSE_SORT
))
DBUG_RETURN
(
false
);
DBUG_RETURN
(
false
);
}
}
}
}
...
...
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