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

Fix crash on Json date columns

This commit is contained in:
Olivier Bertrand
2020-11-04 15:46:02 +01:00
parent 49428c8fa6
commit 6a94ad98fb
3 changed files with 14 additions and 3 deletions

View File

@@ -1587,7 +1587,17 @@ void JVALUE::SetValue(PGLOBAL g, PVAL valp)
Val->Type = TYPE_NULL;
} else switch (valp->GetType()) {
case TYPE_STRING:
case TYPE_DATE:
if (((DTVAL*)valp)->IsFormatted())
Val->Strp = valp->GetCharValue();
else {
char buf[32];
Val->Strp = PlugDup(g, valp->GetCharString(buf));
} // endif Formatted
Val->Type = TYPE_DTM;
break;
case TYPE_DATE:
Val->Strp = valp->GetCharValue();
Val->Type = TYPE_STRG;
break;