~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/create.cc

  • Committer: lbieber
  • Date: 2010-09-13 23:03:27 UTC
  • mfrom: (1761.1.1 build)
  • Revision ID: lbieber@orisndriz08-20100913230327-63e4fk97eacjrtbg
Merge Brian - Adds random_number, random_string, and a counter table to DD

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/item/func.h>
26
26
#include <drizzled/error.h>
27
27
 
 
28
#include "drizzled/function_container.h"
 
29
 
28
30
#include <drizzled/function/str/binary.h>
29
31
#include <drizzled/function/str/concat.h>
30
32
#include <drizzled/function/str/conv.h>
98
100
#include <drizzled/function/math/tan.h>
99
101
#include <drizzled/function/units.h>
100
102
 
101
 
#include <map>
102
 
 
103
103
using namespace std;
104
104
 
105
105
namespace drizzled
2596
2596
  { {0, 0}, NULL}
2597
2597
};
2598
2598
 
2599
 
static map<string, Native_func_registry *> native_functions_map;
2600
 
 
2601
2599
/*
2602
2600
  Load the hash table for native functions.
2603
2601
  Note: this code is not thread safe, and is intended to be used at server
2612
2610
  for (func= func_array; func->builder != NULL; func++)
2613
2611
  {
2614
2612
    func_name.assign(func->name.str, func->name.length);
2615
 
    transform(func_name.begin(), func_name.end(), func_name.begin(), ::tolower);
2616
2613
 
2617
 
    native_functions_map[func_name]= func;
 
2614
    FunctionContainer::getMap()[func_name]= func;
2618
2615
  }
2619
2616
 
2620
2617
  return 0;
2628
2625
  Create_func *builder= NULL;
2629
2626
 
2630
2627
  string func_name(name.str, name.length);
2631
 
  transform(func_name.begin(), func_name.end(), func_name.begin(), ::tolower);
2632
 
 
2633
 
  map<string, Native_func_registry *>::iterator func_iter=
2634
 
    native_functions_map.find(func_name);
2635
 
 
2636
 
  if (func_iter != native_functions_map.end())
 
2628
 
 
2629
  NativeFunctionsMap::iterator func_iter=
 
2630
    FunctionContainer::getMap().find(func_name);
 
2631
 
 
2632
  if (func_iter != FunctionContainer::getMap().end())
2637
2633
  {
2638
2634
    func= (*func_iter).second;
2639
2635
    builder= func->builder;