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

Fix MDEV-12142 crash when creating CSV table

Was an unprepared longjmp (now throw)
Also fix a wrong calculation of To_Line sometimes causing a crash
because of buffer overflow.
  modified:   storage/connect/tabdos.cpp

Fix a wrong setting of USER for JDBC tables in connect_assisted_discovery.
Update jdbc_new.test after that fix, which changed errors.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/jdbc_new.result
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test

Make using try/catch/throw the default option
  modified:   storage/connect/CMakeLists.txt

Typo
  modified:   storage/connect/xindex.cpp

Replace setjmp-longjmp's by try_catch-throw
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/global.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/osutil.c
  modified:   storage/connect/plgdbutl.cpp
  deleted:    storage/connect/plugutil.c
  added:      storage/connect/plugutil.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xobject.cpp
This commit is contained in:
Olivier Bertrand
2017-03-06 17:23:56 +01:00
parent b2956b2ab4
commit 92d283c026
38 changed files with 1638 additions and 1476 deletions

View File

@@ -1,7 +1,7 @@
/************ Odbconn C++ Functions Source Code File (.CPP) ************/
/* Name: ODBCONN.CPP Version 2.2 */
/***********************************************************************/
/* Name: ODBCONN.CPP Version 2.3 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2016 */
/* (C) Copyright to the author Olivier BERTRAND 1998-2017 */
/* */
/* This file contains the ODBC connection classes functions. */
/***********************************************************************/
@@ -249,17 +249,21 @@ static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *db,
assert(qrp);
#endif
// Save stack and allocation environment and prepare error return
if (g->jump_level == MAX_JUMP) {
strcpy(g->Message, MSG(TOO_MANY_JUMPS));
return NULL;
} // endif jump_level
#if defined(USE_TRY)
try {
#else // !USE_TRY
// Save stack and allocation environment and prepare error return
if (g->jump_level == MAX_JUMP) {
strcpy(g->Message, MSG(TOO_MANY_JUMPS));
return NULL;
} // endif jump_level
if (setjmp(g->jumper[++g->jump_level]) != 0) {
printf("%s\n", g->Message);
cap = NULL;
goto fin;
} // endif rc
if (setjmp(g->jumper[++g->jump_level]) != 0) {
printf("%s\n", g->Message);
cap = NULL;
goto fin;
} // endif rc
#endif // !USE_TRY
m = (size_t)qrp->Maxres;
n = (size_t)qrp->Nbcol;
@@ -276,9 +280,20 @@ static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *db,
cap->Status = (UWORD *)PlugSubAlloc(g, NULL, m * sizeof(UWORD));
#if defined(USE_TRY)
} catch (int n) {
htrc("Exeption %d: %s\n", n, g->Message);
cap = NULL;
} catch (const char *msg) {
htrc(g->Message, msg);
printf("%s\n", g->Message);
cap = NULL;
} // end catch
#else // !USE_TRY
fin:
g->jump_level--;
return cap;
g->jump_level--;
#endif // !USE_TRY
return cap;
} // end of AllocCatInfo
#if 0