1997-07-14 12:47:08 +00:00
|
|
|
--- src/msql/msqldb.c Fri Feb 7 10:06:42 1997
|
|
|
|
+++ src/msql/msqldb.c Fri Feb 7 10:15:22 1997
|
|
|
|
@@ -126,7 +126,7 @@
|
|
|
|
#endif
|
|
|
|
|
|
|
|
msqlTrace(TRACE_IN,"msqlListDBs()");
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path, MAXPATHLEN, "%s/msqldb",msqlHomeDir);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb");
|
1997-07-14 12:47:08 +00:00
|
|
|
dirp = opendir(path);
|
|
|
|
if (!dirp)
|
|
|
|
{
|
|
|
|
@@ -187,7 +187,7 @@
|
|
|
|
#endif
|
|
|
|
|
|
|
|
msqlTrace(TRACE_IN,"msqlListTables()");
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s",msqlHomeDir,db);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s",db);
|
1997-07-14 12:47:08 +00:00
|
|
|
dirp = opendir(path);
|
|
|
|
if (!dirp)
|
|
|
|
{
|
|
|
|
@@ -1130,7 +1130,7 @@
|
|
|
|
struct stat buf;
|
|
|
|
|
|
|
|
msqlTrace(TRACE_IN,"msqlInit()");
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path, MAXPATHLEN, "%s/msqldb/%s",msqlHomeDir,db);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s",db);
|
1997-07-14 12:47:08 +00:00
|
|
|
if (stat(path,&buf) < 0)
|
|
|
|
{
|
1998-02-13 10:54:49 +00:00
|
|
|
snprintf(errMsg,BAD_DB_ERROR,db);
|
|
|
|
@@ -1165,8 +1165,7 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
/*
|
|
|
|
** Write the catalog entry
|
|
|
|
*/
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(defPath, MAXPATHLEN, "%s/msqldb/%s/%s.def",
|
|
|
|
- msqlHomeDir,db,table);
|
|
|
|
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.def",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
#ifdef OS2
|
|
|
|
fd = _sopen(defPath,O_RDONLY,SH_DENYNO, S_IREAD | S_IWRITE);
|
|
|
|
#else
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1239,8 +1239,7 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
** Create an empty table
|
|
|
|
*/
|
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(datPath,MAXPATHLEN, "%s/msqldb/%s/%s.dat",
|
|
|
|
- msqlHomeDir,db,table);
|
|
|
|
+ (void)snprintf(datPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.dat",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
(void)unlink(datPath);
|
|
|
|
#ifdef OS2
|
|
|
|
fd = _sopen(datPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1279,8 +1279,7 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
** Create an empty index def file
|
|
|
|
*/
|
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(idxPath, MAXPATHLEN, "%s/msqldb/%s/%s.idx",
|
|
|
|
- msqlHomeDir,db,table);
|
|
|
|
+ (void)snprintf(idxPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
(void)unlink(idxPath);
|
|
|
|
#ifdef OS2
|
|
|
|
fd = _sopen(idxPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1302,8 +1302,7 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
/*
|
|
|
|
** Create an empty overflow file
|
|
|
|
*/
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(oflPath,MAXPATHLEN,"%s/msqldb/%s/%s.ofl",
|
|
|
|
- msqlHomeDir,db,table);
|
|
|
|
+ (void)snprintf(oflPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.ofl",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
(void)unlink(oflPath);
|
|
|
|
#ifdef OS2
|
|
|
|
fd = _sopen(oflPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
|
|
|
|
@@ -1454,10 +1454,10 @@
|
|
|
|
/*
|
|
|
|
** Can't clash with another index either
|
|
|
|
*/
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
|
|
|
|
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",
|
|
|
|
db, index->table);
|
1997-07-14 12:47:08 +00:00
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(idxPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-%s",
|
|
|
|
- msqlHomeDir,db, index->table, index->name);
|
|
|
|
+ (void)snprintf(idxPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-%s",
|
|
|
|
+ db, index->table, index->name);
|
1997-07-14 12:47:08 +00:00
|
|
|
|
|
|
|
#ifdef OS2
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1718,8 +1718,7 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
/*
|
|
|
|
** Now blow away the table files
|
|
|
|
*/
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.def",msqlHomeDir,
|
|
|
|
- db,table);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.def",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
#ifdef OS2
|
1998-02-13 10:54:49 +00:00
|
|
|
fp = fopen(path, MAXPATHLEN, "rb");
|
1997-07-14 12:47:08 +00:00
|
|
|
#else
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1733,18 +1733,15 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
}
|
|
|
|
(void)fclose(fp);
|
|
|
|
unlink(path);
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.dat",msqlHomeDir,
|
|
|
|
- db,table);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.dat",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
unlink(path);
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.ofl",msqlHomeDir,
|
|
|
|
- db,table);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.ofl",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
unlink(path);
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Take care of the index files.
|
|
|
|
*/
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
|
|
|
|
- db,table);
|
|
|
|
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",db,table);
|
1997-07-14 12:47:08 +00:00
|
|
|
#ifdef OS2
|
|
|
|
fd = _sopen(defPath,O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE);
|
|
|
|
#else
|
1998-02-13 10:54:49 +00:00
|
|
|
@@ -1751,9 +1751,9 @@
|
1997-07-14 12:47:08 +00:00
|
|
|
{
|
|
|
|
while(read(fd,&tmp,sizeof(tmp)) == sizeof(tmp))
|
|
|
|
{
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,
|
|
|
|
- "%s/msqldb/%s/%s.idx-%s",
|
1997-07-14 12:47:08 +00:00
|
|
|
- msqlHomeDir,db,table,tmp.name);
|
1998-02-13 10:54:49 +00:00
|
|
|
+ (void)snprintf(path, MAXPATHLEN,
|
|
|
|
+ "/var/db/msqldb/%s/%s.idx-%s",
|
1997-07-14 12:47:08 +00:00
|
|
|
+ db,table,tmp.name);
|
|
|
|
unlink(path);
|
|
|
|
}
|
|
|
|
close(fd);
|
|
|
|
@@ -1791,7 +1791,7 @@
|
|
|
|
return(-1);
|
|
|
|
}
|
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
|
|
|
|
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",
|
|
|
|
db, index->table);
|
1997-07-14 12:47:08 +00:00
|
|
|
#ifdef OS2
|
|
|
|
in = _sopen(defPath,O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE);
|
|
|
|
@@ -1804,7 +1804,7 @@
|
|
|
|
msqlTrace(TRACE_OUT,"msqlDropIndex()");
|
|
|
|
return(-1);
|
|
|
|
}
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(tmpPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-tmp",
|
|
|
|
- msqlHomeDir,db, index->table);
|
|
|
|
+ (void)snprintf(tmpPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-tmp",
|
|
|
|
+ db, index->table);
|
1997-07-14 12:47:08 +00:00
|
|
|
#ifdef OS2
|
|
|
|
out = _sopen(tmpPath,O_RDWR | O_CREAT | O_BINARY, SH_DENYNO,
|
|
|
|
@@ -1855,7 +1855,7 @@
|
|
|
|
*/
|
|
|
|
unlink(defPath);
|
|
|
|
rename(tmpPath,defPath);
|
1998-02-13 10:54:49 +00:00
|
|
|
- snprintf(tmpPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-%s",msqlHomeDir,db,
|
|
|
|
+ snprintf(tmpPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-%s",db,
|
1997-07-14 12:47:08 +00:00
|
|
|
index->table, index->name);
|
|
|
|
unlink(tmpPath);
|
|
|
|
|
|
|
|
@@ -2412,7 +2412,7 @@
|
|
|
|
** See if the directory exists
|
|
|
|
*/
|
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s", msqlHomeDir, db);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s", db);
|
1997-07-14 12:47:08 +00:00
|
|
|
dirp = opendir(path);
|
|
|
|
if (dirp)
|
|
|
|
{
|
|
|
|
@@ -2459,7 +2459,7 @@
|
|
|
|
** See if the directory exists
|
|
|
|
*/
|
|
|
|
|
1998-02-13 10:54:49 +00:00
|
|
|
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s", msqlHomeDir, db);
|
|
|
|
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s", db);
|
1997-07-14 12:47:08 +00:00
|
|
|
dirp = opendir(path);
|
|
|
|
if (!dirp)
|
|
|
|
{
|