Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
cf1c8705
Commit
cf1c8705
authored
Jan 23, 2009
by
Horst Hunger
Browse files
Options
Browse Files
Download
Plain Diff
due to merge
parents
6fd71bf4
33a09cdc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+5
-0
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+11
-0
sql/item_func.cc
sql/item_func.cc
+7
-0
sql/item_func.h
sql/item_func.h
+1
-0
No files found.
mysql-test/r/user_var.result
View file @
cf1c8705
...
...
@@ -399,4 +399,9 @@ select @lastid != id, @lastid, @lastid := id from t1;
0 3 3
1 3 4
drop table t1;
CREATE TABLE t1 (i INT);
CREATE TRIGGER t_after_insert AFTER INSERT ON t1 FOR EACH ROW SET @bug42188 = 10;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/user_var.test
View file @
cf1c8705
...
...
@@ -285,4 +285,15 @@ set @lastid=-1;
select
@
lastid
!=
id
,
@
lastid
,
@
lastid
:=
id
from
t1
;
drop
table
t1
;
#
# Bug#42188: crash and/or memory corruption with user variables in trigger
#
CREATE
TABLE
t1
(
i
INT
);
CREATE
TRIGGER
t_after_insert
AFTER
INSERT
ON
t1
FOR
EACH
ROW
SET
@
bug42188
=
10
;
INSERT
INTO
t1
VALUES
(
1
);
--
change_user
INSERT
INTO
t1
VALUES
(
1
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/item_func.cc
View file @
cf1c8705
...
...
@@ -3808,6 +3808,13 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
}
void
Item_func_set_user_var
::
cleanup
()
{
Item_func
::
cleanup
();
entry
=
NULL
;
}
bool
Item_func_set_user_var
::
set_entry
(
THD
*
thd
,
bool
create_if_not_exists
)
{
if
(
entry
&&
thd
->
thread_id
==
entry_thread_id
)
...
...
sql/item_func.h
View file @
cf1c8705
...
...
@@ -1357,6 +1357,7 @@ class Item_func_set_user_var :public Item_func
void
save_org_in_field
(
Field
*
field
)
{
(
void
)
save_in_field
(
field
,
1
,
0
);
}
bool
register_field_in_read_map
(
uchar
*
arg
);
bool
set_entry
(
THD
*
thd
,
bool
create_if_not_exists
);
void
cleanup
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment