Corretto da Angelo l'errore sul ripristino dell'indice: i Localisamfile con

memo o che usano altre istanze del localisamfile non mantenevano
	correttamente la chiave impostata se diversa da 1
Corretto da me e Guy un errore sui Isamtempfile: il distruttore causava
	la chiusura delle informazioni di tracciato dell'isam


git-svn-id: svn://10.65.10.50/trunk@5780 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
augusto 1997-12-23 11:29:38 +00:00
parent 9aaadee30d
commit 72802a774b

View File

@ -468,9 +468,7 @@ HIDDEN void relisfd(isfdptr & isfd)
delete isfd->r; delete isfd->r;
delete isfd; delete isfd;
#ifdef DBG isfd = NULL;
isfd = NULL; // Per provocare errori
#endif
} }
@ -1470,7 +1468,7 @@ TLocalisamfile::TLocalisamfile(
_oldkey = getkey(); _oldkey = getkey();
setkey(1); setkey(1);
} }
else _was_open = FALSE; else _was_open = TRUE;
} }
// @mfunc Costruttore // @mfunc Costruttore
@ -1485,9 +1483,12 @@ TLocalisamfile::TLocalisamfile(
TLocalisamfile::~TLocalisamfile() TLocalisamfile::~TLocalisamfile()
{ {
if (_was_open) if (_isamfile)
setkey(_oldkey); {
close(); if (_was_open)
setkey(_oldkey);
close();
}
} }
@ -1495,7 +1496,7 @@ int TLocalisamfile::close()
{ {
int err = NOERR; int err = NOERR;
if (!_was_open) if (_was_open)
{ {
clearfilehnd(); clearfilehnd();
} }
@ -1535,13 +1536,13 @@ int TLocalisamfile::open(unsigned int mode)
if (openf[logicnum - 1] != NULL) if (openf[logicnum - 1] != NULL)
{ {
_was_open = FALSE; _was_open = TRUE;
_isamfile = openf[logicnum - 1]; _isamfile = openf[logicnum - 1];
} }
else else
{ {
err = _open(mode, TRUE); err = _open(mode, TRUE);
_was_open = TRUE; _was_open = FALSE;
} }
setstatus(err); setstatus(err);
@ -2886,7 +2887,7 @@ HIDDEN int fld_cmp(const char* a, const char* b, int len, bool number)
// TRectype (record di un file) // TRectype (record di un file)
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
RecDes* TRectype::rec_des() const RecDes* TRectype::rec_des() const
{ {
const isdef* i = _logicnum < EXTERNAL_FILE ? openf[_logicnum-1] : ext_files[_logicnum - EXTERNAL_FILE]; const isdef* i = _logicnum < EXTERNAL_FILE ? openf[_logicnum-1] : ext_files[_logicnum - EXTERNAL_FILE];
CHECKD(i, "Can't use a record of closed file ", _logicnum); CHECKD(i, "Can't use a record of closed file ", _logicnum);