Hello,
On 02/20/2011 08:14 PM, Olav Sandstaa wrote:
> Hi Jørgen,
>
> Thanks for fixing this bug and for a very well commented commit message.
> The solution looks correct. I have only two minor comments. Feel free to
> ignore them if you do not agree.
I agree with both Olav's comments.
Further, I wonder if we just can't do an early exit when
context->select_lex->first_natural_join_processing is false.
> === modified file 'mysql-test/t/sp.test'
> --- a/mysql-test/t/sp.test 2010-07-30 15:28:36 +0000
> +++ b/mysql-test/t/sp.test 2011-02-18 14:57:48 +0000
> @@ -8376,6 +8376,30 @@ SET @@GLOBAL.init_connect= @old_init_con
> DROP PROCEDURE p2;
> DROP PROCEDURE p5;
>
> +--echo #
> +--echo # BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE ||
TABLE_REF->VIEW)
> +--echo # FAILS IN SET_FIELD_ITERATOR
> +--echo #
> +
> +CREATE TABLE t1 (i INT, a INT);
> +CREATE TABLE t2 (j INT, a INT);
> +INSERT INTO t1 VALUES (1,1), (2,2);
> +INSERT INTO t2 VALUES (2,2), (3,3);
> +CREATE VIEW v1 AS SELECT a FROM t2;
> +CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1;
> +ALTER TABLE t2 CHANGE COLUMN a b CHAR;
> +
> +--echo
> +--error ER_VIEW_INVALID
> +CALL proc();
> +--error ER_VIEW_INVALID
> +CALL proc();
> +
> +--echo
> +DROP TABLE t1,t2;
> +DROP VIEW v1;
> +DROP PROCEDURE proc;
It's possible to simplify the test case slightly by removing the INSERTs
and just having the 'a' columns in t1/t2.
Ok to push, but consider the comments above.
--- Jon Olav