~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/string.cc

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

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;
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