← Back to team overview

maria-developers team mailing list archive

Re: Please review MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from create_select, select_paren_derived, select_derived2, query_specification

 

Hi Sergei,


On 05/08/2016 12:39 PM, Sergei Golubchik wrote:
Hi, Alexander!

On May 06, Alexander Barkov wrote:
On May 05, Alexander Barkov wrote:
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a6bbfc8..0d8bfb3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -988,6 +988,7 @@ JOIN::prepare(TABLE_LIST *tables_init,
       }
       if (thd->lex->derived_tables)
       {
+      // SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE()

What does that mean? An example of a query that is not covered by your
current refactoring and still needs this check?

Yes. I added this comment:
...
By the way, fixing this particular restriction grammatically might
need huge refactoring in table_ref and friends.
We'll see later, if it's really feasible.

Hmm, if I'm not mistaken, this if() was removed in branch.
Does it mean I have done this huge refactoring, or I've removed it
incorrectly and introduced a bug?


It was not removed.

It's still there, to distinguish invalid:

  SELECT 1 FROM ((((SELECT 1)))) AS t1 PROCEDURE ANALYSE();

from valid:

  SELECT 1 FROM ((((SELECT 1)))) AS t1;
  SELECT 1 FROM (((t1))) PROCEDURE ANALYSE();

with any nested parentheses level.




Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx



References