Commit 2c167929 authored by Olivier Bertrand's avatar Olivier Bertrand

Fix bug. Date value was null when retrieved from a json expanded array.

  modified:   storage/connect/tabjson.cpp

Assume timestamp is in milliseconds when it is a big integer
that is multiple of 1000.
  modified:   storage/connect/value.cpp
parent fcfcd99e
...@@ -1171,7 +1171,8 @@ void JSONCOL::SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n) ...@@ -1171,7 +1171,8 @@ void JSONCOL::SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n)
case TYPE_INTG: case TYPE_INTG:
case TYPE_BINT: case TYPE_BINT:
case TYPE_DBL: case TYPE_DBL:
vp->SetValue_pval(val->GetValue()); case TYPE_DATE:
vp->SetValue_pval(val->GetValue());
break; break;
case TYPE_BOOL: case TYPE_BOOL:
if (vp->IsTypeNum()) if (vp->IsTypeNum())
......
...@@ -2707,7 +2707,11 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype) ...@@ -2707,7 +2707,11 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
ndv = ExtractDate(valp->GetCharValue(), Pdtp, DefYear, dval); ndv = ExtractDate(valp->GetCharValue(), Pdtp, DefYear, dval);
MakeDate(NULL, dval, ndv); MakeDate(NULL, dval, ndv);
} else } else if (valp->GetType() == TYPE_BIGINT &&
!(valp->GetBigintValue() % 1000)) {
// Assuming that this timestamp is in milliseconds
Tval = valp->GetBigintValue() / 1000;
} else
Tval = valp->GetIntValue(); Tval = valp->GetIntValue();
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment