Commit facd9d52 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch '10.5' into 10.6

parents dbd6c6dc 1974df01
Subproject commit add4a68465bcdad238bcf3e5f2771d8da05e6285 Subproject commit 723ed009ae5dc68acc14cd7664f93503d64cd51d
...@@ -39,7 +39,7 @@ class JOIN; ...@@ -39,7 +39,7 @@ class JOIN;
its base class. its base class.
*/ */
class Server_side_cursor: protected Query_arena, public Sql_alloc class Server_side_cursor: protected Query_arena
{ {
protected: protected:
/** Row destination used for fetch */ /** Row destination used for fetch */
...@@ -61,6 +61,8 @@ class Server_side_cursor: protected Query_arena, public Sql_alloc ...@@ -61,6 +61,8 @@ class Server_side_cursor: protected Query_arena, public Sql_alloc
} }
virtual ~Server_side_cursor(); virtual ~Server_side_cursor();
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return alloc_root(mem_root, size); }
static void operator delete(void *ptr, size_t size); static void operator delete(void *ptr, size_t size);
static void operator delete(void *, MEM_ROOT *){} static void operator delete(void *, MEM_ROOT *){}
}; };
......
...@@ -115,7 +115,7 @@ class Ed_row; ...@@ -115,7 +115,7 @@ class Ed_row;
automatic type conversion. automatic type conversion.
*/ */
class Ed_result_set: public Sql_alloc class Ed_result_set
{ {
public: public:
operator List<Ed_row>&() { return *m_rows; } operator List<Ed_row>&() { return *m_rows; }
...@@ -129,6 +129,8 @@ class Ed_result_set: public Sql_alloc ...@@ -129,6 +129,8 @@ class Ed_result_set: public Sql_alloc
size_t get_field_count() const { return m_column_count; } size_t get_field_count() const { return m_column_count; }
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return alloc_root(mem_root, size); }
static void operator delete(void *ptr, size_t size) throw (); static void operator delete(void *ptr, size_t size) throw ();
static void operator delete(void *, MEM_ROOT *){} static void operator delete(void *, MEM_ROOT *){}
private: private:
......
...@@ -1746,9 +1746,9 @@ static void print_pool_blocked_message(bool max_threads_reached) ...@@ -1746,9 +1746,9 @@ static void print_pool_blocked_message(bool max_threads_reached)
if (now > pool_block_start + BLOCK_MSG_DELAY && !msg_written) if (now > pool_block_start + BLOCK_MSG_DELAY && !msg_written)
{ {
if (max_threads_reached) if (max_threads_reached)
sql_print_error(MAX_THREADS_REACHED_MSG); sql_print_warning(MAX_THREADS_REACHED_MSG);
else else
sql_print_error(CREATE_THREAD_ERROR_MSG, my_errno); sql_print_warning(CREATE_THREAD_ERROR_MSG, my_errno);
sql_print_information("Threadpool has been blocked for %u seconds\n", sql_print_information("Threadpool has been blocked for %u seconds\n",
(uint)((now- pool_block_start)/1000000)); (uint)((now- pool_block_start)/1000000));
......
/*************** Colblk H Declares Source Code File (.H) ***************/ /*************** Colblk H Declares Source Code File (.H) ***************/
/* Name: COLBLK.H Version 1.7 */ /* 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. */ /* This file contains the COLBLK and derived classes declares. */
/***********************************************************************/ /***********************************************************************/
......
let $MONGO= C:/Applic/MongoDB/Server/3.6/bin/mongo; #let $MONGO= C:/Applic/MongoDB/Server/3.6/bin/mongo;
let $MONGOIMPORT= C:/Applic/MongoDB/Server/3.6/bin/mongoimport; #let $MONGOIMPORT= C:/Applic/MongoDB/Server/3.6/bin/mongoimport;
let $MONGO= mongo;
let $MONGOIMPORT= mongoimport;
/***********************************************************************/ /***********************************************************************/
/* 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. */ /* This file contains the ODBC connection classes functions. */
/***********************************************************************/ /***********************************************************************/
...@@ -1509,7 +1509,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) ...@@ -1509,7 +1509,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
ThrowDBX(MSG(COL_NUM_MISM)); ThrowDBX(MSG(COL_NUM_MISM));
// Now bind the column buffers // 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()) { if (!colp->IsSpecial()) {
buffer = colp->GetBuffer(m_RowsetSize); buffer = colp->GetBuffer(m_RowsetSize);
len = colp->GetBuflen(); len = colp->GetBuflen();
...@@ -1525,12 +1525,11 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) ...@@ -1525,12 +1525,11 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n", htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n",
n, tp, buffer, len, colp->GetStrLen()); 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)) if (!Check(rc))
ThrowDBX(rc, "SQLBindCol", hstmt); ThrowDBX(rc, "SQLBindCol", hstmt);
n++;
} // endif pcol } // endif pcol
} catch(DBX *x) { } catch(DBX *x) {
......
...@@ -376,7 +376,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) ...@@ -376,7 +376,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
} // endswitch ReadDB } // endswitch ReadDB
} else } else
jsp = bp->GetArrayValue(bdp, i); jsp = bp->GetNext(jsp);
if (!(row = (jsp) ? bp->GetObject(jsp) : NULL)) if (!(row = (jsp) ? bp->GetObject(jsp) : NULL))
break; break;
...@@ -2187,7 +2187,9 @@ void BSONCOL::WriteColumn(PGLOBAL g) ...@@ -2187,7 +2187,9 @@ void BSONCOL::WriteColumn(PGLOBAL g)
TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp) TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp)
{ {
Docp = NULL; Docp = NULL;
Docrow = NULL;
Multiple = tdp->Multiple; Multiple = tdp->Multiple;
Docsize = 0;
Done = Changed = false; Done = Changed = false;
Bp->SetPretty(2); Bp->SetPretty(2);
} // end of TDBBSON standard constructor } // end of TDBBSON standard constructor
...@@ -2195,7 +2197,9 @@ TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp) ...@@ -2195,7 +2197,9 @@ TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp)
TDBBSON::TDBBSON(PBTDB tdbp) : TDBBSN(tdbp) TDBBSON::TDBBSON(PBTDB tdbp) : TDBBSN(tdbp)
{ {
Docp = tdbp->Docp; Docp = tdbp->Docp;
Docrow = tdbp->Docrow;
Multiple = tdbp->Multiple; Multiple = tdbp->Multiple;
Docsize = tdbp->Docsize;
Done = tdbp->Done; Done = tdbp->Done;
Changed = tdbp->Changed; Changed = tdbp->Changed;
} // end of TDBBSON copy constructor } // end of TDBBSON copy constructor
...@@ -2376,6 +2380,7 @@ int TDBBSON::MakeDocument(PGLOBAL g) ...@@ -2376,6 +2380,7 @@ int TDBBSON::MakeDocument(PGLOBAL g)
} // endif jsp } // endif jsp
Docsize = Bp->GetSize(Docp);
Done = true; Done = true;
return RC_OK; return RC_OK;
} // end of MakeDocument } // end of MakeDocument
...@@ -2390,7 +2395,7 @@ int TDBBSON::Cardinality(PGLOBAL g) ...@@ -2390,7 +2395,7 @@ int TDBBSON::Cardinality(PGLOBAL g)
else if (Cardinal < 0) { else if (Cardinal < 0) {
if (!Multiple) { if (!Multiple) {
if (MakeDocument(g) == RC_OK) if (MakeDocument(g) == RC_OK)
Cardinal = Bp->GetSize(Docp); Cardinal = Docsize;
} else } else
return 10; return 10;
...@@ -2419,6 +2424,7 @@ void TDBBSON::ResetSize(void) ...@@ -2419,6 +2424,7 @@ void TDBBSON::ResetSize(void)
MaxSize = Cardinal = -1; MaxSize = Cardinal = -1;
Fpos = -1; Fpos = -1;
N = 0; N = 0;
Docrow = NULL;
Done = false; Done = false;
} // end of ResetSize } // end of ResetSize
...@@ -2477,6 +2483,7 @@ bool TDBBSON::SetRecpos(PGLOBAL, int recpos) ...@@ -2477,6 +2483,7 @@ bool TDBBSON::SetRecpos(PGLOBAL, int recpos)
#endif // 0 #endif // 0
Fpos = recpos - 1; Fpos = recpos - 1;
Docrow = NULL;
return false; return false;
} // end of SetRecpos } // end of SetRecpos
...@@ -2492,6 +2499,7 @@ bool TDBBSON::OpenDB(PGLOBAL g) ...@@ -2492,6 +2499,7 @@ bool TDBBSON::OpenDB(PGLOBAL g)
Fpos = -1; Fpos = -1;
NextSame = false; NextSame = false;
SameRow = 0; SameRow = 0;
Docrow = NULL;
return false; return false;
} // endif use } // endif use
...@@ -2532,12 +2540,9 @@ int TDBBSON::ReadDB(PGLOBAL) ...@@ -2532,12 +2540,9 @@ int TDBBSON::ReadDB(PGLOBAL)
NextSame = false; NextSame = false;
M++; M++;
rc = RC_OK; rc = RC_OK;
} else if (++Fpos < (signed)Bp->GetSize(Docp)) { } else if (++Fpos < Docsize) {
Row = Bp->GetArrayValue(Docp, Fpos); Docrow = (Docrow) ? Bp->GetNext(Docrow) : Bp->GetArrayValue(Docp, Fpos);
Row = (Docrow->Type == TYPE_JVAL) ? Bp->GetBson(Docrow) : Docrow;
if (Row->Type == TYPE_JVAL)
Row = Bp->GetBson(Row);
SameRow = 0; SameRow = 0;
M = 1; M = 1;
rc = RC_OK; rc = RC_OK;
......
...@@ -318,7 +318,9 @@ class DllExport TDBBSON : public TDBBSN { ...@@ -318,7 +318,9 @@ class DllExport TDBBSON : public TDBBSN {
// Members // Members
PBVAL Docp; // The document array PBVAL Docp; // The document array
PBVAL Docrow; // Document row
int Multiple; // 0: No 1: DIR 2: Section 3: filelist int Multiple; // 0: No 1: DIR 2: Section 3: filelist
int Docsize; // The document size
bool Done; // True when document parsing is done bool Done; // True when document parsing is done
bool Changed; // After Update, Insert or Delete bool Changed; // After Update, Insert or Delete
}; // end of class TDBBSON }; // end of class TDBBSON
......
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