~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/pbms_enabled.h

Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2009 PrimeBase Technologies GmbH, Germany
2
 
 *
3
 
 * PrimeBase Media Stream for MySQL
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
 
 *
19
 
 * Barry Leslie
20
 
 *
21
 
 * 2009-07-16
22
 
 *
23
 
 * H&G2JCtL
24
 
 *
25
 
 * PBMS interface used to enable engines for use with the PBMS engine.
26
 
 *
27
 
 * For an example on how to build this into an engine have a look at the PBXT engine
28
 
 * in file ha_pbxt.cc. Search for 'PBMS_ENABLED'.
29
 
 *
30
 
 */
31
 
 
32
 
 
33
 
#ifndef __PBMS_ENABLED_H__
34
 
#define __PBMS_ENABLED_H__
35
 
 
36
 
#include "pbms.h"
37
 
 
38
 
/*
39
 
 * pbms_initialize() should be called from the engines plugIn's 'init()' function.
40
 
 * The engine_name is the name of your engine, "PBXT" or "InnoDB" for example.
41
 
 *
42
 
 * The isServer flag indicates if this entire server is being enabled. This is only
43
 
 * true if this is being built into the server's handler code above the engine level
44
 
 * calls. 
45
 
 */
46
 
extern bool pbms_initialize(const char *engine_name, bool isServer, PBMSResultPtr result);
47
 
 
48
 
/*
49
 
 * pbms_finalize() should be called from the engines plugIn's 'deinit()' function.
50
 
 */
51
 
extern void pbms_finalize();
52
 
 
53
 
/*
54
 
 * pbms_write_row_blobs() should be called from the engine's 'write_row' function.
55
 
 * 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);
62
 
 
63
 
/*
64
 
 * 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
 
 *
67
 
 * pbms_completed() must be called after calling pbms_delete_row_blobs() and just before
68
 
 * returning from delete_row() to indicate if the operation completed successfully.
69
 
 */
70
 
extern int pbms_delete_row_blobs(TABLE *table, const uchar *buf, PBMSResultPtr result);
71
 
 
72
 
/*
73
 
 * pbms_rename_table_with_blobs() should be called from the engine's 'rename_table' function.
74
 
 *
75
 
 * NOTE: Renaming tables across databases is not supported.
76
 
 *
77
 
 * pbms_completed() must be called after calling pbms_rename_table_with_blobs() and just before
78
 
 * returning from rename_table() to indicate if the operation completed successfully.
79
 
 */
80
 
extern int pbms_rename_table_with_blobs(const char *old_table_path, const char *new_table_path, PBMSResultPtr result);
81
 
 
82
 
/*
83
 
 * pbms_delete_table_with_blobs() should be called from the engine's 'delete_table' function.
84
 
 *
85
 
 * NOTE: Currently pbms_delete_table_with_blobs() cannot be undone so it should only
86
 
 * be called after the host engine has performed successfully drop it's table.
87
 
 *
88
 
 * pbms_completed() must be called after calling pbms_delete_table_with_blobs() and just before
89
 
 * returning from delete_table() to indicate if the operation completed successfully.
90
 
 */
91
 
extern int pbms_delete_table_with_blobs(const char *table_path, PBMSResultPtr result);
92
 
 
93
 
/*
94
 
 * pbms_completed() must be called to indicate success or failure of a an operation after having
95
 
 * called  pbms_write_row_blobs(), pbms_delete_row_blobs(), pbms_rename_table_with_blobs(), or
96
 
 * pbms_delete_table_with_blobs().
97
 
 *
98
 
 * pbms_completed() has the effect of committing or rolling back the changes made if the session
99
 
 * is in 'autocommit' mode.
100
 
 */
101
 
extern void pbms_completed(TABLE *table, bool ok);
102
 
 
103
 
#endif