diff options
author | Kent Boortz <kent.boortz@oracle.com> | 2011-07-04 01:25:49 +0200 |
---|---|---|
committer | Kent Boortz <kent.boortz@oracle.com> | 2011-07-04 01:25:49 +0200 |
commit | 0f03af653cd9891dc6b8d855d7ebffc27b1db288 (patch) | |
tree | aae7686092aab07db57ff0fe0150741ffbc9689d /sql/sql_table.cc | |
parent | 9da00ebec99cd8963b63d011d6dd8111cbf9217e (diff) | |
parent | bc9f870fb12d4aedc6239ec485dee6ebc23d9b94 (diff) | |
download | mariadb-git-0f03af653cd9891dc6b8d855d7ebffc27b1db288.tar.gz |
Updated/added copyright headers
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7576ad3b7b3..9a68420e5fc 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 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 @@ -11,7 +12,8 @@ You should have received a copy of the GNU General Public License 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /* drop and alter of tables */ @@ -5326,6 +5328,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, if (drop) { drop_it.remove(); + /* + ALTER TABLE DROP COLUMN always changes table data even in cases + when new version of the table has the same structure as the old + one. + */ + alter_info->change_level= ALTER_TABLE_DATA_CHANGED; continue; } /* Check if field is changed */ @@ -5403,7 +5411,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, if (!def->after) new_create_list.push_back(def); else if (def->after == first_keyword) + { new_create_list.push_front(def); + /* + Re-ordering columns in table can't be done using in-place algorithm + as it always changes table data. + */ + alter_info->change_level= ALTER_TABLE_DATA_CHANGED; + } else { Create_field *find; @@ -5419,6 +5434,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, goto err; } find_it.after(def); // Put element after this + /* + Re-ordering columns in table can't be done using in-place algorithm + as it always changes table data. + */ alter_info->change_level= ALTER_TABLE_DATA_CHANGED; } } |