~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/type/time.h

  • Committer: Brian Aker
  • Date: 2011-01-18 00:08:34 UTC
  • mto: (2097.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2098.
  • Revision ID: brian@tangent.org-20110118000834-a1p3mves421202oy
Fix additional output, swaps for the valus.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
  DRIZZLE_TIMESTAMP_DATE= 0, DRIZZLE_TIMESTAMP_DATETIME= 1, DRIZZLE_TIMESTAMP_TIME= 2
90
90
};
91
91
 
 
92
/*
 
93
  datatime_t while being stored in an integer is actually a formatted value.
 
94
*/
 
95
struct datatime_t {
 
96
  int64_t value;
 
97
};
 
98
 
92
99
 
93
100
 
94
101
class Time
161
168
  }
162
169
 
163
170
  void convert(drizzled::String &str, timestamp_t arg= type::DRIZZLE_TIMESTAMP_DATETIME);
 
171
  void convert(char *str, size_t &to_length, timestamp_t arg= type::DRIZZLE_TIMESTAMP_DATETIME);
 
172
 
164
173
  void store(const type::Time::epoch_t &from, bool use_localtime= false);
165
174
  void store(const type::Time::epoch_t &from, const usec_t &from_fractional_seconds, bool use_localtime= false);
166
175
  void store(const struct tm &from);
167
176
  void store(const struct timeval &from);
168
177
 
169
178
  static const uint32_t FRACTIONAL_DIGITS= 1000000;
 
179
  static const size_t MAX_STRING_LENGTH= 32;   // +32 to make my_snprintf_{8bit|ucs2} happy
170
180
};
171
181
 
172
182
}
219
229
                  bool *in_dst_time_gap, bool skip_timezone= false);
220
230
 
221
231
/*
222
 
  Required buffer length for my_time_to_str, my_date_to_str,
223
 
  my_datetime_to_str and TIME_to_string functions. Note, that the
224
 
  caller is still responsible to check that given TIME structure
225
 
  has values in valid ranges, otherwise size of the buffer could
226
 
  be not enough. We also rely on the fact that even wrong values
227
 
  sent using binary protocol fit in this buffer.
228
 
*/
229
 
#define MAX_DATE_STRING_REP_LENGTH 30
230
 
 
231
 
int my_TIME_to_str(const type::Time *l_time, char *to);
232
 
 
233
 
/*
234
232
  Available interval types used in any statement.
235
233
 
236
234
  'interval_type' must be sorted so that simple intervals comes first,