Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-42411

XMLTYPE.getNumberVal() returns 0 when a whitespace text node precedes the number

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 13.3
    • Data types
    • None

    Description

      getNumberVal() converts the first non-attribute text node, including whitespace between the XML declaration and the root, or before a child element.

      set sql_mode=oracle;
      --echo # BUG if not 7 and 5
      --delimiter $$
      DECLARE
        x XMLTYPE;
      BEGIN
        x:= '<?xml version="1.0"?>
      <a>7</a>';
        SELECT x.getNumberVal();
        x:= '<a> <b>5</b></a>';
        SELECT x.getNumberVal();
      END;
      $$
      --delimiter ;

      Result:

      x.getNumberVal()
      0
      x.getNumberVal()
      0
      Warnings:
      Warning	1292	Truncated incorrect DOUBLE value: ' '

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.