Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4593

p_s: crash in simplify_joins with delete using subselect from view

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2, 5.5.31, 5.3.12
    • Fix Version/s: 10.0.4, 5.5.32, 5.3.13
    • Component/s: None
    • Labels:
      None
    • Environment:
      Win X64, Linux

      Description

      mysqld.exe!simplify_joins()[sql_select.cc:12827]
      mysqld.exe!JOIN::optimize()[sql_select.cc:1054]
      mysqld.exe!st_select_lex::optimize_unflattened_subqueries()[sql_lex.cc:3476]
      mysqld.exe!mysql_delete()[sql_delete.cc:123]
      mysqld.exe!mysql_execute_command()[sql_parse.cc:3067]
      mysqld.exe!Prepared_statement::execute()[sql_prepare.cc:3905]
      mysqld.exe!Prepared_statement::execute_loop()[sql_prepare.cc:3564]
      mysqld.exe!mysql_sql_stmt_execute()[sql_prepare.cc:2732]
      mysqld.exe!mysql_execute_command()[sql_parse.cc:2207]
      mysqld.exe!mysql_parse()[sql_parse.cc:5765]
      mysqld.exe!dispatch_command()[sql_parse.cc:1071]
      mysqld.exe!do_command()[sql_parse.cc:794]
      mysqld.exe!threadpool_process_request()[threadpool_common.cc:224]
      mysqld.exe!io_completion_callback()[threadpool_win.cc:568]
      
      drop table if exists `t1`,`t2`,`v1`;
      create table `t1`(`a` int)engine=innodb;
      create table `t2`(`a` int)engine=innodb;
      create or replace view `v1` as select `a` from `t1`;
      prepare s from "delete  from `t2` order by (select 1 from `v1`)";
      execute s;
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            sanja Oleksandr Byelkin added a comment -

            the problem is that derived->merged is not set for v1...

            Show
            sanja Oleksandr Byelkin added a comment - the problem is that derived->merged is not set for v1...
            Hide
            sanja Oleksandr Byelkin added a comment -

            merge for insert should be called only for one table (where we delete/insert)

            Show
            sanja Oleksandr Byelkin added a comment - merge for insert should be called only for one table (where we delete/insert)
            Hide
            sanja Oleksandr Byelkin added a comment -

            "merge for insert" put view table in place, then re-initialization before execution removes it, and normal merge does not touch it because the table marked as "merged for insert" and is not part of multi-update or multi-delete.

            IMHO "merge for insert" should be applicable only for tables which top view belongs to "main" SELECT_LEX

            Show
            sanja Oleksandr Byelkin added a comment - "merge for insert" put view table in place, then re-initialization before execution removes it, and normal merge does not touch it because the table marked as "merged for insert" and is not part of multi-update or multi-delete. IMHO "merge for insert" should be applicable only for tables which top view belongs to "main" SELECT_LEX
            Hide
            sanja Oleksandr Byelkin added a comment -

            pushed to 5.3

            Show
            sanja Oleksandr Byelkin added a comment - pushed to 5.3

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                sbester1 sbester1
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: