1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Fix crash when not specifying the collection for MongoDB

modified:   storage/connect/cmgoconn.cpp

- Fix(?) Linux compile errors
  modified:   storage/connect/tabrest.cpp
This commit is contained in:
Olivier Bertrand
2021-04-05 18:33:37 +02:00
parent caff19ada5
commit 2aefe0bee1
2 changed files with 7 additions and 1 deletions

View File

@@ -150,6 +150,12 @@ void CMgoConn::mongo_init(bool init)
/***********************************************************************/
bool CMgoConn::Connect(PGLOBAL g)
{
if (!Pcg->Db_name || !Pcg->Coll_name) {
// This would crash in mongoc_client_get_collection
strcpy(g->Message, "Missing DB or collection name");
return true;
} // endif name
if (!IsInit)
#if defined(__WIN__)
__try {