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
188c558a
Commit
188c558a
authored
Mar 26, 2007
by
gkodinov/kgeorge@magare.gmz[kgeorge]
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/work/B26303-5.1-opt
parents
5e0596f4
93488413
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
mysql-test/r/sp-code.result
mysql-test/r/sp-code.result
+17
-0
mysql-test/t/sp-code.test
mysql-test/t/sp-code.test
+18
-0
sql/item.cc
sql/item.cc
+3
-1
sql/item.h
sql/item.h
+2
-2
No files found.
mysql-test/r/sp-code.result
View file @
188c558a
...
...
@@ -621,3 +621,20 @@ Pos Instruction
0 stmt 2 "CREATE INDEX idx ON t1 (c1)"
DROP PROCEDURE p1;
End of 5.0 tests.
CREATE PROCEDURE p1()
BEGIN
DECLARE dummy int default 0;
CASE 12
WHEN 12
THEN SET dummy = 0;
END CASE;
END//
SHOW PROCEDURE CODE p1;
Pos Instruction
0 set dummy@0 0
1 set_case_expr (6) 0 12
2 jump_if_not 5(6) (case_expr@0 = 12)
3 set dummy@0 0
4 jump 6
5 error 1339
DROP PROCEDURE p1;
mysql-test/t/sp-code.test
View file @
188c558a
...
...
@@ -447,3 +447,21 @@ DROP PROCEDURE p1;
--
echo
End
of
5.0
tests
.
#
# Bug #26303: reserve() not called before qs_append() may lead to buffer
# overflow
#
DELIMITER
//;
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
dummy
int
default
0
;
CASE
12
WHEN
12
THEN
SET
dummy
=
0
;
END
CASE
;
END
//
DELIMITER
;
//
SHOW
PROCEDURE
CODE
p1
;
DROP
PROCEDURE
p1
;
sql/item.cc
View file @
188c558a
...
...
@@ -1088,7 +1088,7 @@ bool Item_splocal::set_value(THD *thd, sp_rcontext *ctx, Item **it)
Item_case_expr methods
*****************************************************************************/
Item_case_expr
::
Item_case_expr
(
int
case_expr_id
)
Item_case_expr
::
Item_case_expr
(
u
int
case_expr_id
)
:
Item_sp_variable
(
C_STRING_WITH_LEN
(
"case_expr"
)),
m_case_expr_id
(
case_expr_id
)
{
...
...
@@ -1125,6 +1125,8 @@ Item_case_expr::this_item_addr(THD *thd, Item **)
void
Item_case_expr
::
print
(
String
*
str
)
{
if
(
str
->
reserve
(
MAX_INT_WIDTH
+
sizeof
(
"case_expr@"
)))
return
;
/* purecov: inspected */
VOID
(
str
->
append
(
STRING_WITH_LEN
(
"case_expr@"
)));
str
->
qs_append
(
m_case_expr_id
);
}
...
...
sql/item.h
View file @
188c558a
...
...
@@ -1116,7 +1116,7 @@ inline Item_result Item_splocal::result_type() const
class
Item_case_expr
:
public
Item_sp_variable
{
public:
Item_case_expr
(
int
case_expr_id
);
Item_case_expr
(
u
int
case_expr_id
);
public:
Item
*
this_item
();
...
...
@@ -1135,7 +1135,7 @@ class Item_case_expr :public Item_sp_variable
void
print
(
String
*
str
);
private:
int
m_case_expr_id
;
u
int
m_case_expr_id
;
};
/*****************************************************************************
...
...
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