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

main.multi_update fails with --ps-protocol

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 5.5.43
    • Component/s: Optimizer, Tests
    • Labels:

      Description

      CURRENT_TEST: main.multi_update
      mysqltest: At line 1048: query 'UPDATE t1 t1  left join v3 t2 on t1.f4 = t2.fe2    SET t1.f20 = t2.ft6_1,    t1.f32 = t2.f32,    t1.f33 = t2.f33,    t1.f37 = t2.f37    WHERE f5 >= '2015-02-01'' failed: 1030: Got error 1 from storage engine
      

      See also buildbot, e.g. http://buildbot.askmonty.org/buildbot/builders/bld-dan-debug/builds/2062/steps/test_1/logs/stdio

      The test started failing from the following commit on 5.5 tree:

      commit b9a75862eaa05708921b8fe9773ffe233048bebc
      Author: Oleksandr Byelkin <sanja@mariadb.com>
      Date:   Thu Mar 5 16:34:13 2015 +0100
      
          MDEV-7613: MariaDB 5.5.40 server crash on update table left join with a view
          
          Multi-update do not need full list of leaf tables. It also do not use it on prepare (mysql_multi_update_prepare()).
      

      Although the failing portion of the test is new, the same updated test passes on the code before the change, so it looks like a code problem.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              Temporary table tov looks like have empty (but initialized) ha_memory (not opened?)

              Show
              sanja Oleksandr Byelkin added a comment - - edited Temporary table tov looks like have empty (but initialized) ha_memory (not opened?)
              Hide
              sanja Oleksandr Byelkin added a comment -

              tov was merged just before it

              Show
              sanja Oleksandr Byelkin added a comment - tov was merged just before it
              Hide
              sanja Oleksandr Byelkin added a comment -

              difference in WHERE between prepare and usual execution

              usual:
              WHERE:(after remove) 0x7fffe80b49b0 (multiple equal(`t1c`.`ft3`, `ua`.`ft3`) and multiple equal(`t1c`.`fe2`, `ua`.`fe2`))

              PS:
              WHERE:(after remove) 0x7fffe80adb68 ((`t1c`.`fe8` = `t1a`.`ft4`) and (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1) and multiple equal(`t1c`.`ft3`, `ua`.`ft3`) and multiple equal(`t1c`.`fe2`, `ua`.`fe2`))

              Show
              sanja Oleksandr Byelkin added a comment - difference in WHERE between prepare and usual execution usual: WHERE:(after remove) 0x7fffe80b49b0 (multiple equal(`t1c`.`ft3`, `ua`.`ft3`) and multiple equal(`t1c`.`fe2`, `ua`.`fe2`)) PS: WHERE:(after remove) 0x7fffe80adb68 ((`t1c`.`fe8` = `t1a`.`ft4`) and (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1) and multiple equal(`t1c`.`ft3`, `ua`.`ft3`) and multiple equal(`t1c`.`fe2`, `ua`.`fe2`))
              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              the difference about caused by elimination t1a. All other sequence of processing derived tables (in general looks the same).

              So the question is how temporary table of a merged view got in JOIN_TAB...

              Show
              sanja Oleksandr Byelkin added a comment - - edited the difference about caused by elimination t1a. All other sequence of processing derived tables (in general looks the same). So the question is how temporary table of a merged view got in JOIN_TAB...
              Hide
              sanja Oleksandr Byelkin added a comment -

              mysql_derived_merge replaces tov with ta1 during usual execution, and even PREPARE STATEMANT, but not during PS execution...

              Show
              sanja Oleksandr Byelkin added a comment - mysql_derived_merge replaces tov with ta1 during usual execution, and even PREPARE STATEMANT, but not during PS execution...
              Hide
              sanja Oleksandr Byelkin added a comment -

              derived->merged is set so merge do nothing...

              Show
              sanja Oleksandr Byelkin added a comment - derived->merged is set so merge do nothing...
              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              What happens:
              1) PREPARE:
              1.1) build leaf table
              1.2) mysql_multi_update_prepare merge view and replace view in leaf table list
              2) EXECUTE
              2.1) forget correct leaf_table and build original leaf table list
              2.2) merge already is done so there will not be replace of the table
              2.3) incorrect leaf table list saved
              2.4) problem because in the list present view which was merged

              Show
              sanja Oleksandr Byelkin added a comment - - edited What happens: 1) PREPARE: 1.1) build leaf table 1.2) mysql_multi_update_prepare merge view and replace view in leaf table list 2) EXECUTE 2.1) forget correct leaf_table and build original leaf table list 2.2) merge already is done so there will not be replace of the table 2.3) incorrect leaf table list saved 2.4) problem because in the list present view which was merged
              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              There is st_select_lex::save_prep_leaf_tables() to solve the problem above, but it is called only for upper level of views.

              So it should be recursive function.

              Show
              sanja Oleksandr Byelkin added a comment - - edited There is st_select_lex::save_prep_leaf_tables() to solve the problem above, but it is called only for upper level of views. So it should be recursive function.
              Hide
              sanja Oleksandr Byelkin added a comment -

              revision-id: 782ebec4c667d40c45e350e8f93025bab2f89b0c
              parent(s): 4cfb7f9db3d9841fd66aed8da4b5312e88d394cb
              committer: Oleksandr Byelkin
              branch nick: server
              timestamp: 2015-04-22 10:14:11 +0200
              message:

              MDEV-8018: main.multi_update fails with --ps-protocol

              save_prep_leaf_tables() made recursive to work with underlying view

              Arena restoiring fixed in case of EOM.

              Show
              sanja Oleksandr Byelkin added a comment - revision-id: 782ebec4c667d40c45e350e8f93025bab2f89b0c parent(s): 4cfb7f9db3d9841fd66aed8da4b5312e88d394cb committer: Oleksandr Byelkin branch nick: server timestamp: 2015-04-22 10:14:11 +0200 message: MDEV-8018 : main.multi_update fails with --ps-protocol save_prep_leaf_tables() made recursive to work with underlying view Arena restoiring fixed in case of EOM. —

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: