~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2008-11-15 18:39:51 UTC
  • mto: (584.1.7 devel)
  • mto: This revision was merged to the branch mainline in revision 588.
  • Revision ID: monty@inaugust.com-20081115183951-jo2v3abwdu24lnwq
Split out hybrid_type_traits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
17
/**
25
25
    (This shouldn't be needed)
26
26
*/
27
27
 
28
 
#include "config.h"
 
28
#include <drizzled/server_includes.h>
 
29
#include <mysys/sha1.h>
29
30
#include <zlib.h>
30
31
#include <drizzled/query_id.h>
 
32
#include <uuid/uuid.h>
 
33
#include <drizzled/data_home.h>
31
34
#include <drizzled/error.h>
32
 
#include <drizzled/function/str/strfunc.h>
33
35
 
34
36
// For soundex_map
35
 
#include "drizzled/internal/my_static.h"
 
37
#include <mysys/my_static.h>
 
38
#include CMATH_H
 
39
 
 
40
#if defined(CMATH_NAMESPACE)
 
41
using namespace CMATH_NAMESPACE;
 
42
#endif
36
43
 
37
44
using namespace std;
38
45
 
39
 
namespace drizzled
40
 
{
41
 
 
42
 
Item_str_func::~Item_str_func() {}
43
 
 
44
46
bool Item_str_func::fix_fields(Session *session, Item **ref)
45
47
{
46
48
  bool res= Item_func::fix_fields(session, ref);
53
55
}
54
56
 
55
57
 
56
 
type::Decimal *Item_str_func::val_decimal(type::Decimal *decimal_value)
 
58
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
57
59
{
58
60
  assert(fixed == 1);
59
61
  char buff[64];
60
62
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
61
63
  res= val_str(&tmp);
62
 
  if (not res)
 
64
  if (!res)
63
65
    return 0;
64
 
 
65
 
  (void)decimal_value->store(E_DEC_FATAL_ERROR, (char*) res->ptr(), res->length(), res->charset());
66
 
 
 
66
  (void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
 
67
                       res->length(), res->charset(), decimal_value);
67
68
  return decimal_value;
68
69
}
69
70
 
84
85
{
85
86
  assert(fixed == 1);
86
87
  int err;
87
 
  char buff[DECIMAL_LONGLONG_DIGITS];
 
88
  char buff[22];
88
89
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
89
90
  res= val_str(&tmp);
90
91
  return (res ?
106
107
  }
107
108
}
108
109
 
109
 
DRIZZLED_API String my_empty_string("",default_charset_info);
110
 
 
111
 
} /* namespace drizzled */