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

truncation in FETCH reports a wrong row number

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4
    • Fix Version/s: 10.2, 10.3, 10.4
    • Component/s: Stored routines
    • Labels:
      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

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration