Merge lp:~stewart/drizzle/seapitester-state-history into lp:drizzle/7.0
- seapitester-state-history
- Merge into 7.0
Proposed by
Stewart Smith
Status: | Merged |
---|---|
Approved by: | Brian Aker |
Approved revision: | 2080 |
Merged at revision: | 2085 |
Proposed branch: | lp:~stewart/drizzle/seapitester-state-history |
Merge into: | lp:drizzle/7.0 |
Diff against target: |
991 lines (+640/-49) 20 files modified
plugin/storage_engine_api_tester/engine_state_history.cc (+135/-0) plugin/storage_engine_api_tester/engine_state_history.h (+26/-0) plugin/storage_engine_api_tester/plugin.ini (+3/-2) plugin/storage_engine_api_tester/storage_engine_api_tester.cc (+6/-0) plugin/storage_engine_api_tester/tests/r/create_table.result (+12/-0) plugin/storage_engine_api_tester/tests/r/multi_stmt_txn.result (+100/-29) plugin/storage_engine_api_tester/tests/r/rnd_pos.result (+68/-0) plugin/storage_engine_api_tester/tests/r/rollback_statement.result (+16/-0) plugin/storage_engine_api_tester/tests/r/select.result (+28/-0) plugin/storage_engine_api_tester/tests/r/transaction.result (+75/-0) plugin/storage_engine_api_tester/tests/r/txn_log_insert.result (+51/-0) plugin/storage_engine_api_tester/tests/r/txn_log_rollback_large_stmt.result (+44/-0) plugin/storage_engine_api_tester/tests/t/create_table.test (+3/-0) plugin/storage_engine_api_tester/tests/t/multi_stmt_txn.test (+24/-18) plugin/storage_engine_api_tester/tests/t/rnd_pos.test (+12/-0) plugin/storage_engine_api_tester/tests/t/rollback_statement.test (+3/-0) plugin/storage_engine_api_tester/tests/t/select.test (+6/-0) plugin/storage_engine_api_tester/tests/t/transaction.test (+15/-0) plugin/storage_engine_api_tester/tests/t/txn_log_insert.test (+8/-0) plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt.test (+5/-0) |
To merge this branch: | bzr merge lp:~stewart/drizzle/seapitester-state-history |
Related bugs: | |
Related blueprints: |
SEAPITester: Engine state history
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+46092@code.launchpad.net |
Commit message
Description of the change
track what is being called in the Storage Engine in storage_
this means that if we start frakking around with things like TransactionServices we can check that we're not suddenly changing how the engines are being called without intending to.
http://
To post a comment you must log in.
- 2080. By Stewart Smith
-
cpplint fix for header guard
Revision history for this message
Stewart Smith (stewart) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'plugin/storage_engine_api_tester/engine_state_history.cc' |
2 | --- plugin/storage_engine_api_tester/engine_state_history.cc 1970-01-01 00:00:00 +0000 |
3 | +++ plugin/storage_engine_api_tester/engine_state_history.cc 2011-01-13 06:17:20 +0000 |
4 | @@ -0,0 +1,135 @@ |
5 | +/* |
6 | + Copyright (C) 2011 Stewart Smith |
7 | + |
8 | + This program is free software; you can redistribute it and/or |
9 | + modify it under the terms of the GNU General Public License |
10 | + as published by the Free Software Foundation; either version 2 |
11 | + of the License, or (at your option) any later version. |
12 | + |
13 | + This program is distributed in the hope that it will be useful, |
14 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | + GNU General Public License for more details. |
17 | + |
18 | + You should have received a copy of the GNU General Public License |
19 | + along with this program; if not, write to the Free Software |
20 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
21 | +*/ |
22 | + |
23 | +#include "config.h" |
24 | +#include "drizzled/plugin/table_function.h" |
25 | +#include <drizzled/plugin/function.h> |
26 | +#include <drizzled/item/func.h> |
27 | +#include <drizzled/algorithm/crc32.h> |
28 | + |
29 | +#include "engine_state_history.h" |
30 | + |
31 | +#include <string> |
32 | +#include <vector> |
33 | + |
34 | +using namespace std; |
35 | +using namespace drizzled; |
36 | + |
37 | +std::vector<std::string> engine_state_history; |
38 | + |
39 | +class EngineStateHistory : public drizzled::plugin::TableFunction |
40 | +{ |
41 | +public: |
42 | + |
43 | + EngineStateHistory(); |
44 | + |
45 | + EngineStateHistory(const char *table_arg) : |
46 | + drizzled::plugin::TableFunction("data_dictionary", table_arg) |
47 | + { } |
48 | + |
49 | + ~EngineStateHistory() {} |
50 | + |
51 | + class Generator : public drizzled::plugin::TableFunction::Generator |
52 | + { |
53 | + private: |
54 | + std::vector<std::string>::iterator it; |
55 | + public: |
56 | + Generator(drizzled::Field **arg); |
57 | + ~Generator(); |
58 | + |
59 | + bool populate(); |
60 | + }; |
61 | + |
62 | + EngineStateHistory::Generator *generator(drizzled::Field **arg) |
63 | + { |
64 | + return new Generator(arg); |
65 | + } |
66 | +}; |
67 | + |
68 | +EngineStateHistory::EngineStateHistory() : |
69 | + plugin::TableFunction("DATA_DICTIONARY", "SEAPITESTER_ENGINE_STATE_HISTORY") |
70 | +{ |
71 | + add_field("STATE"); |
72 | +} |
73 | + |
74 | +EngineStateHistory::Generator::Generator(Field **arg) : |
75 | + plugin::TableFunction::Generator(arg) |
76 | +{ |
77 | + it= engine_state_history.begin(); |
78 | +} |
79 | + |
80 | +EngineStateHistory::Generator::~Generator() |
81 | +{ |
82 | +} |
83 | + |
84 | +bool EngineStateHistory::Generator::populate() |
85 | +{ |
86 | + if (engine_state_history.empty()) |
87 | + return false; |
88 | + |
89 | + if (it == engine_state_history.end()) |
90 | + return false; // No more rows |
91 | + |
92 | + push(*it); |
93 | + it++; |
94 | + |
95 | + |
96 | + return true; |
97 | +} |
98 | + |
99 | +class ClearEngineStateHistoryFunction :public Item_int_func |
100 | +{ |
101 | +public: |
102 | + int64_t val_int(); |
103 | + |
104 | + ClearEngineStateHistoryFunction() :Item_int_func() |
105 | + { |
106 | + unsigned_flag= true; |
107 | + } |
108 | + |
109 | + const char *func_name() const |
110 | + { |
111 | + return "seapitester_clear_engine_state_history"; |
112 | + } |
113 | + |
114 | + void fix_length_and_dec() |
115 | + { |
116 | + max_length= 10; |
117 | + } |
118 | + |
119 | + bool check_argument_count(int n) |
120 | + { |
121 | + return (n == 0); |
122 | + } |
123 | +}; |
124 | + |
125 | +int64_t ClearEngineStateHistoryFunction::val_int() |
126 | +{ |
127 | + engine_state_history.clear(); |
128 | + null_value= false; |
129 | + return 0; |
130 | +} |
131 | + |
132 | + |
133 | +int engine_state_history_table_initialize(drizzled::module::Context &context) |
134 | +{ |
135 | + context.add(new(std::nothrow)EngineStateHistory()); |
136 | + context.add(new plugin::Create_function<ClearEngineStateHistoryFunction>("SEAPITESTER_CLEAR_ENGINE_STATE_HISTORY")); |
137 | + |
138 | + return 0; |
139 | +} |
140 | |
141 | === added file 'plugin/storage_engine_api_tester/engine_state_history.h' |
142 | --- plugin/storage_engine_api_tester/engine_state_history.h 1970-01-01 00:00:00 +0000 |
143 | +++ plugin/storage_engine_api_tester/engine_state_history.h 2011-01-13 06:17:20 +0000 |
144 | @@ -0,0 +1,26 @@ |
145 | +/* |
146 | + Copyright (C) 2011 Stewart Smith |
147 | + |
148 | + This program is free software; you can redistribute it and/or |
149 | + modify it under the terms of the GNU General Public License |
150 | + as published by the Free Software Foundation; either version 2 |
151 | + of the License, or (at your option) any later version. |
152 | + |
153 | + This program is distributed in the hope that it will be useful, |
154 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
155 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
156 | + GNU General Public License for more details. |
157 | + |
158 | + You should have received a copy of the GNU General Public License |
159 | + along with this program; if not, write to the Free Software |
160 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
161 | +*/ |
162 | + |
163 | +#ifndef PLUGIN_STORAGE_ENGINE_API_TESTER_ENGINE_STATE_HISTORY_H |
164 | +#define PLUGIN_STORAGE_ENGINE_API_TESTER_ENGINE_STATE_HISTORY_H |
165 | + |
166 | +extern std::vector<std::string> engine_state_history; |
167 | + |
168 | +int engine_state_history_table_initialize(drizzled::module::Context &context); |
169 | + |
170 | +#endif /* PLUGIN_STORAGE_ENGINE_API_TESTER_ENGINE_STATE_HISTORY_H */ |
171 | |
172 | === modified file 'plugin/storage_engine_api_tester/plugin.ini' |
173 | --- plugin/storage_engine_api_tester/plugin.ini 2010-10-25 14:11:22 +0000 |
174 | +++ plugin/storage_engine_api_tester/plugin.ini 2011-01-13 06:17:20 +0000 |
175 | @@ -1,6 +1,7 @@ |
176 | [plugin] |
177 | title=Storage Engine API Tester |
178 | description=Test engine that enforces SE API calling conventions very strictly |
179 | -sources=storage_engine_api_tester.cc engine_states.cc cursor_states.cc |
180 | +sources=storage_engine_api_tester.cc engine_states.cc cursor_states.cc engine_state_history.cc |
181 | +headers=engine_state_history.h |
182 | load_by_default=no |
183 | -static=no |
184 | \ No newline at end of file |
185 | +static=no |
186 | |
187 | === modified file 'plugin/storage_engine_api_tester/storage_engine_api_tester.cc' |
188 | --- plugin/storage_engine_api_tester/storage_engine_api_tester.cc 2010-12-08 04:51:43 +0000 |
189 | +++ plugin/storage_engine_api_tester/storage_engine_api_tester.cc 2011-01-13 06:17:20 +0000 |
190 | @@ -31,10 +31,13 @@ |
191 | |
192 | #include <boost/unordered_map.hpp> |
193 | |
194 | +#include "engine_state_history.h" |
195 | + |
196 | using namespace std; |
197 | using namespace drizzled; |
198 | |
199 | string engine_state; |
200 | + |
201 | typedef multimap<string, string> state_multimap; |
202 | typedef multimap<string, string>::value_type state_pair; |
203 | typedef multimap<string, string>::iterator state_multimap_iter; |
204 | @@ -131,6 +134,7 @@ |
205 | } |
206 | |
207 | engine_state= new_state; |
208 | + engine_state_history.push_back(new_state); |
209 | |
210 | cerr << "\tENGINE STATE : " << engine_state << endl; |
211 | } |
212 | @@ -529,6 +533,8 @@ |
213 | |
214 | context.add(new plugin::Create_function<SEAPITesterErrorInjectFunc>("seapitester_error_inject")); |
215 | |
216 | + engine_state_history_table_initialize(context); |
217 | + |
218 | return 0; |
219 | } |
220 | |
221 | |
222 | === modified file 'plugin/storage_engine_api_tester/tests/r/create_table.result' |
223 | --- plugin/storage_engine_api_tester/tests/r/create_table.result 2010-10-25 12:46:17 +0000 |
224 | +++ plugin/storage_engine_api_tester/tests/r/create_table.result 2011-01-13 06:17:20 +0000 |
225 | @@ -1,2 +1,14 @@ |
226 | +select seapitester_clear_engine_state_history(); |
227 | +seapitester_clear_engine_state_history() |
228 | +0 |
229 | CREATE TABLE t1 (a int) ENGINE=STORAGE_ENGINE_API_TESTER; |
230 | +select * from data_dictionary.seapitester_engine_state_history; |
231 | +STATE |
232 | +::max_supported_key_length() |
233 | +::max_supported_keys() |
234 | +::doCreateTable() |
235 | +::SEAPITester() |
236 | +select seapitester_clear_engine_state_history(); |
237 | +seapitester_clear_engine_state_history() |
238 | +0 |
239 | drop table t1; |
240 | |
241 | === modified file 'plugin/storage_engine_api_tester/tests/r/multi_stmt_txn.result' |
242 | --- plugin/storage_engine_api_tester/tests/r/multi_stmt_txn.result 2010-11-26 05:19:00 +0000 |
243 | +++ plugin/storage_engine_api_tester/tests/r/multi_stmt_txn.result 2011-01-13 06:17:20 +0000 |
244 | @@ -1,29 +1,100 @@ |
245 | -create table t1 (a int) engine=storage_engine_api_tester; |
246 | -begin; |
247 | -select * from t1; |
248 | -a |
249 | -select * from t1; |
250 | -a |
251 | -commit; |
252 | -drop table t1; |
253 | -create table t1 (a int) engine=storage_engine_api_tester; |
254 | -begin; |
255 | -select * from t1; |
256 | -a |
257 | -insert into t1 values (1); |
258 | -insert into t1 values (1); |
259 | -insert into t1 values (1); |
260 | -select * from t1; |
261 | -a |
262 | -1 |
263 | -1 |
264 | -1 |
265 | -insert into t1 values (1); |
266 | -select * from t1; |
267 | -a |
268 | -1 |
269 | -1 |
270 | -1 |
271 | -1 |
272 | -commit; |
273 | -drop table t1; |
274 | +select seapitester_clear_engine_state_history(); |
275 | +seapitester_clear_engine_state_history() |
276 | +0 |
277 | +create table t1 (a int) engine=storage_engine_api_tester; |
278 | +begin; |
279 | +select * from t1; |
280 | +a |
281 | +select * from t1; |
282 | +a |
283 | +commit; |
284 | +select * from data_dictionary.seapitester_engine_state_history; |
285 | +STATE |
286 | +::max_supported_key_length() |
287 | +::max_supported_keys() |
288 | +::doCreateTable() |
289 | +::SEAPITester() |
290 | +BEGIN |
291 | +In Transaction |
292 | +END STATEMENT |
293 | +COMMIT STATEMENT |
294 | +In Transaction |
295 | +START STATEMENT |
296 | +END STATEMENT |
297 | +COMMIT STATEMENT |
298 | +In Transaction |
299 | +START STATEMENT |
300 | +END STATEMENT |
301 | +COMMIT STATEMENT |
302 | +In Transaction |
303 | +COMMIT |
304 | +::SEAPITester() |
305 | +select seapitester_clear_engine_state_history(); |
306 | +seapitester_clear_engine_state_history() |
307 | +0 |
308 | +drop table t1; |
309 | +create table t1 (a int) engine=storage_engine_api_tester; |
310 | +begin; |
311 | +select * from t1; |
312 | +a |
313 | +insert into t1 values (1); |
314 | +insert into t1 values (1); |
315 | +insert into t1 values (1); |
316 | +select * from t1; |
317 | +a |
318 | +1 |
319 | +1 |
320 | +1 |
321 | +insert into t1 values (1); |
322 | +select * from t1; |
323 | +a |
324 | +1 |
325 | +1 |
326 | +1 |
327 | +1 |
328 | +commit; |
329 | +drop table t1; |
330 | +select * from data_dictionary.seapitester_engine_state_history; |
331 | +STATE |
332 | +::max_supported_key_length() |
333 | +::max_supported_keys() |
334 | +::doCreateTable() |
335 | +::SEAPITester() |
336 | +BEGIN |
337 | +In Transaction |
338 | +END STATEMENT |
339 | +COMMIT STATEMENT |
340 | +In Transaction |
341 | +START STATEMENT |
342 | +END STATEMENT |
343 | +COMMIT STATEMENT |
344 | +In Transaction |
345 | +START STATEMENT |
346 | +END STATEMENT |
347 | +COMMIT STATEMENT |
348 | +In Transaction |
349 | +START STATEMENT |
350 | +END STATEMENT |
351 | +COMMIT STATEMENT |
352 | +In Transaction |
353 | +START STATEMENT |
354 | +END STATEMENT |
355 | +COMMIT STATEMENT |
356 | +In Transaction |
357 | +START STATEMENT |
358 | +END STATEMENT |
359 | +COMMIT STATEMENT |
360 | +In Transaction |
361 | +START STATEMENT |
362 | +END STATEMENT |
363 | +COMMIT STATEMENT |
364 | +In Transaction |
365 | +START STATEMENT |
366 | +END STATEMENT |
367 | +COMMIT STATEMENT |
368 | +In Transaction |
369 | +COMMIT |
370 | +::SEAPITester() |
371 | +select seapitester_clear_engine_state_history(); |
372 | +seapitester_clear_engine_state_history() |
373 | +0 |
374 | |
375 | === modified file 'plugin/storage_engine_api_tester/tests/r/rnd_pos.result' |
376 | --- plugin/storage_engine_api_tester/tests/r/rnd_pos.result 2010-11-29 02:36:55 +0000 |
377 | +++ plugin/storage_engine_api_tester/tests/r/rnd_pos.result 2011-01-13 06:17:20 +0000 |
378 | @@ -1,4 +1,7 @@ |
379 | set storage_engine=storage_engine_api_tester; |
380 | +select seapitester_clear_engine_state_history(); |
381 | +seapitester_clear_engine_state_history() |
382 | +0 |
383 | CREATE TABLE t1 ( |
384 | aufnr varchar(12) NOT NULL default '', |
385 | plnfl varchar(6) NOT NULL default '', |
386 | @@ -11,6 +14,27 @@ |
387 | "40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr |
388 | ASC LIMIT 1; |
389 | drop table t1; |
390 | +select * from data_dictionary.seapitester_engine_state_history; |
391 | +STATE |
392 | +::max_supported_key_length() |
393 | +::max_supported_keys() |
394 | +::doCreateTable() |
395 | +::SEAPITester() |
396 | +START STATEMENT |
397 | +END STATEMENT |
398 | +COMMIT |
399 | +::SEAPITester() |
400 | +START STATEMENT |
401 | +END STATEMENT |
402 | +COMMIT |
403 | +::SEAPITester() |
404 | +START STATEMENT |
405 | +END STATEMENT |
406 | +COMMIT |
407 | +::SEAPITester() |
408 | +select seapitester_clear_engine_state_history(); |
409 | +seapitester_clear_engine_state_history() |
410 | +0 |
411 | CREATE TABLE t1 ( |
412 | aufnr varchar(12) NOT NULL default '', |
413 | plnfl varchar(6) NOT NULL default '', |
414 | @@ -23,6 +47,50 @@ |
415 | "40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr |
416 | ASC LIMIT 1; |
417 | drop table t1; |
418 | +select * from data_dictionary.seapitester_engine_state_history; |
419 | +STATE |
420 | +::max_supported_key_length() |
421 | +::max_supported_key_parts() |
422 | +::max_supported_keys() |
423 | +::max_supported_key_part_length() |
424 | +::doCreateTable() |
425 | +::SEAPITester() |
426 | +START STATEMENT |
427 | +END STATEMENT |
428 | +COMMIT |
429 | +::SEAPITester() |
430 | +START STATEMENT |
431 | +END STATEMENT |
432 | +COMMIT |
433 | +::SEAPITester() |
434 | +START STATEMENT |
435 | +END STATEMENT |
436 | +COMMIT |
437 | +::SEAPITester() |
438 | +select seapitester_clear_engine_state_history(); |
439 | +seapitester_clear_engine_state_history() |
440 | +0 |
441 | create table t1 (a int, b int, c int); |
442 | alter table t1 add unique(a,b); |
443 | drop table t1; |
444 | +select * from data_dictionary.seapitester_engine_state_history; |
445 | +STATE |
446 | +::max_supported_key_length() |
447 | +::max_supported_keys() |
448 | +::doCreateTable() |
449 | +::SEAPITester() |
450 | +START STATEMENT |
451 | +::max_supported_key_length() |
452 | +::max_supported_key_parts() |
453 | +::max_supported_keys() |
454 | +::max_supported_key_part_length() |
455 | +::max_supported_key_part_length() |
456 | +::doCreateTable() |
457 | +::SEAPITester() |
458 | +START STATEMENT |
459 | +END STATEMENT |
460 | +COMMIT |
461 | +::SEAPITester() |
462 | +select seapitester_clear_engine_state_history(); |
463 | +seapitester_clear_engine_state_history() |
464 | +0 |
465 | |
466 | === modified file 'plugin/storage_engine_api_tester/tests/r/rollback_statement.result' |
467 | --- plugin/storage_engine_api_tester/tests/r/rollback_statement.result 2010-10-25 12:45:29 +0000 |
468 | +++ plugin/storage_engine_api_tester/tests/r/rollback_statement.result 2011-01-13 06:17:20 +0000 |
469 | @@ -1,4 +1,20 @@ |
470 | +select seapitester_clear_engine_state_history(); |
471 | +seapitester_clear_engine_state_history() |
472 | +0 |
473 | create table t1 (a int not null) engine=storage_engine_api_tester; |
474 | insert into t1 values (1), (NULL), (2); |
475 | ERROR 23000: Column 'a' cannot be null |
476 | drop table t1; |
477 | +select * from data_dictionary.seapitester_engine_state_history; |
478 | +STATE |
479 | +::max_supported_key_length() |
480 | +::max_supported_keys() |
481 | +::doCreateTable() |
482 | +::SEAPITester() |
483 | +START STATEMENT |
484 | +END STATEMENT |
485 | +ROLLBACK |
486 | +::SEAPITester() |
487 | +select seapitester_clear_engine_state_history(); |
488 | +seapitester_clear_engine_state_history() |
489 | +0 |
490 | |
491 | === modified file 'plugin/storage_engine_api_tester/tests/r/select.result' |
492 | --- plugin/storage_engine_api_tester/tests/r/select.result 2010-12-12 00:13:57 +0000 |
493 | +++ plugin/storage_engine_api_tester/tests/r/select.result 2011-01-13 06:17:20 +0000 |
494 | @@ -1,6 +1,34 @@ |
495 | +select seapitester_clear_engine_state_history(); |
496 | +seapitester_clear_engine_state_history() |
497 | +0 |
498 | CREATE TABLE t2 (a int) ENGINE=STORAGE_ENGINE_API_TESTER; |
499 | start transaction with consistent snapshot; |
500 | +select * from data_dictionary.seapitester_engine_state_history; |
501 | +STATE |
502 | +::max_supported_key_length() |
503 | +::max_supported_keys() |
504 | +::doCreateTable() |
505 | +::SEAPITester() |
506 | +BEGIN |
507 | +In Transaction |
508 | +END STATEMENT |
509 | +COMMIT STATEMENT |
510 | +In Transaction |
511 | +select seapitester_clear_engine_state_history(); |
512 | +seapitester_clear_engine_state_history() |
513 | +0 |
514 | select * from t2; |
515 | a |
516 | commit; |
517 | drop table t2; |
518 | +select * from data_dictionary.seapitester_engine_state_history; |
519 | +STATE |
520 | +START STATEMENT |
521 | +END STATEMENT |
522 | +COMMIT STATEMENT |
523 | +In Transaction |
524 | +COMMIT |
525 | +::SEAPITester() |
526 | +select seapitester_clear_engine_state_history(); |
527 | +seapitester_clear_engine_state_history() |
528 | +0 |
529 | |
530 | === modified file 'plugin/storage_engine_api_tester/tests/r/transaction.result' |
531 | --- plugin/storage_engine_api_tester/tests/r/transaction.result 2010-11-29 07:03:38 +0000 |
532 | +++ plugin/storage_engine_api_tester/tests/r/transaction.result 2011-01-13 06:17:20 +0000 |
533 | @@ -1,3 +1,6 @@ |
534 | +select seapitester_clear_engine_state_history(); |
535 | +seapitester_clear_engine_state_history() |
536 | +0 |
537 | DROP TABLE IF EXISTS t1_trx, t1_non_trx; |
538 | SET AUTOCOMMIT= 0; |
539 | CREATE TABLE t1_trx ( |
540 | @@ -18,6 +21,32 @@ |
541 | ROLLBACK; |
542 | Warnings: |
543 | Warning 1196 Some non-transactional changed tables couldn't be rolled back |
544 | +select * from data_dictionary.seapitester_engine_state_history; |
545 | +STATE |
546 | +::max_supported_key_length() |
547 | +::max_supported_key_parts() |
548 | +::max_supported_keys() |
549 | +::max_supported_key_part_length() |
550 | +::doCreateTable() |
551 | +::SEAPITester() |
552 | +BEGIN |
553 | +In Transaction |
554 | +END STATEMENT |
555 | +COMMIT STATEMENT |
556 | +In Transaction |
557 | +START STATEMENT |
558 | +END STATEMENT |
559 | +COMMIT STATEMENT |
560 | +In Transaction |
561 | +START STATEMENT |
562 | +END STATEMENT |
563 | +COMMIT STATEMENT |
564 | +In Transaction |
565 | +ROLLBACK |
566 | +::SEAPITester() |
567 | +select seapitester_clear_engine_state_history(); |
568 | +seapitester_clear_engine_state_history() |
569 | +0 |
570 | Expected warning about non-trx data changes not being rolled back |
571 | SELECT * FROM t1_trx; |
572 | k v |
573 | @@ -25,6 +54,15 @@ |
574 | k v |
575 | key1 value1 |
576 | key2 value2 |
577 | +select * from data_dictionary.seapitester_engine_state_history; |
578 | +STATE |
579 | +START STATEMENT |
580 | +END STATEMENT |
581 | +COMMIT STATEMENT |
582 | +In Transaction |
583 | +select seapitester_clear_engine_state_history(); |
584 | +seapitester_clear_engine_state_history() |
585 | +0 |
586 | START TRANSACTION; |
587 | INSERT INTO t1_trx VALUES ('key1','value1'); |
588 | INSERT INTO t1_trx VALUES ('key2','value2'); |
589 | @@ -35,9 +73,46 @@ |
590 | key1 value1 |
591 | key2 value2 |
592 | ROLLBACK; |
593 | +select * from data_dictionary.seapitester_engine_state_history; |
594 | +STATE |
595 | +COMMIT |
596 | +::SEAPITester() |
597 | +BEGIN |
598 | +In Transaction |
599 | +END STATEMENT |
600 | +COMMIT STATEMENT |
601 | +In Transaction |
602 | +START STATEMENT |
603 | +END STATEMENT |
604 | +COMMIT STATEMENT |
605 | +In Transaction |
606 | +START STATEMENT |
607 | +END STATEMENT |
608 | +COMMIT STATEMENT |
609 | +In Transaction |
610 | +START STATEMENT |
611 | +END STATEMENT |
612 | +COMMIT STATEMENT |
613 | +In Transaction |
614 | +ROLLBACK |
615 | +::SEAPITester() |
616 | +select seapitester_clear_engine_state_history(); |
617 | +seapitester_clear_engine_state_history() |
618 | +0 |
619 | SELECT t1_trx.k, t1_trx.v |
620 | FROM t1_trx |
621 | INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k; |
622 | k v |
623 | DROP TABLE t1_trx; |
624 | DROP TABLE t1_non_trx; |
625 | +select * from data_dictionary.seapitester_engine_state_history; |
626 | +STATE |
627 | +START STATEMENT |
628 | +END STATEMENT |
629 | +COMMIT STATEMENT |
630 | +In Transaction |
631 | +COMMIT |
632 | +::SEAPITester() |
633 | +select seapitester_clear_engine_state_history(); |
634 | +seapitester_clear_engine_state_history() |
635 | +0 |
636 | |
637 | === modified file 'plugin/storage_engine_api_tester/tests/r/txn_log_insert.result' |
638 | --- plugin/storage_engine_api_tester/tests/r/txn_log_insert.result 2010-12-30 18:07:58 +0000 |
639 | +++ plugin/storage_engine_api_tester/tests/r/txn_log_insert.result 2011-01-13 06:17:20 +0000 |
640 | @@ -1,3 +1,6 @@ |
641 | +select seapitester_clear_engine_state_history(); |
642 | +seapitester_clear_engine_state_history() |
643 | +0 |
644 | DROP TABLE IF EXISTS t1; |
645 | CREATE TABLE t1 ( |
646 | pk int auto_increment primary key, |
647 | @@ -27,6 +30,52 @@ |
648 | select seapitester_error_inject(0); |
649 | seapitester_error_inject(0) |
650 | 0 |
651 | +select * from data_dictionary.seapitester_engine_state_history; |
652 | +STATE |
653 | +::max_supported_key_length() |
654 | +::max_supported_key_parts() |
655 | +::max_supported_keys() |
656 | +::max_supported_key_part_length() |
657 | +::doCreateTable() |
658 | +::SEAPITester() |
659 | +START STATEMENT |
660 | +END STATEMENT |
661 | +ROLLBACK |
662 | +::SEAPITester() |
663 | +BEGIN |
664 | +In Transaction |
665 | +END STATEMENT |
666 | +COMMIT STATEMENT |
667 | +In Transaction |
668 | +START STATEMENT |
669 | +END STATEMENT |
670 | +COMMIT STATEMENT |
671 | +In Transaction |
672 | +START STATEMENT |
673 | +END STATEMENT |
674 | +ROLLBACK STATEMENT |
675 | +In Transaction |
676 | +START STATEMENT |
677 | +END STATEMENT |
678 | +COMMIT STATEMENT |
679 | +In Transaction |
680 | +COMMIT |
681 | +::SEAPITester() |
682 | +START STATEMENT |
683 | +END STATEMENT |
684 | +COMMIT |
685 | +::SEAPITester() |
686 | +START STATEMENT |
687 | +END STATEMENT |
688 | +ROLLBACK |
689 | +::SEAPITester() |
690 | +START STATEMENT |
691 | +END STATEMENT |
692 | +COMMIT |
693 | +::SEAPITester() |
694 | +select seapitester_clear_engine_state_history(); |
695 | +seapitester_clear_engine_state_history() |
696 | +0 |
697 | START TRANSACTION; |
698 | CREATE TABLE `test`.`t1` ( `pk` INT NOT NULL AUTO_INCREMENT, `id` INT NOT NULL, `padding` VARCHAR(200) COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (`pk`) ) ENGINE=STORAGE_ENGINE_API_TESTER COLLATE = utf8_general_ci; |
699 | COMMIT; |
700 | @@ -41,3 +90,5 @@ |
701 | DROP TABLE `test`.`t1`; |
702 | COMMIT; |
703 | SET GLOBAL transaction_log_truncate_debug= true; |
704 | +select * from data_dictionary.seapitester_engine_state_history; |
705 | +STATE |
706 | |
707 | === modified file 'plugin/storage_engine_api_tester/tests/r/txn_log_rollback_large_stmt.result' |
708 | --- plugin/storage_engine_api_tester/tests/r/txn_log_rollback_large_stmt.result 2010-12-23 19:23:22 +0000 |
709 | +++ plugin/storage_engine_api_tester/tests/r/txn_log_rollback_large_stmt.result 2011-01-13 06:17:20 +0000 |
710 | @@ -1,3 +1,6 @@ |
711 | +select seapitester_clear_engine_state_history(); |
712 | +seapitester_clear_engine_state_history() |
713 | +0 |
714 | DROP TABLE IF EXISTS t1; |
715 | CREATE TABLE source ( |
716 | pk int auto_increment primary key, |
717 | @@ -22,6 +25,47 @@ |
718 | select seapitester_error_inject(0); |
719 | seapitester_error_inject(0) |
720 | 0 |
721 | +select * from data_dictionary.seapitester_engine_state_history; |
722 | +STATE |
723 | +::max_supported_key_length() |
724 | +::max_supported_key_parts() |
725 | +::max_supported_keys() |
726 | +::max_supported_key_part_length() |
727 | +::doCreateTable() |
728 | +::SEAPITester() |
729 | +::max_supported_key_length() |
730 | +::max_supported_key_parts() |
731 | +::max_supported_keys() |
732 | +::max_supported_key_part_length() |
733 | +::doCreateTable() |
734 | +::SEAPITester() |
735 | +START STATEMENT |
736 | +END STATEMENT |
737 | +COMMIT |
738 | +::SEAPITester() |
739 | +START STATEMENT |
740 | +END STATEMENT |
741 | +COMMIT |
742 | +::SEAPITester() |
743 | +START STATEMENT |
744 | +END STATEMENT |
745 | +COMMIT |
746 | +::SEAPITester() |
747 | +START STATEMENT |
748 | +END STATEMENT |
749 | +COMMIT |
750 | +::SEAPITester() |
751 | +START STATEMENT |
752 | +END STATEMENT |
753 | +COMMIT |
754 | +::SEAPITester() |
755 | +START STATEMENT |
756 | +END STATEMENT |
757 | +ROLLBACK |
758 | +::SEAPITester() |
759 | +select seapitester_clear_engine_state_history(); |
760 | +seapitester_clear_engine_state_history() |
761 | +0 |
762 | START TRANSACTION; |
763 | CREATE TABLE `test`.`source` ( `pk` INT NOT NULL AUTO_INCREMENT, `d` VARCHAR(16000) COLLATE utf8_general_ci DEFAULT NULL, PRIMARY KEY (`pk`) ) ENGINE=STORAGE_ENGINE_API_TESTER COLLATE = utf8_general_ci; |
764 | COMMIT; |
765 | |
766 | === modified file 'plugin/storage_engine_api_tester/tests/t/create_table.test' |
767 | --- plugin/storage_engine_api_tester/tests/t/create_table.test 2010-10-25 12:46:17 +0000 |
768 | +++ plugin/storage_engine_api_tester/tests/t/create_table.test 2011-01-13 06:17:20 +0000 |
769 | @@ -1,2 +1,5 @@ |
770 | +select seapitester_clear_engine_state_history(); |
771 | CREATE TABLE t1 (a int) ENGINE=STORAGE_ENGINE_API_TESTER; |
772 | +select * from data_dictionary.seapitester_engine_state_history; |
773 | +select seapitester_clear_engine_state_history(); |
774 | drop table t1; |
775 | |
776 | === modified file 'plugin/storage_engine_api_tester/tests/t/multi_stmt_txn.test' |
777 | --- plugin/storage_engine_api_tester/tests/t/multi_stmt_txn.test 2010-11-23 13:19:53 +0000 |
778 | +++ plugin/storage_engine_api_tester/tests/t/multi_stmt_txn.test 2011-01-13 06:17:20 +0000 |
779 | @@ -1,18 +1,24 @@ |
780 | -create table t1 (a int) engine=storage_engine_api_tester; |
781 | -begin; |
782 | -select * from t1; |
783 | -select * from t1; |
784 | -commit; |
785 | -drop table t1; |
786 | - |
787 | -create table t1 (a int) engine=storage_engine_api_tester; |
788 | -begin; |
789 | -select * from t1; |
790 | -insert into t1 values (1); |
791 | -insert into t1 values (1); |
792 | -insert into t1 values (1); |
793 | -select * from t1; |
794 | -insert into t1 values (1); |
795 | -select * from t1; |
796 | -commit; |
797 | -drop table t1; |
798 | +select seapitester_clear_engine_state_history(); |
799 | +create table t1 (a int) engine=storage_engine_api_tester; |
800 | +begin; |
801 | +select * from t1; |
802 | +select * from t1; |
803 | +commit; |
804 | +select * from data_dictionary.seapitester_engine_state_history; |
805 | +select seapitester_clear_engine_state_history(); |
806 | +drop table t1; |
807 | + |
808 | +create table t1 (a int) engine=storage_engine_api_tester; |
809 | +begin; |
810 | +select * from t1; |
811 | +insert into t1 values (1); |
812 | +insert into t1 values (1); |
813 | +insert into t1 values (1); |
814 | +select * from t1; |
815 | +insert into t1 values (1); |
816 | +select * from t1; |
817 | +commit; |
818 | +drop table t1; |
819 | +select * from data_dictionary.seapitester_engine_state_history; |
820 | +select seapitester_clear_engine_state_history(); |
821 | + |
822 | |
823 | === modified file 'plugin/storage_engine_api_tester/tests/t/rnd_pos.test' |
824 | --- plugin/storage_engine_api_tester/tests/t/rnd_pos.test 2010-11-29 02:36:55 +0000 |
825 | +++ plugin/storage_engine_api_tester/tests/t/rnd_pos.test 2011-01-13 06:17:20 +0000 |
826 | @@ -4,6 +4,8 @@ |
827 | # |
828 | set storage_engine=storage_engine_api_tester; |
829 | |
830 | +select seapitester_clear_engine_state_history(); |
831 | + |
832 | # This failed because of syntax. Changed int(5) to int. |
833 | CREATE TABLE t1 ( |
834 | aufnr varchar(12) NOT NULL default '', |
835 | @@ -21,6 +23,9 @@ |
836 | |
837 | drop table t1; |
838 | |
839 | +select * from data_dictionary.seapitester_engine_state_history; |
840 | +select seapitester_clear_engine_state_history(); |
841 | + |
842 | # and again with a primary key |
843 | |
844 | CREATE TABLE t1 ( |
845 | @@ -39,6 +44,9 @@ |
846 | |
847 | drop table t1; |
848 | |
849 | +select * from data_dictionary.seapitester_engine_state_history; |
850 | +select seapitester_clear_engine_state_history(); |
851 | + |
852 | # and again with a unique key that becomes the clustered key |
853 | |
854 | create table t1 (a int, b int, c int); |
855 | @@ -46,3 +54,7 @@ |
856 | alter table t1 add unique(a,b); |
857 | |
858 | drop table t1; |
859 | + |
860 | +select * from data_dictionary.seapitester_engine_state_history; |
861 | +select seapitester_clear_engine_state_history(); |
862 | + |
863 | |
864 | === modified file 'plugin/storage_engine_api_tester/tests/t/rollback_statement.test' |
865 | --- plugin/storage_engine_api_tester/tests/t/rollback_statement.test 2010-10-25 12:45:29 +0000 |
866 | +++ plugin/storage_engine_api_tester/tests/t/rollback_statement.test 2011-01-13 06:17:20 +0000 |
867 | @@ -1,4 +1,7 @@ |
868 | +select seapitester_clear_engine_state_history(); |
869 | create table t1 (a int not null) engine=storage_engine_api_tester; |
870 | --error 1048 |
871 | insert into t1 values (1), (NULL), (2); |
872 | drop table t1; |
873 | +select * from data_dictionary.seapitester_engine_state_history; |
874 | +select seapitester_clear_engine_state_history(); |
875 | |
876 | === modified file 'plugin/storage_engine_api_tester/tests/t/select.test' |
877 | --- plugin/storage_engine_api_tester/tests/t/select.test 2010-12-12 00:13:57 +0000 |
878 | +++ plugin/storage_engine_api_tester/tests/t/select.test 2011-01-13 06:17:20 +0000 |
879 | @@ -1,6 +1,12 @@ |
880 | +select seapitester_clear_engine_state_history(); |
881 | CREATE TABLE t2 (a int) ENGINE=STORAGE_ENGINE_API_TESTER; |
882 | start transaction with consistent snapshot; |
883 | +select * from data_dictionary.seapitester_engine_state_history; |
884 | +select seapitester_clear_engine_state_history(); |
885 | #--error 1146 |
886 | select * from t2; |
887 | commit; |
888 | drop table t2; |
889 | +select * from data_dictionary.seapitester_engine_state_history; |
890 | +select seapitester_clear_engine_state_history(); |
891 | + |
892 | |
893 | === modified file 'plugin/storage_engine_api_tester/tests/t/transaction.test' |
894 | --- plugin/storage_engine_api_tester/tests/t/transaction.test 2010-11-29 07:03:38 +0000 |
895 | +++ plugin/storage_engine_api_tester/tests/t/transaction.test 2011-01-13 06:17:20 +0000 |
896 | @@ -4,6 +4,9 @@ |
897 | # 2. Correct commit and rollback behaviour |
898 | # 3. XA protocol communication and recovery |
899 | |
900 | +select seapitester_clear_engine_state_history(); |
901 | + |
902 | + |
903 | --disable_warnings |
904 | DROP TABLE IF EXISTS t1_trx, t1_non_trx; |
905 | --enable_warnings |
906 | @@ -32,11 +35,17 @@ |
907 | |
908 | ROLLBACK; |
909 | |
910 | +select * from data_dictionary.seapitester_engine_state_history; |
911 | +select seapitester_clear_engine_state_history(); |
912 | + |
913 | --echo Expected warning about non-trx data changes not being rolled back |
914 | |
915 | SELECT * FROM t1_trx; |
916 | SELECT * FROM t1_non_trx; |
917 | |
918 | +select * from data_dictionary.seapitester_engine_state_history; |
919 | +select seapitester_clear_engine_state_history(); |
920 | + |
921 | START TRANSACTION; |
922 | |
923 | INSERT INTO t1_trx VALUES ('key1','value1'); |
924 | @@ -47,6 +56,8 @@ |
925 | INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k; |
926 | |
927 | ROLLBACK; |
928 | +select * from data_dictionary.seapitester_engine_state_history; |
929 | +select seapitester_clear_engine_state_history(); |
930 | |
931 | SELECT t1_trx.k, t1_trx.v |
932 | FROM t1_trx |
933 | @@ -54,3 +65,7 @@ |
934 | |
935 | DROP TABLE t1_trx; |
936 | DROP TABLE t1_non_trx; |
937 | + |
938 | +select * from data_dictionary.seapitester_engine_state_history; |
939 | +select seapitester_clear_engine_state_history(); |
940 | + |
941 | |
942 | === modified file 'plugin/storage_engine_api_tester/tests/t/txn_log_insert.test' |
943 | --- plugin/storage_engine_api_tester/tests/t/txn_log_insert.test 2010-12-30 18:07:58 +0000 |
944 | +++ plugin/storage_engine_api_tester/tests/t/txn_log_insert.test 2011-01-13 06:17:20 +0000 |
945 | @@ -19,6 +19,8 @@ |
946 | # We then use the transaction_reader in plugin/transaction_log/utilities to read the events. |
947 | # |
948 | |
949 | +select seapitester_clear_engine_state_history(); |
950 | + |
951 | --disable_warnings |
952 | DROP TABLE IF EXISTS t1; |
953 | --enable_warnings |
954 | @@ -48,8 +50,14 @@ |
955 | select seapitester_error_inject(0); |
956 | # Read in the transaction.log. |
957 | |
958 | +select * from data_dictionary.seapitester_engine_state_history; |
959 | +select seapitester_clear_engine_state_history(); |
960 | + |
961 | + |
962 | --exec ../plugin/transaction_log/utilities/transaction_reader var/master-data/local/transaction.log |
963 | |
964 | # Truncate the log file to reset for the next test |
965 | --source ../plugin/transaction_log/tests/t/truncate_log.inc |
966 | |
967 | +select * from data_dictionary.seapitester_engine_state_history; |
968 | + |
969 | |
970 | === modified file 'plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt.test' |
971 | --- plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt.test 2010-12-01 11:16:06 +0000 |
972 | +++ plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt.test 2011-01-13 06:17:20 +0000 |
973 | @@ -19,6 +19,8 @@ |
974 | # We then use the transaction_reader in plugin/transaction_log/utilities to read the events. |
975 | # |
976 | |
977 | +select seapitester_clear_engine_state_history(); |
978 | + |
979 | --disable_warnings |
980 | DROP TABLE IF EXISTS t1; |
981 | --enable_warnings |
982 | @@ -46,6 +48,9 @@ |
983 | select seapitester_error_inject(0); |
984 | # Read in the transaction.log. |
985 | |
986 | +select * from data_dictionary.seapitester_engine_state_history; |
987 | +select seapitester_clear_engine_state_history(); |
988 | + |
989 | --exec ../plugin/transaction_log/utilities/transaction_reader var/master-data/local/transaction.log |
990 | |
991 | # Truncate the log file to reset for the next test |
http:// hudson. drizzle. org/view/ Drizzle- param/job/ drizzle- param/706/ (with cpplint fixes)