~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Andrew Hutchings
  • Date: 2011-02-01 10:23:22 UTC
  • mto: (2136.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2137.
  • Revision ID: andrew@linuxjedi.co.uk-20110201102322-oxztcyrjzg3c7yta
Fix counters cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 */
29
29
 
30
30
#ifdef DRIZZLED
31
 
#include <config.h>
 
31
#include "config.h"
32
32
#include <drizzled/common.h>
33
33
#include <drizzled/session.h>
34
34
#include <drizzled/table.h>
35
35
#include <drizzled/message/table.pb.h>
36
 
#include <drizzled/charset.h>
 
36
#include "drizzled/charset_info.h"
37
37
#include <drizzled/table_proto.h>
38
38
#include <drizzled/field.h>
39
39
#endif
529
529
        if (!file) {
530
530
                file = repo->openRepoFile();
531
531
                lock_(myRepostoryList);
532
 
                repo->addRepoFile(RETAIN(file));
 
532
                repo->addRepoFile(file);
 
533
                file->retain();
533
534
                unlock_(myRepostoryList);
534
535
        }
535
536
        return_(file);
544
545
        push_(file);
545
546
        if ((repo = file->myRepo)) {
546
547
                if (repo->isRemovingFP) {
547
 
                        repo->removeRepoFile(file); // No retain expected
 
548
                        repo->removeRepoFile(RETAIN(file));
548
549
                        myRepostoryList->wakeup();
549
550
                }
550
551
                else
551
 
                        repo->returnRepoFile(file); // No retain expected
 
552
                        repo->returnRepoFile(RETAIN(file));
552
553
                repo->release(); /* [++] here is the release.  */
553
554
        }
554
555
        release_(file);
1046
1047
        return getDatabase(CSString::newString(db_name), create);
1047
1048
}
1048
1049
 
1049
 
MSDatabase *MSDatabase::getDatabase(uint32_t db_id, bool missing_ok)
 
1050
MSDatabase *MSDatabase::getDatabase(uint32_t db_id)
1050
1051
{
1051
1052
        MSDatabase *db;
1052
1053
        
1087
1088
        }
1088
1089
        unlock_(gDatabaseList);
1089
1090
        
1090
 
        if ((!db) && !missing_ok) {
 
1091
        if (!db) {
1091
1092
                char buffer[CS_EXC_MESSAGE_SIZE];
1092
1093
 
1093
1094
                cs_strcpy(CS_EXC_MESSAGE_SIZE, buffer, "Unknown database #");