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

- Make function strz return null when LEX_STRING is null

modified:   storage/connect/ha_connect.cc

- Use NOTE instead of WARNING in connect_assisted_discovery
  This because MariaDB raise an error when doing so
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabrest.cpp

- Make MONGO tables recognize STRINGIFY and JsonAllPath
  modified:   storage/connect/mongo.cpp
  modified:   storage/connect/mongo.h
  modified:   storage/connect/tabcmg.h
  modified:   storage/connect/tabjmg.cpp
  modified:   storage/connect/tabcmg.cpp
  modified:   storage/connect/tabjmg.h

- Fix OBJECT option for Pretty != 2 JSN and BSON tables
  Accept all syntaxes  for the OBJECT option
  modified:   storage/connect/tabbson.cpp
  modified:   storage/connect/tabjson.cpp

- Use my_snprintf in function xcurl (by vuvova)
  modified:   storage/connect/tabrest.cpp

- Format dates entered as integer when formatted
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
This commit is contained in:
Olivier Bertrand
2021-06-24 00:46:12 +02:00
parent 5f64276fb2
commit ed70f76cf7
12 changed files with 201 additions and 85 deletions

View File

@@ -2643,9 +2643,9 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
} else if (valp->GetType() == TYPE_BIGINT &&
!(valp->GetBigintValue() % 1000)) {
// Assuming that this timestamp is in milliseconds
Tval = (int)(valp->GetBigintValue() / 1000);
SetValue((int)(valp->GetBigintValue() / 1000));
} else
Tval = valp->GetIntValue();
SetValue(valp->GetIntValue());
} else
Reset();
@@ -2736,21 +2736,39 @@ void DTVAL::SetValue_pvblk(PVBLK blk, int n)
} // end of SetValue
/***********************************************************************/
/* DTVAL SetValue: get date as an integer. */
/***********************************************************************/
void DTVAL::SetValue(int n)
{
Tval = n;
if (Pdtp) {
size_t n = 0, slen = (size_t)Len + 1;
struct tm tm, *ptm= GetGmTime(&tm);
if (ptm)
n = strftime(Sdate, slen, Pdtp->OutFmt, ptm);
} // endif Pdtp
} // end of SetValue
/***********************************************************************/
/* DTVAL GetCharString: get string representation of a date value. */
/***********************************************************************/
char *DTVAL::GetCharString(char *p)
{
if (Pdtp) {
size_t n = 0;
size_t n = 0, slen = (size_t)Len + 1;
struct tm tm, *ptm= GetGmTime(&tm);
if (ptm)
n = strftime(Sdate, Len + 1, Pdtp->OutFmt, ptm);
n = strftime(Sdate, slen, Pdtp->OutFmt, ptm);
if (!n) {
*Sdate = '\0';
strncat(Sdate, "Error", Len + 1);
strncat(Sdate, "Error", slen);
} // endif n
return Sdate;