~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.cc

  • Committer: Monty Taylor
  • Date: 2010-03-02 19:10:25 UTC
  • mto: (1317.1.8)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: mordred@inaugust.com-20100302191025-zoxjz4xwkoa6160h
Prevent unauthorized users from changing schema.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  double nr= my_strntod(cs,(char*) from, len, &end, &error);
49
49
 
50
50
  ASSERT_COLUMN_MARKED_FOR_WRITE;
51
 
  if (error || (!len || (((uint32_t) (end-from) != len) && getTable()->in_use->count_cuted_fields)))
 
51
  if (error || (!len || (((uint32_t) (end-from) != len) && table->in_use->count_cuted_fields)))
52
52
  {
53
53
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
54
54
                (error ? ER_WARN_DATA_OUT_OF_RANGE : ER_WARN_DATA_TRUNCATED), 1);
66
66
  ASSERT_COLUMN_MARKED_FOR_WRITE;
67
67
 
68
68
#ifdef WORDS_BIGENDIAN
69
 
  if (getTable()->getShare()->db_low_byte_first)
 
69
  if (table->s->db_low_byte_first)
70
70
  {
71
71
    float8store(ptr,nr);
72
72
  }
90
90
  ASSERT_COLUMN_MARKED_FOR_READ;
91
91
 
92
92
#ifdef WORDS_BIGENDIAN
93
 
  if (getTable()->getShare()->db_low_byte_first)
 
93
  if (table->s->db_low_byte_first)
94
94
  {
95
95
    float8get(j,ptr);
96
96
  }
108
108
  ASSERT_COLUMN_MARKED_FOR_READ;
109
109
 
110
110
#ifdef WORDS_BIGENDIAN
111
 
  if (getTable()->getShare()->db_low_byte_first)
 
111
  if (table->s->db_low_byte_first)
112
112
  {
113
113
    float8get(j,ptr);
114
114
  }
133
133
    char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
134
134
    String tmp(buf, sizeof(buf), &my_charset_utf8_general_ci), *str;
135
135
    str= val_str(&tmp, &tmp);
136
 
    Session *session= getTable() ? getTable()->in_use : current_session;
137
 
    push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
136
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
138
137
                        ER_TRUNCATED_WRONG_VALUE,
139
138
                        ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
140
139
                        str->c_ptr());
151
150
  ASSERT_COLUMN_MARKED_FOR_READ;
152
151
 
153
152
#ifdef WORDS_BIGENDIAN
154
 
  if (getTable()->getShare()->db_low_byte_first)
 
153
  if (table->s->db_low_byte_first)
155
154
  {
156
155
    float8get(nr,ptr);
157
156
  }
178
177
{
179
178
  double a,b;
180
179
#ifdef WORDS_BIGENDIAN
181
 
  if (getTable()->getShare()->db_low_byte_first)
 
180
  if (table->s->db_low_byte_first)
182
181
  {
183
182
    float8get(a,a_ptr);
184
183
    float8get(b,b_ptr);
199
198
{
200
199
  double nr;
201
200
#ifdef WORDS_BIGENDIAN
202
 
  if (getTable()->getShare()->db_low_byte_first)
 
201
  if (table->s->db_low_byte_first)
203
202
  {
204
203
    float8get(nr,ptr);
205
204
  }