Menu

#4061 No error message when calling an insert stored procedure with too few parameters

Latest_Git
works-for-me
None
5
2014-11-14
2013-08-16
No

There is no error message when calling an insert stored procedure with too few parameters.

This is one of the errors discovered at DebConf.

Discussion

  • Isaac Bennetch

    Isaac Bennetch - 2013-08-16

    Also when this happens, "More" from the top menu wraps to a second line, which might cover some response.

     
  • Kasun Chathuranga

    Are you referring to the case where the stored procedure is written in such a way that it does not pass a value for a required field in the table
    or
    the user calling the stored procedure with less parameters than it requires?

    In the second case it passes empty strings for the missing parameters which I think is the expected behavior.

     
  • Madhura Jayaratne

    • assigned_to: Madhura Jayaratne
     
  • Madhura Jayaratne

    Hi Issac,

    I am unable to reproduce the bug on QA_4_2 branch.

    I created the following table where both of its column are NOT NULL and two insert procedure, one only inserts into one column and the other inserts values for both columns. In both of these cases missing parameter values are treated as empty strings which seems logical. Further another procedure which selects conditionally works well since missing parameter value is treated as empty string.

    CREATE TABLE IF NOT EXISTS t (
    a varchar(10) NOT NULL,
    b varchar(10) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

    CREATE DEFINER=root@localhost PROCEDURE insert1(IN p_a VARCHAR(10))
    MODIFIES SQL DATA
    BEGIN
    INSERT INTO t(a) VALUES (p_a);
    END

    CREATE DEFINER=root@localhost PROCEDURE insert2(IN p_a VARCHAR(10), IN p_b VARCHAR(10))
    MODIFIES SQL DATA
    BEGIN
    INSERT INTO t(a, b) VALUES (p_a, p_b);
    END

    CREATE DEFINER=root@localhost PROCEDURE select(IN p_a VARCHAR(10))
    READS SQL DATA
    BEGIN
    SELECT * FROM t WHERE a = p_a;
    END

     
  • Madhura Jayaratne

    • status: open --> works-for-me
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.