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
c14d3d2f
Commit
c14d3d2f
authored
Jul 31, 2007
by
gshchepa/uchum@gleb.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30120
into gleb.loc:/home/uchum/work/bk/5.1-opt
parents
15f3fb07
1eb20fc0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
5 deletions
+47
-5
mysql-test/r/sp.result
mysql-test/r/sp.result
+11
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+21
-0
sql/item.cc
sql/item.cc
+2
-2
sql/item.h
sql/item.h
+10
-1
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-1
No files found.
mysql-test/r/sp.result
View file @
c14d3d2f
...
@@ -6378,6 +6378,17 @@ Level Code Message
...
@@ -6378,6 +6378,17 @@ Level Code Message
use test;
use test;
drop procedure sp_bug29050;
drop procedure sp_bug29050;
drop table t1;
drop table t1;
SET NAMES latin1;
CREATE PROCEDURE p1()
BEGIN
DECLARE INT;
SELECT ;
END|
CALL p1();
NULL
SET NAMES default;
DROP PROCEDURE p1;
drop procedure if exists proc_25411_a;
drop procedure if exists proc_25411_a;
drop procedure if exists proc_25411_b;
drop procedure if exists proc_25411_b;
drop procedure if exists proc_25411_c;
drop procedure if exists proc_25411_c;
...
...
mysql-test/t/sp.test
View file @
c14d3d2f
...
@@ -7364,6 +7364,27 @@ use test;
...
@@ -7364,6 +7364,27 @@ use test;
drop
procedure
sp_bug29050
;
drop
procedure
sp_bug29050
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #30120 SP with local variables with non-ASCII names crashes server.
#
SET
NAMES
latin1
;
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
INT
;
SELECT
;
END
|
DELIMITER
;
|
CALL
p1
();
SET
NAMES
default
;
DROP
PROCEDURE
p1
;
#
#
# Bug#25411 (trigger code truncated)
# Bug#25411 (trigger code truncated)
#
#
...
...
sql/item.cc
View file @
c14d3d2f
...
@@ -1082,9 +1082,9 @@ bool Item_sp_variable::is_null()
...
@@ -1082,9 +1082,9 @@ bool Item_sp_variable::is_null()
Item_splocal
::
Item_splocal
(
const
LEX_STRING
&
sp_var_name
,
Item_splocal
::
Item_splocal
(
const
LEX_STRING
&
sp_var_name
,
uint
sp_var_idx
,
uint
sp_var_idx
,
enum_field_types
sp_var_type
,
enum_field_types
sp_var_type
,
uint
pos_in_q
)
uint
pos_in_q
,
uint
len_in_q
)
:
Item_sp_variable
(
sp_var_name
.
str
,
sp_var_name
.
length
),
:
Item_sp_variable
(
sp_var_name
.
str
,
sp_var_name
.
length
),
m_var_idx
(
sp_var_idx
),
pos_in_query
(
pos_in_q
)
m_var_idx
(
sp_var_idx
),
pos_in_query
(
pos_in_q
)
,
len_in_query
(
len_in_q
)
{
{
maybe_null
=
TRUE
;
maybe_null
=
TRUE
;
...
...
sql/item.h
View file @
c14d3d2f
...
@@ -1054,9 +1054,18 @@ public:
...
@@ -1054,9 +1054,18 @@ public:
SP variable in query text.
SP variable in query text.
*/
*/
uint
pos_in_query
;
uint
pos_in_query
;
/*
Byte length of SP variable name in the statement (see pos_in_query).
The value of this field may differ from the name_length value because
name_length contains byte length of UTF8-encoded item name, but
the query string (see sp_instr_stmt::m_query) is currently stored with
a charset from the SET NAMES statement.
*/
uint
len_in_query
;
Item_splocal
(
const
LEX_STRING
&
sp_var_name
,
uint
sp_var_idx
,
Item_splocal
(
const
LEX_STRING
&
sp_var_name
,
uint
sp_var_idx
,
enum_field_types
sp_var_type
,
uint
pos_in_q
=
0
);
enum_field_types
sp_var_type
,
uint
pos_in_q
=
0
,
uint
len_in_q
=
0
);
bool
is_splocal
()
{
return
1
;
}
/* Needed for error checking */
bool
is_splocal
()
{
return
1
;
}
/* Needed for error checking */
...
...
sql/sp_head.cc
View file @
c14d3d2f
...
@@ -927,7 +927,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
...
@@ -927,7 +927,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
/* append the text between sp ref occurences */
/* append the text between sp ref occurences */
res
|=
qbuf
.
append
(
cur
+
prev_pos
,
(
*
splocal
)
->
pos_in_query
-
prev_pos
);
res
|=
qbuf
.
append
(
cur
+
prev_pos
,
(
*
splocal
)
->
pos_in_query
-
prev_pos
);
prev_pos
=
(
*
splocal
)
->
pos_in_query
+
(
*
splocal
)
->
m_name
.
length
;
prev_pos
=
(
*
splocal
)
->
pos_in_query
+
(
*
splocal
)
->
len_in_query
;
/* append the spvar substitute */
/* append the spvar substitute */
res
|=
qbuf
.
append
(
STRING_WITH_LEN
(
" NAME_CONST('"
));
res
|=
qbuf
.
append
(
STRING_WITH_LEN
(
" NAME_CONST('"
));
...
...
sql/sql_yacc.yy
View file @
c14d3d2f
...
@@ -9505,7 +9505,8 @@ simple_ident:
...
@@ -9505,7 +9505,8 @@ simple_ident:
Item_splocal *splocal;
Item_splocal *splocal;
splocal= new Item_splocal($1, spv->offset, spv->type,
splocal= new Item_splocal($1, spv->offset, spv->type,
lip->get_tok_start_prev() -
lip->get_tok_start_prev() -
lex->sphead->m_tmp_query);
lex->sphead->m_tmp_query,
lip->tok_end - lip->tok_start_prev);
#ifndef DBUG_OFF
#ifndef DBUG_OFF
if (splocal)
if (splocal)
splocal->m_sp= lex->sphead;
splocal->m_sp= lex->sphead;
...
...
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