Skip to content

Commit 613680a

Browse files
committed
- Fix MDEV-10111 Reconize unsigned integers when creating tables via srcdef
modified: storage/connect/ha_connect.cc modified: storage/connect/myconn.cpp - Fix MDEV-10136 crash on SELECT jsonget_string(NULL, 'a') modified: storage/connect/jsonudf.cpp - Assert longjmp initialized when suballocating modified: storage/connect/plugutil.c - Avoid crash in MakeRecord when table->vcol_set isnull (trace > 1) modified: storage/connect/ha_connect.cc
1 parent ead4147 commit 613680a

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

storage/connect/ha_connect.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ int ha_connect::MakeRecord(char *buf)
19611961
if (trace > 1)
19621962
htrc("Maps: read=%08X write=%08X vcol=%08X defr=%08X defw=%08X\n",
19631963
*table->read_set->bitmap, *table->write_set->bitmap,
1964-
*table->vcol_set->bitmap,
1964+
(table->vcol_set) ? *table->vcol_set->bitmap : 0,
19651965
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
19661966

19671967
// Avoid asserts in field::store() for columns that are not updated
@@ -5619,7 +5619,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
56195619
len= crp->Length;
56205620
dec= crp->Prec;
56215621
flg= crp->Flag;
5622-
v= crp->Var;
5622+
v= (crp->Kdata->IsUnsigned()) ? 'U' : crp->Var;
56235623
tm= (crp->Kdata->IsNullable()) ? 0 : NOT_NULL_FLAG;
56245624

56255625
if (!len && typ == TYPE_STRING)

storage/connect/jsonudf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
14331433
char *p = args->args[0];
14341434

14351435
// Is this a file name?
1436-
if (!strchr("[{ \t\r\n", *p) && (len = GetFileLength(p)))
1436+
if (p && !strchr("[{ \t\r\n", *p) && (len = GetFileLength(p)))
14371437
ml += len * (M + 1);
14381438
else
14391439
ml += args->lengths[0] * M;

storage/connect/myconn.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,12 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
901901
if (fld->flags & NOT_NULL_FLAG)
902902
crp->Nulls = NULL;
903903
else {
904-
crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows);
905-
memset(crp->Nulls, ' ', m_Rows);
904+
if (m_Rows) {
905+
crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows);
906+
memset(crp->Nulls, ' ', m_Rows);
907+
} // endif m_Rows
908+
909+
crp->Kdata->SetNullable(true);
906910
} // endelse fld->flags
907911

908912
} // endfor fld

storage/connect/plugutil.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
516516
if (trace)
517517
htrc("PlugSubAlloc: %s\n", g->Message);
518518

519-
longjmp(g->jumper[g->jump_level], 1);
519+
/* Nothing we can do if longjmp is not initialized. */
520+
assert(g->jump_level >= 0);
521+
longjmp(g->jumper[g->jump_level], 1);
520522
} /* endif size OS32 code */
521523

522524
/*********************************************************************/

0 commit comments

Comments
 (0)