summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2004-07-28 10:49:21 +0400
committerunknown <dlenev@brandersnatch.localdomain>2004-07-28 10:49:21 +0400
commita5e453e6085f441a014d7fdbb4878be4487ee708 (patch)
tree039ffda222a3850fc1e64da6e16e01c3819c6ef1 /sql/field.cc
parentddb6fe7ef52282d949d9a6b2f6715062cdeeb666 (diff)
downloadmariadb-git-a5e453e6085f441a014d7fdbb4878be4487ee708.tar.gz
Fix for bug #4492.
TIMESTAMP columns should be unsigned to preserve compatibility with 4.0 (Or else InnoDB will return different internal TIMESTAMP values when user upgrades to 4.1). Altough this fix will introduce problems with early 4.1 -> 4.1 upgrades (tables with TIMESTAMP field should be reloaded using mysqldump) it will allow easy 4.0 -> 4.1 upgrade (which is more important since 4.1 is still beta). mysql-test/r/metadata.result: TIMESTAMP should be UNSIGNED as in 4.0. mysql-test/r/ps_2myisam.result: TIMESTAMP should be UNSIGNED as in 4.0. mysql-test/r/ps_3innodb.result: TIMESTAMP should be UNSIGNED as in 4.0. mysql-test/r/ps_4heap.result: TIMESTAMP should be UNSIGNED as in 4.0. mysql-test/r/ps_5merge.result: TIMESTAMP should be UNSIGNED as in 4.0. sql/field.cc: TIMESTAMP should be UNSIGNED to preserve compatiblity with 4.0. (Or else InnoDB will return different internal TIMESTAMP values when user upgrades to 4.1).
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index c96a5a6d809..8fba132738c 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2877,7 +2877,8 @@ Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
:Field_str(ptr_arg, 19, (uchar*) 0,0,
unireg_check_arg, field_name_arg, table_arg, cs)
{
- flags|=ZEROFILL_FLAG; /* 4.0 MYD compatibility */
+ /* For 4.0 MYD and 4.0 InnoDB compatibility */
+ flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
if (table && !table->timestamp_field &&
unireg_check != NONE)
{