MXS-1307 Ignore usage differences for functions

Also in the case of functions, we ignore differences in reported
usage context between qc_mysqlembedded and qc_sqlite.
This commit is contained in:
Johan Wikman
2017-08-10 12:54:47 +03:00
parent 878bbe4a98
commit 05bbd9676b

View File

@ -1094,6 +1094,35 @@ public:
return rv; return rv;
} }
static bool at_most_usage_differs(const std::set<QcFunctionInfo>& l,
const std::set<QcFunctionInfo>& r)
{
bool rv = false;
if (l.size() == r.size())
{
rv = true;
std::set<QcFunctionInfo>::iterator i = l.begin();
std::set<QcFunctionInfo>::iterator j = r.begin();
while (rv && (i != l.end()))
{
if (i->m_name != j->m_name)
{
rv = false;
}
else
{
++i;
++j;
}
}
}
return rv;
}
void print(ostream& out) const void print(ostream& out) const
{ {
out << m_name; out << m_name;
@ -1174,6 +1203,11 @@ bool compare_get_function_info(QUERY_CLASSIFIER* pClassifier1, GWBUF* pCopy1,
ss << f1; ss << f1;
success = true; success = true;
} }
else if (QcFunctionInfo::at_most_usage_differs(f1, f2))
{
ss << "WRN: " << f1 << " != " << f2;
success = true;
}
else else
{ {
ss << "ERR: " << f1 << " != " << f2; ss << "ERR: " << f1 << " != " << f2;