~vkolesnikov/pbxt/pbxt-preload-test-bug

« back to all changes in this revision

Viewing changes to src/pbms_enabled.h

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-07-21 21:57:48 UTC
  • mto: This revision was merged to the branch mainline in revision 863.
  • Revision ID: barry.leslie@primebase.com-20100721215748-7wct673d1qrg4tkg
Updated pbms enabled glue code. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *
23
23
 * H&G2JCtL
24
24
 *
25
 
 * PBMS interface used to enable engines for use with the PBMS engine.
 
25
 * PBMS interface used to enable engines for use with the PBMS daemon.
26
26
 *
27
27
 * For an example on how to build this into an engine have a look at the PBXT engine
28
28
 * in file ha_pbxt.cc. Search for 'PBMS_ENABLED'.
35
35
 
36
36
#include "pbms.h"
37
37
 
 
38
#ifdef DRIZZLED
 
39
#include <drizzled/common.h>
 
40
#define TABLE Table
 
41
#define uchar unsigned char
 
42
#else
 
43
#include <mysql_priv.h>
 
44
#endif
 
45
 
 
46
class Field;
 
47
typedef bool (*IsPBMSFilterFunc)(Field *field);
 
48
 
38
49
/*
39
50
 * pbms_initialize() should be called from the engines plugIn's 'init()' function.
40
51
 * The engine_name is the name of your engine, "PBXT" or "InnoDB" for example.
43
54
 * true if this is being built into the server's handler code above the engine level
44
55
 * calls. 
45
56
 */
46
 
extern bool pbms_initialize(const char *engine_name, bool isServer, PBMSResultPtr result);
 
57
extern bool pbms_initialize(const char *engine_name, bool isServer, bool isTransactional, PBMSResultPtr result, IsPBMSFilterFunc is_pbms_blob);
47
58
 
48
59
/*
49
60
 * pbms_finalize() should be called from the engines plugIn's 'deinit()' function.
50
61
 */
51
 
extern void pbms_finalize();
 
62
extern void pbms_finalize(const char *engine_name);
52
63
 
53
64
/*
54
65
 * pbms_write_row_blobs() should be called from the engine's 'write_row' function.
55
66
 * It can alter the row data so it must be called before any other function using the row data.
56
 
 * It should also be called from engine's 'update_row' function for the new row.
57
 
 *
58
 
 * pbms_completed() must be called after calling pbms_write_row_blobs() and just before
59
 
 * returning from write_row() to indicate if the operation completed successfully.
60
 
 */
61
 
extern int pbms_write_row_blobs(TABLE *table, uchar *buf, PBMSResultPtr result);
 
67
 *
 
68
 * pbms_completed() must be called after calling pbms_write_row_blobs() and just before
 
69
 * returning from write_row() to indicate if the operation completed successfully.
 
70
 */
 
71
extern int pbms_write_row_blobs(const TABLE *table, unsigned char *buf, PBMSResultPtr result);
 
72
 
 
73
/*
 
74
 * pbms_update_row_blobs() should be called from the engine's 'update_row' function.
 
75
 * It can alter the row data so it must be called before any other function using the row data.
 
76
 *
 
77
 * pbms_completed() must be called after calling pbms_write_row_blobs() and just before
 
78
 * returning from write_row() to indicate if the operation completed successfully.
 
79
 */
 
80
extern int pbms_update_row_blobs(const TABLE *table, const unsigned char *old_row, unsigned char *new_row, PBMSResultPtr result);
62
81
 
63
82
/*
64
83
 * pbms_delete_row_blobs() should be called from the engine's 'delete_row' function.
65
 
 * It should also be called from engine's 'update_row' function for the old row.
66
84
 *
67
85
 * pbms_completed() must be called after calling pbms_delete_row_blobs() and just before
68
86
 * returning from delete_row() to indicate if the operation completed successfully.
69
87
 */
70
 
extern int pbms_delete_row_blobs(TABLE *table, const uchar *buf, PBMSResultPtr result);
 
88
extern int pbms_delete_row_blobs(const TABLE *table, const unsigned char *buf, PBMSResultPtr result);
71
89
 
72
90
/*
73
91
 * pbms_rename_table_with_blobs() should be called from the engine's 'rename_table' function.
98
116
 * pbms_completed() has the effect of committing or rolling back the changes made if the session
99
117
 * is in 'autocommit' mode.
100
118
 */
101
 
extern void pbms_completed(TABLE *table, bool ok);
 
119
extern void pbms_completed(const TABLE *table, bool ok);
102
120
 
103
121
#endif