~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/function.cc

  • Committer: lbieber at stabletransit
  • Date: 2010-10-14 15:43:11 UTC
  • mfrom: (1848.1.4 build)
  • Revision ID: lbieber@drizzle-build-n02.wc1.dfw1.stabletransit.com-20101014154311-ojsrl9uz80yvizey
Merge Travis - changing struct to C++ classes
Merge Andrew - fix bug #571579: libdrizzle unexpected hang up when using in extremely slow networking environment
Merge Andrew - fix bug #643772: Large rows cannot be read if packet_size exceeds max buffer size
Merge Andrew - fix bug #660082: libdrizzle missing rev.147
Merge Andrew - fix bug 653234: drizzledump (and other clients?) should print Password: prompt on stderr
Merge Andrew - fix bug #653438: "Enter password" prompt should not print stars, or erase them on enter
Merge Andrew - fix bug 659824: Drizzle client UTF8 processing endless loop

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
 
 
31
using namespace std;
 
32
 
32
33
namespace drizzled
33
34
{
34
35
 
41
42
 
42
43
bool plugin::Function::addPlugin(const plugin::Function *udf)
43
44
{
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
45
  if (udf_registry.find(udf->getName()) != udf_registry.end())
53
46
  {
54
 
    errmsg_printf(error::ERROR,
 
47
    errmsg_printf(ERRMSG_LVL_ERROR,
55
48
                  _("A function named %s already exists!\n"),
56
49
                  udf->getName().c_str());
57
50
    return true;
58
51
  }
59
 
 
60
 
  std::pair<UdfMap::iterator, bool> ret=
 
52
  pair<UdfMap::iterator, bool> ret=
61
53
    udf_registry.insert(make_pair(udf->getName(), udf));
62
54
  if (ret.second == false)
63
55
  {
64
 
    errmsg_printf(error::ERROR,
 
56
    errmsg_printf(ERRMSG_LVL_ERROR,
65
57
                  _("Could not add Function!\n"));
66
58
    return true;
67
59
  }
68
 
 
69
60
  return false;
70
61
}
71
62