~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/ha_pbxt.cc

  • Committer: lbieber
  • Date: 2010-09-22 13:48:54 UTC
  • mfrom: (1784.1.3 build)
  • Revision ID: lbieber@orisndriz08-20100922134854-y7mae2taqhn73vsx
Merge Paul M. - latest changes from PBXT 1.0.11-7
Merge Paul M. - fix bug 641038 - pbxt rollback not working (tables reported as non-transactional)
Merge Andrew - fix show stoppers for new drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
#include "systab_xt.h"
80
80
#include "xaction_xt.h"
81
81
#include "backup_xt.h"
 
82
#include "heap_xt.h"
82
83
 
83
84
#ifdef DEBUG
84
85
//#define XT_USE_SYS_PAR_DEBUG_SIZES
600
601
        XTThreadPtr     self;
601
602
        static int      ha_thread_count = 0, ha_id;
602
603
 
603
 
#ifdef DRIZZLED
604
604
        if (!(self = (XTThreadPtr) *thd->getEngineData(pbxt_hton))) {
605
 
#else
606
 
        if (!(self = (XTThreadPtr) *thd_ha_data(thd, pbxt_hton))) {
607
 
#endif
608
605
//              const                   Security_context *sctx;
609
606
                char                    name[120];
610
607
                char                    ha_id_str[50];
635
632
                        return NULL;
636
633
 
637
634
                self->st_xact_mode = XT_XACT_REPEATABLE_READ;
638
 
#ifdef DRIZZLED
639
635
                *thd->getEngineData(pbxt_hton) = (void *) self;
640
 
#else
641
 
                *thd_ha_data(thd, pbxt_hton) = (void *) self;
642
 
#endif
643
636
        }
644
637
        return self;
645
638
}
648
641
{
649
642
        XTThreadPtr             self;
650
643
 
651
 
#ifdef DRIZZLED
652
644
        if (!(self = (XTThreadPtr) *thd->getEngineData(pbxt_hton))) {
653
645
        *thd->getEngineData(pbxt_hton) = NULL;
654
 
#else
655
 
        if ((self = (XTThreadPtr) *thd_ha_data(thd, pbxt_hton))) {
656
 
                *thd_ha_data(thd, pbxt_hton) = NULL;
657
 
#endif
658
646
                xt_free_thread(self);
659
647
        }
660
648
}
661
649
 
662
650
xtPublic XTThreadPtr xt_ha_thd_to_self(THD *thd)
663
651
{
664
 
#ifdef DRIZZLED
665
652
        return (XTThreadPtr) *thd->getEngineData(pbxt_hton);
666
 
#else
667
 
        return (XTThreadPtr) *thd_ha_data(thd, pbxt_hton);
668
 
#endif
669
 
}
670
 
 
671
 
#ifndef DRIZZLED
672
 
/* The first bit is 1. */
673
 
static u_int ha_get_max_bit(MX_BITMAP *map)
674
 
{
675
 
#ifdef DRIZZLED
676
 
        uint32_t        cnt = map->numOfBitsInMap();
677
 
        uint32_t        max_bit = 0;
678
 
 
679
 
        for (uint32_t i = 0; i < cnt; i++)
680
 
                if (map->isBitSet(i))
681
 
                        max_bit = i+1;
682
 
 
683
 
        return max_bit;
684
 
#else
685
 
        my_bitmap_map   *data_ptr = map->bitmap;
686
 
        my_bitmap_map   *end_ptr = map->last_word_ptr;
687
 
        u_int           cnt = map->n_bits;
688
 
        my_bitmap_map   b;
689
 
        
690
 
        for (; end_ptr >= data_ptr; end_ptr--) {
691
 
                if ((b = *end_ptr)) {
692
 
                        my_bitmap_map mask;
693
 
                        
694
 
                        if (end_ptr == map->getLastWordPtr() && map->getLastWordMask())
695
 
                                mask = map->getLastWordMask() >> 1;
696
 
                        else
697
 
                                mask = 0x80000000;
698
 
                        while (!(b & mask)) {
699
 
                                b = b << 1;
700
 
                                /* Should not happen, but if it does, we hang! */
701
 
                                if (!b)
702
 
                                        return map->numOfBitsInMap();
703
 
                                cnt--;
704
 
                        }
705
 
                        return cnt;
706
 
                }
707
 
                if (end_ptr == map->getLastWordPtr())
708
 
                        cnt = ((cnt-1) / 32) * 32;
709
 
                else
710
 
                        cnt -= 32;
711
 
        }
712
 
        return 0;
713
 
#endif
714
 
}
715
 
#endif
 
653
}
716
654
 
717
655
/*
718
656
 * -----------------------------------------------------------------------
1338
1276
  pbxt_end(NULL);
1339
1277
}
1340
1278
 
1341
 
#ifndef DRIZZLED
1342
 
static int pbxt_panic(handlerton *hton, enum ha_panic_function flag)
1343
 
{
1344
 
        return pbxt_end(hton);
1345
 
}
1346
 
#endif
1347
 
 
1348
1279
/*
1349
1280
 * Kill the PBXT thread associated with the MySQL thread.
1350
1281
 */
1351
 
#ifdef DRIZZLED
1352
1282
int PBXTStorageEngine::close_connection(Session *thd)
1353
1283
{
1354
1284
        PBXTStorageEngine * const hton = this;
1355
 
#else
1356
 
static int pbxt_close_connection(handlerton *hton, THD* thd)
1357
 
{
1358
 
#endif
1359
1285
        XTThreadPtr             self;
1360
1286
 
1361
1287
        XT_TRACE_CALL();
1362
 
#ifdef DRIZZLED
1363
1288
        if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1364
1289
                *thd->getEngineData(pbxt_hton) = NULL;
1365
 
#else
1366
 
        if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1367
 
                *thd_ha_data(thd, hton) = NULL;
1368
 
#endif
1369
1290
                /* Required because freeing the thread could cause
1370
1291
                 * free of database which could call xt_close_file_ns()!
1371
1292
                 */
1380
1301
 * when the last PBXT table was removed from the 
1381
1302
 * database.
1382
1303
 */
1383
 
#ifdef DRIZZLED
1384
1304
void PBXTStorageEngine::drop_database(char *)
1385
 
#else
1386
 
static void pbxt_drop_database(handlerton *XT_UNUSED(hton), char *XT_UNUSED(path))
1387
 
#endif
1388
1305
{
1389
1306
        XT_TRACE_CALL();
1390
1307
}
1448
1365
 * pbxt_thr is a pointer the the PBXT thread structure.
1449
1366
 *
1450
1367
 */
1451
 
#ifdef DRIZZLED
1452
1368
int PBXTStorageEngine::commit(Session *thd, bool all)
1453
1369
{
1454
1370
        PBXTStorageEngine * const hton = this;
1455
 
#else
1456
 
static int pbxt_commit(handlerton *hton, THD *thd, bool all)
1457
 
{
1458
 
#endif
1459
1371
        int                     err = 0;
1460
1372
        XTThreadPtr     self;
1461
1373
 
1462
 
#ifdef DRIZZLED
1463
1374
        if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1464
 
#else
1465
 
        if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1466
 
#endif
1467
1375
                XT_PRINT2(self, "%s pbxt_commit all=%d\n", all ? "END CONN XACT" : "END STAT", all);
1468
1376
 
1469
1377
                if (self->st_xact_data) {
1484
1392
        return err;
1485
1393
}
1486
1394
 
1487
 
#ifdef DRIZZLED
1488
1395
int PBXTStorageEngine::rollback(Session *thd, bool all)
1489
1396
{
1490
1397
        PBXTStorageEngine * const hton = this;
1491
 
#else
1492
 
static int pbxt_rollback(handlerton *hton, THD *thd, bool all)
1493
 
{
1494
 
#endif
1495
1398
        int                     err = 0;
1496
1399
        XTThreadPtr     self;
1497
1400
 
1498
 
#ifdef DRIZZLED
1499
 
        if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1500
 
#else
1501
 
        if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
1502
 
#endif
 
1401
        if ((self = (XTThreadPtr) *thd->getEngineData(hton))) {
1503
1402
                XT_PRINT2(self, "%s pbxt_rollback all=%d\n", all ? "CONN END XACT" : "STAT END", all);
1504
1403
 
1505
1404
                if (self->st_xact_data) {
1569
1468
        return err;
1570
1469
}
1571
1470
 
1572
 
static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, char *thread_name, int *err)
 
1471
static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
1573
1472
{
1574
1473
        THD                     *thd;
1575
1474
        XTThreadPtr     self = NULL;
1911
1810
                         * selectity of the indices, as soon as the number of rows
1912
1811
                         * exceeds 200 (see [**])
1913
1812
                         */
 
1813
#ifdef XT_ROW_COUNT_CORRECTED
 
1814
                        /* {CORRECTED-ROW-COUNT} */
 
1815
                        pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) < 150;
 
1816
#else
1914
1817
                        /* {FREE-ROWS-BAD} */
1915
1818
                        pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) < 150;
 
1819
#endif
1916
1820
                }
1917
1821
 
1918
1822
                /* I am not doing this anymore because it was only required
2127
2031
                 * purposes!
2128
2032
                HA_NOT_EXACT_COUNT |
2129
2033
                 */
2130
 
#ifndef DRIZZLED
2131
2034
                /*
2132
2035
                 * This basically means we have a file with the name of
2133
2036
                 * database table (which we do).
2134
2037
                 */
2135
2038
                HA_FILE_BASED |
2136
 
#endif
2137
2039
                /*
2138
2040
                 * Not sure what this does (but MyISAM and InnoDB have it)?!
2139
2041
                 * Could it mean that we support the handler functions.
2267
2169
                                         */
2268
2170
                                        if (!thd || thd_sql_command(thd) == SQLCOM_FLUSH) // FLUSH TABLES
2269
2171
                                                xt_sync_flush_table(self, ot, thd ? 0 : 4);
 
2172
                                        else {
 
2173
                                                /* This change is a result of a problem mentioned by Arjen.
 
2174
                                                 * REPAIR and ALTER lead to the following sequence:
 
2175
                                                 * 1. tab  -- copy --> tmp1
 
2176
                                                 * 2. tab  -- rename --> tmp2
 
2177
                                                 * 3. tmp1 -- rename --> tab
 
2178
                                                 * 4. delete tmp2
 
2179
                                                 *
 
2180
                                                 * PBXT flushes a table before rename.
 
2181
                                                 * In the sequence above results in a table flush in step 3 which can
 
2182
                                                 * take a very long time.
 
2183
                                                 *
 
2184
                                                 * The problem is, during this time frame we have only temp tables.
 
2185
                                                 * A crash in this state leaves the database in a bad state.
 
2186
                                                 *
 
2187
                                                 * To reduce the time in this state, the flush needs to be done
 
2188
                                                 * elsewhere. The code below causes the flish to occur after
 
2189
                                                 * step 1:
 
2190
                                                 */ 
 
2191
                                                switch (thd_sql_command(thd)) {
 
2192
                                                        case SQLCOM_RENAME_TABLE:
 
2193
                                                        case SQLCOM_ANALYZE:
 
2194
                                                        case SQLCOM_ALTER_TABLE:
 
2195
                                                        case SQLCOM_CREATE_INDEX:
 
2196
                                                                xt_sync_flush_table(self, ot, thd ? 0 : 4);
 
2197
                                                                break;
 
2198
                                                }
 
2199
                                        }
2270
2200
                                }
2271
2201
                                freer_(); // xt_db_return_table_to_pool(ot);
2272
2202
                        }
2327
2257
#else
2328
2258
                        xt_tab_load_row_pointers(self, pb_open_tab);
2329
2259
#endif
 
2260
 
2330
2261
                        xt_ind_set_index_selectivity(pb_open_tab, self);
 
2262
#ifdef XT_ROW_COUNT_CORRECTED
 
2263
                        /* {CORRECTED-ROW-COUNT} */
 
2264
                        pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) < 150;
 
2265
#else
2331
2266
                        /* {FREE-ROWS-BAD} */
2332
2267
                        pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) < 150;
 
2268
#endif
2333
2269
                }
2334
2270
 
2335
2271
                init_auto_increment(0);
2422
2358
                xtBool          xn_started = FALSE;
2423
2359
                XTThreadPtr     self = pb_open_tab->ot_thread;
2424
2360
 
2425
 
//#ifndef DRIZZLED
2426
2361
                /*
2427
2362
                 * A table may be opened by a thread with a running
2428
2363
                 * transaction!
2445
2380
                        }
2446
2381
                        xn_started = TRUE;
2447
2382
                }
2448
 
//#endif
 
2383
 
2449
2384
                /* Setup the conditions for the next call! */
2450
2385
                table->in_use = current_thd;
2451
2386
                table->next_number_field = table->found_next_number_field;
2765
2700
        XT_PRINT1(self, "update_row (%s)\n", pb_share->sh_table_path->ps_path);
2766
2701
        XT_DISABLED_TRACE(("UPDATE tx=%d val=%d\n", (int) self->st_xact_data->xd_start_xn_id, (int) XT_GET_DISK_4(&new_data[1])));
2767
2702
        //statistic_increment(ha_update_count,&LOCK_status);
 
2703
 
2768
2704
        /* {START-STAT-HACK} previously position of start statement hack. */
 
2705
 
2769
2706
        xt_xlog_check_long_writer(self);
2770
2707
 
2771
2708
        /* {UPDATE-STACK} */
2850
2787
                return err;
2851
2788
        }
2852
2789
#endif
 
2790
 
2853
2791
        /* {START-STAT-HACK} previously position of start statement hack. */
 
2792
 
2854
2793
        xt_xlog_check_long_writer(pb_open_tab->ot_thread);
2855
2794
 
2856
2795
        if (!xt_tab_delete_record(pb_open_tab, (xtWord1 *) buf))
3913
3852
 
3914
3853
        if ((ot = pb_open_tab)) {
3915
3854
                if (flag & HA_STATUS_VARIABLE) {
 
3855
                        register XTTableHPtr tab = ot->ot_table;
 
3856
 
3916
3857
                        /* {FREE-ROWS-BAD}
3917
3858
                         * Free row count is not reliable, so ignore it.
3918
3859
                         * The problem is if tab_row_fnum > tab_row_eof_id - 1 then
3939
3880
                         * the actual number of vectors. But it must assume that it has at
3940
3881
                         * least EXTRA_RECORDS vectors.
3941
3882
                         */
3942
 
                        stats.deleted = /* ot->ot_table->tab_row_fnum */ 0;
3943
 
                        stats.records = (ha_rows) (ot->ot_table->tab_row_eof_id - 1 /* - stats.deleted */);
3944
 
                        stats.data_file_length = xt_rec_id_to_rec_offset(ot->ot_table, ot->ot_table->tab_rec_eof_id);
3945
 
                        stats.index_file_length = xt_ind_node_to_offset(ot->ot_table, ot->ot_table->tab_ind_eof);
3946
 
                        stats.delete_length = ot->ot_table->tab_rec_fnum * ot->ot_rec_size;
 
3883
#ifdef XT_ROW_COUNT_CORRECTED
 
3884
                        if (tab->tab_row_eof_id <= tab->tab_row_fnum ||
 
3885
                                (!tab->tab_row_free_id && tab->tab_row_fnum))
 
3886
                                xt_tab_check_free_lists(NULL, ot, false, true);
 
3887
                        stats.records = (ha_rows) tab->tab_row_eof_id - 1;
 
3888
                        if (stats.records >= tab->tab_row_fnum) {
 
3889
                                stats.deleted = tab->tab_row_fnum;
 
3890
                                stats.records -= stats.deleted;
 
3891
                        }
 
3892
                        else {
 
3893
                                stats.deleted = 0;
 
3894
                                stats.records = 2;
 
3895
                        }
 
3896
#else
 
3897
                        stats.deleted = /* tab->tab_row_fnum */ 0;
 
3898
                        stats.records = (ha_rows) (tab->tab_row_eof_id - 1 /* - stats.deleted */);
 
3899
#endif
 
3900
                        stats.data_file_length = xt_rec_id_to_rec_offset(tab, tab->tab_rec_eof_id);
 
3901
                        stats.index_file_length = xt_ind_node_to_offset(tab, tab->tab_ind_eof);
 
3902
                        stats.delete_length = tab->tab_rec_fnum * ot->ot_rec_size;
3947
3903
                        //check_time = info.check_time;
3948
3904
                        stats.mean_rec_length = (ulong) ot->ot_rec_size;
3949
3905
                }
3961
3917
                        //share->db_options_in_use = info.options;
3962
3918
                        stats.block_size = XT_INDEX_PAGE_SIZE;
3963
3919
 
3964
 
#ifdef DRIZZLED
3965
3920
                        if (share->getType() == message::Table::STANDARD)
3966
 
#else
3967
 
                        if (share->tmp_table == NO_TMP_TABLE)
3968
 
#endif
3969
3921
#ifdef DRIZZLED
3970
3922
#define WHICH_MUTEX                     mutex
3971
3923
#elif MYSQL_VERSION_ID >= 50404
4230
4182
                 * each row because it may be part of a transaction,
4231
4183
                 * and there may be foreign key actions.
4232
4184
                 */
4233
 
#ifdef DRIZZLED
4234
4185
                XT_RETURN (errno = HA_ERR_WRONG_COMMAND);
4235
 
#else
4236
 
                XT_RETURN (my_errno = HA_ERR_WRONG_COMMAND);
4237
 
#endif
4238
4186
        }
4239
4187
 
4240
4188
        if (!(self = ha_set_current_thread(thd, &err)))
4321
4269
 * now agree with the MyISAM strategy.
4322
4270
 * 
4323
4271
 */
4324
 
#ifdef DRIZZLED
4325
4272
int ha_pbxt::analyze(THD *thd)
4326
 
#else
4327
 
int ha_pbxt::analyze(THD *thd, HA_CHECK_OPT *XT_UNUSED(check_opt))
4328
 
#endif
4329
4273
{
4330
4274
        int                             err = 0;
4331
4275
        XTDatabaseHPtr  db;
4407
4351
        XT_RETURN(err);
4408
4352
}
4409
4353
 
4410
 
#ifndef DRIZZLED
4411
 
int ha_pbxt::repair(THD *XT_UNUSED(thd), HA_CHECK_OPT *XT_UNUSED(check_opt))
4412
 
{
4413
 
        return(HA_ADMIN_TRY_ALTER);
4414
 
}
4415
 
 
4416
 
/*
4417
 
 * This is mapped to "ALTER TABLE tablename TYPE=PBXT", which rebuilds
4418
 
 * the table in MySQL.
4419
 
 */
4420
 
int ha_pbxt::optimize(THD *XT_UNUSED(thd), HA_CHECK_OPT *XT_UNUSED(check_opt))
4421
 
{
4422
 
        return(HA_ADMIN_TRY_ALTER);
4423
 
}
4424
 
#endif
4425
 
 
4426
4354
#ifdef DEBUG
4427
4355
extern int pbxt_mysql_trace_on;
4428
4356
#endif
4429
4357
 
4430
 
#ifdef DRIZZLED
4431
4358
int ha_pbxt::check(THD* thd)
4432
 
#else
4433
 
int ha_pbxt::check(THD* thd, HA_CHECK_OPT* XT_UNUSED(check_opt))
4434
 
#endif
4435
4359
{
4436
4360
        int                             err = 0;
4437
4361
        XTThreadPtr             self;
4594
4518
                                }
4595
4519
 
4596
4520
                                if (pb_share->sh_recalc_selectivity) {
 
4521
#ifdef XT_ROW_COUNT_CORRECTED
 
4522
                                        /* {CORRECTED-ROW-COUNT} */
 
4523
                                        if ((pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) >= 200)
 
4524
#else
4597
4525
                                        /* {FREE-ROWS-BAD} */
4598
 
                                        if ((pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) >= 200) {
 
4526
                                        if ((pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) >= 200)
 
4527
#endif
 
4528
                                        {
4599
4529
                                                /* [**] */
4600
4530
                                                pb_share->sh_recalc_selectivity = FALSE;
4601
4531
                                                xt_ind_set_index_selectivity(pb_open_tab, self);
 
4532
#ifdef XT_ROW_COUNT_CORRECTED
 
4533
                                                /* {CORRECTED-ROW-COUNT} */
 
4534
                                                pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 - pb_share->sh_table->tab_row_fnum) < 150;
 
4535
#else
4602
4536
                                                /* {FREE-ROWS-BAD} */
4603
4537
                                                pb_share->sh_recalc_selectivity = (pb_share->sh_table->tab_row_eof_id - 1 /* - pb_share->sh_table->tab_row_fnum */) < 150;
 
4538
#endif
4604
4539
                                        }
4605
4540
                                }
4606
4541
                        }
4649
4584
                                goto complete;
4650
4585
                        }
4651
4586
                        cont_(a);
 
4587
 
 
4588
                        /* Occurs if you do:
 
4589
                         * truncate table t1;
 
4590
                         * truncate table t1;
 
4591
                         */
 
4592
                        if (!pb_open_tab) {
 
4593
                                if ((err = reopen())) {
 
4594
                                        pb_ex_in_use = 0;
 
4595
                                        goto complete;
 
4596
                                }
 
4597
                        }
4652
4598
                }
4653
4599
                else {
4654
4600
                        pb_ex_in_use = 1;
4979
4925
#ifndef DRIZZLED
4980
4926
                        case SQLCOM_REPAIR:
4981
4927
                        case SQLCOM_OPTIMIZE:
 
4928
#endif
4982
4929
                                self->st_stat_modify = TRUE;
4983
 
#endif
4984
4930
                                break;
4985
4931
                }
4986
4932
        }
5253
5199
 * during create if the table_flag HA_DROP_BEFORE_CREATE was specified for
5254
5200
 * the storage engine.
5255
5201
*/
5256
 
#ifdef DRIZZLED
5257
5202
int PBXTStorageEngine::doDropTable(Session &, const TableIdentifier& ident)
5258
5203
{
5259
5204
        const std::string& path = ident.getPath();
5260
5205
        const char *table_path = path.c_str();
5261
 
#else
5262
 
int ha_pbxt::delete_table(const char *table_path)
5263
 
{
5264
 
#endif
5265
5206
        THD                             *thd = current_thd;
5266
5207
        int                             err = 0;
5267
5208
        XTThreadPtr             self = NULL;
5353
5294
        }
5354
5295
#endif
5355
5296
 
5356
 
#ifdef DRIZZLED
5357
 
          std::string path2(ident.getPath());
5358
 
          path2.append(DEFAULT_FILE_EXTENSION);
5359
 
          (void)internal::my_delete(path2.c_str(), MYF(0));
5360
 
#endif
 
5297
        std::string path2(ident.getPath());
 
5298
        path2.append(DEFAULT_FILE_EXTENSION);
 
5299
        (void)internal::my_delete(path2.c_str(), MYF(0));
5361
5300
 
5362
5301
        return err;
5363
5302
}
5404
5343
 * This function can be used to move a table from one database to
5405
5344
 * another.
5406
5345
 */
5407
 
#ifdef DRIZZLED
5408
5346
int PBXTStorageEngine::doRenameTable(Session&,
5409
5347
                                     const TableIdentifier& from_ident,
5410
5348
                                     const TableIdentifier& to_ident)
5415
5353
        if (strcmp(from, to) == 0)
5416
5354
                return 0;
5417
5355
 
5418
 
#else
5419
 
int ha_pbxt::rename_table(const char *from, const char *to)
5420
 
{
5421
 
#endif
5422
5356
        THD                             *thd = current_thd;
5423
5357
        int                             err = 0;
5424
5358
        XTThreadPtr             self;
5495
5429
        pbms_completed(NULL, (err == 0));
5496
5430
#endif
5497
5431
 
5498
 
#ifdef DRIZZLED
5499
5432
        if (err == 0)
5500
5433
                plugin::StorageEngine::renameDefinitionFromPath(to_ident, from_ident);
5501
 
#endif
5502
5434
 
5503
5435
        XT_RETURN(err);
5504
5436
}
5982
5914
 
5983
5915
                        fk_info->referenced_table = thd_make_lex_string(thd, 0,
5984
5916
                                ref_tbl_name, (uint) strlen(ref_tbl_name), 1);
5985
 
                        
 
5917
 
5986
5918
                        fk_info->referenced_key_name = NULL;                    
5987
5919
 
5988
5920
                        XTIndex *ix = fk->getReferenceIndexPtr();