~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/string.cc

  • Committer: Brian Aker
  • Date: 2009-01-18 01:49:40 UTC
  • Revision ID: brian@gir-3.local-20090118014940-co9651fk7hla6gqg
Removed unused session param from list_open_tables()

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
22
22
#include <drizzled/session.h>
23
23
#include <drizzled/error.h>
24
24
#include <drizzled/item/string.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
Item *Item_string::safe_charset_converter(const CHARSET_INFO * const tocs)
30
27
{
31
28
  Item_string *conv;
32
 
  size_t conv_errors;
 
29
  uint32_t conv_errors;
33
30
  char *ptr;
34
31
  String tmp, cstr, *ostr= val_str(&tmp);
35
32
  cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
57
54
Item *Item_static_string_func::safe_charset_converter(const CHARSET_INFO * const tocs)
58
55
{
59
56
  Item_string *conv;
60
 
  size_t conv_errors;
 
57
  uint32_t conv_errors;
61
58
  String tmp, cstr, *ostr= val_str(&tmp);
62
59
  cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
63
60
  if (conv_errors ||
103
100
 
104
101
  str->append('\'');
105
102
 
106
 
  str_value.print(str);
 
103
  if (query_type == QT_ORDINARY ||
 
104
      my_charset_same(str_value.charset(), system_charset_info))
 
105
  {
 
106
    str_value.print(str);
 
107
  }
 
108
  else
 
109
  {
 
110
    Session *session= current_session;
 
111
    LEX_STRING utf8_lex_str;
 
112
 
 
113
    session->convert_string(&utf8_lex_str,
 
114
                        system_charset_info,
 
115
                        str_value.c_ptr_safe(),
 
116
                        str_value.length(),
 
117
                        str_value.charset());
 
118
 
 
119
    String utf8_str(utf8_lex_str.str,
 
120
                    utf8_lex_str.length,
 
121
                    system_charset_info);
 
122
 
 
123
    utf8_str.print(str);
 
124
  }
107
125
 
108
126
  str->append('\'');
109
127
}
175
193
}
176
194
 
177
195
 
178
 
} /* namespace drizzled */
 
196