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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
* PBMS interface used to enable engines for use with the PBMS daemon.
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
#include <drizzled/common.h>
41
#define uchar unsigned char
43
#include <mysql_priv.h>
47
typedef bool (*IsPBMSFilterFunc)(Field *field);
50
* pbms_initialize() should be called from the engines plugIn's 'init()' function.
51
* The engine_name is the name of your engine, "PBXT" or "InnoDB" for example.
53
* The isServer flag indicates if this entire server is being enabled. This is only
54
* true if this is being built into the server's handler code above the engine level
57
extern bool pbms_initialize(const char *engine_name, bool isServer, bool isTransactional, PBMSResultPtr result, IsPBMSFilterFunc is_pbms_blob);
60
* pbms_finalize() should be called from the engines plugIn's 'deinit()' function.
62
extern void pbms_finalize(const char *engine_name);
65
* pbms_write_row_blobs() should be called from the engine's 'write_row' function.
66
* It can alter the row data so it must be called before any other function using the row data.
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.
71
extern int pbms_write_row_blobs(const TABLE *table, unsigned char *buf, PBMSResultPtr result);
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.
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.
80
extern int pbms_update_row_blobs(const TABLE *table, const unsigned char *old_row, unsigned char *new_row, PBMSResultPtr result);
83
* pbms_delete_row_blobs() should be called from the engine's 'delete_row' function.
85
* pbms_completed() must be called after calling pbms_delete_row_blobs() and just before
86
* returning from delete_row() to indicate if the operation completed successfully.
88
extern int pbms_delete_row_blobs(const TABLE *table, const unsigned char *buf, PBMSResultPtr result);
91
* pbms_rename_table_with_blobs() should be called from the engine's 'rename_table' function.
93
* NOTE: Renaming tables across databases is not supported.
95
* pbms_completed() must be called after calling pbms_rename_table_with_blobs() and just before
96
* returning from rename_table() to indicate if the operation completed successfully.
98
extern int pbms_rename_table_with_blobs(const char *old_table_path, const char *new_table_path, PBMSResultPtr result);
101
* pbms_delete_table_with_blobs() should be called from the engine's 'delete_table' function.
103
* NOTE: Currently pbms_delete_table_with_blobs() cannot be undone so it should only
104
* be called after the host engine has performed successfully drop it's table.
106
* pbms_completed() must be called after calling pbms_delete_table_with_blobs() and just before
107
* returning from delete_table() to indicate if the operation completed successfully.
109
extern int pbms_delete_table_with_blobs(const char *table_path, PBMSResultPtr result);
112
* pbms_completed() must be called to indicate success or failure of a an operation after having
113
* called pbms_write_row_blobs(), pbms_delete_row_blobs(), pbms_rename_table_with_blobs(), or
114
* pbms_delete_table_with_blobs().
116
* pbms_completed() has the effect of committing or rolling back the changes made if the session
117
* is in 'autocommit' mode.
119
extern void pbms_completed(const TABLE *table, bool ok);