Merge lp:~jaypipes/drizzle/captain into lp:~drizzle-trunk/drizzle/development
- captain
- Merge into development
Status: | Superseded | ||||||||
---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~jaypipes/drizzle/captain | ||||||||
Merge into: | lp:~drizzle-trunk/drizzle/development | ||||||||
Diff against target: | None lines | ||||||||
To merge this branch: | bzr merge lp:~jaypipes/drizzle/captain | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+8996@code.launchpad.net |
This proposal has been superseded by a proposal from 2009-07-18.
Commit message
Description of the change
Jay Pipes (jaypipes) wrote : | # |
- 1098. By Brian Aker <brian@gaz>
-
Merge Jay
- 1099. By Brian Aker <brian@gaz>
-
Mege Jay
- 1100. By Brian Aker <brian@gaz>
-
Merge
- 1101. By Brian Aker <brian@gaz>
-
Merge Jay
- 1102. By Brian Aker <brian@gaz>
-
Merge Stewart
- 1103. By Brian Aker <brian@gaz>
-
Removal of all basic MRR
- 1104. By Brian Aker <brian@gaz>
-
Merge of SJ code.
- 1105. By Brian Aker <brian@gaz>
-
Merge Jay
- 1106. By Brian Aker <brian@gaz>
-
Merging Monty (which includes new replication)
- 1107. By Brian Aker <brian@gaz>
-
Collection of Valgrind fixes.
- 1108. By Brian Aker <brian@gaz>
-
Merge of Brian
- 1109. By Brian Aker <brian@gaz>
-
Merge Brian
- 1110. By Brian Aker <brian@gaz>
-
Merge of Monty
- 1111. By Brian Aker <brian@gaz>
-
Merge Brian
- 1112. By Brian Aker <brian@gaz>
-
Merge Jay
- 1113. By Brian Aker <brian@gaz>
-
Merge Monty
- 1114. By Brian Aker <brian@gaz>
-
lcov dead code removal (merge)
- 1115. By Brian Aker <brian@gaz>
-
MErge Jay
- 1116. By Jay Pipes <jpipes@serialcoder>
-
Merges Trond's fix for memory overflow error on Solaris in readdir_r
- 1117. By Jay Pipes <jpipes@serialcoder>
-
Merge Robert's small fix for client/errname.h
- 1118. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's fix for Bug 311013
- 1119. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's continued cleanup of exec command classes plus a couple merge conflict resolutions...
- 1120. By Jay Pipes <jpipes@serialcoder>
-
Merge with trunk
- 1121. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's continued cleanup of execution commands
- 1122. By Jay Pipes <jpipes@serialcoder>
-
Merge trunk
- 1123. By Jay Pipes <jpipes@serialcoder>
-
Merge and resolve conflicts on pandora build fixes.
- 1124. By Jay Pipes <jpipes@serialcoder>
-
Merge Monty's bug fix for 409350. HEAP handler incorrectly does not destroy mutex.
- 1125. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's optimizer refactoring around pulling structs into real classes...
- 1126. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's refactoring of MY_BITMAP struct to a proper class interface.
- 1127. By Jay Pipes <jpipes@serialcoder>
-
Merge plugin slot reorganization from monty
- 1128. By Jay Pipes <jpipes@serialcoder>
-
Merge Biping's pool of thread plugin improvements.
- 1129. By Jay Pipes <jpipes@serialcoder>
-
Merge Monty's fixes for extended help and plugin initialization
- 1130. By Jay Pipes <jpipes@serialcoder>
-
Merge trunk
- 1131. By Jay Pipes <jpipes@serialcoder>
-
Merge Biping's fix for Solaris std::queue header confusion.
- 1132. By Jay Pipes <jpipes@serialcoder>
-
Merge trunk
- 1133. By Jay Pipes <jpipes@serialcoder>
-
Merge Monty's cast corrections.
- 1134. By Jay Pipes <jpipes@serialcoder>
-
Merge Diego
's fixes and enhancements for logging_x plugins - 1135. By Jay Pipes <jpipes@serialcoder>
-
Merging pandora build fixes with support for automake 1.11
- 1136. By Jay Pipes <jpipes@serialcoder>
-
Merge translations
- 1137. By Jay Pipes <jpipes@serialcoder>
-
Ignore table raw reader
- 1138. By Jay Pipes <jpipes@serialcoder>
-
Merge Padraig's continued cleanup of execution commands.
- 1139. By Jay Pipes <jpipes@serialcoder>
-
Merge pandora build fixes
- 1140. By Jay Pipes <jpipes@serialcoder>
-
Merge trunk
Preview Diff
1 | === modified file 'Makefile.am' | |||
2 | --- Makefile.am 2009-07-11 19:23:04 +0000 | |||
3 | +++ Makefile.am 2009-07-17 23:20:36 +0000 | |||
4 | @@ -128,7 +128,6 @@ | |||
5 | 128 | mysys/charset.cc \ | 128 | mysys/charset.cc \ |
6 | 129 | mysys/checksum.cc \ | 129 | mysys/checksum.cc \ |
7 | 130 | mysys/default.cc \ | 130 | mysys/default.cc \ |
8 | 131 | mysys/default_modify.cc \ | ||
9 | 132 | mysys/dynamic_array.cc \ | 131 | mysys/dynamic_array.cc \ |
10 | 133 | mysys/errors.cc \ | 132 | mysys/errors.cc \ |
11 | 134 | mysys/hash.cc \ | 133 | mysys/hash.cc \ |
12 | 135 | 134 | ||
13 | === modified file 'client/drizzle.1' | |||
14 | --- client/drizzle.1 2009-05-23 23:51:18 +0000 | |||
15 | +++ client/drizzle.1 2009-07-17 17:13:52 +0000 | |||
16 | @@ -1018,7 +1018,7 @@ | |||
17 | 1018 | The | 1018 | The |
18 | 1019 | \fBprompt\fR | 1019 | \fBprompt\fR |
19 | 1020 | command reconfigures the default | 1020 | command reconfigures the default |
21 | 1021 | mysql> | 1021 | drizzle> |
22 | 1022 | prompt. The string for defining the prompt can contain the following special sequences. | 1022 | prompt. The string for defining the prompt can contain the following special sequences. |
23 | 1023 | .TS | 1023 | .TS |
24 | 1024 | allbox tab(:); | 1024 | allbox tab(:); |
25 | @@ -1100,7 +1100,7 @@ | |||
26 | 1100 | \\U | 1100 | \\U |
27 | 1101 | T}:T{ | 1101 | T}:T{ |
28 | 1102 | Your full | 1102 | Your full |
30 | 1103 | \fIuser_name\fR@\fIhost_name\fR | 1103 | \fIuser\fR@\fIhost\fR |
31 | 1104 | account name | 1104 | account name |
32 | 1105 | T} | 1105 | T} |
33 | 1106 | T{ | 1106 | T{ |
34 | 1107 | 1107 | ||
35 | === modified file 'client/drizzledump.1' | |||
36 | --- client/drizzledump.1 2009-05-23 23:51:18 +0000 | |||
37 | +++ client/drizzledump.1 2009-07-17 17:13:52 +0000 | |||
38 | @@ -989,19 +989,20 @@ | |||
39 | 989 | NULL (\fIunknown value\fR) | 989 | NULL (\fIunknown value\fR) |
40 | 990 | T}:T{ | 990 | T}:T{ |
41 | 991 | <field name="\fIcolumn_name\fR" | 991 | <field name="\fIcolumn_name\fR" |
43 | 992 | xsi:nil="true" /> | 992 | xsi:nil="true" /> |
44 | 993 | T} | 993 | T} |
45 | 994 | T{ | 994 | T{ |
46 | 995 | \'' (\fIempty string\fR) | 995 | \'' (\fIempty string\fR) |
47 | 996 | T}:T{ | 996 | T}:T{ |
50 | 997 | <field | 997 | <field name="\fIcolumn_name\fR"> |
51 | 998 | name="\fIcolumn_name\fR"></field> | 998 | </field> |
52 | 999 | T} | 999 | T} |
53 | 1000 | T{ | 1000 | T{ |
54 | 1001 | \'NULL' (\fIstring value\fR) | 1001 | \'NULL' (\fIstring value\fR) |
55 | 1002 | T}:T{ | 1002 | T}:T{ |
58 | 1003 | <field | 1003 | <field name="\fIcolumn_name\fR"> |
59 | 1004 | name="\fIcolumn_name\fR">NULL</field> | 1004 | NULL |
60 | 1005 | </field> | ||
61 | 1005 | T} | 1006 | T} |
62 | 1006 | .TE | 1007 | .TE |
63 | 1007 | .sp | 1008 | .sp |
64 | 1008 | 1009 | ||
65 | === modified file 'config/uncrustify.cfg' | |||
66 | --- config/uncrustify.cfg 2009-07-10 21:50:02 +0000 | |||
67 | +++ config/uncrustify.cfg 2009-07-15 21:16:34 +0000 | |||
68 | @@ -60,8 +60,8 @@ | |||
69 | 60 | nl_create_if_one_liner=false | 60 | nl_create_if_one_liner=false |
70 | 61 | nl_create_for_one_liner=false | 61 | nl_create_for_one_liner=false |
71 | 62 | nl_create_while_one_liner=false | 62 | nl_create_while_one_liner=false |
74 | 63 | ls_for_split_full=true | 63 | ls_for_split_full=false |
75 | 64 | ls_func_split_full=true | 64 | ls_func_split_full=false |
76 | 65 | nl_after_multiline_comment=true | 65 | nl_after_multiline_comment=true |
77 | 66 | eat_blanks_after_open_brace=true | 66 | eat_blanks_after_open_brace=true |
78 | 67 | eat_blanks_before_close_brace=true | 67 | eat_blanks_before_close_brace=true |
79 | 68 | 68 | ||
80 | === modified file 'drizzled/Makefile.am' | |||
81 | --- drizzled/Makefile.am 2009-07-12 18:36:46 +0000 | |||
82 | +++ drizzled/Makefile.am 2009-07-15 21:47:32 +0000 | |||
83 | @@ -267,8 +267,11 @@ | |||
84 | 267 | plugin/applier.h \ | 267 | plugin/applier.h \ |
85 | 268 | plugin/authentication.h \ | 268 | plugin/authentication.h \ |
86 | 269 | plugin/error_message_handler.h \ | 269 | plugin/error_message_handler.h \ |
87 | 270 | plugin/handle.h \ | ||
88 | 271 | plugin/library.h \ | ||
89 | 270 | plugin/listen.h \ | 272 | plugin/listen.h \ |
90 | 271 | plugin/logging_handler.h \ | 273 | plugin/logging_handler.h \ |
91 | 274 | plugin/manifest.h \ | ||
92 | 272 | plugin/protocol.h \ | 275 | plugin/protocol.h \ |
93 | 273 | plugin/qcache.h \ | 276 | plugin/qcache.h \ |
94 | 274 | plugin/replicator.h \ | 277 | plugin/replicator.h \ |
95 | 275 | 278 | ||
96 | === modified file 'drizzled/drizzled.cc' | |||
97 | --- drizzled/drizzled.cc 2009-07-16 19:30:03 +0000 | |||
98 | +++ drizzled/drizzled.cc 2009-07-18 18:11:42 +0000 | |||
99 | @@ -2326,10 +2326,7 @@ | |||
100 | 2326 | #endif | 2326 | #endif |
101 | 2327 | 2327 | ||
102 | 2328 | /* Print out all the options including plugin supplied options */ | 2328 | /* Print out all the options including plugin supplied options */ |
107 | 2329 | my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option)); | 2329 | my_print_help_inc_plugins(my_long_options); |
104 | 2330 | |||
105 | 2331 | puts(_("\nTo see what values a running Drizzle server is using, type\n" | ||
106 | 2332 | "'drizzleadmin variables' instead of 'drizzled --help'.")); | ||
108 | 2333 | } | 2330 | } |
109 | 2334 | } | 2331 | } |
110 | 2335 | 2332 | ||
111 | 2336 | 2333 | ||
112 | === modified file 'drizzled/plugin.h' | |||
113 | --- drizzled/plugin.h 2009-07-07 09:06:29 +0000 | |||
114 | +++ drizzled/plugin.h 2009-07-15 21:30:33 +0000 | |||
115 | @@ -31,40 +31,28 @@ | |||
116 | 31 | */ | 31 | */ |
117 | 32 | 32 | ||
118 | 33 | 33 | ||
119 | 34 | /* We use the following strings to define licenses for plugins */ | ||
120 | 35 | enum plugin_license_type { | ||
121 | 36 | PLUGIN_LICENSE_PROPRIETARY, | ||
122 | 37 | PLUGIN_LICENSE_GPL, | ||
123 | 38 | PLUGIN_LICENSE_BSD, | ||
124 | 39 | PLUGIN_LICENSE_LGPL, | ||
125 | 40 | PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_LGPL | ||
126 | 41 | }; | ||
127 | 42 | |||
128 | 43 | const char * const PLUGIN_LICENSE_PROPRIETARY_STRING="PROPRIETARY"; | ||
129 | 44 | const char * const PLUGIN_LICENSE_GPL_STRING="GPL"; | ||
130 | 45 | const char * const PLUGIN_LICENSE_BSD_STRING="BSD"; | ||
131 | 46 | const char * const PLUGIN_LICENSE_LGPL_STRING="LGPL"; | ||
132 | 47 | |||
133 | 48 | /* | 34 | /* |
134 | 49 | Macros for beginning and ending plugin declarations. Between | 35 | Macros for beginning and ending plugin declarations. Between |
135 | 50 | drizzle_declare_plugin and drizzle_declare_plugin_end there should | 36 | drizzle_declare_plugin and drizzle_declare_plugin_end there should |
137 | 51 | be a drizzled_plugin_manifest struct for each plugin to be declared. | 37 | be a drizzled::plugin::Manifest for each plugin to be declared. |
138 | 52 | */ | 38 | */ |
139 | 53 | 39 | ||
140 | 54 | 40 | ||
141 | 55 | #ifndef DRIZZLE_DYNAMIC_PLUGIN | 41 | #ifndef DRIZZLE_DYNAMIC_PLUGIN |
142 | 56 | #define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \ | 42 | #define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \ |
144 | 57 | struct drizzled_plugin_manifest DECLS[]= { | 43 | drizzled::plugin::Manifest DECLS[]= { |
145 | 58 | #else | 44 | #else |
146 | 59 | #define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \ | 45 | #define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \ |
148 | 60 | struct drizzled_plugin_manifest _mysql_plugin_declarations_[]= { | 46 | drizzled::plugin::Manifest _drizzled_plugin_declaration_[]= { |
149 | 61 | #endif | 47 | #endif |
150 | 62 | 48 | ||
151 | 63 | #define drizzle_declare_plugin(NAME) \ | 49 | #define drizzle_declare_plugin(NAME) \ |
152 | 64 | __DRIZZLE_DECLARE_PLUGIN(NAME, \ | 50 | __DRIZZLE_DECLARE_PLUGIN(NAME, \ |
153 | 65 | builtin_ ## NAME ## _plugin) | 51 | builtin_ ## NAME ## _plugin) |
154 | 66 | 52 | ||
156 | 67 | #define drizzle_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0}} | 53 | #define drizzle_declare_plugin_end ,{0,0,0,0,PLUGIN_LICENSE_GPL,0,0,0,0,0}} |
157 | 54 | |||
158 | 55 | |||
159 | 68 | 56 | ||
160 | 69 | /* | 57 | /* |
161 | 70 | the following flags are valid for plugin_init() | 58 | the following flags are valid for plugin_init() |
162 | 71 | 59 | ||
163 | === added file 'drizzled/plugin/handle.h' | |||
164 | --- drizzled/plugin/handle.h 1970-01-01 00:00:00 +0000 | |||
165 | +++ drizzled/plugin/handle.h 2009-07-16 00:24:27 +0000 | |||
166 | @@ -0,0 +1,68 @@ | |||
167 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
168 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
169 | 3 | * | ||
170 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
171 | 5 | * | ||
172 | 6 | * This program is free software; you can redistribute it and/or modify | ||
173 | 7 | * it under the terms of the GNU General Public License as published by | ||
174 | 8 | * the Free Software Foundation; version 2 of the License. | ||
175 | 9 | * | ||
176 | 10 | * This program is distributed in the hope that it will be useful, | ||
177 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
178 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
179 | 13 | * GNU General Public License for more details. | ||
180 | 14 | * | ||
181 | 15 | * You should have received a copy of the GNU General Public License | ||
182 | 16 | * along with this program; if not, write to the Free Software | ||
183 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
184 | 18 | */ | ||
185 | 19 | |||
186 | 20 | #ifndef DRIZZLED_PLUGIN_HANDLE_H | ||
187 | 21 | #define DRIZZLED_PLUGIN_HANDLE_H | ||
188 | 22 | |||
189 | 23 | #include <drizzled/lex_string.h> | ||
190 | 24 | #include <mysys/my_alloc.h> | ||
191 | 25 | |||
192 | 26 | class sys_var; | ||
193 | 27 | |||
194 | 28 | namespace drizzled | ||
195 | 29 | { | ||
196 | 30 | namespace plugin | ||
197 | 31 | { | ||
198 | 32 | |||
199 | 33 | class Manifest; | ||
200 | 34 | class Library; | ||
201 | 35 | |||
202 | 36 | /* A handle of a plugin */ | ||
203 | 37 | class Handle | ||
204 | 38 | { | ||
205 | 39 | const std::string name; | ||
206 | 40 | Manifest *manifest; | ||
207 | 41 | public: | ||
208 | 42 | Library *plugin_dl; | ||
209 | 43 | bool isInited; | ||
210 | 44 | MEM_ROOT mem_root; /* memory for dynamic plugin structures */ | ||
211 | 45 | sys_var *system_vars; /* server variables for this plugin */ | ||
212 | 46 | Handle(Manifest *manifest_arg, Library *library_arg) | ||
213 | 47 | : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg), | ||
214 | 48 | mem_root(), system_vars(NULL) {} | ||
215 | 49 | |||
216 | 50 | Handle(Manifest *manifest_arg) | ||
217 | 51 | : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL), | ||
218 | 52 | mem_root(), system_vars(NULL) {} | ||
219 | 53 | |||
220 | 54 | const std::string& getName() const | ||
221 | 55 | { | ||
222 | 56 | return name; | ||
223 | 57 | } | ||
224 | 58 | |||
225 | 59 | const Manifest& getManifest() const | ||
226 | 60 | { | ||
227 | 61 | return *manifest; | ||
228 | 62 | } | ||
229 | 63 | }; | ||
230 | 64 | |||
231 | 65 | } /* namespace plugin */ | ||
232 | 66 | } /* namespace drizzled */ | ||
233 | 67 | |||
234 | 68 | #endif /* DRIZZLED_PLUGIN_HANDLE_H */ | ||
235 | 0 | 69 | ||
236 | === added file 'drizzled/plugin/library.h' | |||
237 | --- drizzled/plugin/library.h 1970-01-01 00:00:00 +0000 | |||
238 | +++ drizzled/plugin/library.h 2009-07-15 21:47:32 +0000 | |||
239 | @@ -0,0 +1,45 @@ | |||
240 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
241 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
242 | 3 | * | ||
243 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
244 | 5 | * | ||
245 | 6 | * This program is free software; you can redistribute it and/or modify | ||
246 | 7 | * it under the terms of the GNU General Public License as published by | ||
247 | 8 | * the Free Software Foundation; version 2 of the License. | ||
248 | 9 | * | ||
249 | 10 | * This program is distributed in the hope that it will be useful, | ||
250 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
251 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
252 | 13 | * GNU General Public License for more details. | ||
253 | 14 | * | ||
254 | 15 | * You should have received a copy of the GNU General Public License | ||
255 | 16 | * along with this program; if not, write to the Free Software | ||
256 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
257 | 18 | */ | ||
258 | 19 | |||
259 | 20 | #ifndef DRIZZLED_PLUGIN_LIBRARY_H | ||
260 | 21 | #define DRIZZLED_PLUGIN_LIBRARY_H | ||
261 | 22 | |||
262 | 23 | #include <drizzled/lex_string.h> | ||
263 | 24 | |||
264 | 25 | namespace drizzled | ||
265 | 26 | { | ||
266 | 27 | namespace plugin | ||
267 | 28 | { | ||
268 | 29 | |||
269 | 30 | class Manifest; | ||
270 | 31 | |||
271 | 32 | /* A handle for the dynamic library containing a plugin or plugins. */ | ||
272 | 33 | class Library | ||
273 | 34 | { | ||
274 | 35 | public: | ||
275 | 36 | LEX_STRING dl; | ||
276 | 37 | void *handle; | ||
277 | 38 | Manifest *plugins; | ||
278 | 39 | Library() : dl(), handle(NULL), plugins(NULL) {} | ||
279 | 40 | }; | ||
280 | 41 | |||
281 | 42 | } /* namespace plugin */ | ||
282 | 43 | } /* namespace drizzled */ | ||
283 | 44 | |||
284 | 45 | #endif /* DRIZZLED_PLUGIN_LIBRARY_H */ | ||
285 | 0 | 46 | ||
286 | === added file 'drizzled/plugin/manifest.h' | |||
287 | --- drizzled/plugin/manifest.h 1970-01-01 00:00:00 +0000 | |||
288 | +++ drizzled/plugin/manifest.h 2009-07-16 00:24:27 +0000 | |||
289 | @@ -0,0 +1,75 @@ | |||
290 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
291 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
292 | 3 | * | ||
293 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
294 | 5 | * | ||
295 | 6 | * This program is free software; you can redistribute it and/or modify | ||
296 | 7 | * it under the terms of the GNU General Public License as published by | ||
297 | 8 | * the Free Software Foundation; version 2 of the License. | ||
298 | 9 | * | ||
299 | 10 | * This program is distributed in the hope that it will be useful, | ||
300 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
301 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
302 | 13 | * GNU General Public License for more details. | ||
303 | 14 | * | ||
304 | 15 | * You should have received a copy of the GNU General Public License | ||
305 | 16 | * along with this program; if not, write to the Free Software | ||
306 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
307 | 18 | */ | ||
308 | 19 | |||
309 | 20 | #ifndef DRIZZLED_PLUGIN_MANIFEST_H | ||
310 | 21 | #define DRIZZLED_PLUGIN_MANIFEST_H | ||
311 | 22 | |||
312 | 23 | #include <drizzled/plugin_registry.h> | ||
313 | 24 | |||
314 | 25 | struct st_mysql_show_var; | ||
315 | 26 | struct st_mysql_sys_var; | ||
316 | 27 | |||
317 | 28 | /* We use the following strings to define licenses for plugins */ | ||
318 | 29 | enum plugin_license_type { | ||
319 | 30 | PLUGIN_LICENSE_GPL, | ||
320 | 31 | PLUGIN_LICENSE_BSD, | ||
321 | 32 | PLUGIN_LICENSE_LGPL, | ||
322 | 33 | PLUGIN_LICENSE_PROPRIETARY, | ||
323 | 34 | PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_LGPL | ||
324 | 35 | }; | ||
325 | 36 | |||
326 | 37 | |||
327 | 38 | namespace drizzled | ||
328 | 39 | { | ||
329 | 40 | namespace plugin | ||
330 | 41 | { | ||
331 | 42 | |||
332 | 43 | static const std::string LICENSE_GPL_STRING("GPL"); | ||
333 | 44 | static const std::string LICENSE_BSD_STRING("BSD"); | ||
334 | 45 | static const std::string LICENSE_LGPL_STRING("LGPL"); | ||
335 | 46 | static const std::string LICENSE_PROPRIETARY_STRING("PROPRIETARY"); | ||
336 | 47 | |||
337 | 48 | typedef int (*initialize_func_t)(PluginRegistry &); | ||
338 | 49 | |||
339 | 50 | /** | ||
340 | 51 | * Plugin Manfiest | ||
341 | 52 | * | ||
342 | 53 | * One Manifest is required per plugin library which is to be dlopened | ||
343 | 54 | * | ||
344 | 55 | * This is a struct and not a class because it is staticly defined in the | ||
345 | 56 | * plugin objects and needs to be a POD as it can, or else it won't compile. | ||
346 | 57 | */ | ||
347 | 58 | struct Manifest | ||
348 | 59 | { | ||
349 | 60 | const char *name; /* plugin name (for SHOW PLUGINS) */ | ||
350 | 61 | const char *version; /* plugin version (for SHOW PLUGINS) */ | ||
351 | 62 | const char *author; /* plugin author (for SHOW PLUGINS) */ | ||
352 | 63 | const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ | ||
353 | 64 | plugin_license_type license; /* plugin license (PLUGIN_LICENSE_XXX) */ | ||
354 | 65 | initialize_func_t init; /* function to invoke when plugin is loaded */ | ||
355 | 66 | initialize_func_t deinit; /* function to invoke when plugin is unloaded */ | ||
356 | 67 | st_mysql_show_var *status_vars; | ||
357 | 68 | st_mysql_sys_var **system_vars; | ||
358 | 69 | void *reserved1; /* reserved for dependency checking */ | ||
359 | 70 | }; | ||
360 | 71 | |||
361 | 72 | } /* namespace plugin */ | ||
362 | 73 | } /* namespace drizzled */ | ||
363 | 74 | |||
364 | 75 | #endif /* DRIZZLED_PLUGIN_MANIFEST_H */ | ||
365 | 0 | 76 | ||
366 | === modified file 'drizzled/plugin_registry.cc' | |||
367 | --- drizzled/plugin_registry.cc 2009-06-17 18:39:44 +0000 | |||
368 | +++ drizzled/plugin_registry.cc 2009-07-16 00:24:27 +0000 | |||
369 | @@ -45,21 +45,21 @@ | |||
370 | 45 | return the_registry; | 45 | return the_registry; |
371 | 46 | } | 46 | } |
372 | 47 | 47 | ||
374 | 48 | st_plugin_int *PluginRegistry::find(const LEX_STRING *name) | 48 | drizzled::plugin::Handle *PluginRegistry::find(const LEX_STRING *name) |
375 | 49 | { | 49 | { |
376 | 50 | string find_str(name->str,name->length); | 50 | string find_str(name->str,name->length); |
377 | 51 | transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower); | 51 | transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower); |
378 | 52 | 52 | ||
380 | 53 | map<string, st_plugin_int *>::iterator map_iter; | 53 | map<string, drizzled::plugin::Handle *>::iterator map_iter; |
381 | 54 | map_iter= plugin_map.find(find_str); | 54 | map_iter= plugin_map.find(find_str); |
382 | 55 | if (map_iter != plugin_map.end()) | 55 | if (map_iter != plugin_map.end()) |
383 | 56 | return (*map_iter).second; | 56 | return (*map_iter).second; |
384 | 57 | return(0); | 57 | return(0); |
385 | 58 | } | 58 | } |
386 | 59 | 59 | ||
388 | 60 | void PluginRegistry::add(st_plugin_int *plugin) | 60 | void PluginRegistry::add(drizzled::plugin::Handle *plugin) |
389 | 61 | { | 61 | { |
391 | 62 | string add_str(plugin->name.str); | 62 | string add_str(plugin->getName()); |
392 | 63 | transform(add_str.begin(), add_str.end(), | 63 | transform(add_str.begin(), add_str.end(), |
393 | 64 | add_str.begin(), ::tolower); | 64 | add_str.begin(), ::tolower); |
394 | 65 | 65 | ||
395 | @@ -67,14 +67,14 @@ | |||
396 | 67 | } | 67 | } |
397 | 68 | 68 | ||
398 | 69 | 69 | ||
400 | 70 | vector<st_plugin_int *> PluginRegistry::get_list(bool active) | 70 | vector<drizzled::plugin::Handle *> PluginRegistry::get_list(bool active) |
401 | 71 | { | 71 | { |
403 | 72 | st_plugin_int *plugin= NULL; | 72 | drizzled::plugin::Handle *plugin= NULL; |
404 | 73 | 73 | ||
406 | 74 | vector <st_plugin_int *> plugins; | 74 | vector <drizzled::plugin::Handle *> plugins; |
407 | 75 | plugins.reserve(plugin_map.size()); | 75 | plugins.reserve(plugin_map.size()); |
408 | 76 | 76 | ||
410 | 77 | map<string, st_plugin_int *>::iterator map_iter; | 77 | map<string, drizzled::plugin::Handle *>::iterator map_iter; |
411 | 78 | for (map_iter= plugin_map.begin(); | 78 | for (map_iter= plugin_map.begin(); |
412 | 79 | map_iter != plugin_map.end(); | 79 | map_iter != plugin_map.end(); |
413 | 80 | map_iter++) | 80 | map_iter++) |
414 | 81 | 81 | ||
415 | === modified file 'drizzled/plugin_registry.h' | |||
416 | --- drizzled/plugin_registry.h 2009-06-26 06:25:57 +0000 | |||
417 | +++ drizzled/plugin_registry.h 2009-07-15 21:00:16 +0000 | |||
418 | @@ -25,7 +25,6 @@ | |||
419 | 25 | #include <vector> | 25 | #include <vector> |
420 | 26 | #include <map> | 26 | #include <map> |
421 | 27 | 27 | ||
422 | 28 | struct st_plugin_int; | ||
423 | 29 | class StorageEngine; | 28 | class StorageEngine; |
424 | 30 | class InfoSchemaTable; | 29 | class InfoSchemaTable; |
425 | 31 | class Function_builder; | 30 | class Function_builder; |
426 | @@ -40,13 +39,14 @@ | |||
427 | 40 | namespace plugin | 39 | namespace plugin |
428 | 41 | { | 40 | { |
429 | 42 | class Replicator; | 41 | class Replicator; |
430 | 42 | class Handle; | ||
431 | 43 | } | 43 | } |
432 | 44 | } | 44 | } |
433 | 45 | 45 | ||
434 | 46 | class PluginRegistry | 46 | class PluginRegistry |
435 | 47 | { | 47 | { |
436 | 48 | private: | 48 | private: |
438 | 49 | std::map<std::string, st_plugin_int *> | 49 | std::map<std::string, drizzled::plugin::Handle *> |
439 | 50 | plugin_map; | 50 | plugin_map; |
440 | 51 | 51 | ||
441 | 52 | PluginRegistry(const PluginRegistry&); | 52 | PluginRegistry(const PluginRegistry&); |
442 | @@ -54,11 +54,11 @@ | |||
443 | 54 | PluginRegistry() {} | 54 | PluginRegistry() {} |
444 | 55 | 55 | ||
445 | 56 | 56 | ||
451 | 57 | st_plugin_int *find(const LEX_STRING *name); | 57 | drizzled::plugin::Handle *find(const LEX_STRING *name); |
452 | 58 | 58 | ||
453 | 59 | void add(st_plugin_int *plugin); | 59 | void add(drizzled::plugin::Handle *plugin); |
454 | 60 | 60 | ||
455 | 61 | std::vector<st_plugin_int *> get_list(bool active); | 61 | std::vector<drizzled::plugin::Handle *> get_list(bool active); |
456 | 62 | static PluginRegistry& getPluginRegistry(); | 62 | static PluginRegistry& getPluginRegistry(); |
457 | 63 | 63 | ||
458 | 64 | void add(StorageEngine *engine); | 64 | void add(StorageEngine *engine); |
459 | 65 | 65 | ||
460 | === modified file 'drizzled/sql_plugin.cc' | |||
461 | --- drizzled/sql_plugin.cc 2009-06-30 21:28:16 +0000 | |||
462 | +++ drizzled/sql_plugin.cc 2009-07-16 17:37:03 +0000 | |||
463 | @@ -43,19 +43,21 @@ | |||
464 | 43 | #define REPORT_TO_USER 2 | 43 | #define REPORT_TO_USER 2 |
465 | 44 | 44 | ||
466 | 45 | using namespace std; | 45 | using namespace std; |
467 | 46 | using namespace drizzled; | ||
468 | 47 | using namespace drizzled::plugin; | ||
469 | 46 | 48 | ||
471 | 47 | typedef struct drizzled_plugin_manifest builtin_plugin[]; | 49 | typedef Manifest builtin_plugin[]; |
472 | 48 | extern builtin_plugin DRIZZLED_BUILTIN_LIST; | 50 | extern builtin_plugin DRIZZLED_BUILTIN_LIST; |
474 | 49 | static drizzled_plugin_manifest *drizzled_builtins[]= | 51 | static Manifest *drizzled_builtins[]= |
475 | 50 | { | 52 | { |
477 | 51 | DRIZZLED_BUILTIN_LIST,(struct drizzled_plugin_manifest *)0 | 53 | DRIZZLED_BUILTIN_LIST,(Manifest *)0 |
478 | 52 | }; | 54 | }; |
479 | 53 | 55 | ||
480 | 54 | char *opt_plugin_load= NULL; | 56 | char *opt_plugin_load= NULL; |
481 | 55 | const char *opt_plugin_load_default= QUOTE_ARG(DRIZZLED_PLUGIN_LIST); | 57 | const char *opt_plugin_load_default= QUOTE_ARG(DRIZZLED_PLUGIN_LIST); |
482 | 56 | char *opt_plugin_dir_ptr; | 58 | char *opt_plugin_dir_ptr; |
483 | 57 | char opt_plugin_dir[FN_REFLEN]; | 59 | char opt_plugin_dir[FN_REFLEN]; |
485 | 58 | static const char *plugin_declarations_sym= "_mysql_plugin_declarations_"; | 60 | static const char *plugin_declarations_sym= "_drizzled_plugin_declaration_"; |
486 | 59 | 61 | ||
487 | 60 | /* Note that 'int version' must be the first field of every plugin | 62 | /* Note that 'int version' must be the first field of every plugin |
488 | 61 | sub-structure (plugin->info). | 63 | sub-structure (plugin->info). |
489 | @@ -122,7 +124,7 @@ | |||
490 | 122 | class sys_var_pluginvar: public sys_var | 124 | class sys_var_pluginvar: public sys_var |
491 | 123 | { | 125 | { |
492 | 124 | public: | 126 | public: |
494 | 125 | struct st_plugin_int *plugin; | 127 | Handle *plugin; |
495 | 126 | struct st_mysql_sys_var *plugin_var; | 128 | struct st_mysql_sys_var *plugin_var; |
496 | 127 | 129 | ||
497 | 128 | static void *operator new(size_t size, MEM_ROOT *mem_root) | 130 | static void *operator new(size_t size, MEM_ROOT *mem_root) |
498 | @@ -154,10 +156,10 @@ | |||
499 | 154 | /* prototypes */ | 156 | /* prototypes */ |
500 | 155 | static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, | 157 | static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, |
501 | 156 | const char *list); | 158 | const char *list); |
503 | 157 | static int test_plugin_options(MEM_ROOT *, struct st_plugin_int *, | 159 | static int test_plugin_options(MEM_ROOT *, Handle *, |
504 | 158 | int *, char **); | 160 | int *, char **); |
507 | 159 | static bool register_builtin(struct st_plugin_int *, | 161 | static bool register_builtin(Handle *, |
508 | 160 | struct st_plugin_int **); | 162 | Handle **); |
509 | 161 | static void unlock_variables(Session *session, struct system_variables *vars); | 163 | static void unlock_variables(Session *session, struct system_variables *vars); |
510 | 162 | static void cleanup_variables(Session *session, struct system_variables *vars); | 164 | static void cleanup_variables(Session *session, struct system_variables *vars); |
511 | 163 | static void plugin_vars_free_values(sys_var *vars); | 165 | static void plugin_vars_free_values(sys_var *vars); |
512 | @@ -236,14 +238,14 @@ | |||
513 | 236 | Plugin support code | 238 | Plugin support code |
514 | 237 | ****************************************************************************/ | 239 | ****************************************************************************/ |
515 | 238 | 240 | ||
517 | 239 | static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl) | 241 | static Library *plugin_dl_find(const LEX_STRING *dl) |
518 | 240 | { | 242 | { |
519 | 241 | uint32_t i; | 243 | uint32_t i; |
521 | 242 | struct st_plugin_dl *tmp; | 244 | Library *tmp; |
522 | 243 | 245 | ||
523 | 244 | for (i= 0; i < plugin_dl_array.elements; i++) | 246 | for (i= 0; i < plugin_dl_array.elements; i++) |
524 | 245 | { | 247 | { |
526 | 246 | tmp= *dynamic_element(&plugin_dl_array, i, struct st_plugin_dl **); | 248 | tmp= *dynamic_element(&plugin_dl_array, i, Library **); |
527 | 247 | if (! my_strnncoll(files_charset_info, | 249 | if (! my_strnncoll(files_charset_info, |
528 | 248 | (const unsigned char *)dl->str, dl->length, | 250 | (const unsigned char *)dl->str, dl->length, |
529 | 249 | (const unsigned char *)tmp->dl.str, tmp->dl.length)) | 251 | (const unsigned char *)tmp->dl.str, tmp->dl.length)) |
530 | @@ -252,29 +254,29 @@ | |||
531 | 252 | return(0); | 254 | return(0); |
532 | 253 | } | 255 | } |
533 | 254 | 256 | ||
535 | 255 | static st_plugin_dl *plugin_dl_insert_or_reuse(struct st_plugin_dl *plugin_dl) | 257 | static Library *plugin_dl_insert_or_reuse(Library *plugin_dl) |
536 | 256 | { | 258 | { |
537 | 257 | uint32_t i; | 259 | uint32_t i; |
539 | 258 | struct st_plugin_dl *tmp; | 260 | Library *tmp; |
540 | 259 | 261 | ||
541 | 260 | for (i= 0; i < plugin_dl_array.elements; i++) | 262 | for (i= 0; i < plugin_dl_array.elements; i++) |
542 | 261 | { | 263 | { |
544 | 262 | tmp= *dynamic_element(&plugin_dl_array, i, struct st_plugin_dl **); | 264 | tmp= *dynamic_element(&plugin_dl_array, i, Library **); |
545 | 263 | { | 265 | { |
547 | 264 | memcpy(tmp, plugin_dl, sizeof(struct st_plugin_dl)); | 266 | memcpy(tmp, plugin_dl, sizeof(Library)); |
548 | 265 | return(tmp); | 267 | return(tmp); |
549 | 266 | } | 268 | } |
550 | 267 | } | 269 | } |
551 | 268 | if (insert_dynamic(&plugin_dl_array, (unsigned char*)&plugin_dl)) | 270 | if (insert_dynamic(&plugin_dl_array, (unsigned char*)&plugin_dl)) |
552 | 269 | return(0); | 271 | return(0); |
553 | 270 | tmp= *dynamic_element(&plugin_dl_array, plugin_dl_array.elements - 1, | 272 | tmp= *dynamic_element(&plugin_dl_array, plugin_dl_array.elements - 1, |
557 | 271 | struct st_plugin_dl **)= | 273 | Library **)= |
558 | 272 | (struct st_plugin_dl *) memdup_root(&plugin_mem_root, (unsigned char*)plugin_dl, | 274 | (Library *) memdup_root(&plugin_mem_root, (unsigned char*)plugin_dl, |
559 | 273 | sizeof(struct st_plugin_dl)); | 275 | sizeof(Library)); |
560 | 274 | return(tmp); | 276 | return(tmp); |
561 | 275 | } | 277 | } |
562 | 276 | 278 | ||
564 | 277 | static inline void free_plugin_mem(struct st_plugin_dl *p) | 279 | static inline void free_plugin_mem(Library *p) |
565 | 278 | { | 280 | { |
566 | 279 | if (p->handle) | 281 | if (p->handle) |
567 | 280 | dlclose(p->handle); | 282 | dlclose(p->handle); |
568 | @@ -282,11 +284,11 @@ | |||
569 | 282 | } | 284 | } |
570 | 283 | 285 | ||
571 | 284 | 286 | ||
573 | 285 | static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) | 287 | static Library *plugin_dl_add(const LEX_STRING *dl, int report) |
574 | 286 | { | 288 | { |
575 | 287 | string dlpath; | 289 | string dlpath; |
576 | 288 | uint32_t plugin_dir_len; | 290 | uint32_t plugin_dir_len; |
578 | 289 | struct st_plugin_dl *tmp, plugin_dl; | 291 | Library *tmp, plugin_dl; |
579 | 290 | void *sym; | 292 | void *sym; |
580 | 291 | plugin_dir_len= strlen(opt_plugin_dir); | 293 | plugin_dir_len= strlen(opt_plugin_dir); |
581 | 292 | dlpath.reserve(FN_REFLEN); | 294 | dlpath.reserve(FN_REFLEN); |
582 | @@ -345,7 +347,7 @@ | |||
583 | 345 | return(0); | 347 | return(0); |
584 | 346 | } | 348 | } |
585 | 347 | 349 | ||
587 | 348 | plugin_dl.plugins= (struct drizzled_plugin_manifest *)sym; | 350 | plugin_dl.plugins= static_cast<Manifest *>(sym); |
588 | 349 | 351 | ||
589 | 350 | /* Duplicate and convert dll name */ | 352 | /* Duplicate and convert dll name */ |
590 | 351 | plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1; | 353 | plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1; |
591 | @@ -364,9 +366,9 @@ | |||
592 | 364 | { | 366 | { |
593 | 365 | free_plugin_mem(&plugin_dl); | 367 | free_plugin_mem(&plugin_dl); |
594 | 366 | if (report & REPORT_TO_USER) | 368 | if (report & REPORT_TO_USER) |
596 | 367 | my_error(ER_OUTOFMEMORY, MYF(0), sizeof(struct st_plugin_dl)); | 369 | my_error(ER_OUTOFMEMORY, MYF(0), sizeof(Library)); |
597 | 368 | if (report & REPORT_TO_LOG) | 370 | if (report & REPORT_TO_LOG) |
599 | 369 | errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_OUTOFMEMORY), sizeof(struct st_plugin_dl)); | 371 | errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_OUTOFMEMORY), sizeof(Library)); |
600 | 370 | return(0); | 372 | return(0); |
601 | 371 | } | 373 | } |
602 | 372 | return(tmp); | 374 | return(tmp); |
603 | @@ -379,8 +381,8 @@ | |||
604 | 379 | 381 | ||
605 | 380 | for (i= 0; i < plugin_dl_array.elements; i++) | 382 | for (i= 0; i < plugin_dl_array.elements; i++) |
606 | 381 | { | 383 | { |
609 | 382 | struct st_plugin_dl *tmp= *dynamic_element(&plugin_dl_array, i, | 384 | Library *tmp= *dynamic_element(&plugin_dl_array, i, |
610 | 383 | struct st_plugin_dl **); | 385 | Library **); |
611 | 384 | if (! my_strnncoll(files_charset_info, | 386 | if (! my_strnncoll(files_charset_info, |
612 | 385 | (const unsigned char *)dl->str, dl->length, | 387 | (const unsigned char *)dl->str, dl->length, |
613 | 386 | (const unsigned char *)tmp->dl.str, tmp->dl.length)) | 388 | (const unsigned char *)tmp->dl.str, tmp->dl.length)) |
614 | @@ -388,7 +390,7 @@ | |||
615 | 388 | /* Do not remove this element, unless no other plugin uses this dll. */ | 390 | /* Do not remove this element, unless no other plugin uses this dll. */ |
616 | 389 | { | 391 | { |
617 | 390 | free_plugin_mem(tmp); | 392 | free_plugin_mem(tmp); |
619 | 391 | memset(tmp, 0, sizeof(struct st_plugin_dl)); | 393 | memset(tmp, 0, sizeof(Library)); |
620 | 392 | } | 394 | } |
621 | 393 | break; | 395 | break; |
622 | 394 | } | 396 | } |
623 | @@ -398,16 +400,13 @@ | |||
624 | 398 | 400 | ||
625 | 399 | 401 | ||
626 | 400 | 402 | ||
628 | 401 | static st_plugin_int *plugin_insert_or_reuse(struct st_plugin_int *plugin) | 403 | static Handle *plugin_insert_or_reuse(Handle *plugin) |
629 | 402 | { | 404 | { |
630 | 403 | struct st_plugin_int *tmp; | ||
631 | 404 | if (insert_dynamic(&plugin_array, (unsigned char*)&plugin)) | 405 | if (insert_dynamic(&plugin_array, (unsigned char*)&plugin)) |
632 | 405 | return(0); | 406 | return(0); |
638 | 406 | tmp= *dynamic_element(&plugin_array, plugin_array.elements - 1, | 407 | plugin= *dynamic_element(&plugin_array, plugin_array.elements - 1, |
639 | 407 | struct st_plugin_int **)= | 408 | Handle **); |
640 | 408 | (struct st_plugin_int *) memdup_root(&plugin_mem_root, (unsigned char*)plugin, | 409 | return(plugin); |
636 | 409 | sizeof(struct st_plugin_int)); | ||
637 | 410 | return(tmp); | ||
641 | 411 | } | 410 | } |
642 | 412 | 411 | ||
643 | 413 | 412 | ||
644 | @@ -421,8 +420,7 @@ | |||
645 | 421 | { | 420 | { |
646 | 422 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); | 421 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); |
647 | 423 | 422 | ||
650 | 424 | struct st_plugin_int tmp; | 423 | Manifest *manifest; |
649 | 425 | struct drizzled_plugin_manifest *plugin; | ||
651 | 426 | if (! initialized) | 424 | if (! initialized) |
652 | 427 | return(0); | 425 | return(0); |
653 | 428 | 426 | ||
654 | @@ -434,34 +432,32 @@ | |||
655 | 434 | errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_UDF_EXISTS), name->str); | 432 | errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_UDF_EXISTS), name->str); |
656 | 435 | return(true); | 433 | return(true); |
657 | 436 | } | 434 | } |
662 | 437 | /* Clear the whole struct to catch future extensions. */ | 435 | Library *library= plugin_dl_add(dl, report); |
663 | 438 | memset(&tmp, 0, sizeof(tmp)); | 436 | if (library == NULL) |
664 | 439 | if (! (tmp.plugin_dl= plugin_dl_add(dl, report))) | 437 | return true; |
665 | 440 | return(true); | 438 | |
666 | 439 | Handle *tmp= NULL; | ||
667 | 441 | /* Find plugin by name */ | 440 | /* Find plugin by name */ |
669 | 442 | for (plugin= tmp.plugin_dl->plugins; plugin->name; plugin++) | 441 | for (manifest= library->plugins; manifest->name; manifest++) |
670 | 443 | { | 442 | { |
671 | 444 | uint32_t name_len= strlen(plugin->name); | ||
672 | 445 | if (! my_strnncoll(system_charset_info, | 443 | if (! my_strnncoll(system_charset_info, |
673 | 446 | (const unsigned char *)name->str, name->length, | 444 | (const unsigned char *)name->str, name->length, |
676 | 447 | (const unsigned char *)plugin->name, | 445 | (const unsigned char *)manifest->name, |
677 | 448 | name_len)) | 446 | strlen(manifest->name))) |
678 | 449 | { | 447 | { |
680 | 450 | struct st_plugin_int *tmp_plugin_ptr; | 448 | tmp= new (std::nothrow) Handle(manifest, library); |
681 | 449 | if (tmp == NULL) | ||
682 | 450 | return true; | ||
683 | 451 | 451 | ||
689 | 452 | tmp.plugin= plugin; | 452 | if (!test_plugin_options(tmp_root, tmp, argc, argv)) |
685 | 453 | tmp.name.str= (char *)plugin->name; | ||
686 | 454 | tmp.name.length= name_len; | ||
687 | 455 | tmp.isInited= false; | ||
688 | 456 | if (!test_plugin_options(tmp_root, &tmp, argc, argv)) | ||
690 | 457 | { | 453 | { |
692 | 458 | if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp))) | 454 | if ((tmp= plugin_insert_or_reuse(tmp))) |
693 | 459 | { | 455 | { |
696 | 460 | registry.add(tmp_plugin_ptr); | 456 | registry.add(tmp); |
697 | 461 | init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096); | 457 | init_alloc_root(&tmp->mem_root, 4096, 4096); |
698 | 462 | return(false); | 458 | return(false); |
699 | 463 | } | 459 | } |
701 | 464 | mysql_del_sys_var_chain(tmp.system_vars); | 460 | mysql_del_sys_var_chain(tmp->system_vars); |
702 | 465 | goto err; | 461 | goto err; |
703 | 466 | } | 462 | } |
704 | 467 | /* plugin was disabled */ | 463 | /* plugin was disabled */ |
705 | @@ -479,18 +475,18 @@ | |||
706 | 479 | } | 475 | } |
707 | 480 | 476 | ||
708 | 481 | 477 | ||
710 | 482 | static void plugin_del(struct st_plugin_int *plugin) | 478 | static void plugin_del(Handle *plugin) |
711 | 483 | { | 479 | { |
712 | 484 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); | 480 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); |
713 | 485 | if (plugin->isInited) | 481 | if (plugin->isInited) |
714 | 486 | { | 482 | { |
716 | 487 | if (plugin->plugin->status_vars) | 483 | if (plugin->getManifest().status_vars) |
717 | 488 | { | 484 | { |
719 | 489 | remove_status_vars(plugin->plugin->status_vars); | 485 | remove_status_vars(plugin->getManifest().status_vars); |
720 | 490 | } | 486 | } |
721 | 491 | 487 | ||
724 | 492 | if (plugin->plugin->deinit) | 488 | if (plugin->getManifest().deinit) |
725 | 493 | plugin->plugin->deinit(registry); | 489 | plugin->getManifest().deinit(registry); |
726 | 494 | } | 490 | } |
727 | 495 | 491 | ||
728 | 496 | /* Free allocated strings before deleting the plugin. */ | 492 | /* Free allocated strings before deleting the plugin. */ |
729 | @@ -501,44 +497,44 @@ | |||
730 | 501 | pthread_rwlock_wrlock(&LOCK_system_variables_hash); | 497 | pthread_rwlock_wrlock(&LOCK_system_variables_hash); |
731 | 502 | mysql_del_sys_var_chain(plugin->system_vars); | 498 | mysql_del_sys_var_chain(plugin->system_vars); |
732 | 503 | pthread_rwlock_unlock(&LOCK_system_variables_hash); | 499 | pthread_rwlock_unlock(&LOCK_system_variables_hash); |
734 | 504 | free_root(&plugin->mem_root, MYF(0)); | 500 | delete plugin; |
735 | 505 | } | 501 | } |
736 | 506 | 502 | ||
737 | 507 | static void reap_plugins(void) | 503 | static void reap_plugins(void) |
738 | 508 | { | 504 | { |
739 | 509 | size_t count; | 505 | size_t count; |
740 | 510 | uint32_t idx; | 506 | uint32_t idx; |
742 | 511 | struct st_plugin_int *plugin; | 507 | drizzled::plugin::Handle *plugin; |
743 | 512 | 508 | ||
744 | 513 | count= plugin_array.elements; | 509 | count= plugin_array.elements; |
745 | 514 | 510 | ||
746 | 515 | for (idx= 0; idx < count; idx++) | 511 | for (idx= 0; idx < count; idx++) |
747 | 516 | { | 512 | { |
749 | 517 | plugin= *dynamic_element(&plugin_array, idx, struct st_plugin_int **); | 513 | plugin= *dynamic_element(&plugin_array, idx, drizzled::plugin::Handle **); |
750 | 518 | plugin_del(plugin); | 514 | plugin_del(plugin); |
751 | 519 | } | 515 | } |
752 | 520 | } | 516 | } |
753 | 521 | 517 | ||
755 | 522 | static bool plugin_initialize(struct st_plugin_int *plugin) | 518 | static bool plugin_initialize(drizzled::plugin::Handle *plugin) |
756 | 523 | { | 519 | { |
757 | 524 | assert(plugin->isInited == false); | 520 | assert(plugin->isInited == false); |
758 | 525 | 521 | ||
759 | 526 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); | 522 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); |
761 | 527 | if (plugin->plugin->init) | 523 | if (plugin->getManifest().init) |
762 | 528 | { | 524 | { |
764 | 529 | if (plugin->plugin->init(registry)) | 525 | if (plugin->getManifest().init(registry)) |
765 | 530 | { | 526 | { |
766 | 531 | errmsg_printf(ERRMSG_LVL_ERROR, | 527 | errmsg_printf(ERRMSG_LVL_ERROR, |
767 | 532 | _("Plugin '%s' init function returned error.\n"), | 528 | _("Plugin '%s' init function returned error.\n"), |
769 | 533 | plugin->name.str); | 529 | plugin->getName().c_str()); |
770 | 534 | goto err; | 530 | goto err; |
771 | 535 | } | 531 | } |
772 | 536 | } | 532 | } |
773 | 537 | plugin->isInited= true; | 533 | plugin->isInited= true; |
774 | 538 | 534 | ||
776 | 539 | if (plugin->plugin->status_vars) | 535 | if (plugin->getManifest().status_vars) |
777 | 540 | { | 536 | { |
779 | 541 | add_status_vars(plugin->plugin->status_vars); // add_status_vars makes a copy | 537 | add_status_vars(plugin->getManifest().status_vars); // add_status_vars makes a copy |
780 | 542 | } | 538 | } |
781 | 543 | 539 | ||
782 | 544 | /* | 540 | /* |
783 | @@ -584,9 +580,9 @@ | |||
784 | 584 | int plugin_init(int *argc, char **argv, int flags) | 580 | int plugin_init(int *argc, char **argv, int flags) |
785 | 585 | { | 581 | { |
786 | 586 | uint32_t idx; | 582 | uint32_t idx; |
790 | 587 | struct drizzled_plugin_manifest **builtins; | 583 | Manifest **builtins; |
791 | 588 | struct drizzled_plugin_manifest *plugin; | 584 | Manifest *manifest; |
792 | 589 | struct st_plugin_int tmp, *plugin_ptr; | 585 | Handle *handle; |
793 | 590 | MEM_ROOT tmp_root; | 586 | MEM_ROOT tmp_root; |
794 | 591 | 587 | ||
795 | 592 | if (initialized) | 588 | if (initialized) |
796 | @@ -601,9 +597,9 @@ | |||
797 | 601 | 597 | ||
798 | 602 | 598 | ||
799 | 603 | if (my_init_dynamic_array(&plugin_dl_array, | 599 | if (my_init_dynamic_array(&plugin_dl_array, |
801 | 604 | sizeof(struct st_plugin_dl *),16,16) || | 600 | sizeof(Library *),16,16) || |
802 | 605 | my_init_dynamic_array(&plugin_array, | 601 | my_init_dynamic_array(&plugin_array, |
804 | 606 | sizeof(struct st_plugin_int *),16,16)) | 602 | sizeof(Handle *),16,16)) |
805 | 607 | goto err; | 603 | goto err; |
806 | 608 | 604 | ||
807 | 609 | initialized= 1; | 605 | initialized= 1; |
808 | @@ -613,21 +609,20 @@ | |||
809 | 613 | */ | 609 | */ |
810 | 614 | for (builtins= drizzled_builtins; *builtins; builtins++) | 610 | for (builtins= drizzled_builtins; *builtins; builtins++) |
811 | 615 | { | 611 | { |
813 | 616 | for (plugin= *builtins; plugin->name; plugin++) | 612 | for (manifest= *builtins; manifest->name; manifest++) |
814 | 617 | { | 613 | { |
819 | 618 | memset(&tmp, 0, sizeof(tmp)); | 614 | handle= new (std::nothrow) Handle(manifest); |
820 | 619 | tmp.plugin= plugin; | 615 | if (handle == NULL) |
821 | 620 | tmp.name.str= (char *)plugin->name; | 616 | return true; |
818 | 621 | tmp.name.length= strlen(plugin->name); | ||
822 | 622 | 617 | ||
823 | 623 | free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); | 618 | free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); |
825 | 624 | if (test_plugin_options(&tmp_root, &tmp, argc, argv)) | 619 | if (test_plugin_options(&tmp_root, handle, argc, argv)) |
826 | 625 | continue; | 620 | continue; |
827 | 626 | 621 | ||
829 | 627 | if (register_builtin(&tmp, &plugin_ptr)) | 622 | if (register_builtin(handle, &handle)) |
830 | 628 | goto err_unlock; | 623 | goto err_unlock; |
831 | 629 | 624 | ||
833 | 630 | if (plugin_initialize(plugin_ptr)) | 625 | if (plugin_initialize(handle)) |
834 | 631 | goto err_unlock; | 626 | goto err_unlock; |
835 | 632 | 627 | ||
836 | 633 | } | 628 | } |
837 | @@ -649,11 +644,11 @@ | |||
838 | 649 | */ | 644 | */ |
839 | 650 | for (idx= 0; idx < plugin_array.elements; idx++) | 645 | for (idx= 0; idx < plugin_array.elements; idx++) |
840 | 651 | { | 646 | { |
843 | 652 | plugin_ptr= *dynamic_element(&plugin_array, idx, struct st_plugin_int **); | 647 | handle= *dynamic_element(&plugin_array, idx, Handle **); |
844 | 653 | if (plugin_ptr->isInited == false) | 648 | if (handle->isInited == false) |
845 | 654 | { | 649 | { |
848 | 655 | if (plugin_initialize(plugin_ptr)) | 650 | if (plugin_initialize(handle)) |
849 | 656 | plugin_del(plugin_ptr); | 651 | plugin_del(handle); |
850 | 657 | } | 652 | } |
851 | 658 | } | 653 | } |
852 | 659 | 654 | ||
853 | @@ -670,8 +665,8 @@ | |||
854 | 670 | } | 665 | } |
855 | 671 | 666 | ||
856 | 672 | 667 | ||
859 | 673 | static bool register_builtin(struct st_plugin_int *tmp, | 668 | static bool register_builtin(Handle *tmp, |
860 | 674 | struct st_plugin_int **ptr) | 669 | Handle **ptr) |
861 | 675 | { | 670 | { |
862 | 676 | 671 | ||
863 | 677 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); | 672 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); |
864 | @@ -683,9 +678,7 @@ | |||
865 | 683 | return(1); | 678 | return(1); |
866 | 684 | 679 | ||
867 | 685 | *ptr= *dynamic_element(&plugin_array, plugin_array.elements - 1, | 680 | *ptr= *dynamic_element(&plugin_array, plugin_array.elements - 1, |
871 | 686 | struct st_plugin_int **)= | 681 | Handle **); |
869 | 687 | (struct st_plugin_int *) memdup_root(&plugin_mem_root, (unsigned char*)tmp, | ||
870 | 688 | sizeof(struct st_plugin_int)); | ||
872 | 689 | 682 | ||
873 | 690 | registry.add(*ptr); | 683 | registry.add(*ptr); |
874 | 691 | 684 | ||
875 | @@ -701,8 +694,8 @@ | |||
876 | 701 | { | 694 | { |
877 | 702 | char buffer[FN_REFLEN]; | 695 | char buffer[FN_REFLEN]; |
878 | 703 | LEX_STRING name= {buffer, 0}, dl= {NULL, 0}, *str= &name; | 696 | LEX_STRING name= {buffer, 0}, dl= {NULL, 0}, *str= &name; |
881 | 704 | struct st_plugin_dl *plugin_dl; | 697 | Library *plugin_dl; |
882 | 705 | struct drizzled_plugin_manifest *plugin; | 698 | Manifest *plugin; |
883 | 706 | char *p= buffer; | 699 | char *p= buffer; |
884 | 707 | while (list) | 700 | while (list) |
885 | 708 | { | 701 | { |
886 | @@ -778,8 +771,8 @@ | |||
887 | 778 | { | 771 | { |
888 | 779 | uint32_t idx; | 772 | uint32_t idx; |
889 | 780 | size_t count= plugin_array.elements; | 773 | size_t count= plugin_array.elements; |
892 | 781 | vector<st_plugin_int *> plugins; | 774 | vector<Handle *> plugins; |
893 | 782 | vector<st_plugin_dl *> dl; | 775 | vector<Library *> dl; |
894 | 783 | 776 | ||
895 | 784 | if (initialized) | 777 | if (initialized) |
896 | 785 | { | 778 | { |
897 | @@ -803,7 +796,7 @@ | |||
898 | 803 | dl.reserve(count); | 796 | dl.reserve(count); |
899 | 804 | for (idx= 0; idx < count; idx++) | 797 | for (idx= 0; idx < count; idx++) |
900 | 805 | dl.push_back(*dynamic_element(&plugin_dl_array, idx, | 798 | dl.push_back(*dynamic_element(&plugin_dl_array, idx, |
902 | 806 | struct st_plugin_dl **)); | 799 | Library **)); |
903 | 807 | for (idx= 0; idx < count; idx++) | 800 | for (idx= 0; idx < count; idx++) |
904 | 808 | free_plugin_mem(dl[idx]); | 801 | free_plugin_mem(dl[idx]); |
905 | 809 | delete_dynamic(&plugin_dl_array); | 802 | delete_dynamic(&plugin_dl_array); |
906 | @@ -1123,7 +1116,7 @@ | |||
907 | 1123 | { | 1116 | { |
908 | 1124 | sys_var *var; | 1117 | sys_var *var; |
909 | 1125 | sys_var_pluginvar *pi= NULL; | 1118 | sys_var_pluginvar *pi= NULL; |
911 | 1126 | st_plugin_int *plugin; | 1119 | Handle *plugin; |
912 | 1127 | 1120 | ||
913 | 1128 | pthread_rwlock_rdlock(&LOCK_system_variables_hash); | 1121 | pthread_rwlock_rdlock(&LOCK_system_variables_hash); |
914 | 1129 | if ((var= intern_find_sys_var(str, length, false)) && | 1122 | if ((var= intern_find_sys_var(str, length, false)) && |
915 | @@ -1867,10 +1860,10 @@ | |||
916 | 1867 | } | 1860 | } |
917 | 1868 | 1861 | ||
918 | 1869 | 1862 | ||
920 | 1870 | static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, | 1863 | static int construct_options(MEM_ROOT *mem_root, Handle *tmp, |
921 | 1871 | my_option *options, bool can_disable) | 1864 | my_option *options, bool can_disable) |
922 | 1872 | { | 1865 | { |
924 | 1873 | const char *plugin_name= tmp->plugin->name; | 1866 | const char *plugin_name= tmp->getManifest().name; |
925 | 1874 | uint32_t namelen= strlen(plugin_name), optnamelen; | 1867 | uint32_t namelen= strlen(plugin_name), optnamelen; |
926 | 1875 | uint32_t buffer_length= namelen * 4 + (can_disable ? 75 : 10); | 1868 | uint32_t buffer_length= namelen * 4 + (can_disable ? 75 : 10); |
927 | 1876 | char *name= (char*) alloc_root(mem_root, buffer_length) + 1; | 1869 | char *name= (char*) alloc_root(mem_root, buffer_length) + 1; |
928 | @@ -1916,7 +1909,7 @@ | |||
929 | 1916 | by my_getopt and register_var() in the first pass uses realloc | 1909 | by my_getopt and register_var() in the first pass uses realloc |
930 | 1917 | */ | 1910 | */ |
931 | 1918 | 1911 | ||
933 | 1919 | for (plugin_option= tmp->plugin->system_vars; | 1912 | for (plugin_option= tmp->getManifest().system_vars; |
934 | 1920 | plugin_option && *plugin_option; plugin_option++, index++) | 1913 | plugin_option && *plugin_option; plugin_option++, index++) |
935 | 1921 | { | 1914 | { |
936 | 1922 | opt= *plugin_option; | 1915 | opt= *plugin_option; |
937 | @@ -1953,7 +1946,7 @@ | |||
938 | 1953 | }; | 1946 | }; |
939 | 1954 | } | 1947 | } |
940 | 1955 | 1948 | ||
942 | 1956 | for (plugin_option= tmp->plugin->system_vars; | 1949 | for (plugin_option= tmp->getManifest().system_vars; |
943 | 1957 | plugin_option && *plugin_option; plugin_option++, index++) | 1950 | plugin_option && *plugin_option; plugin_option++, index++) |
944 | 1958 | { | 1951 | { |
945 | 1959 | switch ((opt= *plugin_option)->flags & PLUGIN_VAR_TYPEMASK) { | 1952 | switch ((opt= *plugin_option)->flags & PLUGIN_VAR_TYPEMASK) { |
946 | @@ -2082,24 +2075,24 @@ | |||
947 | 2082 | } | 2075 | } |
948 | 2083 | 2076 | ||
949 | 2084 | 2077 | ||
952 | 2085 | static my_option *construct_help_options(MEM_ROOT *mem_root, | 2078 | static my_option *construct_help_options(MEM_ROOT *mem_root, Handle *p) |
951 | 2086 | struct st_plugin_int *p) | ||
953 | 2087 | { | 2079 | { |
954 | 2088 | st_mysql_sys_var **opt; | 2080 | st_mysql_sys_var **opt; |
955 | 2089 | my_option *opts; | 2081 | my_option *opts; |
956 | 2090 | bool can_disable; | 2082 | bool can_disable; |
957 | 2091 | uint32_t count= EXTRA_OPTIONS; | 2083 | uint32_t count= EXTRA_OPTIONS; |
958 | 2092 | 2084 | ||
960 | 2093 | for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2) {}; | 2085 | for (opt= p->getManifest().system_vars; opt && *opt; opt++, count+= 2) {}; |
961 | 2094 | 2086 | ||
963 | 2095 | if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count))) | 2087 | opts= (my_option*)alloc_root(mem_root, (sizeof(my_option) * count)); |
964 | 2088 | if (opts == NULL) | ||
965 | 2096 | return NULL; | 2089 | return NULL; |
966 | 2097 | 2090 | ||
967 | 2098 | memset(opts, 0, sizeof(my_option) * count); | 2091 | memset(opts, 0, sizeof(my_option) * count); |
968 | 2099 | 2092 | ||
970 | 2100 | if ((my_strcasecmp(&my_charset_utf8_general_ci, p->name.str, "MyISAM") == 0)) | 2093 | if ((my_strcasecmp(&my_charset_utf8_general_ci, p->getName().c_str(), "MyISAM") == 0)) |
971 | 2101 | can_disable= false; | 2094 | can_disable= false; |
973 | 2102 | else if ((my_strcasecmp(&my_charset_utf8_general_ci, p->name.str, "MEMORY") == 0)) | 2095 | else if ((my_strcasecmp(&my_charset_utf8_general_ci, p->getName().c_str(), "MEMORY") == 0)) |
974 | 2103 | can_disable= false; | 2096 | can_disable= false; |
975 | 2104 | else | 2097 | else |
976 | 2105 | can_disable= true; | 2098 | can_disable= true; |
977 | @@ -2125,7 +2118,7 @@ | |||
978 | 2125 | NOTE: | 2118 | NOTE: |
979 | 2126 | Requires that a write-lock is held on LOCK_system_variables_hash | 2119 | Requires that a write-lock is held on LOCK_system_variables_hash |
980 | 2127 | */ | 2120 | */ |
982 | 2128 | static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, | 2121 | static int test_plugin_options(MEM_ROOT *tmp_root, Handle *tmp, |
983 | 2129 | int *argc, char **argv) | 2122 | int *argc, char **argv) |
984 | 2130 | { | 2123 | { |
985 | 2131 | struct sys_var_chain chain= { NULL, NULL }; | 2124 | struct sys_var_chain chain= { NULL, NULL }; |
986 | @@ -2140,14 +2133,13 @@ | |||
987 | 2140 | sys_var *v; | 2133 | sys_var *v; |
988 | 2141 | struct st_bookmark *var; | 2134 | struct st_bookmark *var; |
989 | 2142 | uint32_t len, count= EXTRA_OPTIONS; | 2135 | uint32_t len, count= EXTRA_OPTIONS; |
990 | 2143 | assert(tmp->plugin && tmp->name.str); | ||
991 | 2144 | 2136 | ||
993 | 2145 | for (opt= tmp->plugin->system_vars; opt && *opt; opt++) | 2137 | for (opt= tmp->getManifest().system_vars; opt && *opt; opt++) |
994 | 2146 | count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */ | 2138 | count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */ |
995 | 2147 | 2139 | ||
997 | 2148 | if ((my_strcasecmp(&my_charset_utf8_general_ci, tmp->name.str, "MyISAM") == 0)) | 2140 | if ((my_strcasecmp(&my_charset_utf8_general_ci, tmp->getName().c_str(), "MyISAM") == 0)) |
998 | 2149 | can_disable= false; | 2141 | can_disable= false; |
1000 | 2150 | else if ((my_strcasecmp(&my_charset_utf8_general_ci, tmp->name.str, "MEMORY") == 0)) | 2142 | else if ((my_strcasecmp(&my_charset_utf8_general_ci, tmp->getName().c_str(), "MEMORY") == 0)) |
1001 | 2151 | can_disable= false; | 2143 | can_disable= false; |
1002 | 2152 | else | 2144 | else |
1003 | 2153 | can_disable= true; | 2145 | can_disable= true; |
1004 | @@ -2156,14 +2148,14 @@ | |||
1005 | 2156 | { | 2148 | { |
1006 | 2157 | if (!(opts= (my_option*) alloc_root(tmp_root, sizeof(my_option) * count))) | 2149 | if (!(opts= (my_option*) alloc_root(tmp_root, sizeof(my_option) * count))) |
1007 | 2158 | { | 2150 | { |
1009 | 2159 | errmsg_printf(ERRMSG_LVL_ERROR, _("Out of memory for plugin '%s'."), tmp->name.str); | 2151 | errmsg_printf(ERRMSG_LVL_ERROR, _("Out of memory for plugin '%s'."), tmp->getName().c_str()); |
1010 | 2160 | return(-1); | 2152 | return(-1); |
1011 | 2161 | } | 2153 | } |
1012 | 2162 | memset(opts, 0, sizeof(my_option) * count); | 2154 | memset(opts, 0, sizeof(my_option) * count); |
1013 | 2163 | 2155 | ||
1014 | 2164 | if (construct_options(tmp_root, tmp, opts, can_disable)) | 2156 | if (construct_options(tmp_root, tmp, opts, can_disable)) |
1015 | 2165 | { | 2157 | { |
1017 | 2166 | errmsg_printf(ERRMSG_LVL_ERROR, _("Bad options for plugin '%s'."), tmp->name.str); | 2158 | errmsg_printf(ERRMSG_LVL_ERROR, _("Bad options for plugin '%s'."), tmp->getName().c_str()); |
1018 | 2167 | return(-1); | 2159 | return(-1); |
1019 | 2168 | } | 2160 | } |
1020 | 2169 | 2161 | ||
1021 | @@ -2173,7 +2165,7 @@ | |||
1022 | 2173 | if (error) | 2165 | if (error) |
1023 | 2174 | { | 2166 | { |
1024 | 2175 | errmsg_printf(ERRMSG_LVL_ERROR, _("Parsing options for plugin '%s' failed."), | 2167 | errmsg_printf(ERRMSG_LVL_ERROR, _("Parsing options for plugin '%s' failed."), |
1026 | 2176 | tmp->name.str); | 2168 | tmp->getName().c_str()); |
1027 | 2177 | goto err; | 2169 | goto err; |
1028 | 2178 | } | 2170 | } |
1029 | 2179 | } | 2171 | } |
1030 | @@ -2181,18 +2173,18 @@ | |||
1031 | 2181 | error= 1; | 2173 | error= 1; |
1032 | 2182 | 2174 | ||
1033 | 2183 | { | 2175 | { |
1035 | 2184 | for (opt= tmp->plugin->system_vars; opt && *opt; opt++) | 2176 | for (opt= tmp->getManifest().system_vars; opt && *opt; opt++) |
1036 | 2185 | { | 2177 | { |
1037 | 2186 | if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR)) | 2178 | if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR)) |
1038 | 2187 | continue; | 2179 | continue; |
1039 | 2188 | 2180 | ||
1041 | 2189 | if ((var= find_bookmark(tmp->name.str, o->name, o->flags))) | 2181 | if ((var= find_bookmark(tmp->getName().c_str(), o->name, o->flags))) |
1042 | 2190 | v= new (mem_root) sys_var_pluginvar(var->key + 1, o); | 2182 | v= new (mem_root) sys_var_pluginvar(var->key + 1, o); |
1043 | 2191 | else | 2183 | else |
1044 | 2192 | { | 2184 | { |
1046 | 2193 | len= tmp->name.length + strlen(o->name) + 2; | 2185 | len= tmp->getName().length() + strlen(o->name) + 2; |
1047 | 2194 | varname= (char*) alloc_root(mem_root, len); | 2186 | varname= (char*) alloc_root(mem_root, len); |
1049 | 2195 | sprintf(varname,"%s-%s",tmp->name.str,o->name); | 2187 | sprintf(varname,"%s-%s",tmp->getName().c_str(),o->name); |
1050 | 2196 | my_casedn_str(&my_charset_utf8_general_ci, varname); | 2188 | my_casedn_str(&my_charset_utf8_general_ci, varname); |
1051 | 2197 | 2189 | ||
1052 | 2198 | for (p= varname; *p; p++) | 2190 | for (p= varname; *p; p++) |
1053 | @@ -2216,7 +2208,7 @@ | |||
1054 | 2216 | if (mysql_add_sys_var_chain(chain.first, NULL)) | 2208 | if (mysql_add_sys_var_chain(chain.first, NULL)) |
1055 | 2217 | { | 2209 | { |
1056 | 2218 | errmsg_printf(ERRMSG_LVL_ERROR, _("Plugin '%s' has conflicting system variables"), | 2210 | errmsg_printf(ERRMSG_LVL_ERROR, _("Plugin '%s' has conflicting system variables"), |
1058 | 2219 | tmp->name.str); | 2211 | tmp->getName().c_str()); |
1059 | 2220 | goto err; | 2212 | goto err; |
1060 | 2221 | } | 2213 | } |
1061 | 2222 | tmp->system_vars= chain.first; | 2214 | tmp->system_vars= chain.first; |
1062 | @@ -2235,49 +2227,69 @@ | |||
1063 | 2235 | Help Verbose text with Plugin System Variables | 2227 | Help Verbose text with Plugin System Variables |
1064 | 2236 | ****************************************************************************/ | 2228 | ****************************************************************************/ |
1065 | 2237 | 2229 | ||
1076 | 2238 | static int option_cmp(my_option *a, my_option *b) | 2230 | class OptionCmp |
1077 | 2239 | { | 2231 | { |
1078 | 2240 | return my_strcasecmp(&my_charset_utf8_general_ci, a->name, b->name); | 2232 | public: |
1079 | 2241 | } | 2233 | bool operator() (const my_option &a, const my_option &b) |
1080 | 2242 | 2234 | { | |
1081 | 2243 | 2235 | return my_strcasecmp(&my_charset_utf8_general_ci, a.name, b.name); | |
1082 | 2244 | void my_print_help_inc_plugins(my_option *main_options, uint32_t size) | 2236 | } |
1083 | 2245 | { | 2237 | }; |
1084 | 2246 | DYNAMIC_ARRAY all_options; | 2238 | |
1085 | 2247 | struct st_plugin_int *p; | 2239 | |
1086 | 2240 | void my_print_help_inc_plugins(my_option *main_options) | ||
1087 | 2241 | { | ||
1088 | 2242 | vector<my_option> all_options; | ||
1089 | 2243 | Handle *p; | ||
1090 | 2248 | MEM_ROOT mem_root; | 2244 | MEM_ROOT mem_root; |
1092 | 2249 | my_option *opt; | 2245 | my_option *opt= NULL; |
1093 | 2250 | 2246 | ||
1094 | 2251 | init_alloc_root(&mem_root, 4096, 4096); | 2247 | init_alloc_root(&mem_root, 4096, 4096); |
1095 | 2252 | my_init_dynamic_array(&all_options, sizeof(my_option), size, size/4); | ||
1096 | 2253 | 2248 | ||
1097 | 2254 | if (initialized) | 2249 | if (initialized) |
1098 | 2255 | for (uint32_t idx= 0; idx < plugin_array.elements; idx++) | 2250 | for (uint32_t idx= 0; idx < plugin_array.elements; idx++) |
1099 | 2256 | { | 2251 | { |
1104 | 2257 | p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **); | 2252 | p= *dynamic_element(&plugin_array, idx, Handle **); |
1105 | 2258 | 2253 | ||
1106 | 2259 | if (!p->plugin->system_vars || | 2254 | if (p->getManifest().system_vars == NULL) |
1107 | 2260 | !(opt= construct_help_options(&mem_root, p))) | 2255 | continue; |
1108 | 2256 | |||
1109 | 2257 | opt= construct_help_options(&mem_root, p); | ||
1110 | 2258 | if (opt == NULL) | ||
1111 | 2261 | continue; | 2259 | continue; |
1112 | 2262 | 2260 | ||
1113 | 2263 | /* Only options with a non-NULL comment are displayed in help text */ | 2261 | /* Only options with a non-NULL comment are displayed in help text */ |
1114 | 2264 | for (;opt->id; opt++) | 2262 | for (;opt->id; opt++) |
1115 | 2263 | { | ||
1116 | 2265 | if (opt->comment) | 2264 | if (opt->comment) |
1118 | 2266 | insert_dynamic(&all_options, (unsigned char*) opt); | 2265 | { |
1119 | 2266 | all_options.push_back(*opt); | ||
1120 | 2267 | |||
1121 | 2268 | } | ||
1122 | 2269 | } | ||
1123 | 2267 | } | 2270 | } |
1124 | 2268 | 2271 | ||
1125 | 2269 | for (;main_options->id; main_options++) | 2272 | for (;main_options->id; main_options++) |
1127 | 2270 | insert_dynamic(&all_options, (unsigned char*) main_options); | 2273 | { |
1128 | 2274 | if (main_options->comment) | ||
1129 | 2275 | { | ||
1130 | 2276 | all_options.push_back(*main_options); | ||
1131 | 2277 | } | ||
1132 | 2278 | } | ||
1133 | 2271 | 2279 | ||
1135 | 2272 | sort_dynamic(&all_options, (qsort_cmp) option_cmp); | 2280 | /** |
1136 | 2281 | * @TODO: Fix the my_option building so that it doens't break sort | ||
1137 | 2282 | * | ||
1138 | 2283 | * sort(all_options.begin(), all_options.end(), OptionCmp()); | ||
1139 | 2284 | */ | ||
1140 | 2273 | 2285 | ||
1141 | 2274 | /* main_options now points to the empty option terminator */ | 2286 | /* main_options now points to the empty option terminator */ |
1148 | 2275 | insert_dynamic(&all_options, (unsigned char*) main_options); | 2287 | all_options.push_back(*main_options); |
1149 | 2276 | 2288 | ||
1150 | 2277 | my_print_help((my_option*) all_options.buffer); | 2289 | my_print_help(&*(all_options.begin())); |
1151 | 2278 | my_print_variables((my_option*) all_options.buffer); | 2290 | my_print_variables(&*(all_options.begin())); |
1152 | 2279 | 2291 | ||
1147 | 2280 | delete_dynamic(&all_options); | ||
1153 | 2281 | free_root(&mem_root, MYF(0)); | 2292 | free_root(&mem_root, MYF(0)); |
1154 | 2293 | |||
1155 | 2282 | } | 2294 | } |
1156 | 2283 | 2295 | ||
1157 | 2284 | 2296 | ||
1158 | === modified file 'drizzled/sql_plugin.h' | |||
1159 | --- drizzled/sql_plugin.h 2009-07-07 09:06:29 +0000 | |||
1160 | +++ drizzled/sql_plugin.h 2009-07-16 17:37:03 +0000 | |||
1161 | @@ -36,63 +36,15 @@ | |||
1162 | 36 | #ifndef DRIZZLE_SERVER_PLUGIN_H | 36 | #ifndef DRIZZLE_SERVER_PLUGIN_H |
1163 | 37 | #define DRIZZLE_SERVER_PLUGIN_H | 37 | #define DRIZZLE_SERVER_PLUGIN_H |
1164 | 38 | 38 | ||
1165 | 39 | #include <drizzled/lex_string.h> | ||
1166 | 40 | #include <mysys/my_alloc.h> | ||
1167 | 41 | #include <drizzled/plugin_registry.h> | ||
1168 | 42 | #include <drizzled/plugin.h> | 39 | #include <drizzled/plugin.h> |
1169 | 40 | #include <drizzled/plugin/manifest.h> | ||
1170 | 41 | #include <drizzled/plugin/library.h> | ||
1171 | 42 | #include <drizzled/plugin/handle.h> | ||
1172 | 43 | 43 | ||
1173 | 44 | class Session; | ||
1174 | 44 | class sys_var; | 45 | class sys_var; |
1226 | 45 | class Session; | 46 | typedef struct st_mysql_lex_string LEX_STRING; |
1227 | 46 | 47 | struct my_option; | |
1177 | 47 | |||
1178 | 48 | /* A handle for the dynamic library containing a plugin or plugins. */ | ||
1179 | 49 | struct drizzled_plugin_manifest; | ||
1180 | 50 | |||
1181 | 51 | struct st_plugin_dl | ||
1182 | 52 | { | ||
1183 | 53 | LEX_STRING dl; | ||
1184 | 54 | void *handle; | ||
1185 | 55 | struct drizzled_plugin_manifest *plugins; | ||
1186 | 56 | }; | ||
1187 | 57 | |||
1188 | 58 | /* A handle of a plugin */ | ||
1189 | 59 | |||
1190 | 60 | struct st_plugin_int | ||
1191 | 61 | { | ||
1192 | 62 | LEX_STRING name; | ||
1193 | 63 | struct drizzled_plugin_manifest *plugin; | ||
1194 | 64 | struct st_plugin_dl *plugin_dl; | ||
1195 | 65 | bool isInited; | ||
1196 | 66 | MEM_ROOT mem_root; /* memory for dynamic plugin structures */ | ||
1197 | 67 | sys_var *system_vars; /* server variables for this plugin */ | ||
1198 | 68 | }; | ||
1199 | 69 | |||
1200 | 70 | |||
1201 | 71 | #define plugin_decl(pi) ((pi)->plugin) | ||
1202 | 72 | #define plugin_data(pi,cast) (static_cast<cast>((pi)->data)) | ||
1203 | 73 | #define plugin_name(pi) (&((pi)->name)) | ||
1204 | 74 | #define plugin_equals(p1,p2) ((p1) && (p2) && (p1) == (p2)) | ||
1205 | 75 | |||
1206 | 76 | |||
1207 | 77 | typedef int (*plugin_type_init)(PluginRegistry &); | ||
1208 | 78 | |||
1209 | 79 | /* | ||
1210 | 80 | Plugin description structure. | ||
1211 | 81 | */ | ||
1212 | 82 | |||
1213 | 83 | struct drizzled_plugin_manifest | ||
1214 | 84 | { | ||
1215 | 85 | const char *name; /* plugin name (for SHOW PLUGINS) */ | ||
1216 | 86 | const char *version; /* plugin version (for SHOW PLUGINS) */ | ||
1217 | 87 | const char *author; /* plugin author (for SHOW PLUGINS) */ | ||
1218 | 88 | const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ | ||
1219 | 89 | int license; /* plugin license (PLUGIN_LICENSE_XXX) */ | ||
1220 | 90 | plugin_type_init init; /* function to invoke when plugin is loaded */ | ||
1221 | 91 | plugin_type_init deinit; /* function to invoke when plugin is unloaded */ | ||
1222 | 92 | struct st_mysql_show_var *status_vars; | ||
1223 | 93 | struct st_mysql_sys_var **system_vars; | ||
1224 | 94 | void *reserved1; /* reserved for dependency checking */ | ||
1225 | 95 | }; | ||
1228 | 96 | 48 | ||
1229 | 97 | extern char *opt_plugin_load; | 49 | extern char *opt_plugin_load; |
1230 | 98 | extern char *opt_plugin_dir_ptr; | 50 | extern char *opt_plugin_dir_ptr; |
1231 | @@ -100,12 +52,12 @@ | |||
1232 | 100 | 52 | ||
1233 | 101 | extern int plugin_init(int *argc, char **argv, int init_flags); | 53 | extern int plugin_init(int *argc, char **argv, int init_flags); |
1234 | 102 | extern void plugin_shutdown(void); | 54 | extern void plugin_shutdown(void); |
1236 | 103 | extern void my_print_help_inc_plugins(struct my_option *options, uint32_t size); | 55 | extern void my_print_help_inc_plugins(my_option *options); |
1237 | 104 | extern bool plugin_is_ready(const LEX_STRING *name, int type); | 56 | extern bool plugin_is_ready(const LEX_STRING *name, int type); |
1238 | 105 | extern bool mysql_install_plugin(Session *session, const LEX_STRING *name, | 57 | extern bool mysql_install_plugin(Session *session, const LEX_STRING *name, |
1239 | 106 | const LEX_STRING *dl); | 58 | const LEX_STRING *dl); |
1240 | 107 | extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name); | 59 | extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name); |
1242 | 108 | extern bool plugin_register_builtin(struct drizzled_plugin_manifest *plugin); | 60 | extern bool plugin_register_builtin(drizzled::plugin::Manifest *plugin); |
1243 | 109 | extern void plugin_sessionvar_init(Session *session); | 61 | extern void plugin_sessionvar_init(Session *session); |
1244 | 110 | extern void plugin_sessionvar_cleanup(Session *session); | 62 | extern void plugin_sessionvar_cleanup(Session *session); |
1245 | 111 | extern sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error); | 63 | extern sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error); |
1246 | 112 | 64 | ||
1247 | === modified file 'extra/clean_source.sh' | |||
1248 | --- extra/clean_source.sh 2009-07-10 21:50:02 +0000 | |||
1249 | +++ extra/clean_source.sh 2009-07-15 21:16:34 +0000 | |||
1250 | @@ -15,8 +15,8 @@ | |||
1251 | 15 | # along with this program; if not, write to the Free Software | 15 | # along with this program; if not, write to the Free Software |
1252 | 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1253 | 17 | 17 | ||
1255 | 18 | for file in `ack-grep -f | grep -v innobase | grep -v '\.pb\.'| grep -v bak-header | grep -v '^intl' | grep -v '^config' `; do | 18 | for file in `ack-grep -f | grep -v innobase | grep -v '\.pb\.'| grep -v bak-header | grep -v '^intl' | grep -v '^config' | grep -v '\.am$' | grep -v '\.ac$' | grep -v m4 | grep -v sql_yacc.yy | grep -v '.gperf$' `; do |
1256 | 19 | grep Copyright $file >/dev/null 2>&1 || echo "No copyright header in $file" | 19 | grep Copyright $file >/dev/null 2>&1 || echo "No copyright header in $file" |
1258 | 20 | uncrustify -c ../config/uncrustify.cfg --replace $file | 20 | uncrustify -c config/uncrustify.cfg --replace $file |
1259 | 21 | done | 21 | done |
1260 | 22 | 22 | ||
1261 | 23 | 23 | ||
1262 | === modified file 'm4/pandora_warnings.m4' | |||
1263 | --- m4/pandora_warnings.m4 2009-07-15 19:22:16 +0000 | |||
1264 | +++ m4/pandora_warnings.m4 2009-07-17 23:20:36 +0000 | |||
1265 | @@ -125,7 +125,7 @@ | |||
1266 | 125 | ]) | 125 | ]) |
1267 | 126 | 126 | ||
1268 | 127 | NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" | 127 | NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" |
1270 | 128 | NO_SHADOW="-Wno-shadow" | 128 | NO_SHADOW="-Wno-shadow -Wno-conversion" |
1271 | 129 | 129 | ||
1272 | 130 | AS_IF([test "$INTELCC" = "yes"],[ | 130 | AS_IF([test "$INTELCC" = "yes"],[ |
1273 | 131 | m4_if(PW_LESS_WARNINGS,[no],[ | 131 | m4_if(PW_LESS_WARNINGS,[no],[ |
1274 | 132 | 132 | ||
1275 | === modified file 'mysys/base64.cc' | |||
1276 | --- mysys/base64.cc 2009-05-03 15:58:12 +0000 | |||
1277 | +++ mysys/base64.cc 2009-07-17 22:25:54 +0000 | |||
1278 | @@ -213,9 +213,9 @@ | |||
1279 | 213 | i++; | 213 | i++; |
1280 | 214 | 214 | ||
1281 | 215 | end: | 215 | end: |
1285 | 216 | b[0]= (c >> 16) & 0xff; | 216 | b[0]= char((c >> 16) & 0xff); |
1286 | 217 | b[1]= (c >> 8) & 0xff; | 217 | b[1]= char((c >> 8) & 0xff); |
1287 | 218 | b[2]= (c >> 0) & 0xff; | 218 | b[2]= char((c >> 0) & 0xff); |
1288 | 219 | 219 | ||
1289 | 220 | for (j=0; j<3-mark; j++) | 220 | for (j=0; j<3-mark; j++) |
1290 | 221 | *d++= b[j]; | 221 | *d++= b[j]; |
1291 | @@ -228,7 +228,7 @@ | |||
1292 | 228 | The variable 'i' is set to 'len' when padding has been read, so it | 228 | The variable 'i' is set to 'len' when padding has been read, so it |
1293 | 229 | does not actually reflect the number of bytes read from 'src'. | 229 | does not actually reflect the number of bytes read from 'src'. |
1294 | 230 | */ | 230 | */ |
1296 | 231 | return i != len ? -1 : d - dst_base; | 231 | return (i != len) ? -1 : int(d - dst_base); |
1297 | 232 | } | 232 | } |
1298 | 233 | 233 | ||
1299 | 234 | 234 | ||
1300 | 235 | 235 | ||
1301 | === modified file 'mysys/checksum.cc' | |||
1302 | --- mysys/checksum.cc 2009-04-17 21:01:47 +0000 | |||
1303 | +++ mysys/checksum.cc 2009-07-17 22:25:54 +0000 | |||
1304 | @@ -30,6 +30,6 @@ | |||
1305 | 30 | 30 | ||
1306 | 31 | ha_checksum my_checksum(ha_checksum crc, const unsigned char *pos, size_t length) | 31 | ha_checksum my_checksum(ha_checksum crc, const unsigned char *pos, size_t length) |
1307 | 32 | { | 32 | { |
1309 | 33 | return (ha_checksum)crc32((uint32_t)crc, pos, length); | 33 | return ha_checksum(crc32((uint32_t)crc, pos, uInt(length))); |
1310 | 34 | } | 34 | } |
1311 | 35 | 35 | ||
1312 | 36 | 36 | ||
1313 | === modified file 'mysys/default.cc' | |||
1314 | --- mysys/default.cc 2009-07-10 21:19:35 +0000 | |||
1315 | +++ mysys/default.cc 2009-07-17 23:20:36 +0000 | |||
1316 | @@ -164,7 +164,7 @@ | |||
1317 | 164 | /* Handle --defaults-group-suffix= */ | 164 | /* Handle --defaults-group-suffix= */ |
1318 | 165 | uint32_t i; | 165 | uint32_t i; |
1319 | 166 | const char **extra_groups; | 166 | const char **extra_groups; |
1321 | 167 | const uint32_t instance_len= strlen(my_defaults_group_suffix); | 167 | const size_t instance_len= strlen(my_defaults_group_suffix); |
1322 | 168 | struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx; | 168 | struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx; |
1323 | 169 | char *ptr; | 169 | char *ptr; |
1324 | 170 | TYPELIB *group= ctx->group; | 170 | TYPELIB *group= ctx->group; |
1325 | @@ -176,7 +176,7 @@ | |||
1326 | 176 | 176 | ||
1327 | 177 | for (i= 0; i < group->count; i++) | 177 | for (i= 0; i < group->count; i++) |
1328 | 178 | { | 178 | { |
1330 | 179 | uint32_t len; | 179 | size_t len; |
1331 | 180 | extra_groups[i]= group->type_names[i]; /** copy group */ | 180 | extra_groups[i]= group->type_names[i]; /** copy group */ |
1332 | 181 | 181 | ||
1333 | 182 | len= strlen(extra_groups[i]); | 182 | len= strlen(extra_groups[i]); |
1334 | @@ -455,8 +455,8 @@ | |||
1335 | 455 | memcpy(res+1+args.elements, *argv + 1, (*argc-1)*sizeof(char*)); | 455 | memcpy(res+1+args.elements, *argv + 1, (*argc-1)*sizeof(char*)); |
1336 | 456 | res[args.elements+ *argc]=0; /* last null */ | 456 | res[args.elements+ *argc]=0; /* last null */ |
1337 | 457 | 457 | ||
1340 | 458 | (*argc)+=args.elements; | 458 | (*argc)+=int(args.elements); |
1341 | 459 | *argv= (char**) res; | 459 | *argv= static_cast<char**>(res); |
1342 | 460 | *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ | 460 | *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ |
1343 | 461 | delete_dynamic(&args); | 461 | delete_dynamic(&args); |
1344 | 462 | if (found_print_defaults) | 462 | if (found_print_defaults) |
1345 | 463 | 463 | ||
1346 | === removed file 'mysys/default_modify.cc' | |||
1347 | --- mysys/default_modify.cc 2009-06-30 21:28:16 +0000 | |||
1348 | +++ mysys/default_modify.cc 1970-01-01 00:00:00 +0000 | |||
1349 | @@ -1,252 +0,0 @@ | |||
1350 | 1 | /* Copyright (C) 2005 MySQL AB | ||
1351 | 2 | |||
1352 | 3 | This program is free software; you can redistribute it and/or modify | ||
1353 | 4 | it under the terms of the GNU General Public License as published by | ||
1354 | 5 | the Free Software Foundation; version 2 of the License. | ||
1355 | 6 | |||
1356 | 7 | This program is distributed in the hope that it will be useful, | ||
1357 | 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1358 | 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1359 | 10 | GNU General Public License for more details. | ||
1360 | 11 | |||
1361 | 12 | You should have received a copy of the GNU General Public License | ||
1362 | 13 | along with this program; if not, write to the Free Software | ||
1363 | 14 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | ||
1364 | 15 | |||
1365 | 16 | #include "mysys/mysys_priv.h" | ||
1366 | 17 | #include <mystrings/m_string.h> | ||
1367 | 18 | #include <mysys/my_dir.h> | ||
1368 | 19 | |||
1369 | 20 | #include <stdio.h> | ||
1370 | 21 | #include <algorithm> | ||
1371 | 22 | |||
1372 | 23 | using namespace std; | ||
1373 | 24 | |||
1374 | 25 | #define BUFF_SIZE 1024 | ||
1375 | 26 | #define RESERVE 1024 /* Extend buffer with this extent */ | ||
1376 | 27 | |||
1377 | 28 | #define NEWLINE "\n" | ||
1378 | 29 | #define NEWLINE_LEN 1 | ||
1379 | 30 | |||
1380 | 31 | static char *add_option(char *dst, const char *option_value, | ||
1381 | 32 | const char *option, int remove_option); | ||
1382 | 33 | |||
1383 | 34 | |||
1384 | 35 | /* | ||
1385 | 36 | Add/remove option to the option file section. | ||
1386 | 37 | |||
1387 | 38 | SYNOPSYS | ||
1388 | 39 | modify_defaults_file() | ||
1389 | 40 | file_location The location of configuration file to edit | ||
1390 | 41 | option The name of the option to look for (can be NULL) | ||
1391 | 42 | option value The value of the option we would like to set (can be NULL) | ||
1392 | 43 | section_name The name of the section (must be NOT NULL) | ||
1393 | 44 | remove_option This defines what we want to remove: | ||
1394 | 45 | - MY_REMOVE_NONE -- nothing to remove; | ||
1395 | 46 | - MY_REMOVE_OPTION -- remove the specified option; | ||
1396 | 47 | - MY_REMOVE_SECTION -- remove the specified section; | ||
1397 | 48 | IMPLEMENTATION | ||
1398 | 49 | We open the option file first, then read the file line-by-line, | ||
1399 | 50 | looking for the section we need. At the same time we put these lines | ||
1400 | 51 | into a buffer. Then we look for the option within this section and | ||
1401 | 52 | change/remove it. In the end we get a buffer with modified version of the | ||
1402 | 53 | file. Then we write it to the file, truncate it if needed and close it. | ||
1403 | 54 | Note that there is a small time gap, when the file is incomplete, | ||
1404 | 55 | and this theoretically might introduce a problem. | ||
1405 | 56 | |||
1406 | 57 | RETURN | ||
1407 | 58 | 0 - ok | ||
1408 | 59 | 1 - some error has occured. Probably due to the lack of resourses | ||
1409 | 60 | 2 - cannot open the file | ||
1410 | 61 | */ | ||
1411 | 62 | |||
1412 | 63 | int modify_defaults_file(const char *file_location, const char *option, | ||
1413 | 64 | const char *option_value, | ||
1414 | 65 | const char *section_name, int remove_option) | ||
1415 | 66 | { | ||
1416 | 67 | FILE *cnf_file; | ||
1417 | 68 | struct stat file_stat; | ||
1418 | 69 | char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer; | ||
1419 | 70 | size_t opt_len= 0, optval_len= 0, sect_len; | ||
1420 | 71 | uint32_t nr_newlines= 0; | ||
1421 | 72 | size_t buffer_size; | ||
1422 | 73 | bool in_section= false, opt_applied= 0; | ||
1423 | 74 | size_t reserve_extended; | ||
1424 | 75 | uint32_t new_opt_len; | ||
1425 | 76 | int reserve_occupied= 0; | ||
1426 | 77 | |||
1427 | 78 | if (!(cnf_file= fopen(file_location, "r+"))) | ||
1428 | 79 | return(2); | ||
1429 | 80 | |||
1430 | 81 | if (fstat(fileno(cnf_file), &file_stat)) | ||
1431 | 82 | goto malloc_err; | ||
1432 | 83 | |||
1433 | 84 | if (option && option_value) | ||
1434 | 85 | { | ||
1435 | 86 | opt_len= strlen(option); | ||
1436 | 87 | optval_len= strlen(option_value); | ||
1437 | 88 | } | ||
1438 | 89 | |||
1439 | 90 | new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN; | ||
1440 | 91 | |||
1441 | 92 | /* calculate the size of the buffer we need */ | ||
1442 | 93 | reserve_extended= (opt_len + | ||
1443 | 94 | 1 + /* For '=' char */ | ||
1444 | 95 | optval_len + /* Option value len */ | ||
1445 | 96 | NEWLINE_LEN + /* Space for newline */ | ||
1446 | 97 | RESERVE); /* Some additional space */ | ||
1447 | 98 | |||
1448 | 99 | buffer_size= (size_t)max((uint64_t)file_stat.st_size + 1, (uint64_t)SIZE_MAX); | ||
1449 | 100 | |||
1450 | 101 | /* | ||
1451 | 102 | Reserve space to read the contents of the file and some more | ||
1452 | 103 | for the option we want to add. | ||
1453 | 104 | */ | ||
1454 | 105 | if (!(file_buffer= (char*) malloc(max(buffer_size + reserve_extended, | ||
1455 | 106 | (size_t)SIZE_MAX)))) | ||
1456 | 107 | goto malloc_err; | ||
1457 | 108 | |||
1458 | 109 | sect_len= strlen(section_name); | ||
1459 | 110 | |||
1460 | 111 | for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); ) | ||
1461 | 112 | { | ||
1462 | 113 | /* Skip over whitespaces */ | ||
1463 | 114 | for (src_ptr= linebuff; my_isspace(&my_charset_utf8_general_ci, *src_ptr); | ||
1464 | 115 | src_ptr++) | ||
1465 | 116 | {} | ||
1466 | 117 | |||
1467 | 118 | if (!*src_ptr) /* Empty line */ | ||
1468 | 119 | { | ||
1469 | 120 | nr_newlines++; | ||
1470 | 121 | continue; | ||
1471 | 122 | } | ||
1472 | 123 | |||
1473 | 124 | /* correct the option (if requested) */ | ||
1474 | 125 | if (option && in_section && !strncmp(src_ptr, option, opt_len) && | ||
1475 | 126 | (*(src_ptr + opt_len) == '=' || | ||
1476 | 127 | my_isspace(&my_charset_utf8_general_ci, *(src_ptr + opt_len)) || | ||
1477 | 128 | *(src_ptr + opt_len) == '\0')) | ||
1478 | 129 | { | ||
1479 | 130 | char *old_src_ptr= src_ptr; | ||
1480 | 131 | src_ptr= strchr(src_ptr+ opt_len, '\0'); /* Find the end of the line */ | ||
1481 | 132 | |||
1482 | 133 | /* could be negative */ | ||
1483 | 134 | reserve_occupied+= (int) new_opt_len - (int) (src_ptr - old_src_ptr); | ||
1484 | 135 | if (reserve_occupied >= (int) reserve_extended) | ||
1485 | 136 | { | ||
1486 | 137 | reserve_extended= (uint32_t) reserve_occupied + RESERVE; | ||
1487 | 138 | if (!(file_buffer= (char*) realloc(file_buffer, buffer_size + | ||
1488 | 139 | reserve_extended))) | ||
1489 | 140 | goto malloc_err; | ||
1490 | 141 | } | ||
1491 | 142 | opt_applied= 1; | ||
1492 | 143 | dst_ptr= add_option(dst_ptr, option_value, option, remove_option); | ||
1493 | 144 | } | ||
1494 | 145 | else | ||
1495 | 146 | { | ||
1496 | 147 | /* | ||
1497 | 148 | If we are going to the new group and have an option to apply, do | ||
1498 | 149 | it now. If we are removing a single option or the whole section | ||
1499 | 150 | this will only trigger opt_applied flag. | ||
1500 | 151 | */ | ||
1501 | 152 | |||
1502 | 153 | if (in_section && !opt_applied && *src_ptr == '[') | ||
1503 | 154 | { | ||
1504 | 155 | dst_ptr= add_option(dst_ptr, option_value, option, remove_option); | ||
1505 | 156 | opt_applied= 1; /* set the flag to do write() later */ | ||
1506 | 157 | reserve_occupied= new_opt_len+ opt_len + 1 + NEWLINE_LEN; | ||
1507 | 158 | } | ||
1508 | 159 | |||
1509 | 160 | for (; nr_newlines; nr_newlines--) | ||
1510 | 161 | dst_ptr= strcpy(dst_ptr, NEWLINE)+NEWLINE_LEN; | ||
1511 | 162 | |||
1512 | 163 | /* Skip the section if MY_REMOVE_SECTION was given */ | ||
1513 | 164 | if (!in_section || remove_option != MY_REMOVE_SECTION) | ||
1514 | 165 | dst_ptr= strcpy(dst_ptr, linebuff); | ||
1515 | 166 | dst_ptr+= strlen(linebuff); | ||
1516 | 167 | } | ||
1517 | 168 | /* Look for a section */ | ||
1518 | 169 | if (*src_ptr == '[') | ||
1519 | 170 | { | ||
1520 | 171 | /* Copy the line to the buffer */ | ||
1521 | 172 | if (!strncmp(++src_ptr, section_name, sect_len)) | ||
1522 | 173 | { | ||
1523 | 174 | src_ptr+= sect_len; | ||
1524 | 175 | /* Skip over whitespaces. They are allowed after section name */ | ||
1525 | 176 | for (; my_isspace(&my_charset_utf8_general_ci, *src_ptr); src_ptr++) | ||
1526 | 177 | {} | ||
1527 | 178 | |||
1528 | 179 | if (*src_ptr != ']') | ||
1529 | 180 | { | ||
1530 | 181 | in_section= false; | ||
1531 | 182 | continue; /* Missing closing parenthesis. Assume this was no group */ | ||
1532 | 183 | } | ||
1533 | 184 | |||
1534 | 185 | if (remove_option == MY_REMOVE_SECTION) | ||
1535 | 186 | dst_ptr= dst_ptr - strlen(linebuff); | ||
1536 | 187 | |||
1537 | 188 | in_section= true; | ||
1538 | 189 | } | ||
1539 | 190 | else | ||
1540 | 191 | in_section= false; /* mark that this section is of no interest to us */ | ||
1541 | 192 | } | ||
1542 | 193 | } | ||
1543 | 194 | |||
1544 | 195 | /* | ||
1545 | 196 | File ended. Apply an option or set opt_applied flag (in case of | ||
1546 | 197 | MY_REMOVE_SECTION) so that the changes are saved. Do not do anything | ||
1547 | 198 | if we are removing non-existent option. | ||
1548 | 199 | */ | ||
1549 | 200 | |||
1550 | 201 | if (!opt_applied && in_section && (remove_option != MY_REMOVE_OPTION)) | ||
1551 | 202 | { | ||
1552 | 203 | /* New option still remains to apply at the end */ | ||
1553 | 204 | if (!remove_option && *(dst_ptr - 1) != '\n') | ||
1554 | 205 | dst_ptr= strcpy(dst_ptr, NEWLINE)+NEWLINE_LEN; | ||
1555 | 206 | dst_ptr= add_option(dst_ptr, option_value, option, remove_option); | ||
1556 | 207 | opt_applied= 1; | ||
1557 | 208 | } | ||
1558 | 209 | for (; nr_newlines; nr_newlines--) | ||
1559 | 210 | dst_ptr= strcpy(dst_ptr, NEWLINE)+NEWLINE_LEN; | ||
1560 | 211 | |||
1561 | 212 | if (opt_applied) | ||
1562 | 213 | { | ||
1563 | 214 | /* Don't write the file if there are no changes to be made */ | ||
1564 | 215 | if (ftruncate(fileno(cnf_file), (size_t) (dst_ptr - file_buffer)) || | ||
1565 | 216 | fseeko(cnf_file, 0, SEEK_SET) || | ||
1566 | 217 | fwrite(file_buffer, 1, (size_t) (dst_ptr - file_buffer), cnf_file)) | ||
1567 | 218 | goto err; | ||
1568 | 219 | } | ||
1569 | 220 | if (fclose(cnf_file)) | ||
1570 | 221 | return(1); | ||
1571 | 222 | |||
1572 | 223 | free(file_buffer); | ||
1573 | 224 | return(0); | ||
1574 | 225 | |||
1575 | 226 | err: | ||
1576 | 227 | free(file_buffer); | ||
1577 | 228 | malloc_err: | ||
1578 | 229 | fclose(cnf_file); | ||
1579 | 230 | |||
1580 | 231 | return 1; /* out of resources */ | ||
1581 | 232 | } | ||
1582 | 233 | |||
1583 | 234 | |||
1584 | 235 | static char *add_option(char *dst, const char *option_value, | ||
1585 | 236 | const char *option, int remove_option) | ||
1586 | 237 | { | ||
1587 | 238 | if (!remove_option) | ||
1588 | 239 | { | ||
1589 | 240 | dst= strcpy(dst, option); | ||
1590 | 241 | dst+= strlen(option); | ||
1591 | 242 | if (*option_value) | ||
1592 | 243 | { | ||
1593 | 244 | *dst++= '='; | ||
1594 | 245 | dst= strcpy(dst, option_value); | ||
1595 | 246 | dst+= strlen(option_value); | ||
1596 | 247 | } | ||
1597 | 248 | /* add a newline */ | ||
1598 | 249 | dst= strcpy(dst, NEWLINE)+NEWLINE_LEN; | ||
1599 | 250 | } | ||
1600 | 251 | return dst; | ||
1601 | 252 | } | ||
1602 | 253 | 0 | ||
1603 | === modified file 'mysys/my_bitmap.h' | |||
1604 | --- mysys/my_bitmap.h 2009-05-23 00:05:52 +0000 | |||
1605 | +++ mysys/my_bitmap.h 2009-07-17 22:25:54 +0000 | |||
1606 | @@ -80,7 +80,7 @@ | |||
1607 | 80 | 80 | ||
1608 | 81 | static inline void bitmap_set_bit(MY_BITMAP const *map, uint32_t bit) | 81 | static inline void bitmap_set_bit(MY_BITMAP const *map, uint32_t bit) |
1609 | 82 | { | 82 | { |
1611 | 83 | ((unsigned char *)map->bitmap)[bit / 8] |= (1 << ((bit) & 7)); | 83 | ((unsigned char *)map->bitmap)[bit / 8] |= (unsigned char)(1 << ((bit) & 7)); |
1612 | 84 | } | 84 | } |
1613 | 85 | 85 | ||
1614 | 86 | static inline void bitmap_flip_bit(MY_BITMAP const *map, uint32_t bit) | 86 | static inline void bitmap_flip_bit(MY_BITMAP const *map, uint32_t bit) |
1615 | 87 | 87 | ||
1616 | === modified file 'mysys/my_sys.h' | |||
1617 | --- mysys/my_sys.h 2009-07-11 06:24:19 +0000 | |||
1618 | +++ mysys/my_sys.h 2009-07-17 23:20:36 +0000 | |||
1619 | @@ -71,10 +71,6 @@ | |||
1620 | 71 | #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ | 71 | #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ |
1621 | 72 | #define MY_GIVE_INFO 2 /* Give time info about process*/ | 72 | #define MY_GIVE_INFO 2 /* Give time info about process*/ |
1622 | 73 | 73 | ||
1623 | 74 | #define MY_REMOVE_NONE 0 /* Params for modify_defaults_file */ | ||
1624 | 75 | #define MY_REMOVE_OPTION 1 | ||
1625 | 76 | #define MY_REMOVE_SECTION 2 | ||
1626 | 77 | |||
1627 | 78 | #define ME_HIGHBYTE 8 /* Shift for colours */ | 74 | #define ME_HIGHBYTE 8 /* Shift for colours */ |
1628 | 79 | #define ME_NOCUR 1 /* Don't use curses message */ | 75 | #define ME_NOCUR 1 /* Don't use curses message */ |
1629 | 80 | #define ME_OLDWIN 2 /* Use old window */ | 76 | #define ME_OLDWIN 2 /* Use old window */ |
1630 | @@ -401,9 +397,6 @@ | |||
1631 | 401 | char **group_suffix); | 397 | char **group_suffix); |
1632 | 402 | extern int load_defaults(const char *conf_file, const char **groups, | 398 | extern int load_defaults(const char *conf_file, const char **groups, |
1633 | 403 | int *argc, char ***argv); | 399 | int *argc, char ***argv); |
1634 | 404 | extern int modify_defaults_file(const char *file_location, const char *option, | ||
1635 | 405 | const char *option_value, | ||
1636 | 406 | const char *section_name, int remove_option); | ||
1637 | 407 | extern int my_search_option_files(const char *conf_file, int *argc, | 400 | extern int my_search_option_files(const char *conf_file, int *argc, |
1638 | 408 | char ***argv, uint32_t *args_used, | 401 | char ***argv, uint32_t *args_used, |
1639 | 409 | Process_option_func func, void *func_ctx); | 402 | Process_option_func func, void *func_ctx); |
1640 | 410 | 403 | ||
1641 | === modified file 'plugin/info_schema/info_schema_methods.cc' | |||
1642 | --- plugin/info_schema/info_schema_methods.cc 2009-07-09 01:35:10 +0000 | |||
1643 | +++ plugin/info_schema/info_schema_methods.cc 2009-07-18 18:11:42 +0000 | |||
1644 | @@ -330,7 +330,7 @@ | |||
1645 | 330 | return (0); | 330 | return (0); |
1646 | 331 | } | 331 | } |
1647 | 332 | 332 | ||
1649 | 333 | class ShowPlugins : public unary_function<st_plugin_int *, bool> | 333 | class ShowPlugins : public unary_function<drizzled::plugin::Handle *, bool> |
1650 | 334 | { | 334 | { |
1651 | 335 | Session *session; | 335 | Session *session; |
1652 | 336 | Table *table; | 336 | Table *table; |
1653 | @@ -340,17 +340,17 @@ | |||
1654 | 340 | 340 | ||
1655 | 341 | result_type operator() (argument_type plugin) | 341 | result_type operator() (argument_type plugin) |
1656 | 342 | { | 342 | { |
1658 | 343 | struct drizzled_plugin_manifest *plug= plugin_decl(plugin); | 343 | const drizzled::plugin::Manifest &manifest= plugin->getManifest(); |
1659 | 344 | const CHARSET_INFO * const cs= system_charset_info; | 344 | const CHARSET_INFO * const cs= system_charset_info; |
1660 | 345 | 345 | ||
1661 | 346 | table->restoreRecordAsDefault(); | 346 | table->restoreRecordAsDefault(); |
1662 | 347 | 347 | ||
1665 | 348 | table->field[0]->store(plugin_name(plugin)->str, | 348 | table->field[0]->store(plugin->getName().c_str(), |
1666 | 349 | plugin_name(plugin)->length, cs); | 349 | plugin->getName().size(), cs); |
1667 | 350 | 350 | ||
1669 | 351 | if (plug->version) | 351 | if (manifest.version) |
1670 | 352 | { | 352 | { |
1672 | 353 | table->field[1]->store(plug->version, strlen(plug->version), cs); | 353 | table->field[1]->store(manifest.version, strlen(manifest.version), cs); |
1673 | 354 | table->field[1]->set_notnull(); | 354 | table->field[1]->set_notnull(); |
1674 | 355 | } | 355 | } |
1675 | 356 | else | 356 | else |
1676 | @@ -365,9 +365,9 @@ | |||
1677 | 365 | table->field[2]->store(STRING_WITH_LEN("INACTIVE"), cs); | 365 | table->field[2]->store(STRING_WITH_LEN("INACTIVE"), cs); |
1678 | 366 | } | 366 | } |
1679 | 367 | 367 | ||
1681 | 368 | if (plug->author) | 368 | if (manifest.author) |
1682 | 369 | { | 369 | { |
1684 | 370 | table->field[3]->store(plug->author, strlen(plug->author), cs); | 370 | table->field[3]->store(manifest.author, strlen(manifest.author), cs); |
1685 | 371 | table->field[3]->set_notnull(); | 371 | table->field[3]->set_notnull(); |
1686 | 372 | } | 372 | } |
1687 | 373 | else | 373 | else |
1688 | @@ -375,9 +375,9 @@ | |||
1689 | 375 | table->field[3]->set_null(); | 375 | table->field[3]->set_null(); |
1690 | 376 | } | 376 | } |
1691 | 377 | 377 | ||
1693 | 378 | if (plug->descr) | 378 | if (manifest.descr) |
1694 | 379 | { | 379 | { |
1696 | 380 | table->field[4]->store(plug->descr, strlen(plug->descr), cs); | 380 | table->field[4]->store(manifest.descr, strlen(manifest.descr), cs); |
1697 | 381 | table->field[4]->set_notnull(); | 381 | table->field[4]->set_notnull(); |
1698 | 382 | } | 382 | } |
1699 | 383 | else | 383 | else |
1700 | @@ -385,22 +385,23 @@ | |||
1701 | 385 | table->field[4]->set_null(); | 385 | table->field[4]->set_null(); |
1702 | 386 | } | 386 | } |
1703 | 387 | 387 | ||
1705 | 388 | switch (plug->license) { | 388 | switch (manifest.license) { |
1706 | 389 | case PLUGIN_LICENSE_GPL: | 389 | case PLUGIN_LICENSE_GPL: |
1709 | 390 | table->field[5]->store(PLUGIN_LICENSE_GPL_STRING, | 390 | table->field[5]->store(drizzled::plugin::LICENSE_GPL_STRING.c_str(), |
1710 | 391 | strlen(PLUGIN_LICENSE_GPL_STRING), cs); | 391 | drizzled::plugin::LICENSE_GPL_STRING.size(), cs); |
1711 | 392 | break; | 392 | break; |
1712 | 393 | case PLUGIN_LICENSE_BSD: | 393 | case PLUGIN_LICENSE_BSD: |
1715 | 394 | table->field[5]->store(PLUGIN_LICENSE_BSD_STRING, | 394 | table->field[5]->store(drizzled::plugin::LICENSE_BSD_STRING.c_str(), |
1716 | 395 | strlen(PLUGIN_LICENSE_BSD_STRING), cs); | 395 | drizzled::plugin::LICENSE_BSD_STRING.size(), cs); |
1717 | 396 | break; | 396 | break; |
1718 | 397 | case PLUGIN_LICENSE_LGPL: | 397 | case PLUGIN_LICENSE_LGPL: |
1721 | 398 | table->field[5]->store(PLUGIN_LICENSE_LGPL_STRING, | 398 | table->field[5]->store(drizzled::plugin::LICENSE_LGPL_STRING.c_str(), |
1722 | 399 | strlen(PLUGIN_LICENSE_LGPL_STRING), cs); | 399 | drizzled::plugin::LICENSE_LGPL_STRING.size(), cs); |
1723 | 400 | break; | 400 | break; |
1724 | 401 | default: | 401 | default: |
1727 | 402 | table->field[5]->store(PLUGIN_LICENSE_PROPRIETARY_STRING, | 402 | table->field[5]->store(drizzled::plugin::LICENSE_PROPRIETARY_STRING.c_str(), |
1728 | 403 | strlen(PLUGIN_LICENSE_PROPRIETARY_STRING), cs); | 403 | drizzled::plugin::LICENSE_PROPRIETARY_STRING.size(), |
1729 | 404 | cs); | ||
1730 | 404 | break; | 405 | break; |
1731 | 405 | } | 406 | } |
1732 | 406 | table->field[5]->set_notnull(); | 407 | table->field[5]->set_notnull(); |
1733 | @@ -414,8 +415,8 @@ | |||
1734 | 414 | Table *table= tables->table; | 415 | Table *table= tables->table; |
1735 | 415 | 416 | ||
1736 | 416 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); | 417 | PluginRegistry ®istry= PluginRegistry::getPluginRegistry(); |
1739 | 417 | vector<st_plugin_int *> plugins= registry.get_list(true); | 418 | vector<drizzled::plugin::Handle *> plugins= registry.get_list(true); |
1740 | 418 | vector<st_plugin_int *>::iterator iter= | 419 | vector<drizzled::plugin::Handle *>::iterator iter= |
1741 | 419 | find_if(plugins.begin(), plugins.end(), ShowPlugins(session, table)); | 420 | find_if(plugins.begin(), plugins.end(), ShowPlugins(session, table)); |
1742 | 420 | if (iter != plugins.end()) | 421 | if (iter != plugins.end()) |
1743 | 421 | { | 422 | { |
1744 | 422 | 423 | ||
1745 | === modified file 'plugin/innobase/handler/ha_innodb.cc' | |||
1746 | --- plugin/innobase/handler/ha_innodb.cc 2009-07-07 09:06:29 +0000 | |||
1747 | +++ plugin/innobase/handler/ha_innodb.cc 2009-07-15 21:00:16 +0000 | |||
1748 | @@ -131,7 +131,7 @@ | |||
1749 | 131 | #ifdef DRIZZLE_DYNAMIC_PLUGIN | 131 | #ifdef DRIZZLE_DYNAMIC_PLUGIN |
1750 | 132 | /* These must be weak global variables in the dynamic plugin. */ | 132 | /* These must be weak global variables in the dynamic plugin. */ |
1751 | 133 | #ifdef __WIN__ | 133 | #ifdef __WIN__ |
1753 | 134 | struct drizzled_plugin_manifest* builtin_innobase_plugin_ptr; | 134 | struct drizzled::plugin::Manifest* builtin_innobase_plugin_ptr; |
1754 | 135 | #else | 135 | #else |
1755 | 136 | int builtin_innobase_plugin; | 136 | int builtin_innobase_plugin; |
1756 | 137 | #endif /* __WIN__ */ | 137 | #endif /* __WIN__ */ |
1757 | @@ -9063,9 +9063,9 @@ | |||
1758 | 9063 | 9063 | ||
1759 | 9064 | /* Copy the system variables. */ | 9064 | /* Copy the system variables. */ |
1760 | 9065 | 9065 | ||
1764 | 9066 | struct drizzled_plugin_manifest* builtin; | 9066 | drizzled::plugin::Manifest* builtin; |
1765 | 9067 | struct st_mysql_sys_var** sta; /* static parameters */ | 9067 | st_mysql_sys_var** sta; /* static parameters */ |
1766 | 9068 | struct st_mysql_sys_var** dyn; /* dynamic parameters */ | 9068 | st_mysql_sys_var** dyn; /* dynamic parameters */ |
1767 | 9069 | 9069 | ||
1768 | 9070 | #ifdef __WIN__ | 9070 | #ifdef __WIN__ |
1769 | 9071 | if (!builtin_innobase_plugin_ptr) { | 9071 | if (!builtin_innobase_plugin_ptr) { |
1770 | @@ -9076,7 +9076,7 @@ | |||
1771 | 9076 | builtin = builtin_innobase_plugin_ptr; | 9076 | builtin = builtin_innobase_plugin_ptr; |
1772 | 9077 | #else | 9077 | #else |
1773 | 9078 | 9078 | ||
1775 | 9079 | builtin = (struct drizzled_plugin_manifest*) &builtin_innobase_plugin; | 9079 | builtin = (drizzled::plugin::Manifest*) &builtin_innobase_plugin; |
1776 | 9080 | #endif | 9080 | #endif |
1777 | 9081 | 9081 | ||
1778 | 9082 | for (sta = builtin->system_vars; *sta != NULL; sta++) { | 9082 | for (sta = builtin->system_vars; *sta != NULL; sta++) { |
1779 | 9083 | 9083 | ||
1780 | === modified file 'plugin/innobase/handler/win_delay_loader.cc' | |||
1781 | --- plugin/innobase/handler/win_delay_loader.cc 2009-04-11 00:30:51 +0000 | |||
1782 | +++ plugin/innobase/handler/win_delay_loader.cc 2009-07-15 21:00:16 +0000 | |||
1783 | @@ -76,7 +76,7 @@ | |||
1784 | 76 | The following is defined in ha_innodb.cc. It is used for copying the | 76 | The following is defined in ha_innodb.cc. It is used for copying the |
1785 | 77 | system variables from the builtin innodb plugin to the dynamic plugin. | 77 | system variables from the builtin innodb plugin to the dynamic plugin. |
1786 | 78 | */ | 78 | */ |
1788 | 79 | extern struct drizzled_plugin_manifest* builtin_innobase_plugin_ptr; | 79 | extern drizzled::plugin::Manifest* builtin_innobase_plugin_ptr; |
1789 | 80 | 80 | ||
1790 | 81 | /*********************************************************************** | 81 | /*********************************************************************** |
1791 | 82 | The preffered load-address defined in PE (portable executable format).*/ | 82 | The preffered load-address defined in PE (portable executable format).*/ |
1792 | @@ -644,7 +644,7 @@ | |||
1793 | 644 | wdl_binlog_format_names, char*); | 644 | wdl_binlog_format_names, char*); |
1794 | 645 | 645 | ||
1795 | 646 | /* It is fine if builtin_innobase_plugin is not available. */ | 646 | /* It is fine if builtin_innobase_plugin is not available. */ |
1797 | 647 | builtin_innobase_plugin_ptr = (struct drizzled_plugin_manifest*) | 647 | builtin_innobase_plugin_ptr = (drizzled::plugin::Manifest*) |
1798 | 648 | wdl_get_varaddr_from_map( | 648 | wdl_get_varaddr_from_map( |
1799 | 649 | hmod, | 649 | hmod, |
1800 | 650 | "?builtin_innobase_plugin@@3PAUdrizzled_plugin_manifest@@A"); | 650 | "?builtin_innobase_plugin@@3PAUdrizzled_plugin_manifest@@A"); |
Contains Monty's build-cleanup and plugin class cleanup branches. All tests pass on Linux64, Solaris64, and MacOSX64, with only known exception of drizzledump failure on Solaris and myisamcheck failure on MacOSX.