Merge lp:~brianaker/drizzle/now-fix into lp:drizzle/7.0

Proposed by Brian Aker
Status: Merged
Approved by: Brian Aker
Approved revision: not available
Merged at revision: 2072
Proposed branch: lp:~brianaker/drizzle/now-fix
Merge into: lp:drizzle/7.0
Diff against target: 124 lines (+43/-8)
5 files modified
drizzled/field/microtime.cc (+15/-0)
drizzled/field/microtime.h (+6/-4)
drizzled/sql_base.cc (+3/-0)
drizzled/type/time.cc (+18/-3)
drizzled/type/time.h (+1/-1)
To merge this branch: bzr merge lp:~brianaker/drizzle/now-fix
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+45806@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/field/microtime.cc'
2--- drizzled/field/microtime.cc 2011-01-06 23:02:43 +0000
3+++ drizzled/field/microtime.cc 2011-01-11 01:56:36 +0000
4@@ -90,6 +90,21 @@
5 return 0;
6 }
7
8+int Microtime::store_time(type::Time *ltime, enum enum_drizzle_timestamp_type )
9+{
10+ long my_timezone;
11+ bool in_dst_time_gap;
12+
13+ time_t time_tmp= my_system_gmt_sec(ltime, &my_timezone, &in_dst_time_gap, true);
14+ uint64_t tmp_seconds= time_tmp;
15+ uint32_t tmp_micro= ltime->second_part;
16+
17+ pack_num(tmp_seconds);
18+ pack_num(tmp_micro, ptr +8);
19+
20+ return 0;
21+}
22+
23 int Microtime::store(double from)
24 {
25 ASSERT_COLUMN_MARKED_FOR_WRITE;
26
27=== modified file 'drizzled/field/microtime.h'
28--- drizzled/field/microtime.h 2011-01-06 18:00:47 +0000
29+++ drizzled/field/microtime.h 2011-01-11 01:56:36 +0000
30@@ -50,10 +50,12 @@
31 enum_field_types type() const { return DRIZZLE_TYPE_MICROTIME;}
32 enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
33 enum Item_result cmp_type () const { return STRING_RESULT; }
34- int store(const char *to,uint32_t length,
35- const CHARSET_INFO * const charset);
36- int store(double nr);
37- int store(int64_t nr, bool unsigned_val);
38+ int store(const char *to,uint32_t length,
39+ const CHARSET_INFO * const charset);
40+ int store(double nr);
41+ int store(int64_t nr, bool unsigned_val);
42+ int store_time(type::Time *ltime, enum enum_drizzle_timestamp_type t_type);
43+
44 double val_real(void);
45 int64_t val_int(void);
46 String *val_str(String*,String *);
47
48=== modified file 'drizzled/sql_base.cc'
49--- drizzled/sql_base.cc 2011-01-08 11:27:50 +0000
50+++ drizzled/sql_base.cc 2011-01-11 01:56:36 +0000
51@@ -3887,12 +3887,15 @@
52 table= (*ptr)->getTable();
53 table->auto_increment_field_not_null= false;
54 }
55+
56 while ((field = *ptr++) && ! session->is_error())
57 {
58 value=v++;
59 table= field->getTable();
60+
61 if (field == table->next_number_field)
62 table->auto_increment_field_not_null= true;
63+
64 if (value->save_in_field(field, 0) < 0)
65 {
66 if (table)
67
68=== modified file 'drizzled/type/time.cc'
69--- drizzled/type/time.cc 2010-12-26 00:07:57 +0000
70+++ drizzled/type/time.cc 2011-01-11 01:56:36 +0000
71@@ -814,7 +814,7 @@
72 */
73 time_t
74 my_system_gmt_sec(const type::Time *t_src, long *my_timezone,
75- bool *in_dst_time_gap)
76+ bool *in_dst_time_gap, bool skip_timezone)
77 {
78 uint32_t loop;
79 time_t tmp= 0;
80@@ -929,7 +929,15 @@
81 3600);
82
83 current_timezone= my_time_zone;
84- localtime_r(&tmp,&tm_tmp);
85+ if (skip_timezone)
86+ {
87+ gmtime_r(&tmp, &tm_tmp);
88+ }
89+ else
90+ {
91+ localtime_r(&tmp,&tm_tmp);
92+ }
93+
94 l_time=&tm_tmp;
95 for (loop=0;
96 loop < 2 &&
97@@ -949,7 +957,14 @@
98 (long) ((int) t->second - (int) l_time->tm_sec));
99 current_timezone+= diff+3600; /* Compensate for -3600 above */
100 tmp+= (time_t) diff;
101- localtime_r(&tmp,&tm_tmp);
102+ if (skip_timezone)
103+ {
104+ gmtime_r(&tmp, &tm_tmp);
105+ }
106+ else
107+ {
108+ localtime_r(&tmp, &tm_tmp);
109+ }
110 l_time=&tm_tmp;
111 }
112 /*
113
114=== modified file 'drizzled/type/time.h'
115--- drizzled/type/time.h 2011-01-06 23:02:43 +0000
116+++ drizzled/type/time.h 2011-01-11 01:56:36 +0000
117@@ -145,7 +145,7 @@
118
119 time_t
120 my_system_gmt_sec(const type::Time *t, long *my_timezone,
121- bool *in_dst_time_gap);
122+ bool *in_dst_time_gap, bool skip_timezone= false);
123
124 void set_zero_time(type::Time *tm, enum enum_drizzle_timestamp_type time_type);
125

Subscribers

People subscribed via source and target branches