Skip to content

Commit

Permalink
MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Barkov committed Aug 15, 2017
1 parent 6179a8e commit 22c9663
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 2 deletions.
10 changes: 10 additions & 0 deletions mysql-test/r/sp-row.result
Original file line number Diff line number Diff line change
Expand Up @@ -2246,3 +2246,13 @@ b
10
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
#
BEGIN NOT ATOMIC
DECLARE a ROW(a INT);
EXPLAIN SELECT 1 INTO a.a;
END;
$$
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
11 changes: 11 additions & 0 deletions mysql-test/suite/compat/oracle/r/sp-row.result
Original file line number Diff line number Diff line change
Expand Up @@ -3070,3 +3070,14 @@ b
10
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
#
DECLARE
a ROW(a INT);
BEGIN
EXPLAIN SELECT 1 INTO a.a;
END;
$$
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
13 changes: 13 additions & 0 deletions mysql-test/suite/compat/oracle/t/sp-row.test
Original file line number Diff line number Diff line change
Expand Up @@ -2375,3 +2375,16 @@ DELIMITER ;$$
CALL p1;
DROP PROCEDURE p1;
DROP TABLE t1;

--echo #
--echo # MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
--echo #

DELIMITER $$;
DECLARE
a ROW(a INT);
BEGIN
EXPLAIN SELECT 1 INTO a.a;
END;
$$
DELIMITER ;$$
13 changes: 13 additions & 0 deletions mysql-test/t/sp-row.test
Original file line number Diff line number Diff line change
Expand Up @@ -1471,3 +1471,16 @@ DELIMITER ;$$
CALL p1;
DROP PROCEDURE p1;
DROP TABLE t1;


--echo #
--echo # MDEV-13527 Crash when EXPLAIN SELECT .. INTO row_sp_variable.field
--echo #

DELIMITER $$;
BEGIN NOT ATOMIC
DECLARE a ROW(a INT);
EXPLAIN SELECT 1 INTO a.a;
END;
$$
DELIMITER ;$$
2 changes: 1 addition & 1 deletion sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -12155,7 +12155,7 @@ select_outvar:
}
| ident '.' ident
{
if (!($$= Lex->create_outvar(thd, &$1, &$3)))
if (!($$= Lex->create_outvar(thd, &$1, &$3)) && Lex->result)
MYSQL_YYABORT;
}
;
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_yacc_ora.yy
Original file line number Diff line number Diff line change
Expand Up @@ -12218,7 +12218,7 @@ select_outvar:
}
| ident '.' ident
{
if (!($$= Lex->create_outvar(thd, &$1, &$3)))
if (!($$= Lex->create_outvar(thd, &$1, &$3)) && Lex->result)
MYSQL_YYABORT;
}
;
Expand Down

0 comments on commit 22c9663

Please sign in to comment.