Skip to content

Commit

Permalink
Merge remote-tracking branch 'connect/10.2' into 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Oct 28, 2021
2 parents ff3274d + 94fb9d9 commit 99c8935
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion storage/connect/colblk.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*************** Colblk H Declares Source Code File (.H) ***************/
/* Name: COLBLK.H Version 1.7 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2019 */
/* */
/* This file contains the COLBLK and derived classes declares. */
/***********************************************************************/
Expand Down
12 changes: 10 additions & 2 deletions storage/connect/mysql-test/connect/t/mongo.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
let $MONGO= C:/Applic/MongoDB/Server/3.6/bin/mongo;
let $MONGOIMPORT= C:/Applic/MongoDB/Server/3.6/bin/mongoimport;
#let $MONGO= C:/Applic/MongoDB/Server/3.6/bin/mongo;
#let $MONGOIMPORT= C:/Applic/MongoDB/Server/3.6/bin/mongoimport;
let $MONGO= mongo;
let $MONGOIMPORT= mongoimport;







9 changes: 4 additions & 5 deletions storage/connect/odbconn.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************/
/* Name: ODBCONN.CPP Version 2.3 */
/* Name: ODBCONN.CPP Version 2.4 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2017 */
/* (C) Copyright to the author Olivier BERTRAND 1998-2021 */
/* */
/* This file contains the ODBC connection classes functions. */
/***********************************************************************/
Expand Down Expand Up @@ -1509,7 +1509,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
ThrowDBX(MSG(COL_NUM_MISM));

// Now bind the column buffers
for (n = 1, colp = tocols; colp; colp = (PODBCCOL)colp->GetNext())
for (colp = tocols; colp; colp = (PODBCCOL)colp->GetNext())
if (!colp->IsSpecial()) {
buffer = colp->GetBuffer(m_RowsetSize);
len = colp->GetBuflen();
Expand All @@ -1525,12 +1525,11 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n",
n, tp, buffer, len, colp->GetStrLen());

rc = SQLBindCol(hstmt, n, tp, buffer, len, colp->GetStrLen());
rc = SQLBindCol(hstmt, colp->GetIndex(), tp, buffer, len, colp->GetStrLen());

if (!Check(rc))
ThrowDBX(rc, "SQLBindCol", hstmt);

n++;
} // endif pcol

} catch(DBX *x) {
Expand Down
21 changes: 13 additions & 8 deletions storage/connect/tabbson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
} // endswitch ReadDB

} else
jsp = bp->GetArrayValue(bdp, i);
jsp = bp->GetNext(jsp);

if (!(row = (jsp) ? bp->GetObject(jsp) : NULL))
break;
Expand Down Expand Up @@ -2185,15 +2185,19 @@ void BSONCOL::WriteColumn(PGLOBAL g)
TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp)
{
Docp = NULL;
Docrow = NULL;
Multiple = tdp->Multiple;
Docsize = 0;
Done = Changed = false;
Bp->SetPretty(2);
} // end of TDBBSON standard constructor

TDBBSON::TDBBSON(PBTDB tdbp) : TDBBSN(tdbp)
{
Docp = tdbp->Docp;
Docrow = tdbp->Docrow;
Multiple = tdbp->Multiple;
Docsize = tdbp->Docsize;
Done = tdbp->Done;
Changed = tdbp->Changed;
} // end of TDBBSON copy constructor
Expand Down Expand Up @@ -2374,6 +2378,7 @@ int TDBBSON::MakeDocument(PGLOBAL g)

} // endif jsp

Docsize = Bp->GetSize(Docp);
Done = true;
return RC_OK;
} // end of MakeDocument
Expand All @@ -2388,7 +2393,7 @@ int TDBBSON::Cardinality(PGLOBAL g)
else if (Cardinal < 0) {
if (!Multiple) {
if (MakeDocument(g) == RC_OK)
Cardinal = Bp->GetSize(Docp);
Cardinal = Docsize;

} else
return 10;
Expand Down Expand Up @@ -2417,6 +2422,7 @@ void TDBBSON::ResetSize(void)
MaxSize = Cardinal = -1;
Fpos = -1;
N = 0;
Docrow = NULL;
Done = false;
} // end of ResetSize

Expand Down Expand Up @@ -2475,6 +2481,7 @@ bool TDBBSON::SetRecpos(PGLOBAL, int recpos)
#endif // 0

Fpos = recpos - 1;
Docrow = NULL;
return false;
} // end of SetRecpos

Expand All @@ -2490,6 +2497,7 @@ bool TDBBSON::OpenDB(PGLOBAL g)
Fpos = -1;
NextSame = false;
SameRow = 0;
Docrow = NULL;
return false;
} // endif use

Expand Down Expand Up @@ -2530,12 +2538,9 @@ int TDBBSON::ReadDB(PGLOBAL)
NextSame = false;
M++;
rc = RC_OK;
} else if (++Fpos < (signed)Bp->GetSize(Docp)) {
Row = Bp->GetArrayValue(Docp, Fpos);

if (Row->Type == TYPE_JVAL)
Row = Bp->GetBson(Row);

} else if (++Fpos < Docsize) {
Docrow = (Docrow) ? Bp->GetNext(Docrow) : Bp->GetArrayValue(Docp, Fpos);
Row = (Docrow->Type == TYPE_JVAL) ? Bp->GetBson(Docrow) : Docrow;
SameRow = 0;
M = 1;
rc = RC_OK;
Expand Down
2 changes: 2 additions & 0 deletions storage/connect/tabbson.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ class DllExport TDBBSON : public TDBBSN {

// Members
PBVAL Docp; // The document array
PBVAL Docrow; // Document row
int Multiple; // 0: No 1: DIR 2: Section 3: filelist
int Docsize; // The document size
bool Done; // True when document parsing is done
bool Changed; // After Update, Insert or Delete
}; // end of class TDBBSON
Expand Down

0 comments on commit 99c8935

Please sign in to comment.