~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/function.cc

  • Committer: Lee Bieber
  • Date: 2010-12-23 23:11:00 UTC
  • mfrom: (2024.1.1 clean)
  • Revision ID: kalebral@gmail.com-20101223231100-0rqirgz7ugkl10yp
Merge Brian - session list cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <drizzled/gettext.h>
27
27
#include "drizzled/plugin/function.h"
28
 
#include <drizzled/function_container.h>
29
28
 
30
29
#include "drizzled/util/string.h"
31
30
 
41
40
 
42
41
bool plugin::Function::addPlugin(const plugin::Function *udf)
43
42
{
44
 
  if (FunctionContainer::getMap().find(udf->getName()) != FunctionContainer::getMap().end())
45
 
  {
46
 
    errmsg_printf(error::ERROR,
47
 
                  _("A function named %s already exists!\n"),
48
 
                  udf->getName().c_str());
49
 
    return true;
50
 
  }
51
 
 
52
43
  if (udf_registry.find(udf->getName()) != udf_registry.end())
53
44
  {
54
 
    errmsg_printf(error::ERROR,
 
45
    errmsg_printf(ERRMSG_LVL_ERROR,
55
46
                  _("A function named %s already exists!\n"),
56
47
                  udf->getName().c_str());
57
48
    return true;
58
49
  }
59
 
 
60
50
  std::pair<UdfMap::iterator, bool> ret=
61
51
    udf_registry.insert(make_pair(udf->getName(), udf));
62
52
  if (ret.second == false)
63
53
  {
64
 
    errmsg_printf(error::ERROR,
 
54
    errmsg_printf(ERRMSG_LVL_ERROR,
65
55
                  _("Could not add Function!\n"));
66
56
    return true;
67
57
  }
68
 
 
69
58
  return false;
70
59
}
71
60