~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/int64_t.cc

  • Committer: Brian Aker
  • Date: 2008-11-25 02:31:14 UTC
  • Revision ID: brian@tangent.org-20081125023114-2f7sx8fye2jytgyw
Removed dead event structure pieces from replication.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
  const CHARSET_INFO * const cs=res.charset();
226
226
  res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), "bigint"));
227
227
}
 
228
 
 
229
 
 
230
unsigned char *Field_int64_t::pack(unsigned char* to, const unsigned char *from,
 
231
                                         uint32_t,
 
232
#ifdef WORDS_BIGENDIAN
 
233
                                         bool low_byte_first
 
234
#else
 
235
                                         bool
 
236
#endif
 
237
)
 
238
{
 
239
  int64_t val;
 
240
#ifdef WORDS_BIGENDIAN
 
241
  if (table->s->db_low_byte_first)
 
242
     val = sint8korr(from);
 
243
  else
 
244
#endif
 
245
    int64_tget(val, from);
 
246
 
 
247
#ifdef WORDS_BIGENDIAN
 
248
  if (low_byte_first)
 
249
    int8store(to, val);
 
250
  else
 
251
#endif
 
252
    int64_tstore(to, val);
 
253
  return to + sizeof(val);
 
254
}
 
255
 
 
256
 
 
257
const unsigned char *Field_int64_t::unpack(unsigned char* to, const unsigned char *from, uint32_t,
 
258
#ifdef WORDS_BIGENDIAN
 
259
                                           bool low_byte_first
 
260
#else
 
261
                                           bool
 
262
#endif
 
263
)
 
264
{
 
265
  int64_t val;
 
266
#ifdef WORDS_BIGENDIAN
 
267
  if (low_byte_first)
 
268
    val = sint8korr(from);
 
269
  else
 
270
#endif
 
271
    int64_tget(val, from);
 
272
 
 
273
#ifdef WORDS_BIGENDIAN
 
274
  if (table->s->db_low_byte_first)
 
275
    int8store(to, val);
 
276
  else
 
277
#endif
 
278
    int64_tstore(to, val);
 
279
  return from + sizeof(val);
 
280
}
 
281