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/server_includes.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.
67
* It should also be called from engine's 'update_row' function for the new row.
69
* pbms_completed() must be called after calling pbms_write_row_blobs() and just before
70
* returning from write_row() to indicate if the operation completed successfully.
72
extern int pbms_write_row_blobs(TABLE *table, unsigned char *buf, PBMSResultPtr result);
75
* pbms_delete_row_blobs() should be called from the engine's 'delete_row' function.
76
* It should also be called from engine's 'update_row' function for the old row.
78
* pbms_completed() must be called after calling pbms_delete_row_blobs() and just before
79
* returning from delete_row() to indicate if the operation completed successfully.
81
extern int pbms_delete_row_blobs(TABLE *table, const unsigned char *buf, PBMSResultPtr result);
84
* pbms_rename_table_with_blobs() should be called from the engine's 'rename_table' function.
86
* NOTE: Renaming tables across databases is not supported.
88
* pbms_completed() must be called after calling pbms_rename_table_with_blobs() and just before
89
* returning from rename_table() to indicate if the operation completed successfully.
91
extern int pbms_rename_table_with_blobs(const char *old_table_path, const char *new_table_path, PBMSResultPtr result);
94
* pbms_delete_table_with_blobs() should be called from the engine's 'delete_table' function.
96
* NOTE: Currently pbms_delete_table_with_blobs() cannot be undone so it should only
97
* be called after the host engine has performed successfully drop it's table.
99
* pbms_completed() must be called after calling pbms_delete_table_with_blobs() and just before
100
* returning from delete_table() to indicate if the operation completed successfully.
102
extern int pbms_delete_table_with_blobs(const char *table_path, PBMSResultPtr result);
105
* pbms_completed() must be called to indicate success or failure of a an operation after having
106
* called pbms_write_row_blobs(), pbms_delete_row_blobs(), pbms_rename_table_with_blobs(), or
107
* pbms_delete_table_with_blobs().
109
* pbms_completed() has the effect of committing or rolling back the changes made if the session
110
* is in 'autocommit' mode.
112
extern void pbms_completed(TABLE *table, bool ok);