List:Commits« Previous MessageNext Message »
From:Dmitry Lenev Date:September 23 2010 5:24pm
Subject:Re: bzr commit into mysql-5.5-runtime branch (jon.hauglid:3141)
Bug#54920
View as plain text  
Hello Jon Olav!

* Jon Olav Hauglid <jon.hauglid@stripped> [10/09/21 15:44]:
> #At file:///export/home/x/mysql-5.5-runtime-bug54920/ based on
> revid:jon.hauglid@stripped
> 
>  3141 Jon Olav Hauglid	2010-09-21
>       Bug #54920 Stored functions are allowed in HANDLER statements,
>                  but broken.
>       
>       Before this patch, it was allowed to use stored functions in
>       HANDLER ... READ statements. The problem was that this functionality
>       was not really supported by the code. Proper locking would for example
>       not be performed, and it was also possible to break replication by
>       having stored functions that performed updates.
>       
>       This patch disallows the use of stored functions in HANDLER ... READ.
>       Any such statement will now give a syntax error. This is an incompatible
>       change and should be reflected in the documentation.
>       
>       Test case added to handler_myisam/handler_innodb.test.

...

> === modified file 'mysql-test/r/handler_innodb.result'
> --- a/mysql-test/r/handler_innodb.result	2010-07-05 11:59:34 +0000
> +++ b/mysql-test/r/handler_innodb.result	2010-09-21 11:33:55 +0000

...

> +HANDLER t1 READ FIRST WHERE f1() = 1;
> +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds
> to your MySQL server version for the right syntax to use near '' at line 1
>  

...

> === modified file 'sql/sql_yacc.yy'
> --- a/sql/sql_yacc.yy	2010-09-09 14:29:14 +0000
> +++ b/sql/sql_yacc.yy	2010-09-21 11:33:55 +0000
> @@ -13245,6 +13245,12 @@ handler:
>            handler_read_or_scan where_clause opt_limit_clause
>            {
>              Lex->expr_allows_subselect= TRUE;
> +            /* Stored functions are not supported for HANDLER READ. */
> +            if (Lex->uses_stored_routines())
> +            {
> +              my_parse_error(ER(ER_SYNTAX_ERROR));
> +              MYSQL_YYABORT;
> +            }

I wonder if instead it makes sense to use ER_NOT_SUPPORTED_YET error
with a bit more elaborate explanation here. What do you think?

I think your patch is OK to push after considering the above suggestion.

-- 
Dmitry Lenev, Software Developer
Oracle Development SPB/MySQL, www.mysql.com

Are you MySQL certified?  http://www.mysql.com/certification
Thread
bzr commit into mysql-5.5-runtime branch (jon.hauglid:3141) Bug#54920Jon Olav Hauglid21 Sep
  • Re: bzr commit into mysql-5.5-runtime branch (jon.hauglid:3141)Bug#54920Dmitry Lenev23 Sep