Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.5(EOL), 12.0(EOL)
-
None
Description
DELIMITER /
|
CREATE OR REPLACE PROCEDURE p1() |
BEGIN
|
DECLARE r0 ROW(a INT, b VARCHAR(10)); |
DECLARE r2 ROW(a INT, b VARCHAR(10)) DEFAULT (1,'b1'); |
SET r0=r2; |
SELECT '02' AS stage, r0=r2, (r0=r2) IS NULL; |
END; |
/
|
DELIMITER ;
|
CALL p1;
|
+-------+-------+-----------------+
|
| stage | r0=r2 | (r0=r2) IS NULL |
|
+-------+-------+-----------------+
|
| 02 | 1 | 1 |
|
+-------+-------+-----------------+
|
The above result does not look correct. It says that r0=r2 is TRUE and is NULL at the same time.
The problem goes away if I add the two lines marked with "NEW" in Field_row::sp_prepare_and_store_item:
bool Field_row::sp_prepare_and_store_item(THD *thd, Item **value) |
{
|
...
|
src->bring_value();
|
if (m_table->sp_set_all_fields_from_item(thd, src)) |
{
|
set_null(); // NEW |
DBUG_RETURN(true); |
}
|
set_notnull(); // NEW |
DBUG_RETURN(false); |
}
|
Attachments
Issue Links
- relates to
-
MDEV-12252 ROW data type for stored function return values
-
- Closed
-
-
MDEV-20034 Add support for the pre-defined weak SYS_REFCURSOR
-
- Closed
-