~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/mysql.result

Replace MAX_(DATE|TIME).*_WIDTH defines in definitions.h with real (and correct) static const members to Temporal types.

This fixes the buffer overflow in https://bugs.launchpad.net/drizzle/+bug/373468

It also removes a handwritten snprintf in field/datetime.cc
However... this caused us to have to change Temporal to have a way to not
"convert" the int64_t value (so 20090101 becomes 20090101000000 etc) as it
has already been converted and we just want the Temporal type to do the
to_string conversion.

This still causes a failure in 'metadata' test due to size of timestamp type. I need feedback from Jay on when the usecond code comes into play to know the correct fix for this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
+------+------+---------------------------+
40
40
i       j       k
41
41
NULL    1       NULL
42
 
Field   Type    Null    Default Default_is_NULL On_Update
43
 
i       INTEGER TRUE            TRUE    
44
 
j       INTEGER FALSE           FALSE   
45
 
k       INTEGER TRUE            TRUE    
 
42
Field   Type    Null    Key     Default Extra
 
43
i       int     YES             NULL    
 
44
j       int     NO              NULL    
 
45
k       int     YES             NULL    
46
46
+------+---+------+
47
47
| i    | j | k    |
48
48
+------+---+------+
49
49
| NULL | 1 | NULL | 
50
50
+------+---+------+
51
 
+-------+---------+-------+---------+-----------------+-----------+
52
 
| Field | Type    | Null  | Default | Default_is_NULL | On_Update |
53
 
+-------+---------+-------+---------+-----------------+-----------+
54
 
| i     | INTEGER | TRUE  |         | TRUE            |           | 
55
 
| j     | INTEGER | FALSE |         | FALSE           |           | 
56
 
| k     | INTEGER | TRUE  |         | TRUE            |           | 
57
 
+-------+---------+-------+---------+-----------------+-----------+
 
51
+-------+------+------+-----+---------+-------+
 
52
| Field | Type | Null | Key | Default | Extra |
 
53
+-------+------+------+-----+---------+-------+
 
54
| i     | int  | YES  |     | NULL    |       | 
 
55
| j     | int  | NO   |     | NULL    |       | 
 
56
| k     | int  | YES  |     | NULL    |       | 
 
57
+-------+------+------+-----+---------+-------+
58
58
i       s1
59
59
1       x
60
60
2       NULL
74
74
| NULL        | 
75
75
+-------------+
76
76
create table t1(a int, b varchar(255), c int);
77
 
Field   Type    Null    Default Default_is_NULL On_Update
78
 
a       INTEGER TRUE            TRUE    
79
 
b       VARCHAR TRUE            TRUE    
80
 
c       INTEGER TRUE            TRUE    
81
 
Field   Type    Null    Default Default_is_NULL On_Update
82
 
a       INTEGER TRUE            TRUE    
83
 
b       VARCHAR TRUE            TRUE    
84
 
c       INTEGER TRUE            TRUE    
 
77
Field   Type    Null    Key     Default Extra
 
78
a       int     YES             NULL    
 
79
b       varchar(255)    YES             NULL    
 
80
c       int     YES             NULL    
 
81
Field   Type    Null    Key     Default Extra
 
82
a       int     YES             NULL    
 
83
b       varchar(255)    YES             NULL    
 
84
c       int     YES             NULL    
85
85
drop table t1;
86
86
1
87
87
1