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

truncation in FETCH reports a wrong row number

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • Stored routines
    • None

    Description

      SET sql_mode=default;
      DROP TABLE IF EXISTS t1;
      DROP PROCEDURE IF EXISTS p1;
       
      CREATE TABLE t1 (a INT, b VARCHAR(10));
      INSERT INTO t1 VALUES (10,'11x');
      INSERT INTO t1 VALUES (10,'12x');
       
      DELIMITER $$
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE cur1 CURSOR FOR SELECT b FROM t1;
          BEGIN
          DECLARE res int;
          OPEN cur1;
          FETCH cur1 INTO res;
          CLOSE cur1;
        END;
      END;
      $$
      DELIMITER ;
       
      CALL p1();
      SHOW WARNINGS;
      

      Returns

      +---------+------+------------------------------------------+
      | Level   | Code | Message                                  |
      +---------+------+------------------------------------------+
      | Warning | 1265 | Data truncated for column 'res' at row 3 |
      +---------+------+------------------------------------------+
      

      The row number looks wrongs.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.