Commit 8721d20f authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix MDEV-7879 by adding a test in all SetValue_pval function to return when valp == this.

- Fix MDEV-7840 by making proper datetime constant in ha_connect::CheckCond on a second place.
parent daa8b6b5
......@@ -2714,7 +2714,12 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, AMT tty, Item *cond)
case MYSQL_TYPE_DATETIME:
if (tty == TYPE_AM_ODBC) {
strcat(body, "{ts '");
strcat(strncat(body, res->ptr(), res->length()), "'}");
strncat(body, res->ptr(), res->length());
if (res->length() < 19)
strcat(body, "1970-01-01 00:00:00" + res->length());
strcat(body, "'}");
break;
} // endif ODBC
......
......@@ -627,6 +627,7 @@ int TYPVAL<double>::GetValLen(void)
template <class TYPE>
bool TYPVAL<TYPE>::SetValue_pval(PVAL valp, bool chktype)
{
if (valp != this) {
if (chktype && Type != valp->GetType())
return true;
......@@ -635,6 +636,8 @@ bool TYPVAL<TYPE>::SetValue_pval(PVAL valp, bool chktype)
else
Reset();
} // endif valp
return false;
} // end of SetValue
......@@ -1319,6 +1322,7 @@ ulonglong TYPVAL<PSZ>::GetUBigintValue(void)
/***********************************************************************/
bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
{
if (valp != this) {
if (chktype && (valp->GetType() != Type || valp->GetSize() > Len))
return true;
......@@ -1329,6 +1333,8 @@ bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
else
Reset();
} // endif valp
return false;
} // end of SetValue_pval
......@@ -2063,11 +2069,12 @@ double BINVAL::GetFloatValue(void)
/***********************************************************************/
bool BINVAL::SetValue_pval(PVAL valp, bool chktype)
{
bool rc = false;
if (valp != this) {
if (chktype && (valp->GetType() != Type || valp->GetSize() > Clen))
return true;
bool rc = false;
if (!(Null = valp->IsNull() && Nullable)) {
if ((rc = (Len = valp->GetSize()) > Clen))
Len = Clen;
......@@ -2076,6 +2083,8 @@ bool BINVAL::SetValue_pval(PVAL valp, bool chktype)
} else
Reset();
} // endif valp
return rc;
} // end of SetValue_pval
......@@ -2629,6 +2638,7 @@ bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval)
/***********************************************************************/
bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
{
if (valp != this) {
if (chktype && Type != valp->GetType())
return true;
......@@ -2645,6 +2655,8 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
} else
Reset();
} // endif valp
return false;
} // end of SetValue
......
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