~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_strfunc.cc

  • Committer: Brian Aker
  • Date: 2008-08-07 16:29:49 UTC
  • mfrom: (264.1.20 codestyle)
  • Revision ID: brian@tangent.org-20080807162949-7o8eyjgdn8ms3n1a
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    (This shouldn't be needed)
26
26
*/
27
27
 
28
 
#ifdef USE_PRAGMA_IMPLEMENTATION
29
 
#pragma implementation                          // gcc: Class implementation
30
 
#endif
31
 
 
32
 
 
33
 
#include "mysql_priv.h"
 
28
#include <drizzled/server_includes.h>
34
29
#include <mysys/sha1.h>
35
30
#include <zlib.h>
36
31
C_MODE_START
1252
1247
}
1253
1248
 
1254
1249
 
1255
 
Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
 
1250
Item *Item_func_sysconst::safe_charset_converter(const CHARSET_INFO * const tocs)
1256
1251
{
1257
1252
  Item_string *conv;
1258
1253
  uint conv_errors;
1298
1293
  // For system threads (e.g. replication SQL thread) user may be empty
1299
1294
  if (user)
1300
1295
  {
1301
 
    CHARSET_INFO *cs= str_value.charset();
 
1296
    const CHARSET_INFO * const cs= str_value.charset();
1302
1297
    uint res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen;
1303
1298
 
1304
1299
    if (str_value.alloc(res_length))
2040
2035
 
2041
2036
void Item_func_set_collation::fix_length_and_dec()
2042
2037
{
2043
 
  CHARSET_INFO *set_collation;
 
2038
  const CHARSET_INFO *set_collation;
2044
2039
  const char *colname;
2045
2040
  String tmp, *str= args[1]->val_str(&tmp);
2046
2041
  colname= str->c_ptr();
2106
2101
  assert(fixed == 1);
2107
2102
  uint dummy_errors;
2108
2103
 
2109
 
  CHARSET_INFO *cs= args[0]->collation.collation; 
 
2104
  const CHARSET_INFO * const cs= args[0]->collation.collation; 
2110
2105
  null_value= 0;
2111
2106
  str->copy(cs->csname, strlen(cs->csname),
2112
2107
            &my_charset_latin1, collation.collation, &dummy_errors);
2117
2112
{
2118
2113
  assert(fixed == 1);
2119
2114
  uint dummy_errors;
2120
 
  CHARSET_INFO *cs= args[0]->collation.collation; 
 
2115
  const CHARSET_INFO * const cs= args[0]->collation.collation; 
2121
2116
 
2122
2117
  null_value= 0;
2123
2118
  str->copy(cs->name, strlen(cs->name),
2128
2123
 
2129
2124
void Item_func_weight_string::fix_length_and_dec()
2130
2125
{
2131
 
  CHARSET_INFO *cs= args[0]->collation.collation;
 
2126
  const CHARSET_INFO * const cs= args[0]->collation.collation;
2132
2127
  collation.set(&my_charset_bin, args[0]->collation.derivation);
2133
2128
  flags= my_strxfrm_flag_normalize(flags, cs->levels_for_order);
2134
2129
  max_length= cs->mbmaxlen * max(args[0]->max_length, nweights);
2140
2135
String *Item_func_weight_string::val_str(String *str)
2141
2136
{
2142
2137
  String *res;
2143
 
  CHARSET_INFO *cs= args[0]->collation.collation;
 
2138
  const CHARSET_INFO * const cs= args[0]->collation.collation;
2144
2139
  uint tmp_length, frm_length;
2145
2140
  assert(fixed == 1);
2146
2141