~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Olaf van der Spek
  • Date: 2011-03-29 12:04:36 UTC
  • mto: (2257.1.1 build) (2276.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: olafvdspek@gmail.com-20110329120436-vozkuer8vqgh027p
Always call assert()

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
 
// For soundex_map
35
 
#include "drizzled/internal/my_static.h"
36
 
 
37
34
using namespace std;
38
35
 
39
36
namespace drizzled
53
50
}
54
51
 
55
52
 
56
 
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
 
53
type::Decimal *Item_str_func::val_decimal(type::Decimal *decimal_value)
57
54
{
58
55
  assert(fixed == 1);
59
56
  char buff[64];
60
57
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
61
58
  res= val_str(&tmp);
62
 
  if (!res)
 
59
  if (not res)
63
60
    return 0;
64
 
  (void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
65
 
                       res->length(), res->charset(), decimal_value);
 
61
 
 
62
  (void)decimal_value->store(E_DEC_FATAL_ERROR, (char*) res->ptr(), res->length(), res->charset());
 
63
 
66
64
  return decimal_value;
67
65
}
68
66
 
83
81
{
84
82
  assert(fixed == 1);
85
83
  int err;
86
 
  char buff[22];
 
84
  char buff[DECIMAL_LONGLONG_DIGITS];
87
85
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
88
86
  res= val_str(&tmp);
89
87
  return (res ?
105
103
  }
106
104
}
107
105
 
108
 
String my_empty_string("",default_charset_info);
 
106
DRIZZLED_API String my_empty_string("",default_charset_info);
109
107
 
110
108
} /* namespace drizzled */