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

MySQL WL#4179 - Stored programs: validation of stored program statements

Details

    Description

      Test case for MySQL "WL#4179 - Stored programs: validation of stored program statements" fails in 10.0.

      Test diff attached. Please try to apply test case as is unless it is applicable.

      Changes introduced by the task MDEV-5816.
      ---------------------------------------------
      Main logic of SP instructions processing is modified to support handling of tables metadata change the Stored routine's instructions depends on.

      • On first execution of SP instruction the current version of metadata for tables used by SP statement is extracted from the data dictionary and remembered in SP instruction's context.
      • Next time the same SP instruction is run the current version of underlying tables metadata is checked against their version loaded from data dictionary. In case these versions are different the statement for this SP instruction is re-parsed and actual metadata of underlying tables is reloaded from the data dictionary.

      To invalidate current SP instruction on metadata change and force its re-parsing, the same approach that used for Prepared Statement is applied - an instance of the class Reprepare_observer installed before second and subsequent executions of SP instruction and in case underlying tables metadata be changed this fact will be notified to and SP instruction's statement be re-parsed.

      Attachments

        Issue Links

          Activity

            shulga Dmitry Shulga added a comment - - edited

            Updated status of the task:

            • The new branch 10.11-MDEV-5816-1 contains current implementation of the task.
            • There are few failing tests: sys_vars.sysvars_star versioning.partition main.ps_ddl sysschema.pr_create_synonym_db innodb.autoinc_persist atomic.rename_trigger
            • There are several memory leaks on recompilation of statements for failing SP instructions that will be fixed on the next development cycle
            • There is the critical issue regarding recompilation of statements inside triggers.
              • Before the failed statement of trigger is re-parsed, all items storing in the intrusive list sp_lex_instr::free_list are deleted. For triggers such items include Item_trigger_field. On the other hand, pointers to deleted objects of the class Item_trigger_field are stored at objects of the class Trigger. After re-parsing of the current statement for the failed SP instruction, Trigger objects still points to objects just destroyed that results in crash.
            • First 8 test suites in the file sp_validation.test (borrowed from MySQL) passed ok. Total number of test suites is 11. First test that fails is regarding to running a stored routine that
              has an meta-data dependent expression inside IF instruction.
            shulga Dmitry Shulga added a comment - - edited Updated status of the task: The new branch 10.11- MDEV-5816 -1 contains current implementation of the task. There are few failing tests: sys_vars.sysvars_star versioning.partition main.ps_ddl sysschema.pr_create_synonym_db innodb.autoinc_persist atomic.rename_trigger There are several memory leaks on recompilation of statements for failing SP instructions that will be fixed on the next development cycle There is the critical issue regarding recompilation of statements inside triggers. Before the failed statement of trigger is re-parsed, all items storing in the intrusive list sp_lex_instr::free_list are deleted. For triggers such items include Item_trigger_field. On the other hand, pointers to deleted objects of the class Item_trigger_field are stored at objects of the class Trigger. After re-parsing of the current statement for the failed SP instruction, Trigger objects still points to objects just destroyed that results in crash. First 8 test suites in the file sp_validation.test (borrowed from MySQL) passed ok. Total number of test suites is 11. First test that fails is regarding to running a stored routine that has an meta-data dependent expression inside IF instruction.
            shulga Dmitry Shulga added a comment -

            Branch for review is bb-11.0-MDEV-5816

            shulga Dmitry Shulga added a comment - Branch for review is bb-11.0- MDEV-5816

            see my e-main with only 2 issues

            sanja Oleksandr Byelkin added a comment - see my e-main with only 2 issues
            shulga Dmitry Shulga added a comment -

            The branch bb-11.2-MDEV-5816 is ready for review and QA.

            shulga Dmitry Shulga added a comment - The branch bb-11.2- MDEV-5816 is ready for review and QA.

            okay to push

            ramesh Ramesh Sivaraman added a comment - okay to push

            People

              shulga Dmitry Shulga
              svoj Sergey Vojtovich
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.