~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/repository_ms.cc

  • Committer: Monty Taylor
  • Date: 2011-03-11 18:48:55 UTC
  • mfrom: (2228.1.8 build)
  • Revision ID: mordred@inaugust.com-20110311184855-1essd3a6xfr7lx6r
Merged Andrew: drizzledump and docs bug fixes
Merged Barry: pbms bugfixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
        if (storage_type == MS_STANDARD_STORAGE) {
236
236
                char hex_checksum[33];
237
237
                cs_bin_to_hex(33, hex_checksum, 16, blob_head.rb_blob_checksum_md5d.val);
238
 
                hex_checksum[32] = 0;
239
238
                stream->addHeader(MS_CHECKSUM_TAG, hex_checksum);
240
239
        }
241
240
        
356
355
                                        tab_id = CS_GET_DISK_4(ptr.rp_tab_ref->tr_table_id_4);
357
356
                                        blob_id = CS_GET_DISK_6(ptr.rp_tab_ref->tr_blob_id_6);
358
357
 
359
 
                                        if (otab->getDBTable()->myTableID == tab_id)
 
358
                                        if ((otab->haveTable()) && (otab->getDBTable()->myTableID == tab_id))
360
359
                                                otab->getDBTable()->updateBlobHandle(otab, blob_id, otab->myWriteRepo->myRepoID, dst_offset, new_head_size);
361
360
                                        else {
362
361
                                                MSOpenTable *ref_otab;
708
707
                if (new_head_size > MS_OT_BUFFER_SIZE)
709
708
                        CSException::throwAssertion(CS_CONTEXT, "BLOB reference header overflow");
710
709
 
711
 
                memset(ptr.rp_chars + head_size, 0, new_head_size - head_size);         
 
710
                memset(ptr.rp_chars + head_size, 0, new_head_size - head_size);
 
711
                CS_SET_DISK_2(ptr.rp_head->rb_head_size_2, new_head_size);
 
712
                
712
713
        }       
713
714
                                
714
715
        // Meta data is placed at the end of the header.
720
721
                
721
722
        
722
723
        CS_SET_DISK_2(ptr.rp_head->rb_mdata_size_2, mdata_size);
723
 
        CS_SET_DISK_2(ptr.rp_head->rb_mdata_offset_2, mdata_offset);
724
 
        
 
724
        CS_SET_DISK_2(ptr.rp_head->rb_mdata_offset_2, mdata_offset);    
725
725
#ifdef HAVE_ALIAS_SUPPORT
726
726
        uint32_t alias_hash = INVALID_ALIAS_HASH;
727
727
        if (alias) {
1667
1667
        CSMutex *myLock;
1668
1668
        enter_();
1669
1669
        
1670
 
        myLock = &myRepoLock[0];
 
1670
        myLock = &myRepoWriteLock;
1671
1671
        lock_(myLock);
1672
1672
        
1673
1673
        ASSERT(!myRepoXLock);
1695
1695
{
1696
1696
        CSMutex *myLock;
1697
1697
        enter_();
1698
 
        myLock = &myRepoLock[0];
 
1698
        myLock = &myRepoWriteLock;
1699
1699
        lock_(myLock);
1700
1700
        
1701
1701
        ASSERT(myRepoLockState & state);
1717
1717
{
1718
1718
        CSMutex *myLock;
1719
1719
        enter_();
1720
 
        myLock = &myRepoLock[0];
 
1720
        myLock = &myRepoWriteLock;
1721
1721
        lock_(myLock);
1722
1722
        this->myRepoLockState &= ~(REPO_COMPACTING | REPO_WRITE);
1723
1723
        if ( this->myRepoLockState == REPO_UNLOCKED) {
1734
1734
{
1735
1735
        CSMutex *myLock;
1736
1736
        enter_();
1737
 
        myLock = &myRepoLock[0];
 
1737
        myLock = &myRepoWriteLock;
1738
1738
        lock_(myLock);
1739
1739
        
1740
1740
        
1756
1756
        uint32_t state;
1757
1757
        enter_();
1758
1758
        
1759
 
        myLock = &myRepoLock[0];
 
1759
        myLock = &myRepoWriteLock;
1760
1760
        lock_(myLock);
1761
1761
        state = this->myRepoLockState;
1762
1762
        this->myRepoLockState |= REPO_BACKUP;