[MDEV-5231] Per query variables from Percona Server [patch] Created: 2013-11-03 Updated: 2022-03-29 Resolved: 2014-11-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Fix Version/s: | 10.1.2 |
| Type: | Task | Priority: | Critical |
| Reporter: | Patryk Pomykalski | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Port of per query variables feature from Percona Server. Allows changing variables for duration of the query. patch for mariadb 10.0: http://bazaar.launchpad.net/~pomyks/maria/10.0-per-query-variables/revision/3880 |
| Comments |
| Comment by Oleksandr Byelkin [ 2014-02-20 ] |
|
10.0 patch applied with no problem on 10.1. |
| Comment by Oleksandr Byelkin [ 2014-02-20 ] |
|
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. |
| Comment by Oleksandr Byelkin [ 2014-02-20 ] |
|
Result of any alloc should be checked before assigning something by this address. |
| Comment by Oleksandr Byelkin [ 2014-02-20 ] |
|
What if a variable with some side-effect changed? (are there such variables among session one). |
| Comment by Oleksandr Byelkin [ 2014-02-20 ] |
|
update called on restoring which is OK |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
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. |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
Deallocation items before mysql_sql_stmt_execute() call looks suspicious. |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
Yes. It was unclean items from setting variables. So it should be done in other place. |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
Above rise question which memory execution of setting variables run on. |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
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). |
| Comment by Oleksandr Byelkin [ 2014-02-21 ] |
|
Is everything ok with SP?.. |
| Comment by Oleksandr Byelkin [ 2014-02-24 ] |
|
Subqueries in the variables expressions? |
| Comment by Oleksandr Byelkin [ 2014-02-24 ] |
|
CREATE TABLE t1 (v1 INT, v2 INT); PREPARE stmt2 crash in the original patch. |
| Comment by Patryk Pomykalski [ 2014-04-17 ] |
|
Percona Server 5.6.16 also crashes. |
| Comment by Oleksandr Byelkin [ 2014-05-22 ] |
|
The patch sent for review. |
| Comment by Oleksandr Byelkin [ 2014-06-24 ] |
| Comment by Oleksandr Byelkin [ 2014-07-10 ] |
|
Above fixed |
| Comment by Oleksandr Byelkin [ 2014-07-14 ] |
| Comment by Oleksandr Byelkin [ 2014-07-14 ] |
| Comment by Oleksandr Byelkin [ 2014-10-13 ] |
|
Diff sent by e-mail, commit e-mail will be soon also. |
| Comment by roberto spadim [ 2014-10-13 ] |
|
does the query cache (and query cache strip comments) work with it? |
| Comment by Oleksandr Byelkin [ 2014-10-21 ] |
|
postreview fixes sent to review |
| Comment by Sergei Golubchik [ 2014-10-21 ] |
|
ok to push with changes as in the last review |
| Comment by Sergei Golubchik [ 2014-10-22 ] |
|
ok to push |