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

            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.

            Percona Server 5.6.16 also crashes.

            pomyk Patryk Pomykalski added a comment - Percona Server 5.6.16 also crashes.

            The patch sent for review.

            sanja Oleksandr Byelkin added a comment - The patch sent for review.
            sanja Oleksandr Byelkin added a comment - https://bugs.launchpad.net/percona-server/+bug/1333650

            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

            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.
            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?

            postreview fixes sent to review

            sanja Oleksandr Byelkin added a comment - postreview fixes sent to review

            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

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            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.