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

Per query variables from Percona Server [patch]

Details

    • Task
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1.2
    • OTHER
    • None

    Description

      Attachments

        Issue Links

          Activity

            pomyk Patryk Pomykalski created issue -
            pomyk Patryk Pomykalski made changes -
            Field Original Value New Value
            Description Port of per query variables feature from Percona Server. Allows changing variables for duration of the query.
            docs: http://www.percona.com/doc/percona-server/5.6/flexibility/per_query_variable_statement.html
            commit in PS: http://bazaar.launchpad.net/~percona-core/percona-server/5.6/revision/477

            patch for mariadb 10.0: https://code.launchpad.net/~pomyks/maria/10.0-per-query-variables
            Port of per query variables feature from Percona Server. Allows changing variables for duration of the query.
            docs: http://www.percona.com/doc/percona-server/5.6/flexibility/per_query_variable_statement.html
            commit in PS: http://bazaar.launchpad.net/~percona-core/percona-server/5.6/revision/477

            patch for mariadb 10.0: http://bazaar.launchpad.net/~pomyks/maria/10.0-per-query-variables/revision/3880
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1.0 [ 12200 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            10.0 patch applied with no problem on 10.1.
            2 issue to check so far:
            1) if saving/restoring variables values could be optimized
            2) increasing conflicts in the parser

            sanja Oleksandr Byelkin added a comment - 10.0 patch applied with no problem on 10.1. 2 issue to check so far: 1) if saving/restoring variables values could be optimized 2) increasing conflicts in the parser

            mem_root memory should be used for allocation instead of my_malloc. Time of live of variables backup is statement and mem_root should be faster.

            sanja Oleksandr Byelkin added a comment - mem_root memory should be used for allocation instead of my_malloc. Time of live of variables backup is statement and mem_root should be faster.

            Result of any alloc should be checked before assigning something by this address.

            sanja Oleksandr Byelkin added a comment - Result of any alloc should be checked before assigning something by this address.
            sanja Oleksandr Byelkin added a comment - - edited

            What if a variable with some side-effect changed? (are there such variables among session one).

            sanja Oleksandr Byelkin added a comment - - edited What if a variable with some side-effect changed? (are there such variables among session one).

            update called on restoring which is OK

            sanja Oleksandr Byelkin added a comment - update called on restoring which is OK

            As far as all variables copied in one chunk (two if there is dynamic). There is no gain in copy of only changed.

            But first call of malloc (backup of THD variables) changed with sql_alloc because it should not live over statement execution.

            Both memory allocation results checked and error returned in case of EOM.

            sanja Oleksandr Byelkin added a comment - As far as all variables copied in one chunk (two if there is dynamic). There is no gain in copy of only changed. But first call of malloc (backup of THD variables) changed with sql_alloc because it should not live over statement execution. Both memory allocation results checked and error returned in case of EOM.

            Deallocation items before mysql_sql_stmt_execute() call looks suspicious.

            sanja Oleksandr Byelkin added a comment - Deallocation items before mysql_sql_stmt_execute() call looks suspicious.

            Yes. It was unclean items from setting variables. So it should be done in other place.

            sanja Oleksandr Byelkin added a comment - Yes. It was unclean items from setting variables. So it should be done in other place.

            Above rise question which memory execution of setting variables run on.

            sanja Oleksandr Byelkin added a comment - Above rise question which memory execution of setting variables run on.

            The place of item list is correct (only EXECUTION prepared statement need it) but comment changed on more correct.

            Arena checked and it is correct (DBUG_ASSERT put there).

            sanja Oleksandr Byelkin added a comment - The place of item list is correct (only EXECUTION prepared statement need it) but comment changed on more correct. Arena checked and it is correct (DBUG_ASSERT put there).

            Is everything ok with SP?..

            sanja Oleksandr Byelkin added a comment - Is everything ok with SP?..

            Subqueries in the variables expressions?

            sanja Oleksandr Byelkin added a comment - Subqueries in the variables expressions?

            CREATE TABLE t1 (v1 INT, v2 INT);
            INSERT INTO t1 VALUES (1,2);
            INSERT INTO t1 VALUES (3,4);

            PREPARE stmt2
            FROM 'SELECT * FROM t1';
            SET STATEMENT myisam_sort_buffer_size=400000,
            myisam_repair_threads=(select max(v1) from t1),
            sort_buffer_size=200000,
            binlog_format=row,
            keep_files_on_create=OFF,
            max_join_size=4444440000000 FOR
            EXECUTE stmt2;

            crash in the original patch.

            sanja Oleksandr Byelkin added a comment - CREATE TABLE t1 (v1 INT, v2 INT); INSERT INTO t1 VALUES (1,2); INSERT INTO t1 VALUES (3,4); PREPARE stmt2 FROM 'SELECT * FROM t1'; SET STATEMENT myisam_sort_buffer_size=400000, myisam_repair_threads=(select max(v1) from t1), sort_buffer_size=200000, binlog_format=row, keep_files_on_create=OFF, max_join_size=4444440000000 FOR EXECUTE stmt2; crash in the original patch.
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]

            Percona Server 5.6.16 also crashes.

            pomyk Patryk Pomykalski added a comment - Percona Server 5.6.16 also crashes.
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            The patch sent for review.

            sanja Oleksandr Byelkin added a comment - The patch sent for review.
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Workflow defaullt [ 29538 ] MariaDB v2 [ 44645 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin added a comment - https://bugs.launchpad.net/percona-server/+bug/1333650
            psergei Sergei Petrunia made changes -
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.1.0 [ 12200 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            Above fixed

            sanja Oleksandr Byelkin added a comment - Above fixed
            sanja Oleksandr Byelkin added a comment - https://bugs.launchpad.net/percona-server/+bug/1341438
            sanja Oleksandr Byelkin added a comment - https://bugs.launchpad.net/percona-server/+bug/1341606
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]

            Diff sent by e-mail, commit e-mail will be soon also.

            sanja Oleksandr Byelkin added a comment - Diff sent by e-mail, commit e-mail will be soon also.
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            rspadim roberto spadim added a comment - - edited

            does the query cache (and query cache strip comments) work with it?

            rspadim roberto spadim added a comment - - edited does the query cache (and query cache strip comments) work with it?
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]

            postreview fixes sent to review

            sanja Oleksandr Byelkin added a comment - postreview fixes sent to review
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]

            ok to push with changes as in the last review

            serg Sergei Golubchik added a comment - ok to push with changes as in the last review
            serg Sergei Golubchik made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]

            ok to push

            serg Sergei Golubchik added a comment - ok to push
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Component/s OTHER [ 10125 ]
            Fix Version/s 10.1.2 [ 15801 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 44645 ] MariaDB v3 [ 64011 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 64011 ] MariaDB v4 [ 132214 ]
            rucha174 Rucha Deodhar made changes -

            People

              sanja Oleksandr Byelkin
              pomyk Patryk Pomykalski
              Votes:
              3 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.