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
329013f9
Commit
329013f9
authored
Mar 29, 2004
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#3287: Stored Procedure Case Statement Not SQL:2003 Compliant.
parent
52c820fb
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
83 additions
and
3 deletions
+83
-3
include/mysqld_error.h
include/mysqld_error.h
+2
-1
include/sql_state.h
include/sql_state.h
+1
-0
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+21
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+27
-0
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+1
-0
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+1
-0
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+1
-0
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-0
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+1
-0
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+1
-0
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+1
-0
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+1
-0
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+1
-0
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+1
-0
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+1
-0
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+1
-0
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+1
-0
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+1
-0
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+1
-0
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+1
-0
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+1
-0
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+1
-0
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+1
-0
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+1
-0
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+1
-0
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+1
-0
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+1
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+9
-2
No files found.
include/mysqld_error.h
View file @
329013f9
...
@@ -342,4 +342,5 @@
...
@@ -342,4 +342,5 @@
#define ER_SP_NO_USE 1323
#define ER_SP_NO_USE 1323
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1324
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1324
#define ER_SP_CURSOR_AFTER_HANDLER 1325
#define ER_SP_CURSOR_AFTER_HANDLER 1325
#define ER_ERROR_MESSAGES 326
#define ER_SP_CASE_NOT_FOUND 1326
#define ER_ERROR_MESSAGES 327
include/sql_state.h
View file @
329013f9
...
@@ -199,3 +199,4 @@ ER_SP_SUBSELECT_NYI, "0A000", "",
...
@@ -199,3 +199,4 @@ ER_SP_SUBSELECT_NYI, "0A000", "",
ER_SP_NO_USE
,
"42000"
,
""
,
ER_SP_NO_USE
,
"42000"
,
""
,
ER_SP_VARCOND_AFTER_CURSHNDLR
,
"42000"
,
""
,
ER_SP_VARCOND_AFTER_CURSHNDLR
,
"42000"
,
""
,
ER_SP_CURSOR_AFTER_HANDLER
,
"42000"
,
""
,
ER_SP_CURSOR_AFTER_HANDLER
,
"42000"
,
""
,
ER_SP_CASE_NOT_FOUND
,
"20000"
,
""
,
mysql-test/r/sp-error.result
View file @
329013f9
...
@@ -341,4 +341,25 @@ call bug2329_2()|
...
@@ -341,4 +341,25 @@ call bug2329_2()|
ERROR 42S22: Unknown column 'v' in 'field list'
ERROR 42S22: Unknown column 'v' in 'field list'
drop procedure bug2329_1|
drop procedure bug2329_1|
drop procedure bug2329_2|
drop procedure bug2329_2|
create function bug3287() returns int
begin
declare v int default null;
case
when v is not null then return 1;
end case;
return 2;
end|
select bug3287()|
ERROR 20000: Case not found for CASE statement
drop function bug3287|
create procedure bug3287(x int)
case x
when 0 then
insert into test.t1 values (x, 0.1);
when 1 then
insert into test.t1 values (x, 1.1);
end case|
call bug3287(2)|
ERROR 20000: Case not found for CASE statement
drop procedure bug3287|
drop table t1|
drop table t1|
mysql-test/t/sp-error.test
View file @
329013f9
...
@@ -473,6 +473,33 @@ call bug2329_2()|
...
@@ -473,6 +473,33 @@ call bug2329_2()|
drop
procedure
bug2329_1
|
drop
procedure
bug2329_1
|
drop
procedure
bug2329_2
|
drop
procedure
bug2329_2
|
#
# BUG#3287
#
create
function
bug3287
()
returns
int
begin
declare
v
int
default
null
;
case
when
v
is
not
null
then
return
1
;
end
case
;
return
2
;
end
|
--
error
1326
select
bug3287
()
|
drop
function
bug3287
|
create
procedure
bug3287
(
x
int
)
case
x
when
0
then
insert
into
test
.
t1
values
(
x
,
0.1
);
when
1
then
insert
into
test
.
t1
values
(
x
,
1.1
);
end
case
|
--
error
1326
call
bug3287
(
2
)
|
drop
procedure
bug3287
|
drop
table
t1
|
drop
table
t1
|
delimiter
;
|
delimiter
;
|
sql/share/czech/errmsg.txt
View file @
329013f9
...
@@ -338,3 +338,4 @@ character-set=latin2
...
@@ -338,3 +338,4 @@ character-set=latin2
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/danish/errmsg.txt
View file @
329013f9
...
@@ -332,3 +332,4 @@ character-set=latin1
...
@@ -332,3 +332,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/dutch/errmsg.txt
View file @
329013f9
...
@@ -340,3 +340,4 @@ character-set=latin1
...
@@ -340,3 +340,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/english/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=latin1
...
@@ -329,3 +329,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/estonian/errmsg.txt
View file @
329013f9
...
@@ -334,3 +334,4 @@ character-set=latin7
...
@@ -334,3 +334,4 @@ character-set=latin7
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/french/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=latin1
...
@@ -329,3 +329,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/german/errmsg.txt
View file @
329013f9
...
@@ -341,3 +341,4 @@ character-set=latin1
...
@@ -341,3 +341,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/greek/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=greek
...
@@ -329,3 +329,4 @@ character-set=greek
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/hungarian/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=latin2
...
@@ -331,3 +331,4 @@ character-set=latin2
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/italian/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=latin1
...
@@ -329,3 +329,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/japanese/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=ujis
...
@@ -331,3 +331,4 @@ character-set=ujis
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/korean/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=euckr
...
@@ -329,3 +329,4 @@ character-set=euckr
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/norwegian-ny/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=latin1
...
@@ -331,3 +331,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/norwegian/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=latin1
...
@@ -331,3 +331,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/polish/errmsg.txt
View file @
329013f9
...
@@ -333,3 +333,4 @@ character-set=latin2
...
@@ -333,3 +333,4 @@ character-set=latin2
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/portuguese/errmsg.txt
View file @
329013f9
...
@@ -330,3 +330,4 @@ character-set=latin1
...
@@ -330,3 +330,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/romanian/errmsg.txt
View file @
329013f9
...
@@ -333,3 +333,4 @@ character-set=latin2
...
@@ -333,3 +333,4 @@ character-set=latin2
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/russian/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=koi8r
...
@@ -331,3 +331,4 @@ character-set=koi8r
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/serbian/errmsg.txt
View file @
329013f9
...
@@ -324,3 +324,4 @@ character-set=cp1250
...
@@ -324,3 +324,4 @@ character-set=cp1250
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/slovak/errmsg.txt
View file @
329013f9
...
@@ -337,3 +337,4 @@ character-set=latin2
...
@@ -337,3 +337,4 @@ character-set=latin2
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/spanish/errmsg.txt
View file @
329013f9
...
@@ -331,3 +331,4 @@ character-set=latin1
...
@@ -331,3 +331,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/swedish/errmsg.txt
View file @
329013f9
...
@@ -329,3 +329,4 @@ character-set=latin1
...
@@ -329,3 +329,4 @@ character-set=latin1
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/share/ukrainian/errmsg.txt
View file @
329013f9
...
@@ -334,3 +334,4 @@ character-set=koi8u
...
@@ -334,3 +334,4 @@ character-set=koi8u
"USE is not allowed in a stored procedure"
"USE is not allowed in a stored procedure"
"Variable or condition declaration after cursor or handler declaration"
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
sql/sql_yacc.yy
View file @
329013f9
...
@@ -1908,9 +1908,16 @@ sp_case:
...
@@ -1908,9 +1908,16 @@ sp_case:
;
;
sp_whens:
sp_whens:
/* Empty */ {}
/* Empty */
| WHEN_SYM sp_case {}
{
sp_head *sp= Lex->sphead;
uint ip= sp->instructions();
sp_instr_error *i= new sp_instr_error(ip, ER_SP_CASE_NOT_FOUND);
sp->add_instr(i);
}
| ELSE sp_proc_stmts {}
| ELSE sp_proc_stmts {}
| WHEN_SYM sp_case {}
;
;
sp_labeled_control:
sp_labeled_control:
...
...
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