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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also when this happens, "More" from the top menu wraps to a second line, which might cover some response.
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.
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
PROCEDUREinsert1
(INp_a
VARCHAR(10))MODIFIES SQL DATA
BEGIN
INSERT INTO
t
(a
) VALUES (p_a);END
CREATE DEFINER=
root
@localhost
PROCEDUREinsert2
(INp_a
VARCHAR(10), INp_b
VARCHAR(10))MODIFIES SQL DATA
BEGIN
INSERT INTO
t
(a
,b
) VALUES (p_a, p_b);END
CREATE DEFINER=
root
@localhost
PROCEDUREselect
(INp_a
VARCHAR(10))READS SQL DATA
BEGIN
SELECT * FROM t WHERE a = p_a;
END