summaryrefslogtreecommitdiff
path: root/mysql-test/r/alter_table.result
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-10-09 14:41:04 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2009-10-09 14:41:04 +0200
commit798ce98340ded50323522aa436c4102e86a829a9 (patch)
treee7a14619a96812db600156dc17255efec6917ac5 /mysql-test/r/alter_table.result
parentfce4fa362c5234f1e85212060f61b842844192b7 (diff)
parent74deaae946f060318900b93249e1d48f4d43c9af (diff)
downloadmariadb-git-798ce98340ded50323522aa436c4102e86a829a9.tar.gz
Bug#43508: Renaming timestamp or date column triggers table copy
We set up DATE and TIMESTAMP differently in field-creation than we did in field-MD creation (for CREATE). Admirably, ALTER TABLE detected this and didn't damage any data, but it did initiate a full copy/conversion, which we don't really need to do. Now we describe Field and Create_field the same for those types. As a result, ALTER TABLE that only changes meta-data (like a field's name) no longer forces a data-copy when there needn't be one. mysql-test/r/alter_table.result: 0 rows should be affected when a meta-data change is enough ALTER TABLE. mysql-test/t/alter_table.test: add test-case: show that we don't do a full data-copy on ALTER TABLE when we don't need to. sql/field.cc: Remove Field_str::compare_str_field_flags() (now in Field/Create_field as field_flags_are_binary(). Correct some field-lengths! sql/field.h: Clean-up: use defined constants rather than numeric literals for certain field-lengths. Add enquiry-functions binaryp() to classes Field and Create_field. This replaces field.cc's Field_str::compare_str_field_flags().
Diffstat (limited to 'mysql-test/r/alter_table.result')
-rw-r--r--mysql-test/r/alter_table.result8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 5a115e9ea99..6ed76fc86bf 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1268,4 +1268,12 @@ a b
4 b
5 a
DROP TABLE t1;
+CREATE TABLE t1 (f1 TIMESTAMP NULL DEFAULT NULL,
+f2 INT(11) DEFAULT NULL) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES (NULL, NULL), ("2009-10-09 11:46:19", 2);
+this should affect no rows as there is no real change
+ALTER TABLE t1 CHANGE COLUMN f1 f1_no_real_change TIMESTAMP NULL DEFAULT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+DROP TABLE t1;
End of 5.1 tests