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
ed6e09a3
Commit
ed6e09a3
authored
Dec 02, 2005
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-review fixes for BUG#14376: MySQL crash on scoped variable (re)initialization
parent
c4c2dc07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
sql/sp_pcontext.cc
sql/sp_pcontext.cc
+1
-2
sql/sp_pcontext.h
sql/sp_pcontext.h
+9
-8
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-5
No files found.
sql/sp_pcontext.cc
View file @
ed6e09a3
...
...
@@ -150,7 +150,7 @@ sp_pcontext::diff_cursors(sp_pcontext *ctx)
sp_pvar_t
*
sp_pcontext
::
find_pvar
(
LEX_STRING
*
name
,
my_bool
scoped
)
{
uint
i
=
m_pboundary
;
uint
i
=
m_p
var
.
elements
-
m_p
boundary
;
while
(
i
--
)
{
...
...
@@ -186,7 +186,6 @@ sp_pcontext::push_pvar(LEX_STRING *name, enum enum_field_types type,
p
->
offset
=
current_pvars
();
p
->
dflt
=
NULL
;
insert_dynamic
(
&
m_pvar
,
(
gptr
)
&
p
);
m_pboundary
=
m_pvar
.
elements
;
}
}
...
...
sql/sp_pcontext.h
View file @
ed6e09a3
...
...
@@ -164,7 +164,6 @@ class sp_pcontext : public Sql_alloc
{
while
(
num
--
)
pop_dynamic
(
&
m_pvar
);
m_pboundary
=
m_pvar
.
elements
;
}
// Find by name
...
...
@@ -184,12 +183,14 @@ class sp_pcontext : public Sql_alloc
return
p
;
}
// Set the current scope boundary (for default values)
// The argument is the number of variables to skip.
/*
Set the current scope boundary (for default values)
The argument is the number of variables to skip.
*/
inline
void
declare_var_boundary
(
uint
n
)
{
m_pboundary
=
m_pvar
.
elements
-
n
;
m_pboundary
=
n
;
}
//
...
...
@@ -297,10 +298,10 @@ class sp_pcontext : public Sql_alloc
uint
m_poffset
;
// Variable offset for this context
uint
m_coffset
;
// Cursor offset for this context
/*
Boundary for finding variables in this
in this context.
This is normally the same as m_pvar.elements, but differs during
parsing of DECLARE ... DEFAULT, to get the scope right for DEFAULT
values.
Boundary for finding variables in this
context. This is the number
of variables currently "invisible" to default clauses.
This is normally 0, but will be larger during parsing of
DECLARE ... DEFAULT, to get the scope right for DEFAULT
values.
*/
uint
m_pboundary
;
...
...
sql/sql_yacc.yy
View file @
ed6e09a3
...
...
@@ -1661,11 +1661,11 @@ sp_decls:
sp_decl:
DECLARE_SYM sp_decl_idents type
{
LEX *lex= Lex;
LEX *lex= Lex;
lex->sphead->reset_lex(YYTHD);
lex->spcont->declare_var_boundary($2);
}
lex->sphead->reset_lex(YYTHD);
lex->spcont->declare_var_boundary($2);
}
sp_opt_default
{
LEX *lex= Lex;
...
...
@@ -1695,7 +1695,7 @@ sp_decl:
lex->sphead->add_instr(in);
ctx->set_default(i, it);
}
ctx->declare_var_boundary(0);
ctx->declare_var_boundary(0);
lex->sphead->restore_lex(YYTHD);
$$.vars= $2;
$$.conds= $$.hndlrs= $$.curs= 0;
...
...
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