← Back to team overview

maria-developers team mailing list archive

Re: A fix for MDEV-5689 ExtractValue(xml, 'substring(/x, /y)') crashes

 

Hi Sergei,


On 03/20/2014 12:04 PM, Sergei Golubchik wrote:
Hi, Alexander!

On Mar 20, Alexander Barkov wrote:
On 03/19/2014 12:03 AM, Sergei Golubchik wrote:
On Feb 20, Alexander Barkov wrote:
please review a fix for MDEV-5689.

It also fixes
MDEV-5709 ExtractValue() with XPath variable references returns wrong
result.

+    String m_parsed_buf; // Array of MY_XML_NODEs, pointing to raw_buffer

How's that an "Array of MY_XML_NODEs", if it's just a String?
Ok. I'm confused. In some places it looks like m_parsed_buf is, indeed,
an array of MY_XML_NODEs. In other places it looks like it's a string.
How comes?

It's always a dynamic array of MY_XML_NODEs, which
just uses String as a dynamic storage.
It's never used as a  "normal" string.
There is one exception though: m_parsed_bug.charset()
is used to store character set of the entire XML value,
to make MY_XPATH aware of the character set of the XML value.

It could be stored in a structure of
"DYNAMIC_ARRAY + CHARSET_INFO" instead.
But that will need a bigger patch.

Okay. While it'd be a nice chance, I agree that it's outside of the
scope of this bug fix.

I pushed my patch to 10.0.
But the reported test case did not crash without the fix.
I guess this is because some fix was earlier merged from
MySQL to MariaDB-5.5 and then to MariaDB-10.0.

Should now a part of this MySQL fix be reverted in MariaDB-10.0?



Regards,
Sergei



Follow ups

References