diff options
author | unknown <dlenev@brandersnatch.localdomain> | 2004-07-28 10:49:21 +0400 |
---|---|---|
committer | unknown <dlenev@brandersnatch.localdomain> | 2004-07-28 10:49:21 +0400 |
commit | 6360654afef016daa4adda9e36e464ee9822f001 (patch) | |
tree | 039ffda222a3850fc1e64da6e16e01c3819c6ef1 | |
parent | 788178e3b22c964bb84e0535d78a45accbb283ea (diff) | |
download | mariadb-git-6360654afef016daa4adda9e36e464ee9822f001.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).
-rw-r--r-- | mysql-test/r/metadata.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps_2myisam.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps_3innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps_4heap.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps_5merge.result | 4 | ||||
-rw-r--r-- | sql/field.cc | 3 |
6 files changed, 8 insertions, 7 deletions
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 80a01a0ca90..ced3ca61f80 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -21,7 +21,7 @@ def test t1 t1 g g 5 4 0 Y 32768 3 63 def test t1 t1 h h 0 7 0 Y 32768 4 63 def test t1 t1 i i 13 4 0 Y 32864 0 63 def test t1 t1 j j 10 10 0 Y 128 0 63 -def test t1 t1 k k 7 19 0 N 1217 0 63 +def test t1 t1 k k 7 19 0 N 1249 0 63 def test t1 t1 l l 12 19 0 Y 128 0 63 def test t1 t1 m m 254 1 0 Y 256 0 8 def test t1 t1 n n 254 3 0 Y 2048 0 8 diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 23ce63cacc3..b49eedb4067 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -870,7 +870,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 8ec7caa311c..3a2708376fa 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -870,7 +870,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index fae17eb2e23..4228d95677d 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -871,7 +871,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 5aedebe396f..03020ccc0f3 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -913,7 +913,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 @@ -2106,7 +2106,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 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) { |