1243
/* Tell PBMS to close all open tables of this sort: */
1244
xt_pbms_close_all_tables(name->ps_path);
1247
1239
/* Wait for all open tables to close: */
1248
1240
xt_db_wait_for_open_tables(self, table_pool);
1321
1313
/* Remove the PBMS table: */
1322
1314
ASSERT(xt_get_self() == self);
1324
xt_pbms_drop_table(name->ps_path);
1327
1316
/* Remove the table from the directory. It will get a new
1328
1317
* ID so the handle in the directory will no longer be valid.
1645
1634
tab_delete_table_files(self, tab_name, tab_id);
1647
1636
ASSERT(xt_get_self() == self);
1649
xt_pbms_drop_table(tab_name->ps_path);
1651
1637
if ((te_ptr = (XTTableEntryPtr) xt_sl_find(self, db->db_table_by_id, &tab_id))) {
1652
1638
tab_remove_table_path(self, db, te_ptr->te_tab_path);
1653
1639
xt_sl_delete(self, db->db_table_by_id, &tab_id);
3712
if (tab->tab_dic.dic_blob_count) {
3713
/* If the record contains any LONGBLOB then check how much
3718
switch (old_rec_type) {
3719
case XT_TAB_STATUS_DELETE:
3720
case XT_TAB_STATUS_DEL_CLEAN:
3722
case XT_TAB_STATUS_FIXED:
3723
case XT_TAB_STATUS_FIX_CLEAN:
3724
/* Should not be the case, record with LONGBLOB can never be fixed! */
3726
case XT_TAB_STATUS_VARIABLE:
3727
case XT_TAB_STATUS_VAR_CLEAN:
3728
cols_req = tab->tab_dic.dic_blob_cols_req;
3729
cols_in_buffer = cols_req;
3730
blob_size = myxt_load_row_length(ot, rec_size - XT_REC_FIX_HEADER_SIZE, ot->ot_row_rbuffer + XT_REC_FIX_HEADER_SIZE, &cols_in_buffer);
3731
if (cols_in_buffer < cols_req)
3732
blob_size = tab->tab_dic.dic_rec_size;
3734
blob_size += XT_REC_FIX_HEADER_SIZE;
3735
if (blob_size > rec_size)
3736
rec_size = blob_size;
3738
case XT_TAB_STATUS_EXT_DLOG:
3739
case XT_TAB_STATUS_EXT_CLEAN:
3740
cols_req = tab->tab_dic.dic_blob_cols_req;
3741
cols_in_buffer = cols_req;
3742
blob_size = myxt_load_row_length(ot, rec_size - XT_REC_EXT_HEADER_SIZE, ot->ot_row_rbuffer + XT_REC_EXT_HEADER_SIZE, &cols_in_buffer);
3743
if (cols_in_buffer < cols_req)
3744
blob_size = tab->tab_dic.dic_rec_size;
3746
blob_size += XT_REC_EXT_HEADER_SIZE;
3747
if (blob_size > rec_size)
3748
rec_size = blob_size;
3755
3698
if (XT_REC_IS_EXT_DLOG(old_rec_type)) {
3756
3699
/* {LOCK-EXT-REC} Lock, and read again to make sure that the
4387
4330
xtRowID row_id;
4388
4331
u_int idx_cnt = 0;
4389
4332
XTIndexPtr *ind;
4393
/* PBMS: Reference BLOBs!? */
4394
if (tab->tab_dic.dic_blob_count) {
4395
if (!myxt_use_blobs(ot, &pbms_table, rec_buf))
4400
4334
if (!myxt_store_row(ot, &rec_info, (char *) rec_buf))
4434
/* Reference the BLOBs in the row: */
4435
if (tab->tab_dic.dic_blob_count) {
4436
if (!myxt_retain_blobs(ot, pbms_table, rec_info.ri_rec_id)) {
4444
4367
/* Do the foreign key stuff: */
4445
4368
if (ot->ot_table->tab_dic.dic_table->dt_fkeys.size() > 0) {
4446
4369
if (!ot->ot_table->tab_dic.dic_table->insertRow(ot, rec_buf))
4461
4384
tab_free_row_on_fail(ot, tab, row_id);
4465
if (tab->tab_dic.dic_blob_count && pbms_table)
4466
myxt_unuse_blobs(ot, pbms_table);
4568
4487
xtLogOffset log_offset;
4569
4488
xtBool prev_ext_rec;
4574
if (tab->tab_dic.dic_blob_count) {
4575
if (!myxt_use_blobs(ot, &pbms_table, after_buf))
4580
4490
if (!myxt_store_row(ot, &rec_info, (char *) after_buf))
4640
4550
if (prev_ext_rec)
4641
4551
tab_free_ext_record_on_fail(ot, rec_id, &prev_rec_head, TRUE);
4644
if (tab->tab_dic.dic_blob_count) {
4645
/* Retain the BLOBs new record: */
4646
if (!myxt_retain_blobs(ot, pbms_table, rec_id))
4648
/* Release the BLOBs in the old record: */
4649
myxt_release_blobs(ot, before_buf, rec_id);
4692
4592
tab_free_ext_record_on_fail(ot, rec_id, &prev_rec_head, TRUE);
4696
/* Unuse the BLOBs of the new record: */
4697
if (tab->tab_dic.dic_blob_count && pbms_table)
4698
myxt_unuse_blobs(ot, pbms_table);
4753
4644
row_id = ot->ot_curr_row_id;
4754
4645
self = ot->ot_thread;
4757
/* PBMS: Reference BLOBs!? */
4758
if (tab->tab_dic.dic_blob_count) {
4759
if (!myxt_use_blobs(ot, &pbms_table, after_buf))
4764
4647
if (!myxt_store_row(ot, &rec_info, (char *) after_buf))
4814
/* Reference the BLOBs in the row: */
4815
if (tab->tab_dic.dic_blob_count) {
4816
if (!myxt_retain_blobs(ot, pbms_table, rec_info.ri_rec_id)) {
4824
4696
if (ot->ot_table->tab_dic.dic_table->dt_trefs || ot->ot_table->tab_dic.dic_table->dt_fkeys.size() > 0) {
4825
4697
if (!ot->ot_table->tab_dic.dic_table->updateRow(ot, before_buf, after_buf))