summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-01-05 15:09:06 +0200
committerMichael Widenius <monty@askmonty.org>2011-01-05 15:09:06 +0200
commitab32ce9aa7fb09b2fb578e5bb44f004092bf1d89 (patch)
treea794e234b9474b9eb7d2f445aa5d59ab9814f32d /sql/sql_table.cc
parent711b36732b6913c189e1075441c7c9bd8ef529da (diff)
downloadmariadb-git-ab32ce9aa7fb09b2fb578e5bb44f004092bf1d89.tar.gz
ALTER TABLE IGNORE didn't ignore duplicates for unique add index for InnoDB
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8446ca46e3c..a7a0a96ce10 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7136,6 +7136,16 @@ view_err:
/* Non-primary unique key. */
needed_online_flags|= HA_ONLINE_ADD_UNIQUE_INDEX;
needed_fast_flags|= HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES;
+ if (ignore)
+ {
+ /*
+ If ignore is used, we have to remove all duplicate rows,
+ which require a full table copy.
+ */
+ need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ pk_changed= 2; // Don't change need_copy_table
+ break;
+ }
}
}
else