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:
@@ -1587,6 +1587,16 @@ void JVALUE::SetValue(PGLOBAL g, PVAL valp)
|
||||
Val->Type = TYPE_NULL;
|
||||
} else switch (valp->GetType()) {
|
||||
case TYPE_STRING:
|
||||
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;
|
||||
|
@@ -160,7 +160,7 @@ enum RECFM {RECFM_DFLT = 0, /* Default table type */
|
||||
RECFM_FMT = 8, /* FMT formatted file */
|
||||
RECFM_VCT = 9, /* VCT formatted files */
|
||||
RECFM_XML = 10, /* XML formatted files */
|
||||
RECFM_JASON = 11, /* JASON formatted files */
|
||||
RECFM_JSON = 11, /* JSON formatted files */
|
||||
RECFM_DIR = 12, /* DIR table */
|
||||
RECFM_ODBC = 13, /* Table accessed via ODBC */
|
||||
RECFM_JDBC = 14, /* Table accessed via JDBC */
|
||||
|
@@ -418,6 +418,7 @@ class DllExport DTVAL : public TYPVAL<int> {
|
||||
virtual bool SetValue_char(const char *p, int n);
|
||||
virtual void SetValue_psz(PCSZ s);
|
||||
virtual void SetValue_pvblk(PVBLK blk, int n);
|
||||
virtual PSZ GetCharValue(void) { return Sdate; }
|
||||
virtual char *GetCharString(char *p);
|
||||
virtual int ShowValue(char *buf, int len);
|
||||
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||
|
Reference in New Issue
Block a user