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).
parent f6f1e1f4
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment