~pbms-core/pbms/5.11-beta

« back to all changes in this revision

Viewing changes to mybs/src/Engine_ms.cc

  • Committer: barry_leslie
  • Date: 2008-09-12 14:22:01 UTC
  • Revision ID: barry_leslie-71db134102f081d5227c64cc38ca9d28e72a6c9f
Internal name changes from MyBS to PBMS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2007 SNAP Innovation GmbH
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
2
 *
3
 
 * BLOB Streaming for MySQL
 
3
 * PrimeBase Media Stream for MySQL
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License as published by
31
31
#include "CSStrUtil.h"
32
32
#include "CSThread.h"
33
33
 
34
 
#include "BSEngine.h"
35
 
#include "BSConnectionHandler.h"
36
 
#include "BSOpenTable.h"
37
 
#include "BSUtil.h"
38
 
#include "BSNetwork.h"
 
34
#include "Engine_ms.h"
 
35
#include "ConnectionHandler_ms.h"
 
36
#include "OpenTable_ms.h"
 
37
#include "Util_ms.h"
 
38
#include "Network_ms.h"
39
39
 
40
 
MyBSEngineRec mybs_engine = {
41
 
        BS_ENGINE_VERSION,
42
 
        0,
43
 
        0,
44
 
        "MyBS",
 
40
PBMSEngineRec pbms_engine = {
 
41
        MS_ENGINE_VERSION,
 
42
        0,
 
43
        0,
 
44
        "PBMS",
45
45
        NULL
46
46
};
47
47
 
50
50
 * ENGINE CALL-IN INTERFACE
51
51
 */
52
52
 
53
 
MYBS_API *StreamingEngines;
 
53
PBMS_API *StreamingEngines;
54
54
 
55
55
#ifdef new
56
56
#undef new
57
57
#endif
58
58
 
59
 
void BSEngine::startUp()
 
59
void MSEngine::startUp()
60
60
{
61
 
        StreamingEngines = new MYBS_API();
 
61
        StreamingEngines = new PBMS_API();
62
62
}
63
63
 
64
 
void BSEngine::shutDown()
 
64
void MSEngine::shutDown()
65
65
{
66
66
        delete StreamingEngines;
67
67
}
68
68
 
69
 
int BSEngine::getEngineCount()
 
69
int MSEngine::getEngineCount()
70
70
{
71
 
        MyBSSharedMemoryPtr sh_mem = StreamingEngines->sharedMemory;
 
71
        PBMSSharedMemoryPtr sh_mem = StreamingEngines->sharedMemory;
72
72
 
73
73
        if (sh_mem)
74
74
                return sh_mem->sm_list_len;
75
75
        return 0;
76
76
}
77
77
 
78
 
MyBSEnginePtr BSEngine::getEngine(int i)
 
78
PBMSEnginePtr MSEngine::getEngine(int i)
79
79
{
80
 
        MyBSSharedMemoryPtr     sh_mem = StreamingEngines->sharedMemory;
81
 
        MyBSEnginePtr           engine;
 
80
        PBMSSharedMemoryPtr     sh_mem = StreamingEngines->sharedMemory;
 
81
        PBMSEnginePtr           engine;
82
82
 
83
83
        if (sh_mem && i>=0 && i<sh_mem->sm_list_len) {
84
84
                if ((engine = sh_mem->sm_engine_list[i]))
87
87
        return NULL;
88
88
}
89
89
 
90
 
void BSEngine::closeConnection(void *thd)
 
90
void MSEngine::closeConnection(void *thd)
91
91
{
92
 
        MyBSSharedMemoryPtr     sh_mem = StreamingEngines->sharedMemory;
93
 
        MyBSEnginePtr           engine;
 
92
        PBMSSharedMemoryPtr     sh_mem = StreamingEngines->sharedMemory;
 
93
        PBMSEnginePtr           engine;
94
94
 
95
95
        if (thd && sh_mem) {
96
96
                for (int i=0; i<sh_mem->sm_list_len; i++) {
97
97
                        if ((engine = sh_mem->sm_engine_list[i])) {
98
 
                                if (engine->bs_close_conn)
99
 
                                        engine->bs_close_conn(thd);
 
98
                                if (engine->ms_close_conn)
 
99
                                        engine->ms_close_conn(thd);
100
100
                        }
101
101
                }
102
102
        }
103
103
}
104
104
 
105
 
void BSEngine::closeConnections(MyBSEnginePtr engine)
 
105
void MSEngine::closeConnections(PBMSEnginePtr engine)
106
106
{
107
107
        CSThread *ptr;
108
108
 
109
109
        enter_();
110
 
        lock_(BSNetwork::gHandlerList);
 
110
        lock_(MSNetwork::gHandlerList);
111
111
 
112
 
        ptr = (CSThread *) BSNetwork::gHandlerList->getBack();
 
112
        ptr = (CSThread *) MSNetwork::gHandlerList->getBack();
113
113
        while (ptr) {
114
114
                void *thd;
115
115
 
116
 
                if ((thd = ((BSConnectionHandler *) ptr)->myMySQLTHD))
117
 
                        engine->bs_close_conn(thd);
 
116
                if ((thd = ((MSConnectionHandler *) ptr)->myMySQLTHD))
 
117
                        engine->ms_close_conn(thd);
118
118
                ptr = (CSThread *) ptr->getNextLink();
119
119
        }
120
120
 
121
 
        unlock_(BSNetwork::gHandlerList);
 
121
        unlock_(MSNetwork::gHandlerList);
122
122
        exit_();
123
123
}
124
124
 
125
 
int BSEngine::getEngineList(size_t len, char *engine_list)
 
125
int MSEngine::getEngineList(size_t len, char *engine_list)
126
126
{
127
 
        MyBSSharedMemoryPtr             sh_mem = StreamingEngines->sharedMemory;
 
127
        PBMSSharedMemoryPtr             sh_mem = StreamingEngines->sharedMemory;
128
128
        int                                             i, cnt = 0;
129
 
        MyBSEnginePtr                   engine;
 
129
        PBMSEnginePtr                   engine;
130
130
        
131
131
        *engine_list = 0;
132
132
        if (sh_mem) {
133
133
                for (i=0; i<sh_mem->sm_list_len; i++) {
134
134
                        if ((engine = sh_mem->sm_engine_list[i])) {
135
 
                                if (engine->bs_close_conn) {
 
135
                                if (engine->ms_close_conn) {
136
136
                                        if (cnt)
137
137
                                                cs_strcat(len, engine_list, ", ");
138
 
                                        cs_strcat(len, engine_list, engine->bs_engine_name);
 
138
                                        cs_strcat(len, engine_list, engine->ms_engine_name);
139
139
                                        cnt++;
140
140
                                }
141
141
                        }
144
144
        return cnt;
145
145
}
146
146
 
147
 
void BSEngine::throwEngineError(const char *func, const char *file, int line, int err, char *engine, int code, const char *message, const char *stack)
 
147
void MSEngine::throwEngineError(const char *func, const char *file, int line, int err, char *engine, int code, const char *message, const char *stack)
148
148
{
149
149
        char buffer[CS_EXC_MESSAGE_SIZE];
150
150
 
159
159
        CSException::throwException(func, file, line, err, buffer, stack);
160
160
}
161
161
 
162
 
void BSEngine::throwEngineError(const char *func, const char *file, int line, int err, char *engine, MyBSResultPtr result)
 
162
void MSEngine::throwEngineError(const char *func, const char *file, int line, int err, char *engine, PBMSResultPtr result)
163
163
{
164
164
        throwEngineError(func, file, line, err, engine, result->mr_code, result->mr_message, result->mr_stack);
165
165
}
166
166
 
167
 
void BSEngine::throwEngineListError(const char *func, const char *file, int line, int err, const char *message, const char *item)
 
167
void MSEngine::throwEngineListError(const char *func, const char *file, int line, int err, const char *message, const char *item)
168
168
{
169
169
        char    buffer[CS_EXC_MESSAGE_SIZE];
170
170
        int             cnt;
179
179
        if (!cnt)
180
180
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, ", No streaming enabled engines");
181
181
        else if (cnt == 1) {
182
 
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, ", Streaming engine: ");
 
182
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, ", Stream engine: ");
183
183
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, list);
184
184
        }
185
185
        else {
186
 
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, ", Streaming engines: ");
 
186
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, ", Stream engines: ");
187
187
                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, list);
188
188
        }
189
189
        CSException::throwException(func, file, line, err, buffer);
194
194
 * ENGINE CALLBACK INTERFACE
195
195
 */
196
196
 
197
 
static void bs_deregister_engine(MyBSEnginePtr engine)
 
197
static void ms_deregister_engine(PBMSEnginePtr engine)
198
198
{
199
 
        BSConnectionHandler     *thread = NULL;
 
199
        MSConnectionHandler     *thread = NULL;
200
200
 
201
201
        if (!CSThread::getSelf()) {
202
 
                if (!(thread = BSConnectionHandler::newHandler(NULL))) {
 
202
                if (!(thread = MSConnectionHandler::newHandler(NULL))) {
203
203
                        CSException::logOSError(CS_CONTEXT, ENOMEM);
204
204
                        return;
205
205
                }
212
212
        try_(a) {
213
213
                if (thread)
214
214
                        thread->threadName = CSString::newString("deregister_engine");
215
 
                engine->bs_removing = 1;
216
 
                BSTableList::removeEngineTables(engine);
217
 
                BSEngine::closeConnections(engine);
 
215
                engine->ms_removing = 1;
 
216
                MSTableList::removeEngineTables(engine);
 
217
                MSEngine::closeConnections(engine);
218
218
        }
219
219
        catch_(a) {
220
220
                self->logException();
225
225
                CSThread::detach(thread);
226
226
}
227
227
 
228
 
static void bs_table_close_all(const char *table_url)
 
228
static void ms_table_close_all(const char *table_url)
229
229
{
230
 
        BSConnectionHandler     *thread = NULL;
 
230
        MSConnectionHandler     *thread = NULL;
231
231
 
232
232
        if (!CSThread::getSelf()) {
233
 
                if (!(thread = BSConnectionHandler::newHandler(NULL))) {
 
233
                if (!(thread = MSConnectionHandler::newHandler(NULL))) {
234
234
                        CSException::logOSError(CS_CONTEXT, ENOMEM);
235
235
                        return;
236
236
                }
244
244
        try_(a) {
245
245
                if (thread)
246
246
                        thread->threadName = CSString::newString("close_table");
247
 
                BSTableList::removeTablePool(CSString::newString(table_url));
 
247
                MSTableList::removeTablePool(CSString::newString(table_url));
248
248
        }
249
249
        catch_(a) {
250
250
                self->logException();
255
255
                CSThread::detach(thread);
256
256
}
257
257
 
258
 
static int bs_set_content_len(void *stream, off_t len, MyBSResultPtr result)
 
258
static int ms_set_content_len(void *stream, off_t len, PBMSResultPtr result)
259
259
{
260
260
        CSHTTPOutputStream      *out;
261
261
 
262
262
        out = (CSHTTPOutputStream *) stream;
263
263
        out->setContentLength((csWord8) len);
264
 
        return BS_OK;
 
264
        return MS_OK;
265
265
}
266
266
 
267
 
static int bs_write_head(void *stream, MyBSResultPtr result)
 
267
static int ms_write_head(void *stream, PBMSResultPtr result)
268
268
{
269
 
        int                                     r = BS_OK;
 
269
        int                                     r = MS_OK;
270
270
        CSHTTPOutputStream      *out;
271
 
        BSConnectionHandler     *me;
 
271
        MSConnectionHandler     *me;
272
272
 
273
273
        enter_();
274
 
        me = (BSConnectionHandler *) self;
 
274
        me = (MSConnectionHandler *) self;
275
275
        out = (CSHTTPOutputStream *) stream;
276
276
        try_(a) {
277
277
                me->replyPending = false;
278
278
                out->writeHead();
279
279
        }
280
280
        catch_(a) {
281
 
                r = mybs_exception_to_result(&self->myException, result);
 
281
                r = pbms_exception_to_result(&self->myException, result);
282
282
        }
283
283
        cont_(a);
284
284
        return_(r);
285
285
}
286
286
 
287
 
static int bs_write_stream(void *stream, void *buffer, size_t len, MyBSResultPtr result)
 
287
static int ms_write_stream(void *stream, void *buffer, size_t len, PBMSResultPtr result)
288
288
{
289
 
        int                                     r = BS_OK;
 
289
        int                                     r = MS_OK;
290
290
        CSHTTPOutputStream      *out;
291
291
 
292
292
        enter_();
295
295
                out->write((char *) buffer, len);
296
296
        }
297
297
        catch_(a) {
298
 
                r = mybs_exception_to_result(&self->myException, result);
 
298
                r = pbms_exception_to_result(&self->myException, result);
299
299
        }
300
300
        cont_(a);
301
301
        return_(r);
302
302
}
303
303
 
304
 
static int bs_open_table(void **open_table, char *table_path, MyBSResultPtr result)
 
304
static int ms_open_table(void **open_table, char *table_path, PBMSResultPtr result)
305
305
{
306
306
        CSThread                *self;
307
307
        int                             err;
308
 
        BSOpenTable             *otab;
 
308
        MSOpenTable             *otab;
309
309
 
310
 
        if ((err = mybs_enter_conn_no_thd(&self, result, NULL)))
 
310
        if ((err = pbms_enter_conn_no_thd(&self, result, NULL)))
311
311
                return err;
312
312
        inner_();
313
313
 
314
314
        retry:
315
315
        try_(a) {
316
 
                otab = BSTableList::getOpenTableByStr(table_path, true);
 
316
                otab = MSTableList::getOpenTableByStr(table_path, true);
317
317
                *open_table = otab;
318
318
        }
319
319
        catch_(a) {
320
 
                if (self->myException.getErrorCode() == BS_ERR_DATABASE_DELETED)
 
320
                if (self->myException.getErrorCode() == MS_ERR_DATABASE_DELETED)
321
321
                        goto retry;
322
 
                err = mybs_exception_to_result(&self->myException, result);
 
322
                err = pbms_exception_to_result(&self->myException, result);
323
323
        }
324
324
        cont_(a);
325
325
        return_(err);
326
326
}
327
327
 
328
 
static void bs_close_table(void *open_table)
 
328
static void ms_close_table(void *open_table)
329
329
{
330
 
        BSOpenTable *otab;
 
330
        MSOpenTable *otab;
331
331
 
332
 
        otab = (BSOpenTable *) open_table;
 
332
        otab = (MSOpenTable *) open_table;
333
333
        otab->unUseBlobs();
334
334
        otab->returnToPool();
335
 
        mybs_exit_conn();
 
335
        pbms_exit_conn();
336
336
}
337
337
 
338
 
static int bs_use_blob(void *open_table, char **ret_blob_url, char *blob_url, unsigned short col_index, MyBSResultPtr result)
 
338
static int ms_use_blob(void *open_table, char **ret_blob_url, char *blob_url, unsigned short col_index, PBMSResultPtr result)
339
339
{
340
 
        int                             err = BS_OK;
341
 
        BSBlobURLRec    blob;
342
 
        BSOpenTable             *otab;
 
340
        int                             err = MS_OK;
 
341
        MSBlobURLRec    blob;
 
342
        MSOpenTable             *otab;
343
343
 
344
344
        enter_();
345
 
        otab = (BSOpenTable *) open_table;
 
345
        otab = (MSOpenTable *) open_table;
346
346
        try_(a) {
347
 
                if (bs_parse_blob_url(&blob, blob_url, false))
 
347
                if (ms_parse_blob_url(&blob, blob_url, false))
348
348
                        otab->useBlob(blob.bu_type, blob.bu_database, blob.bu_tab_id, blob.bu_blob_id, blob.bu_auth_code, col_index, ret_blob_url);
349
349
                else {
350
350
                        char buffer[CS_EXC_MESSAGE_SIZE];
351
351
 
352
352
                        cs_strcpy(CS_EXC_MESSAGE_SIZE, buffer, "Incorrect URL: ");
353
353
                        cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, blob_url);
354
 
                        CSException::throwException(CS_CONTEXT, BS_ERR_INCORRECT_URL, buffer);
 
354
                        CSException::throwException(CS_CONTEXT, MS_ERR_INCORRECT_URL, buffer);
355
355
                }
356
356
        }
357
357
        catch_(a) {
358
 
                err = mybs_exception_to_result(&self->myException, result);
 
358
                err = pbms_exception_to_result(&self->myException, result);
359
359
        }
360
360
        cont_(a);
361
361
        return_(err);
362
362
}
363
363
 
364
 
static int bs_retain_blobs(void *open_table, MyBSEngineRefPtr eng_ref, MyBSResultPtr result)
 
364
static int ms_retain_blobs(void *open_table, PBMSEngineRefPtr eng_ref, PBMSResultPtr result)
365
365
{
366
 
        int                     err = BS_OK;
367
 
        BSOpenTable     *otab;
 
366
        int                     err = MS_OK;
 
367
        MSOpenTable     *otab;
368
368
 
369
369
        enter_();
370
370
        try_(a) {
371
 
                otab = (BSOpenTable *) open_table;
 
371
                otab = (MSOpenTable *) open_table;
372
372
                otab->retainReferences(eng_ref);
373
373
        }
374
374
        catch_(a) {
375
 
                err = mybs_exception_to_result(&self->myException, result);
 
375
                err = pbms_exception_to_result(&self->myException, result);
376
376
        }
377
377
        cont_(a);
378
378
        return_(err);
379
379
}
380
380
 
381
 
static int bs_release_blob(void *open_table, char *blob_url, unsigned short col_index, MyBSEngineRefPtr eng_ref, MyBSResultPtr result)
 
381
static int ms_release_blob(void *open_table, char *blob_url, unsigned short col_index, PBMSEngineRefPtr eng_ref, PBMSResultPtr result)
382
382
{
383
 
        int                             err = BS_OK;
384
 
        BSBlobURLRec    blob;
385
 
        BSOpenTable             *otab;
 
383
        int                             err = MS_OK;
 
384
        MSBlobURLRec    blob;
 
385
        MSOpenTable             *otab;
386
386
 
387
387
        enter_();
388
388
        try_(a) {
389
 
                otab = (BSOpenTable *) open_table;
390
 
                if (bs_parse_blob_url(&blob, blob_url, true)) {
 
389
                otab = (MSOpenTable *) open_table;
 
390
                if (ms_parse_blob_url(&blob, blob_url, true)) {
391
391
                        otab->openForReading();
392
392
                        if (otab->getTableID() == blob.bu_tab_id)
393
393
                                otab->releaseReference(blob.bu_blob_id, blob.bu_auth_code, col_index, eng_ref);
396
396
 
397
397
                                cs_strcpy(CS_EXC_MESSAGE_SIZE, buffer, "Incorrect table ID: ");
398
398
                                cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, blob_url);
399
 
                                CSException::throwException(CS_CONTEXT, BS_ERR_INCORRECT_URL, buffer);
 
399
                                CSException::throwException(CS_CONTEXT, MS_ERR_INCORRECT_URL, buffer);
400
400
                        }
401
401
                }
402
402
                else {
404
404
 
405
405
                        cs_strcpy(CS_EXC_MESSAGE_SIZE, buffer, "Incorrect URL: ");
406
406
                        cs_strcat(CS_EXC_MESSAGE_SIZE, buffer, blob_url);
407
 
                        CSException::throwException(CS_CONTEXT, BS_ERR_INCORRECT_URL, buffer);
 
407
                        CSException::throwException(CS_CONTEXT, MS_ERR_INCORRECT_URL, buffer);
408
408
                }
409
409
        }
410
410
        catch_(a) {
411
 
                err = mybs_exception_to_result(&self->myException, result);
 
411
                err = pbms_exception_to_result(&self->myException, result);
412
412
        }
413
413
        cont_(a);
414
414
        return_(err);
415
415
}
416
416
 
417
 
static int bs_drop_table(const char *table_path, MyBSResultPtr result)
 
417
static int ms_drop_table(const char *table_path, PBMSResultPtr result)
418
418
{
419
419
        CSThread        *self;
420
420
        int                     err;
421
421
 
422
 
        if ((err = mybs_enter_conn_no_thd(&self, result, NULL)))
 
422
        if ((err = pbms_enter_conn_no_thd(&self, result, NULL)))
423
423
                return err;
424
424
        inner_();
425
425
        try_(a) {
426
426
                CSPath                  *from_path;
427
427
                CSPath                  *to_path;
428
 
                BSOpenTable             *otab;
429
 
                BSOpenTablePool *tab_pool;
430
 
                BSTable                 *tab;
431
 
                BSDatabase              *database_to_drop = NULL;
 
428
                MSOpenTable             *otab;
 
429
                MSOpenTablePool *tab_pool;
 
430
                MSTable                 *tab;
 
431
                MSDatabase              *database_to_drop = NULL;
432
432
 
433
433
                // getOpenTable() must 'create' the table if it doesn't exist because if it doesn't
434
434
                // it will fail even if the table exists but was not open. We need an open table to delete it.
435
 
                if (!(otab = BSTableList::getOpenTableByStr(table_path, true)))
 
435
                if (!(otab = MSTableList::getOpenTableByStr(table_path, true)))
436
436
                        goto exit;
437
437
                frompool_(otab);
438
438
 
451
451
                tab->retain();
452
452
                push_(tab);
453
453
 
454
 
                tab_pool = BSTableList::lockTablePool(otab);
 
454
                tab_pool = MSTableList::lockTablePool(otab);
455
455
                frompool_(tab_pool);
456
456
 
457
457
                if (from_path->exists())
477
477
                exit:;          
478
478
        }
479
479
        catch_(a) {
480
 
                err = mybs_exception_to_result(&self->myException, result);
 
480
                err = pbms_exception_to_result(&self->myException, result);
481
481
        }
482
482
        cont_(a);
483
483
        outer_();
484
 
        mybs_exit_conn();
 
484
        pbms_exit_conn();
485
485
        return err;
486
486
}
487
487
 
488
 
static int be_rename_table(const char *from_table, const char *to_table, MyBSResultPtr result)
 
488
static int ms_rename_table(const char *from_table, const char *to_table, PBMSResultPtr result)
489
489
{
490
490
        CSThread        *self;
491
491
        int                     err;
492
492
 
493
 
        if ((err = mybs_enter_conn_no_thd(&self, result, NULL)))
 
493
        if ((err = pbms_enter_conn_no_thd(&self, result, NULL)))
494
494
                return err;
495
495
        inner_();
496
496
        try_(a) {
497
 
                BSOpenTable             *otab;
 
497
                MSOpenTable             *otab;
498
498
                char                    from_path_buffer[PATH_MAX];
499
499
                char                    to_path_buffer[PATH_MAX];
500
500
                CSPath                  *from_path;
501
501
                CSPath                  *to_path;
502
 
                BSOpenTablePool *tab_pool;
503
 
                BSTable                 *tab;
 
502
                MSOpenTablePool *tab_pool;
 
503
                MSTable                 *tab;
504
504
 
505
505
                /* Check the databases: */
506
506
                cs_strcpy(PATH_MAX, from_path_buffer, from_table);
508
508
                cs_remove_last_name_of_path(from_path_buffer);
509
509
                cs_remove_last_name_of_path(to_path_buffer);
510
510
                if (strcasecmp(from_path_buffer, to_path_buffer) != 0)
511
 
                        CSException::throwException(CS_CONTEXT, BS_ERR_NOT_IMPLEMENTED, "Cannot move a table to a difference database");
 
511
                        CSException::throwException(CS_CONTEXT, MS_ERR_NOT_IMPLEMENTED, "Cannot move a table to a difference database");
512
512
 
513
 
                if (!(otab = BSTableList::getOpenTableByStr(from_table, false)))
 
513
                if (!(otab = MSTableList::getOpenTableByStr(from_table, false)))
514
514
                        goto exit;
515
515
                frompool_(otab);
516
516
 
530
530
                tab->retain();
531
531
                push_(tab);
532
532
                
533
 
                tab_pool = BSTableList::lockTablePool(otab);
 
533
                tab_pool = MSTableList::lockTablePool(otab);
534
534
                frompool_(tab_pool);
535
535
 
536
536
                from_path->move(to_path);
543
543
                exit: ;
544
544
        }
545
545
        catch_(a) {
546
 
                err = mybs_exception_to_result(&self->myException, result);
 
546
                err = pbms_exception_to_result(&self->myException, result);
547
547
        }
548
548
        cont_(a);
549
549
        outer_();
550
 
        mybs_exit_conn();
 
550
        pbms_exit_conn();
551
551
        return err;
552
552
}
553
553
 
554
 
MyBSCallbacksRec engine_callbacks = {
555
 
        BS_CALLBACK_VERSION,
556
 
        bs_deregister_engine,
557
 
        bs_table_close_all,
558
 
        bs_set_content_len,
559
 
        bs_write_head,
560
 
        bs_write_stream,
561
 
        mybs_close_conn,
562
 
        bs_open_table,
563
 
        bs_close_table,
564
 
        bs_use_blob,
565
 
        bs_retain_blobs,
566
 
        bs_release_blob,
567
 
        bs_drop_table,
568
 
        be_rename_table
 
554
PBMSCallbacksRec engine_callbacks = {
 
555
        MS_CALLBACK_VERSION,
 
556
        ms_deregister_engine,
 
557
        ms_table_close_all,
 
558
        ms_set_content_len,
 
559
        ms_write_head,
 
560
        ms_write_stream,
 
561
        pbms_close_conn,
 
562
        ms_open_table,
 
563
        ms_close_table,
 
564
        ms_use_blob,
 
565
        ms_retain_blobs,
 
566
        ms_release_blob,
 
567
        ms_drop_table,
 
568
        ms_rename_table
569
569
};
570
570
 
571
571