summaryrefslogtreecommitdiff
path: root/storage/connect/connect.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-03-23 23:48:10 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-03-23 23:48:10 +0100
commit8f0ae6322c40aa339f9362f59715440952c34a3e (patch)
treea53f8f8374b53c7ab7f7b78a1579887d22f8846d /storage/connect/connect.cc
parent7a7ff18cc07ff1c2addf3ae511eac73598cb84c0 (diff)
downloadmariadb-git-8f0ae6322c40aa339f9362f59715440952c34a3e.tar.gz
- Upated columns must be allocated before opening the table
modified: storage/connect/connect.cc
Diffstat (limited to 'storage/connect/connect.cc')
-rw-r--r--storage/connect/connect.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index ad5639170ac..204e242726b 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -294,31 +294,6 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
colp->AddColUse(U_P); // For PLG tables
} // 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 */
/* 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,
} else if (tdbp && mode == MODE_INSERT)
((PTDBASE)tdbp)->SetSetCols(tdbp->GetColumns());
+ // Now do open the physical table
if (xtrace)
printf("Opening table %s in mode %d tdbp=%p\n",
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;
} // end of CntOpenTable