~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/plugin_ms.cc

  • Committer: Andrew Hutchings
  • Date: 2010-11-14 14:46:36 UTC
  • mto: (1931.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1932.
  • Revision ID: andrew@linuxjedi.co.uk-20101114144636-bkttapbfpp20ccd2
Fix broken Global Status test
Fix some stats not reset
Cleanup code a little

Note: local session stats are not reset, they will be added to the global stats after flush if any query is executed on those sessions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2010 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2010 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase Media Stream for MySQL
4
4
 *
24
24
 *
25
25
 */
26
26
#ifdef DRIZZLED
27
 
#include <config.h>
 
27
#include "config.h"
28
28
#include <drizzled/common.h>
29
29
#include <drizzled/plugin.h>
30
30
#include <drizzled/session.h>
57
57
#include "events_ms.h"
58
58
static PBMSEvents *pbms_events= NULL;
59
59
 
 
60
 
60
61
extern int pbms_init_func(module::Context &registry);
61
 
 
62
 
static void init_options(module::option_context &context)
 
62
extern struct drizzled::drizzle_sys_var* pbms_system_variables[];
 
63
 
 
64
extern uint32_t pbms_port_number;
 
65
 
 
66
static void init_options(drizzled::module::option_context &context)
63
67
{
64
 
        PBMSParameters::initOptions(context);
 
68
  context("port",
 
69
          po::value<uint32_t>(&pbms_port_number)->default_value(DEFAULT_PBMS_PORT),
 
70
          N_("Port number to use for connection or 0 for default PBMS port "));
65
71
}
66
72
 
 
73
 
67
74
static int my_init(module::Context &context)
68
75
{
69
76
        int rtc;
70
 
 
71
 
        PBMSParameters::startUp(context);
 
77
        const module::option_map &vm= context.getOptions();
 
78
 
 
79
        if (vm.count("port"))
 
80
        {
 
81
          if (pbms_port_number > 65535)
 
82
          {
 
83
            errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid port number\n"));
 
84
            return(-1);
 
85
          }
 
86
        }
 
87
 
 
88
        PBMSParameters::startUp();
72
89
        rtc = pbms_init_func(context);
73
90
        if (rtc == 0) {
74
91
                pbms_events = new PBMSEvents();
87
104
        "The Media Stream daemon for Drizzle",
88
105
        PLUGIN_LICENSE_GPL,
89
106
        my_init, /* Plugin Init */
90
 
        NULL,          /* depends */
 
107
        pbms_system_variables,          /* system variables                */
91
108
        init_options                                            /* config options                  */
92
109
}
93
110
DRIZZLE_DECLARE_PLUGIN_END;
115
132
        0x0001 /* 0.1 */,
116
133
        NULL,                                                                                   /* status variables                                                             */
117
134
#if MYSQL_VERSION_ID >= 50118
118
 
        pbms_system_variables,                                                  /* depends */
 
135
        pbms_system_variables,                                                  /* system variables                                                             */
119
136
#else
120
137
        NULL,
121
138
#endif
125
142
#endif //DRIZZLED
126
143
 
127
144
 
128
 
// vim:noexpandtab:sts=8:sw=8:tabstop=8:smarttab: