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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4cb65274
Commit
4cb65274
authored
Sep 10, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-show-5.0
parents
a7de21c3
624cf0e5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
16 deletions
+68
-16
.bzrignore
.bzrignore
+1
-1
libmysqld/Makefile.am
libmysqld/Makefile.am
+1
-1
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+9
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+17
-1
sql/sp_head.cc
sql/sp_head.cc
+25
-3
sql/sp_head.h
sql/sp_head.h
+3
-7
sql/sp_rcontext.cc
sql/sp_rcontext.cc
+3
-0
sql/sp_rcontext.h
sql/sp_rcontext.h
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-3
No files found.
.bzrignore
View file @
4cb65274
...
@@ -440,6 +440,7 @@ libmysqld/sql_state.c
...
@@ -440,6 +440,7 @@ libmysqld/sql_state.c
libmysqld/sql_string.cc
libmysqld/sql_string.cc
libmysqld/sql_table.cc
libmysqld/sql_table.cc
libmysqld/sql_test.cc
libmysqld/sql_test.cc
libmysqld/sql_trigger.cc
libmysqld/sql_udf.cc
libmysqld/sql_udf.cc
libmysqld/sql_union.cc
libmysqld/sql_union.cc
libmysqld/sql_unions.cc
libmysqld/sql_unions.cc
...
@@ -919,4 +920,3 @@ vio/test-ssl
...
@@ -919,4 +920,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
libmysqld/sql_trigger.cc
libmysqld/Makefile.am
View file @
4cb65274
...
@@ -59,7 +59,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
...
@@ -59,7 +59,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc
\
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc
\
spatial.cc gstream.cc sql_help.cc tztime.cc protocol_cursor.cc
\
spatial.cc gstream.cc sql_help.cc tztime.cc protocol_cursor.cc
\
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc
\
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc
\
parse_file.cc sql_view.cc
parse_file.cc sql_view.cc
sql_trigger.cc
libmysqld_int_a_SOURCES
=
$(libmysqld_sources)
$(libmysqlsources)
$(sqlsources)
libmysqld_int_a_SOURCES
=
$(libmysqld_sources)
$(libmysqlsources)
$(sqlsources)
libmysqld_a_SOURCES
=
libmysqld_a_SOURCES
=
...
...
mysql-test/r/sp-error.result
View file @
4cb65274
...
@@ -485,4 +485,13 @@ create procedure bug4344() drop procedure bug4344|
...
@@ -485,4 +485,13 @@ create procedure bug4344() drop procedure bug4344|
ERROR HY000: Can't drop a PROCEDURE from within another stored routine
ERROR HY000: Can't drop a PROCEDURE from within another stored routine
create procedure bug4344() drop function bug4344|
create procedure bug4344() drop function bug4344|
ERROR HY000: Can't drop a FUNCTION from within another stored routine
ERROR HY000: Can't drop a FUNCTION from within another stored routine
drop procedure if exists bug3294|
create procedure bug3294()
begin
declare continue handler for sqlexception drop table t5;
drop table t5;
end|
call bug3294()|
ERROR 42S02: Unknown table 't5'
drop procedure bug3294|
drop table t1|
drop table t1|
mysql-test/t/sp-error.test
View file @
4cb65274
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# Make sure we don't have any procedures left.
# Make sure we don't have any procedures left.
delete
from
mysql
.
proc
;
delete
from
mysql
.
proc
;
# A test "global" procedures, i.e. not belonging to any database.
# A test
of
"global" procedures, i.e. not belonging to any database.
create
function
.
f1
()
returns
int
return
1
;
create
function
.
f1
()
returns
int
return
1
;
create
procedure
.
p1
()
select
1
,
database
();
create
procedure
.
p1
()
select
1
,
database
();
create
procedure
p1
()
select
2
,
database
();
create
procedure
p1
()
select
2
,
database
();
...
@@ -650,6 +650,22 @@ create procedure bug4344() drop procedure bug4344|
...
@@ -650,6 +650,22 @@ create procedure bug4344() drop procedure bug4344|
--
error
1357
--
error
1357
create
procedure
bug4344
()
drop
function
bug4344
|
create
procedure
bug4344
()
drop
function
bug4344
|
#
# BUG#3294: Stored procedure crash if table dropped before use
# (Actually, when an error occurs within an error handler.)
--
disable_warnings
drop
procedure
if
exists
bug3294
|
--
enable_warnings
create
procedure
bug3294
()
begin
declare
continue
handler
for
sqlexception
drop
table
t5
;
drop
table
t5
;
end
|
--
error
1051
call
bug3294
()
|
drop
procedure
bug3294
|
drop
table
t1
|
drop
table
t1
|
...
...
sql/sp_head.cc
View file @
4cb65274
...
@@ -499,6 +499,7 @@ sp_head::execute(THD *thd)
...
@@ -499,6 +499,7 @@ sp_head::execute(THD *thd)
ip
=
hip
;
ip
=
hip
;
ret
=
0
;
ret
=
0
;
ctx
->
clear_handler
();
ctx
->
clear_handler
();
ctx
->
in_handler
=
TRUE
;
continue
;
continue
;
}
}
}
}
...
@@ -1586,19 +1587,40 @@ int
...
@@ -1586,19 +1587,40 @@ int
sp_instr_hreturn
::
execute
(
THD
*
thd
,
uint
*
nextp
)
sp_instr_hreturn
::
execute
(
THD
*
thd
,
uint
*
nextp
)
{
{
DBUG_ENTER
(
"sp_instr_hreturn::execute"
);
DBUG_ENTER
(
"sp_instr_hreturn::execute"
);
thd
->
spcont
->
restore_variables
(
m_frame
);
if
(
m_dest
)
*
nextp
=
thd
->
spcont
->
pop_hstack
();
*
nextp
=
m_dest
;
else
{
thd
->
spcont
->
restore_variables
(
m_frame
);
*
nextp
=
thd
->
spcont
->
pop_hstack
();
}
thd
->
spcont
->
in_handler
=
FALSE
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
void
void
sp_instr_hreturn
::
print
(
String
*
str
)
sp_instr_hreturn
::
print
(
String
*
str
)
{
{
str
->
reserve
(
1
2
);
str
->
reserve
(
1
6
);
str
->
append
(
"hreturn "
);
str
->
append
(
"hreturn "
);
str
->
qs_append
(
m_frame
);
str
->
qs_append
(
m_frame
);
if
(
m_dest
)
str
->
qs_append
(
m_dest
);
}
uint
sp_instr_hreturn
::
opt_mark
(
sp_head
*
sp
)
{
if
(
m_dest
)
return
sp_instr_jump
::
opt_mark
(
sp
);
else
{
marked
=
1
;
return
UINT_MAX
;
}
}
}
//
//
// sp_instr_cpush
// sp_instr_cpush
//
//
...
...
sql/sp_head.h
View file @
4cb65274
...
@@ -677,7 +677,7 @@ private:
...
@@ -677,7 +677,7 @@ private:
};
// class sp_instr_hpop : public sp_instr
};
// class sp_instr_hpop : public sp_instr
class
sp_instr_hreturn
:
public
sp_instr
class
sp_instr_hreturn
:
public
sp_instr
_jump
{
{
sp_instr_hreturn
(
const
sp_instr_hreturn
&
);
/* Prevent use of these */
sp_instr_hreturn
(
const
sp_instr_hreturn
&
);
/* Prevent use of these */
void
operator
=
(
sp_instr_hreturn
&
);
void
operator
=
(
sp_instr_hreturn
&
);
...
@@ -685,7 +685,7 @@ class sp_instr_hreturn : public sp_instr
...
@@ -685,7 +685,7 @@ class sp_instr_hreturn : public sp_instr
public:
public:
sp_instr_hreturn
(
uint
ip
,
sp_pcontext
*
ctx
,
uint
fp
)
sp_instr_hreturn
(
uint
ip
,
sp_pcontext
*
ctx
,
uint
fp
)
:
sp_instr
(
ip
,
ctx
),
m_frame
(
fp
)
:
sp_instr
_jump
(
ip
,
ctx
),
m_frame
(
fp
)
{}
{}
virtual
~
sp_instr_hreturn
()
virtual
~
sp_instr_hreturn
()
...
@@ -695,11 +695,7 @@ public:
...
@@ -695,11 +695,7 @@ public:
virtual
void
print
(
String
*
str
);
virtual
void
print
(
String
*
str
);
virtual
uint
opt_mark
(
sp_head
*
sp
)
virtual
uint
opt_mark
(
sp_head
*
sp
);
{
marked
=
1
;
return
UINT_MAX
;
}
private:
private:
...
...
sql/sp_rcontext.cc
View file @
4cb65274
...
@@ -32,6 +32,7 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
...
@@ -32,6 +32,7 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
:
m_count
(
0
),
m_fsize
(
fsize
),
m_result
(
NULL
),
m_hcount
(
0
),
m_hsp
(
0
),
:
m_count
(
0
),
m_fsize
(
fsize
),
m_result
(
NULL
),
m_hcount
(
0
),
m_hsp
(
0
),
m_hfound
(
-
1
),
m_ccount
(
0
)
m_hfound
(
-
1
),
m_ccount
(
0
)
{
{
in_handler
=
FALSE
;
m_frame
=
(
Item
**
)
sql_alloc
(
fsize
*
sizeof
(
Item
*
));
m_frame
=
(
Item
**
)
sql_alloc
(
fsize
*
sizeof
(
Item
*
));
m_outs
=
(
int
*
)
sql_alloc
(
fsize
*
sizeof
(
int
));
m_outs
=
(
int
*
)
sql_alloc
(
fsize
*
sizeof
(
int
));
m_handler
=
(
sp_handler_t
*
)
sql_alloc
(
hmax
*
sizeof
(
sp_handler_t
));
m_handler
=
(
sp_handler_t
*
)
sql_alloc
(
hmax
*
sizeof
(
sp_handler_t
));
...
@@ -58,6 +59,8 @@ sp_rcontext::set_item_eval(uint idx, Item *i, enum_field_types type)
...
@@ -58,6 +59,8 @@ sp_rcontext::set_item_eval(uint idx, Item *i, enum_field_types type)
int
int
sp_rcontext
::
find_handler
(
uint
sql_errno
)
sp_rcontext
::
find_handler
(
uint
sql_errno
)
{
{
if
(
in_handler
)
return
0
;
// Already executing a handler
if
(
m_hfound
>=
0
)
if
(
m_hfound
>=
0
)
return
1
;
// Already got one
return
1
;
// Already got one
...
...
sql/sp_rcontext.h
View file @
4cb65274
...
@@ -46,6 +46,8 @@ class sp_rcontext : public Sql_alloc
...
@@ -46,6 +46,8 @@ class sp_rcontext : public Sql_alloc
public:
public:
bool
in_handler
;
sp_rcontext
(
uint
fsize
,
uint
hmax
,
uint
cmax
);
sp_rcontext
(
uint
fsize
,
uint
hmax
,
uint
cmax
);
~
sp_rcontext
()
~
sp_rcontext
()
...
...
sql/sql_yacc.yy
View file @
4cb65274
...
@@ -1599,13 +1599,17 @@ sp_decl:
...
@@ -1599,13 +1599,17 @@ sp_decl:
sp_head *sp= lex->sphead;
sp_head *sp= lex->sphead;
sp_pcontext *ctx= lex->spcont;
sp_pcontext *ctx= lex->spcont;
sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */
sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */
sp_instr_hreturn *i;
if ($2 == SP_HANDLER_CONTINUE)
if ($2 == SP_HANDLER_CONTINUE)
sp->add_instr(new sp_instr_hreturn(sp->instructions(), ctx,
{
ctx->current_pvars()));
i= new sp_instr_hreturn(sp->instructions(), ctx,
ctx->current_pvars());
sp->add_instr(i);
}
else
else
{ /* EXIT or UNDO handler, just jump to the end of the block */
{ /* EXIT or UNDO handler, just jump to the end of the block */
sp_instr_jump *i= new sp_instr_jump(sp->instructions(), ctx
);
i= new sp_instr_hreturn(sp->instructions(), ctx, 0
);
sp->add_instr(i);
sp->add_instr(i);
sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
...
...
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