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

ALTER.. with xmltype silently overwrites row with prior rows data

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • 12.3
    • 12.3
    • XML
    • None

    Description

      In non-strict mode ALTER truncates invalid xml - and sets previous xml value

      SET sql_mode = '';
      CREATE TABLE t(id INT, s VARCHAR(100));
      INSERT INTO t VALUES (1,'<abc>aaaaaaaaaa</abc>'), (2,'a'), (3,'b'), (4,'<c/>');
      ALTER TABLE t MODIFY COLUMN s XMLTYPE;
      SELECT id, s FROM t;
      DROP TABLE t;
      

      MariaDB [test]> SELECT id, s FROM t;
      +------+-----------------------+
      | id   | s                     |
      +------+-----------------------+
      |    1 | <abc>aaaaaaaaaa</abc> |
      |    2 | <abc>aaaaaaaaaa</abc> |
      |    3 | <abc>aaaaaaaaaa</abc> |
      |    4 | <c/>                  |
      +------+-----------------------+
      4 rows in set (0,002 sec)
      

      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.