1
/* Copyright (C) 2009 PrimeBase Technologies GmbH, Germany
3
* PrimeBase Media Stream for MySQL
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.
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.
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
25
* PBMS interface used to enable engines for use with the PBMS engine.
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'.
33
#ifndef __PBMS_ENABLED_H__
34
#define __PBMS_ENABLED_H__
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.
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
46
extern bool pbms_initialize(const char *engine_name, bool isServer, PBMSResultPtr result);
49
* pbms_finalize() should be called from the engines plugIn's 'deinit()' function.
51
extern void pbms_finalize();
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.
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.
61
extern int pbms_write_row_blobs(TABLE *table, uchar *buf, PBMSResultPtr result);
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.
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.
70
extern int pbms_delete_row_blobs(TABLE *table, const uchar *buf, PBMSResultPtr result);
73
* pbms_rename_table_with_blobs() should be called from the engine's 'rename_table' function.
75
* NOTE: Renaming tables across databases is not supported.
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.
80
extern int pbms_rename_table_with_blobs(const char *old_table_path, const char *new_table_path, PBMSResultPtr result);
83
* pbms_delete_table_with_blobs() should be called from the engine's 'delete_table' function.
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.
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.
91
extern int pbms_delete_table_with_blobs(const char *table_path, PBMSResultPtr result);
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().
98
* pbms_completed() has the effect of committing or rolling back the changes made if the session
99
* is in 'autocommit' mode.
101
extern void pbms_completed(TABLE *table, bool ok);