~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/strfunc.cc

  • Committer: Monty Taylor
  • Date: 2011-03-10 18:09:05 UTC
  • mfrom: (2225.2.2 refactor)
  • mto: This revision was merged to the branch mainline in revision 2228.
  • Revision ID: mordred@inaugust.com-20110310180905-ttx05t7q7ff6nl7c
Merge Olad: Refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    (This shouldn't be needed)
26
26
*/
27
27
 
28
 
#include "config.h"
 
28
#include <config.h>
29
29
#include <zlib.h>
30
30
#include <drizzled/query_id.h>
31
31
#include <drizzled/error.h>
32
32
#include <drizzled/function/str/strfunc.h>
33
33
 
34
34
// For soundex_map
35
 
#include "drizzled/internal/my_static.h"
 
35
#include <drizzled/internal/my_static.h>
36
36
 
37
37
using namespace std;
38
38
 
53
53
}
54
54
 
55
55
 
56
 
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
 
56
type::Decimal *Item_str_func::val_decimal(type::Decimal *decimal_value)
57
57
{
58
58
  assert(fixed == 1);
59
59
  char buff[64];
60
60
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
61
61
  res= val_str(&tmp);
62
 
  if (!res)
 
62
  if (not res)
63
63
    return 0;
64
 
  (void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
65
 
                       res->length(), res->charset(), decimal_value);
 
64
 
 
65
  (void)decimal_value->store(E_DEC_FATAL_ERROR, (char*) res->ptr(), res->length(), res->charset());
 
66
 
66
67
  return decimal_value;
67
68
}
68
69
 
83
84
{
84
85
  assert(fixed == 1);
85
86
  int err;
86
 
  char buff[22];
 
87
  char buff[DECIMAL_LONGLONG_DIGITS];
87
88
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
88
89
  res= val_str(&tmp);
89
90
  return (res ?
105
106
  }
106
107
}
107
108
 
108
 
String my_empty_string("",default_charset_info);
 
109
DRIZZLED_API String my_empty_string("",default_charset_info);
109
110
 
110
111
} /* namespace drizzled */