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

Update Returning Into expected to produce warning/error for zero-row plan

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • N/A
    • Server
    • None
    • Q1/2027 Server Maintenance

    Description

      CREATE TABLE t1 (a INT);
      UPDATE t1 SET a=a+1 WHERE 1=0 RETURNING a INTO @a;
       
      INSERT INTO t1 VALUES (1),(2);
       
      --error ER_SP_FETCH_NO_DATA
      UPDATE t1 SET a=a+1 WHERE a=123 RETURNING a INTO @a;
       
      UPDATE t1 SET a=a+1 WHERE 1=0 RETURNING a INTO @a;
      UPDATE t1 SET a=a+1 limit 0 RETURNING a INTO @a;
       
      DROP TABLE t1;
      

      CREATE TABLE t1 (a INT);
      UPDATE t1 SET a=a+1 WHERE 1=0 RETURNING a INTO @a;
      INSERT INTO t1 VALUES (1),(2);
      UPDATE t1 SET a=a+1 WHERE a=123 RETURNING a INTO @a;
      ERROR 02000: No data - zero rows fetched, selected, or processed
      UPDATE t1 SET a=a+1 WHERE 1=0 RETURNING a INTO @a;
      UPDATE t1 SET a=a+1 limit 0 RETURNING a INTO @a;
      DROP TABLE t1;
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h 58m
                  4h 58m
                  Remaining:
                  Remaining Estimate - 4h 58m
                  4h 58m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

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