~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/long.cc

  • Committer: Brian Aker
  • Date: 2009-07-11 05:59:19 UTC
  • mfrom: (1089.1.9 merge)
  • Revision ID: brian@gaz-20090711055919-m4px3crrdgta5lie
Collection of patches from new-cleanup (includes asserts for field in debug)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  int error;
41
41
  int64_t rnd;
42
42
 
 
43
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
44
 
43
45
  error= get_int(cs, from, len, &rnd, UINT32_MAX, INT32_MIN, INT32_MAX);
44
46
  store_tmp= (long) rnd;
45
47
#ifdef WORDS_BIGENDIAN
60
62
  int32_t res;
61
63
  nr=rint(nr);
62
64
 
 
65
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
66
 
63
67
  if (nr < (double) INT32_MIN)
64
68
  {
65
69
    res=(int32_t) INT32_MIN;
93
97
  int error= 0;
94
98
  int32_t res;
95
99
 
 
100
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
101
 
96
102
  if (nr < 0 && unsigned_val)
97
103
    nr= ((int64_t) INT32_MAX) + 1;           // Generate overflow
98
104
  if (nr < (int64_t) INT32_MIN)
126
132
double Field_long::val_real(void)
127
133
{
128
134
  int32_t j;
 
135
 
 
136
  ASSERT_COLUMN_MARKED_FOR_READ;
 
137
 
129
138
#ifdef WORDS_BIGENDIAN
130
139
  if (table->s->db_low_byte_first)
131
140
    j=sint4korr(ptr);
138
147
int64_t Field_long::val_int(void)
139
148
{
140
149
  int32_t j;
 
150
 
 
151
  ASSERT_COLUMN_MARKED_FOR_READ;
 
152
 
141
153
  /* See the comment in Field_long::store(int64_t) */
142
154
  assert(table->in_use == current_session);
143
155
#ifdef WORDS_BIGENDIAN
158
170
  val_buffer->alloc(mlength);
159
171
  char *to=(char*) val_buffer->ptr();
160
172
  int32_t j;
 
173
 
 
174
  ASSERT_COLUMN_MARKED_FOR_READ;
 
175
 
161
176
#ifdef WORDS_BIGENDIAN
162
177
  if (table->s->db_low_byte_first)
163
178
    j=sint4korr(ptr);