Commit 8f0ae632 authored by Olivier Bertrand's avatar Olivier Bertrand

- Upated columns must be allocated before opening the table

modified:
  storage/connect/connect.cc
parent 7a7ff18c
...@@ -294,31 +294,6 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, ...@@ -294,31 +294,6 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
colp->AddColUse(U_P); // For PLG tables colp->AddColUse(U_P); // For PLG tables
} // endfor colp } // endfor colp
// Now do open the physical table
tdbp->SetMode(mode);
if (del && ((PTDBASE)tdbp)->GetFtype() != RECFM_NAF) {
// To avoid erasing the table when doing a partial delete
// make a fake Next
PDOSDEF ddp= new(g) DOSDEF;
PTDB tp= new(g) TDBDOS(ddp, NULL);
tdbp->SetNext(tp);
dup->Check &= ~CHK_DELETE;
} // endif del
if (xtrace)
printf("About to open the table: tdbp=%p\n", tdbp);
if (mode != MODE_ANY) {
if (tdbp->OpenDB(g)) {
printf("%s\n", g->Message);
return true;
} else
tdbp->SetNext(NULL);
} // endif mode
/*********************************************************************/ /*********************************************************************/
/* In Update mode, the updated column blocks must be distinct from */ /* In Update mode, the updated column blocks must be distinct from */
/* the read column blocks. So make a copy of the TDB and allocate */ /* the read column blocks. So make a copy of the TDB and allocate */
...@@ -355,10 +330,35 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, ...@@ -355,10 +330,35 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
} else if (tdbp && mode == MODE_INSERT) } else if (tdbp && mode == MODE_INSERT)
((PTDBASE)tdbp)->SetSetCols(tdbp->GetColumns()); ((PTDBASE)tdbp)->SetSetCols(tdbp->GetColumns());
// Now do open the physical table
if (xtrace) if (xtrace)
printf("Opening table %s in mode %d tdbp=%p\n", printf("Opening table %s in mode %d tdbp=%p\n",
tdbp->GetName(), mode, tdbp); tdbp->GetName(), mode, tdbp);
tdbp->SetMode(mode);
if (del && ((PTDBASE)tdbp)->GetFtype() != RECFM_NAF) {
// To avoid erasing the table when doing a partial delete
// make a fake Next
PDOSDEF ddp= new(g) DOSDEF;
PTDB tp= new(g) TDBDOS(ddp, NULL);
tdbp->SetNext(tp);
dup->Check &= ~CHK_DELETE;
} // endif del
if (xtrace)
printf("About to open the table: tdbp=%p\n", tdbp);
if (mode != MODE_ANY) {
if (tdbp->OpenDB(g)) {
printf("%s\n", g->Message);
return true;
} else
tdbp->SetNext(NULL);
} // endif mode
return false; return false;
} // end of CntOpenTable } // end of CntOpenTable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment