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
7b19170c
Commit
7b19170c
authored
Mar 11, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#9101 - RELEASE/ROLLBACK TO SAVEPOINT did not forget savepoints correctly
parent
e272ab97
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
14 deletions
+29
-14
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+7
-1
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+10
-1
sql/sql_parse.cc
sql/sql_parse.cc
+12
-12
No files found.
mysql-test/r/innodb.result
View file @
7b19170c
...
...
@@ -262,7 +262,11 @@ n
5
6
7
rollback to savepoint `savept2`;
savepoint savept3;
rollback to savepoint savept2;
rollback to savepoint savept3;
ERROR 42000: SAVEPOINT savept3 does not exist
rollback to savepoint savept2;
release savepoint `my_savepoint`;
select n from t1;
n
...
...
@@ -272,6 +276,8 @@ n
7
rollback to savepoint `my_savepoint`;
ERROR 42000: SAVEPOINT my_savepoint does not exist
rollback to savepoint savept2;
ERROR 42000: SAVEPOINT savept2 does not exist
insert into t1 values (8);
savepoint sv;
commit;
...
...
mysql-test/t/innodb.test
View file @
7b19170c
...
...
@@ -130,17 +130,26 @@ insert into t1 values (6);
insert
into
t1
values
(
4
);
select
n
from
t1
;
set
autocommit
=
0
;
#
# savepoints
#
begin
;
savepoint
`my_savepoint`
;
insert
into
t1
values
(
7
);
savepoint
`savept2`
;
insert
into
t1
values
(
3
);
select
n
from
t1
;
rollback
to
savepoint
`savept2`
;
savepoint
savept3
;
rollback
to
savepoint
savept2
;
--
error
1305
rollback
to
savepoint
savept3
;
rollback
to
savepoint
savept2
;
release
savepoint
`my_savepoint`
;
select
n
from
t1
;
--
error
1305
rollback
to
savepoint
`my_savepoint`
;
--
error
1305
rollback
to
savepoint
savept2
;
insert
into
t1
values
(
8
);
savepoint
sv
;
commit
;
...
...
sql/sql_parse.cc
View file @
7b19170c
...
...
@@ -3805,21 +3805,21 @@ mysql_execute_command(THD *thd)
break
;
case
SQLCOM_RELEASE_SAVEPOINT
:
{
SAVEPOINT
*
*
sv
;
for
(
sv
=
&
thd
->
transaction
.
savepoints
;
*
sv
;
sv
=&
(
*
sv
)
->
prev
)
SAVEPOINT
*
sv
;
for
(
sv
=
thd
->
transaction
.
savepoints
;
sv
;
sv
=
sv
->
prev
)
{
if
(
my_strnncoll
(
system_charset_info
,
(
uchar
*
)
lex
->
ident
.
str
,
lex
->
ident
.
length
,
(
uchar
*
)
(
*
sv
)
->
name
,
(
*
sv
)
->
length
)
==
0
)
(
uchar
*
)
sv
->
name
,
sv
->
length
)
==
0
)
break
;
}
if
(
*
sv
)
if
(
sv
)
{
if
(
ha_release_savepoint
(
thd
,
*
sv
))
if
(
ha_release_savepoint
(
thd
,
sv
))
res
=
TRUE
;
// cannot happen
else
send_ok
(
thd
);
*
sv
=
(
*
sv
)
->
prev
;
thd
->
transaction
.
savepoints
=
sv
->
prev
;
}
else
my_error
(
ER_SP_DOES_NOT_EXIST
,
MYF
(
0
),
"SAVEPOINT"
,
lex
->
ident
.
str
);
...
...
@@ -3827,17 +3827,17 @@ mysql_execute_command(THD *thd)
}
case
SQLCOM_ROLLBACK_TO_SAVEPOINT
:
{
SAVEPOINT
*
*
sv
;
for
(
sv
=
&
thd
->
transaction
.
savepoints
;
*
sv
;
sv
=&
(
*
sv
)
->
prev
)
SAVEPOINT
*
sv
;
for
(
sv
=
thd
->
transaction
.
savepoints
;
sv
;
sv
=
sv
->
prev
)
{
if
(
my_strnncoll
(
system_charset_info
,
(
uchar
*
)
lex
->
ident
.
str
,
lex
->
ident
.
length
,
(
uchar
*
)
(
*
sv
)
->
name
,
(
*
sv
)
->
length
)
==
0
)
(
uchar
*
)
sv
->
name
,
sv
->
length
)
==
0
)
break
;
}
if
(
*
sv
)
if
(
sv
)
{
if
(
ha_rollback_to_savepoint
(
thd
,
*
sv
))
if
(
ha_rollback_to_savepoint
(
thd
,
sv
))
res
=
TRUE
;
// cannot happen
else
{
...
...
@@ -3848,7 +3848,7 @@ mysql_execute_command(THD *thd)
ER
(
ER_WARNING_NOT_COMPLETE_ROLLBACK
));
send_ok
(
thd
);
}
*
sv
=
(
*
sv
)
->
pre
v
;
thd
->
transaction
.
savepoints
=
s
v
;
}
else
my_error
(
ER_SP_DOES_NOT_EXIST
,
MYF
(
0
),
"SAVEPOINT"
,
lex
->
ident
.
str
);
...
...
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