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
cef84f3b
Commit
cef84f3b
authored
Jun 01, 2005
by
lenz@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/space/my/mysql-5.0
parents
9afd2563
f711a3d7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
128 additions
and
4 deletions
+128
-4
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+13
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+29
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+23
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+29
-0
sql/item.h
sql/item.h
+7
-0
sql/protocol.h
sql/protocol.h
+2
-2
sql/sp_head.cc
sql/sp_head.cc
+13
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-1
No files found.
mysql-test/r/sp-error.result
View file @
cef84f3b
...
@@ -658,4 +658,17 @@ create procedure bug9529_9012345678901234567890123456789012345678901234567890123
...
@@ -658,4 +658,17 @@ create procedure bug9529_9012345678901234567890123456789012345678901234567890123
begin
begin
end|
end|
ERROR 42000: Identifier name 'bug9529_90123456789012345678901234567890123456789012345678901234567890' is too long
ERROR 42000: Identifier name 'bug9529_90123456789012345678901234567890123456789012345678901234567890' is too long
drop procedure if exists bug10969|
create procedure bug10969()
begin
declare s1 int default 0;
select default(s1) from t30;
end|
ERROR 42000: Incorrect column name 's1'
create procedure bug10969()
begin
declare s1 int default 0;
select default(t30.s1) from t30;
end|
drop procedure bug10969|
drop table t1|
drop table t1|
mysql-test/r/sp.result
View file @
cef84f3b
...
@@ -3109,4 +3109,33 @@ select bug9559()|
...
@@ -3109,4 +3109,33 @@ select bug9559()|
bug9559()
bug9559()
-3
-3
drop function bug9559|
drop function bug9559|
drop procedure if exists bug10961|
create procedure bug10961()
begin
declare v char;
declare x int;
declare c cursor for select * from dual;
declare continue handler for sqlexception select x;
set x = 1;
open c;
set x = 2;
fetch c into v;
set x = 3;
close c;
end|
call bug10961()|
x
1
x
2
x
3
call bug10961()|
x
1
x
2
x
3
drop procedure bug10961|
drop table t1,t2;
drop table t1,t2;
mysql-test/t/sp-error.test
View file @
cef84f3b
...
@@ -930,6 +930,29 @@ begin
...
@@ -930,6 +930,29 @@ begin
end
|
end
|
#
# BUG#10969: Stored procedures: crash if default() function
#
--
disable_warnings
drop
procedure
if
exists
bug10969
|
--
enable_warnings
--
error
ER_WRONG_COLUMN_NAME
create
procedure
bug10969
()
begin
declare
s1
int
default
0
;
select
default
(
s1
)
from
t30
;
end
|
# This should work
create
procedure
bug10969
()
begin
declare
s1
int
default
0
;
select
default
(
t30
.
s1
)
from
t30
;
end
|
drop
procedure
bug10969
|
#
#
# BUG#NNNN: New bug synopsis
# BUG#NNNN: New bug synopsis
#
#
...
...
mysql-test/t/sp.test
View file @
cef84f3b
...
@@ -3801,6 +3801,7 @@ call bug5963_2(1)|
...
@@ -3801,6 +3801,7 @@ call bug5963_2(1)|
drop
procedure
bug5963_2
|
drop
procedure
bug5963_2
|
drop
table
t3
|
drop
table
t3
|
#
#
# BUG#9559: Functions: Numeric Operations using -ve value gives incorrect
# BUG#9559: Functions: Numeric Operations using -ve value gives incorrect
# results.
# results.
...
@@ -3820,6 +3821,34 @@ select bug9559()|
...
@@ -3820,6 +3821,34 @@ select bug9559()|
drop
function
bug9559
|
drop
function
bug9559
|
#
# BUG#10961: Stored procedures: crash if select * from dual
#
--
disable_warnings
drop
procedure
if
exists
bug10961
|
--
enable_warnings
# "select * from dual" results in an error, so the cursor will not open
create
procedure
bug10961
()
begin
declare
v
char
;
declare
x
int
;
declare
c
cursor
for
select
*
from
dual
;
declare
continue
handler
for
sqlexception
select
x
;
set
x
=
1
;
open
c
;
set
x
=
2
;
fetch
c
into
v
;
set
x
=
3
;
close
c
;
end
|
call
bug10961
()
|
call
bug10961
()
|
drop
procedure
bug10961
|
#
#
# BUG#NNNN: New bug synopsis
# BUG#NNNN: New bug synopsis
#
#
...
...
sql/item.h
View file @
cef84f3b
...
@@ -584,6 +584,13 @@ public:
...
@@ -584,6 +584,13 @@ public:
Item
::
maybe_null
=
TRUE
;
Item
::
maybe_null
=
TRUE
;
}
}
/* For error printing */
inline
void
my_name
(
char
**
strp
,
uint
*
lengthp
)
{
*
strp
=
m_name
.
str
;
*
lengthp
=
m_name
.
length
;
}
bool
is_splocal
()
{
return
1
;
}
/* Needed for error checking */
bool
is_splocal
()
{
return
1
;
}
/* Needed for error checking */
Item
*
this_item
();
Item
*
this_item
();
...
...
sql/protocol.h
View file @
cef84f3b
...
@@ -159,8 +159,8 @@ public:
...
@@ -159,8 +159,8 @@ public:
MYSQL_ROWS
**
prev_record
;
MYSQL_ROWS
**
prev_record
;
ulong
row_count
;
ulong
row_count
;
Protocol_cursor
()
{}
Protocol_cursor
()
:
data
(
NULL
)
{}
Protocol_cursor
(
THD
*
thd_arg
,
MEM_ROOT
*
ini_alloc
)
:
Protocol_simple
(
thd_arg
),
alloc
(
ini_alloc
)
{}
Protocol_cursor
(
THD
*
thd_arg
,
MEM_ROOT
*
ini_alloc
)
:
Protocol_simple
(
thd_arg
),
alloc
(
ini_alloc
)
,
data
(
NULL
)
{}
bool
prepare_for_send
(
List
<
Item
>
*
item_list
)
bool
prepare_for_send
(
List
<
Item
>
*
item_list
)
{
{
row_count
=
0
;
row_count
=
0
;
...
...
sql/sp_head.cc
View file @
cef84f3b
...
@@ -1913,7 +1913,19 @@ sp_instr_copen::execute(THD *thd, uint *nextp)
...
@@ -1913,7 +1913,19 @@ sp_instr_copen::execute(THD *thd, uint *nextp)
else
else
res
=
lex_keeper
->
reset_lex_and_exec_core
(
thd
,
nextp
,
FALSE
,
this
);
res
=
lex_keeper
->
reset_lex_and_exec_core
(
thd
,
nextp
,
FALSE
,
this
);
c
->
post_open
(
thd
,
(
lex_keeper
?
TRUE
:
FALSE
));
/*
Work around the fact that errors in selects are not returned properly
(but instead converted into a warning), so if a condition handler
caught, we have lost the result code.
*/
if
(
!
res
)
{
uint
dummy1
,
dummy2
;
if
(
thd
->
spcont
->
found_handler
(
&
dummy1
,
&
dummy2
))
res
=
-
1
;
}
c
->
post_open
(
thd
,
(
lex_keeper
&&
!
res
?
TRUE
:
FALSE
));
}
}
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
...
...
sql/sql_yacc.yy
View file @
cef84f3b
...
@@ -4343,7 +4343,18 @@ simple_expr:
...
@@ -4343,7 +4343,18 @@ simple_expr:
| CONVERT_SYM '(' expr USING charset_name ')'
| CONVERT_SYM '(' expr USING charset_name ')'
{ $$= new Item_func_conv_charset($3,$5); }
{ $$= new Item_func_conv_charset($3,$5); }
| DEFAULT '(' simple_ident ')'
| DEFAULT '(' simple_ident ')'
{ $$= new Item_default_value($3); }
{
if ($3->is_splocal())
{
LEX_STRING name;
Item_splocal *il= static_cast<Item_splocal *>($3);
il->my_name(&name.str, &name.length);
my_error(ER_WRONG_COLUMN_NAME, MYF(0), name.str);
YYABORT;
}
$$= new Item_default_value($3);
}
| VALUES '(' simple_ident ')'
| VALUES '(' simple_ident ')'
{ $$= new Item_insert_value($3); }
{ $$= new Item_insert_value($3); }
| FUNC_ARG0 '(' ')'
| FUNC_ARG0 '(' ')'
...
...
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