You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-11-24 08:41:09 +03:00
ColumnStore now uses standard bin/lib paths for pretty much everything. Data path is now hard-coded to /var/lib/columnstore. This patch also: * Removes v1 decompression * Removes a bunch of unneeded files * Removes COLUMNSTORE_INSTALL_DIR / $INSTALLDIR * Makes my.cnf.d work for all platforms (MCOL-3558) * Changes configcpp to use recursive mutex (fixes possible config write deadlock) * Fixes MCOL-3599 Fix regr functions, The library was installed in the wrong location * Fixes a bunch of Ubuntu packaging issues * Changes the binary names of several of the executables so as not to clash with potential executables from other packages
119 lines
2.3 KiB
C++
119 lines
2.3 KiB
C++
/* Copyright (C) 2014 InfiniDB, Inc.
|
|
Copyright (C) 2016 MariaDB Corporation
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; version 2 of
|
|
the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
/******************************************************************************************
|
|
* $Id$
|
|
*
|
|
******************************************************************************************/
|
|
#include <unistd.h>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
#include <boost/thread/mutex.hpp>
|
|
using namespace boost;
|
|
|
|
#ifdef _MSC_VER
|
|
#include "idbregistry.h"
|
|
#endif
|
|
#include "installdir.h"
|
|
#include "configcpp.h"
|
|
|
|
using namespace config;
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
namespace startup
|
|
{
|
|
|
|
/* static */
|
|
mutex StartUp::fTmpDirLock;
|
|
/* static */
|
|
string* StartUp::fTmpDirp = 0;
|
|
|
|
/* static */
|
|
const string StartUp::tmpDir()
|
|
{
|
|
mutex::scoped_lock lk(fTmpDirLock);
|
|
|
|
if (fTmpDirp)
|
|
return *fTmpDirp;
|
|
|
|
#ifdef _MSC_VER
|
|
fTmpDirp = new string("C:\\Calpont\Tmp");
|
|
string cfStr = IDBreadRegistry("");
|
|
|
|
if (!cfStr.empty())
|
|
*fTmpDirp = cfStr;
|
|
|
|
return *fTmpDirp;
|
|
|
|
#else
|
|
|
|
//check for non-root user
|
|
/* const char* p = getenv("HOME");
|
|
string homedir = p;
|
|
|
|
if (homedir == "/root")
|
|
{
|
|
Config* sysConfig = Config::makeConfig();
|
|
|
|
string TempFileDir;
|
|
|
|
try
|
|
{
|
|
TempFileDir = sysConfig->getConfig("SystemConfig", "TempFileDir");
|
|
}
|
|
catch (...)
|
|
{}
|
|
|
|
fTmpDirp = new string("/tmp");
|
|
|
|
*fTmpDirp = *fTmpDirp + TempFileDir;
|
|
}
|
|
else
|
|
{
|
|
// non-root user
|
|
fTmpDirp = new string(homedir);
|
|
|
|
*fTmpDirp = *fTmpDirp + "/.tmp";
|
|
}
|
|
*/
|
|
Config* sysConfig = Config::makeConfig();
|
|
|
|
string TempFileDir;
|
|
|
|
try
|
|
{
|
|
TempFileDir = sysConfig->getConfig("SystemConfig", "SystemTempFileDir");
|
|
}
|
|
catch (...)
|
|
{}
|
|
|
|
return TempFileDir;
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
}
|
|
// vim:ts=4 sw=4:
|
|
|