summaryrefslogtreecommitdiff
path: root/sql/item_xmlfunc.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-25 19:41:58 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-25 19:41:58 +0300
commitecc7f305dde85d704a37e584c29df0ed3f97f7be (patch)
tree31810998f5f198e105c0f1f8e5acd6c9e7a581c3 /sql/item_xmlfunc.cc
parent736ca14323fa16e409378f0da8005bce4be6dcf8 (diff)
parent5530a93f47324b847c799d00a2756729a2869d13 (diff)
downloadmariadb-git-ecc7f305dde85d704a37e584c29df0ed3f97f7be.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/item_xmlfunc.cc')
-rw-r--r--sql/item_xmlfunc.cc34
1 files changed, 23 insertions, 11 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 328d4727aa3..6017a0fa8af 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -997,11 +997,16 @@ static Item *create_comparator(MY_XPATH *xpath,
b->type() == Item::XPATH_NODESET)
{
uint len= (uint)(xpath->query.end - context->beg);
- set_if_smaller(len, 32);
- my_printf_error(ER_UNKNOWN_ERROR,
- "XPATH error: "
- "comparison of two nodesets is not supported: '%.*s'",
- MYF(0), len, context->beg);
+ if (len <= 32)
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "XPATH error: "
+ "comparison of two nodesets is not supported: '%.*s'",
+ MYF(0), len, context->beg);
+ else
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "XPATH error: "
+ "comparison of two nodesets is not supported: '%.32T'",
+ MYF(0), context->beg);
return 0; // TODO: Comparison of two nodesets
}
@@ -2653,9 +2658,12 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath)
xpath->item= NULL;
DBUG_ASSERT(xpath->query.end > dollar_pos);
uint len= (uint)(xpath->query.end - dollar_pos);
- set_if_smaller(len, 32);
- my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.*s'",
- MYF(0), len, dollar_pos);
+ if (len <= 32)
+ my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.*s'",
+ MYF(0), len, dollar_pos);
+ else
+ my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.32T'",
+ MYF(0), dollar_pos);
}
}
return xpath->item ? 1 : 0;
@@ -2786,9 +2794,13 @@ bool Item_xml_str_func::fix_fields(THD *thd, Item **ref)
if (!rc)
{
uint clen= (uint)(xpath.query.end - xpath.lasttok.beg);
- set_if_smaller(clen, 32);
- my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.*s'",
- MYF(0), clen, xpath.lasttok.beg);
+ if (clen <= 32)
+ my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.*s'",
+ MYF(0), clen, xpath.lasttok.beg);
+ else
+ my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.32T'",
+ MYF(0), xpath.lasttok.beg);
+
return true;
}