~vjsamuel/drizzle/rplugin-rabbitmq

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.cc

  • Committer: Brian Aker
  • Date: 2010-07-16 19:54:08 UTC
  • mfrom: (1660.1.4 rollup)
  • Revision ID: brian@gaz-20100716195408-8fiuxwmy4mpqq4ko
Rollup patch + fix for not intel processors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
      function should be called only for first of them (i.e. the one
143
143
      having auto-set property).
144
144
    */
145
 
    assert(table->timestamp_field == this);
 
145
    assert(getTable()->timestamp_field == this);
146
146
    /* Fall-through */
147
147
  case TIMESTAMP_DNUN_FIELD:
148
148
    return TIMESTAMP_AUTO_SET_ON_BOTH;
234
234
  ASSERT_COLUMN_MARKED_FOR_READ;
235
235
 
236
236
#ifdef WORDS_BIGENDIAN
237
 
  if (table && table->s->db_low_byte_first)
 
237
  if (getTable() && getTable()->s->db_low_byte_first)
238
238
    temp= uint4korr(ptr);
239
239
  else
240
240
#endif
259
259
  to= (char *) val_buffer->ptr();
260
260
 
261
261
#ifdef WORDS_BIGENDIAN
262
 
  if (table && table->s->db_low_byte_first)
 
262
  if (getTable() && getTable()->s->db_low_byte_first)
263
263
    temp= uint4korr(ptr);
264
264
  else
265
265
#endif
283
283
  uint32_t temp;
284
284
 
285
285
#ifdef WORDS_BIGENDIAN
286
 
  if (table && table->s->db_low_byte_first)
 
286
  if (getTable() && getTable()->s->db_low_byte_first)
287
287
    temp= uint4korr(ptr);
288
288
  else
289
289
#endif
316
316
{
317
317
  int32_t a,b;
318
318
#ifdef WORDS_BIGENDIAN
319
 
  if (table && table->s->db_low_byte_first)
 
319
  if (getTable() && getTable()->s->db_low_byte_first)
320
320
  {
321
321
    a=sint4korr(a_ptr);
322
322
    b=sint4korr(b_ptr);
334
334
void Field_timestamp::sort_string(unsigned char *to,uint32_t )
335
335
{
336
336
#ifdef WORDS_BIGENDIAN
337
 
  if (!table || !table->s->db_low_byte_first)
 
337
  if (!getTable() || !getTable()->s->db_low_byte_first)
338
338
  {
339
339
    to[0] = ptr[0];
340
340
    to[1] = ptr[1];
358
358
 
359
359
void Field_timestamp::set_time()
360
360
{
361
 
  Session *session= table ? table->in_use : current_session;
 
361
  Session *session= getTable() ? getTable()->in_use : current_session;
362
362
  long tmp= (long) session->query_start();
363
363
  set_notnull();
364
364
  store_timestamp(tmp);
366
366
 
367
367
void Field_timestamp::set_default()
368
368
{
369
 
  if (table->timestamp_field == this &&
 
369
  if (getTable()->timestamp_field == this &&
370
370
      unireg_check != TIMESTAMP_UN_FIELD)
371
371
    set_time();
372
372
  else
378
378
  if ((*null_value= is_null()))
379
379
    return 0;
380
380
#ifdef WORDS_BIGENDIAN
381
 
  if (table && table->s->db_low_byte_first)
 
381
  if (getTable() && getTable()->s->db_low_byte_first)
382
382
    return sint4korr(ptr);
383
383
#endif
384
384
  long tmp;
389
389
void Field_timestamp::store_timestamp(time_t timestamp)
390
390
{
391
391
#ifdef WORDS_BIGENDIAN
392
 
  if (table && table->s->db_low_byte_first)
 
392
  if (getTable() && getTable()->s->db_low_byte_first)
393
393
  {
394
394
    int4store(ptr,timestamp);
395
395
  }