• Sergey Glukhov's avatar
    Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507 · 1d09ec62
    Sergey Glukhov authored
    Problem:
       RelativeLocationPath can appear only after a node-set expression
       in the third and the fourth branches of this rule:
         PathExpr :: =  LocationPath
                        | FilterExpr
                        | FilterExpr '/' RelativeLocationPath
                        | FilterExpr '//' RelativeLocationPath
       XPatch code didn't check the type of FilterExpr and crashed.
    Fix:
       If FilterExpr is a scalar expression
       (variable reference, literal, number, scalar function call)
       return error.
    
    
    mysql-test/r/xml.result:
      test result
    mysql-test/t/xml.test:
      test case
    sql/item_xmlfunc.cc:
      Problem:
         RelativeLocationPath can appear only after a node-set expression
         in the third and the fourth branches of this rule:
           PathExpr :: =  LocationPath
                          | FilterExpr
                          | FilterExpr '/' RelativeLocationPath
                          | FilterExpr '//' RelativeLocationPath
         XPatch code didn't check the type of FilterExpr and crashed.
      Fix:
         If FilterExpr is a scalar expression
         (variable reference, literal, number, scalar function call)
         return error.
    1d09ec62
xml.test 22.3 KB