~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/fstring.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 04:28:21 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020042821-rqqdrccuu8195k3y
Second pass of thd cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  const char *from_end_pos;
41
41
 
42
42
  /* See the comment for Field_long::store(int64_t) */
43
 
  assert(table->in_use == current_thd);
 
43
  assert(table->in_use == current_session);
44
44
 
45
45
  copy_length= well_formed_copy_nchars(field_charset,
46
46
                                       (char*) ptr, field_length,
91
91
    char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
92
92
    String tmp(buf, sizeof(buf), cs);
93
93
    tmp.copy((char*) ptr, field_length, cs);
94
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
94
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
95
95
                        ER_TRUNCATED_WRONG_VALUE, 
96
96
                        ER(ER_TRUNCATED_WRONG_VALUE),
97
97
                        "DOUBLE", tmp.c_ptr());
116
116
    char buf[LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE];
117
117
    String tmp(buf, sizeof(buf), cs);
118
118
    tmp.copy((char*) ptr, field_length, cs);
119
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
119
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
120
120
                        ER_TRUNCATED_WRONG_VALUE, 
121
121
                        ER(ER_TRUNCATED_WRONG_VALUE),
122
122
                        "INTEGER", tmp.c_ptr());
129
129
                              String *val_ptr)
130
130
{
131
131
  /* See the comment for Field_long::store(int64_t) */
132
 
  assert(table->in_use == current_thd);
 
132
  assert(table->in_use == current_session);
133
133
  uint32_t length;
134
134
 
135
135
  length= field_charset->cset->lengthsp(field_charset, (const char*) ptr, field_length);
149
149
    const CHARSET_INFO * const cs= charset();
150
150
    String tmp(buf, sizeof(buf), cs);
151
151
    tmp.copy((char*) ptr, field_length, cs);
152
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
152
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
153
153
                        ER_TRUNCATED_WRONG_VALUE, 
154
154
                        ER(ER_TRUNCATED_WRONG_VALUE),
155
155
                        "DECIMAL", tmp.c_ptr());
193
193
 
194
194
void Field_string::sql_type(String &res) const
195
195
{
196
 
  Session *thd= table->in_use;
 
196
  Session *session= table->in_use;
197
197
  const CHARSET_INFO * const cs= res.charset();
198
198
  uint32_t length;
199
199
 
200
200
  length= cs->cset->snprintf(cs,(char*) res.ptr(),
201
201
                             res.alloced_length(), "%s(%d)",
202
202
                             ((type() == DRIZZLE_TYPE_VARCHAR &&
203
 
                               !thd->variables.new_mode) ?
 
203
                               !session->variables.new_mode) ?
204
204
                              (has_charset() ? "varchar" : "varbinary") :
205
205
                              (has_charset() ? "char" : "binary")),
206
206
                             (int) field_length / charset()->mbmaxlen);