summaryrefslogtreecommitdiff
path: root/mysql-test/r/alter_table.result
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-06-24 13:02:20 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2009-06-24 13:02:20 +0200
commit74deaae946f060318900b93249e1d48f4d43c9af (patch)
tree91ef103df7056ffa6cd178a11a2301c411b885f3 /mysql-test/r/alter_table.result
parente2ac8c07bdd2e58f5f7b4919a76a0d1881f3ed5e (diff)
downloadmariadb-git-74deaae946f060318900b93249e1d48f4d43c9af.tar.gz
Bug#43508: Renaming timestamp or date column triggers table copy
Altering a table to update a column with types DATE or TIMESTAMP would incorrectly be seen as a significant change that necessitates a slow copy+rename operation instead of a fast update. There were two problems: The character set is magically set for TIMESTAMP to be "binary", but that was done too deep in field use code for ALTER TABLE to know of it. Now, put that in the constructor for Field_timestamp. Also, when we set the character set for the new replacement/ comparison field, also raise the "binary" field flag that tells us we should compare it exactly. That is necessary to match the old stored definition. Next is the problem that the default length for TIMESTAMP and DATE fields is different than the length read from the .frm . The compressed size is written to the file, but the human-readable, part-delimited length is used as default length. IIRC, for timestamp it was 19!=14, and for date it was 8!=10. Length mismatch causes a table copy. Also, clean up a place where a comparison function alters one of its parameters and replace it with an assertion of the condition it mutates.
Diffstat (limited to 'mysql-test/r/alter_table.result')
0 files changed, 0 insertions, 0 deletions