~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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_info.h"
 
36
#include <drizzled/charset.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(file);
533
 
                file->retain();
 
532
                repo->addRepoFile(RETAIN(file));
534
533
                unlock_(myRepostoryList);
535
534
        }
536
535
        return_(file);
545
544
        push_(file);
546
545
        if ((repo = file->myRepo)) {
547
546
                if (repo->isRemovingFP) {
548
 
                        repo->removeRepoFile(RETAIN(file));
 
547
                        repo->removeRepoFile(file); // No retain expected
549
548
                        myRepostoryList->wakeup();
550
549
                }
551
550
                else
552
 
                        repo->returnRepoFile(RETAIN(file));
 
551
                        repo->returnRepoFile(file); // No retain expected
553
552
                repo->release(); /* [++] here is the release.  */
554
553
        }
555
554
        release_(file);
1047
1046
        return getDatabase(CSString::newString(db_name), create);
1048
1047
}
1049
1048
 
1050
 
MSDatabase *MSDatabase::getDatabase(uint32_t db_id)
 
1049
MSDatabase *MSDatabase::getDatabase(uint32_t db_id, bool missing_ok)
1051
1050
{
1052
1051
        MSDatabase *db;
1053
1052
        
1088
1087
        }
1089
1088
        unlock_(gDatabaseList);
1090
1089
        
1091
 
        if (!db) {
 
1090
        if ((!db) && !missing_ok) {
1092
1091
                char buffer[CS_EXC_MESSAGE_SIZE];
1093
1092
 
1094
1093
                cs_strcpy(CS_EXC_MESSAGE_SIZE, buffer, "Unknown database #");