~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-10-09 17:44:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1853.
  • Revision ID: brian@tangent.org-20101009174413-4cs0q58kw0fjd45y
First pass through adding back user_locks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase Media Stream for MySQL
4
4
 *
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_info.h"
37
37
#include <drizzled/table_proto.h>
38
38
#include <drizzled/field.h>
39
39
#endif
545
545
        push_(file);
546
546
        if ((repo = file->myRepo)) {
547
547
                if (repo->isRemovingFP) {
548
 
                        repo->removeRepoFile(RETAIN(file));
 
548
                        repo->removeRepoFile(file);
549
549
                        myRepostoryList->wakeup();
550
550
                }
551
551
                else
552
 
                        repo->returnRepoFile(RETAIN(file));
 
552
                        repo->returnRepoFile(file);
553
553
                repo->release(); /* [++] here is the release.  */
554
554
        }
555
555
        release_(file);
1076
1076
                                                int len = ptr - dir_name;
1077
1077
                                                ptr++;
1078
1078
                                                if ((strtoul(ptr, NULL, 10) == db_id) && len) {
1079
 
                                                        db = getDatabase(CSString::newString(dir_name, len), true);
 
1079
                                                        db = getDatabase(CSCString::newString(dir_name, len), true);
1080
1080
                                                        ASSERT(db->myDatabaseID == db_id);
1081
1081
                                                }
1082
1082
                                        }
1259
1259
         * The database name is case sensitive here if the file system names are
1260
1260
         * case sensitive. This is desirable.
1261
1261
         */
1262
 
        path = CSPath::newPath(ms_my_get_mysql_home_path(), RETAIN(db_name));
 
1262
        path = CSPath::newPath(ms_my_get_mysql_home_path().c_str(), RETAIN(db_name));
1263
1263
        push_(path);
1264
1264
        if (create && !path->exists()) {
1265
1265
                CSException::throwException(CS_CONTEXT, MS_ERR_UNKNOWN_DB, db_name->getCString());
1597
1597
                        gDatabaseList->remove(doomedDatabase->getKey());
1598
1598
                if (!self->myMustQuit) 
1599
1599
                        unlock_(gDatabaseList); 
1600
 
                ASSERT(doomedDatabase->getRefCount() == 1);
 
1600
                ASSERT(doomedDatabase->iRefCount == 1);
1601
1601
                release_(doomedDatabase);
1602
1602
                
1603
1603
        } else {
1605
1605
                bool create = false;
1606
1606
                uint32_t db_id;
1607
1607
                
1608
 
                path = createDatabasePath(ms_my_get_mysql_home_path(), CSString::newString(db_name), &db_id, &create);
 
1608
                path = createDatabasePath(ms_my_get_mysql_home_path().c_str(), CSString::newString(db_name), &db_id, &create);
1609
1609
                
1610
1610
                if (path) {
1611
1611
                        MSTransactionManager::dropDatabase(db_id);
1636
1636
// 3: <database>/<table>
1637
1637
bool MSDatabase::convertTablePathToIDs(const char *table_path, uint32_t *db_id, uint32_t *tab_id, bool create) 
1638
1638
{
1639
 
        const char      *base = ms_my_get_mysql_home_path();
 
1639
        const char      *base = ms_my_get_mysql_home_path().c_str();
1640
1640
        CSString        *table_url;
1641
1641
        CSString        *db_path = NULL;
1642
1642
        CSString        *db_name = NULL;
1736
1736
        MSDatabase *db;
1737
1737
        enter_();
1738
1738
        
1739
 
        db = newDatabase(ms_my_get_mysql_home_path(), db_name, 0, create);
 
1739
        db = newDatabase(ms_my_get_mysql_home_path().c_str(), db_name, 0, create);
1740
1740
        
1741
1741
        if (db) {
1742
1742
                push_(db);