~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/module.h

Merge Revision revid:marko.makela@oracle.com-20100514133144-fe0l0b89tea4x4uu from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100514133144-fe0l0b89tea4x4uu

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
Merge from mysql-5.1-innodb:

Post-merge fixes: Remove the MYSQL_VERSION_ID checks, because they only
apply to the InnoDB Plugin. Fix potential race condition accessing
trx->op_info and trx->detailed_error.
------------------------------------------------------------
revno: 3466
revision-id: marko.makela@oracle.com-20100514130815-ym7j7cfu88ro6km4
parent: marko.makela@oracle.com-20100514130228-n3n42nw7ht78k0wn
committer: Marko Mkel <marko.makela@oracle.com>
branch nick: mysql-5.1-innodb2
timestamp: Fri 2010-05-14 16:08:15 +0300
message:
  Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)
  Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

  This fixes the bugs in the InnoDB Plugin.

  ha_innodb.h: Use trx_query_string() instead of trx_query() when
  available (MySQL 5.1.42 or later).

  innobase_get_stmt(): New function, to retrieve the currently running
  SQL statement.

  struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead.

  dict_strip_comments(): Add and observe the parameter sql_length. Treat
  /*/ as the start of a comment.

  dict_create_foreign_constraints(), row_table_add_foreign_constraints():
  Add the parameter sql_length.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2009 Sun Microsystems
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; version 2 of the License.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 */
 
19
 
 
20
#ifndef DRIZZLED_MODULE_MODULE_H
 
21
#define DRIZZLED_MODULE_MODULE_H
 
22
 
 
23
/**
 
24
 * @file Defines a Plugin Module
 
25
 *
 
26
 * A plugin::Module is the fundamental functional element of the plugin system.
 
27
 * Plugins are inited and deinited by module. A module init can register one
 
28
 * or more plugin::Plugin objects. 
 
29
 */
 
30
 
 
31
#include <cassert>
 
32
#include <vector>
 
33
#include <boost/program_options.hpp>
 
34
 
 
35
#include "drizzled/module/manifest.h"
 
36
#include "drizzled/module/registry.h"
 
37
 
 
38
 
 
39
namespace drizzled
 
40
{
 
41
class set_var;
 
42
 
 
43
void module_shutdown(module::Registry &registry);
 
44
 
 
45
namespace module
 
46
{
 
47
 
 
48
class Library;
 
49
 
 
50
/* A plugin module */
 
51
class Module
 
52
{
 
53
  const std::string name;
 
54
  const Manifest *manifest;
 
55
 
 
56
public:
 
57
  typedef std::vector<sys_var *> Variables;
 
58
  Library *plugin_dl;
 
59
  bool isInited;
 
60
  Variables system_vars;         /* server variables for this plugin */
 
61
  Variables sys_vars;
 
62
  Module(const Manifest *manifest_arg,
 
63
         Library *library_arg) :
 
64
    name(manifest_arg->name),
 
65
    manifest(manifest_arg),
 
66
    plugin_dl(library_arg),
 
67
    isInited(false),
 
68
    system_vars(),
 
69
    sys_vars()
 
70
  {
 
71
    assert(manifest != NULL);
 
72
  }
 
73
 
 
74
  ~Module();
 
75
 
 
76
  const std::string& getName() const
 
77
  {
 
78
    return name;
 
79
  }
 
80
 
 
81
  const Manifest& getManifest() const
 
82
  {
 
83
    return *manifest;
 
84
  }
 
85
 
 
86
  void addMySysVar(sys_var *var)
 
87
  {
 
88
    sys_vars.push_back(var);
 
89
    addSysVar(var);
 
90
  }
 
91
 
 
92
  void addSysVar(sys_var *var)
 
93
  {
 
94
    system_vars.push_back(var);
 
95
  }
 
96
 
 
97
  Variables &getSysVars()
 
98
  {
 
99
    return system_vars;
 
100
  }
 
101
};
 
102
 
 
103
} /* namespace module */
 
104
} /* namespace drizzled */
 
105
 
 
106
#endif /* DRIZZLED_MODULE_MODULE_H */