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:
@@ -518,8 +518,12 @@ bool ARRAY::FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm)
|
||||
vp = valp;
|
||||
|
||||
} else if (opc != OP_EXIST) {
|
||||
sprintf(g->Message, MSG(MISSING_ARG), opc);
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
sprintf(g->Message, MSG(MISSING_ARG), opc);
|
||||
#if defined(USE_TRY)
|
||||
throw TYPE_ARRAY;
|
||||
#else // !USE_TRY
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#endif // !USE_TRY
|
||||
} else // OP_EXIST
|
||||
return Nval > 0;
|
||||
|
||||
@@ -681,15 +685,23 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
|
||||
{
|
||||
if (Vblp == NULL) {
|
||||
strcpy(g->Message, MSG(PREC_VBLP_NULL));
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#if defined(USE_TRY)
|
||||
throw TYPE_ARRAY;
|
||||
#else // !USE_TRY
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#endif // !USE_TRY
|
||||
} // endif Vblp
|
||||
|
||||
bool was = Vblp->IsCi();
|
||||
|
||||
if (was && !p) {
|
||||
strcpy(g->Message, MSG(BAD_SET_CASE));
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
} // endif Vblp
|
||||
#if defined(USE_TRY)
|
||||
throw TYPE_ARRAY;
|
||||
#else // !USE_TRY
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#endif // !USE_TRY
|
||||
} // endif Vblp
|
||||
|
||||
if (was || !p)
|
||||
return;
|
||||
@@ -699,7 +711,11 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
|
||||
if (!was && Type == TYPE_STRING)
|
||||
// Must be resorted to eliminate duplicate strings
|
||||
if (Sort(g))
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#if defined(USE_TRY)
|
||||
throw TYPE_ARRAY;
|
||||
#else // !USE_TRY
|
||||
longjmp(g->jumper[g->jump_level], TYPE_ARRAY);
|
||||
#endif // !USE_TRY
|
||||
|
||||
} // end of SetPrecision
|
||||
|
||||
|
Reference in New Issue
Block a user