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
aa35efd2
Commit
aa35efd2
authored
Jul 22, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after merge fixes
parent
c9fd7757
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
63 deletions
+62
-63
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+2
-2
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+49
-49
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+2
-2
sql/opt_range.h
sql/opt_range.h
+1
-1
sql/sp.cc
sql/sp.cc
+1
-2
sql/sp_head.cc
sql/sp_head.cc
+4
-3
sql/sql_lex.cc
sql/sql_lex.cc
+2
-2
sql/sql_view.cc
sql/sql_view.cc
+1
-2
No files found.
mysql-test/r/sp-error.result
View file @
aa35efd2
...
@@ -44,7 +44,7 @@ call foo()|
...
@@ -44,7 +44,7 @@ call foo()|
ERROR 42000: PROCEDURE test.foo does not exist
ERROR 42000: PROCEDURE test.foo does not exist
drop procedure if exists foo|
drop procedure if exists foo|
Warnings:
Warnings:
Warning 130
3
PROCEDURE foo does not exist
Warning 130
4
PROCEDURE foo does not exist
show create procedure foo|
show create procedure foo|
ERROR 42000: PROCEDURE foo does not exist
ERROR 42000: PROCEDURE foo does not exist
create procedure foo()
create procedure foo()
...
@@ -80,7 +80,7 @@ declare y int;
...
@@ -80,7 +80,7 @@ declare y int;
set x = y;
set x = y;
end|
end|
Warnings:
Warnings:
Warning 13
09
Referring to uninitialized variable y
Warning 13
10
Referring to uninitialized variable y
drop procedure foo|
drop procedure foo|
create procedure foo()
create procedure foo()
return 42|
return 42|
...
...
mysql-test/t/sp-error.test
View file @
aa35efd2
...
@@ -49,18 +49,18 @@ create function func1() returns int
...
@@ -49,18 +49,18 @@ create function func1() returns int
return
42
|
return
42
|
# Can't create recursively
# Can't create recursively
--
error
130
1
--
error
130
2
create
procedure
foo
()
create
procedure
foo
()
create
procedure
bar
()
set
@
x
=
3
|
create
procedure
bar
()
set
@
x
=
3
|
--
error
130
1
--
error
130
2
create
procedure
foo
()
create
procedure
foo
()
create
function
bar
()
returns
double
return
2.3
|
create
function
bar
()
returns
double
return
2.3
|
# Already exists
# Already exists
--
error
130
2
--
error
130
3
create
procedure
proc1
()
create
procedure
proc1
()
set
@
x
=
42
|
set
@
x
=
42
|
--
error
130
2
--
error
130
3
create
function
func1
()
returns
int
create
function
func1
()
returns
int
return
42
|
return
42
|
...
@@ -68,39 +68,39 @@ drop procedure proc1|
...
@@ -68,39 +68,39 @@ drop procedure proc1|
drop
function
func1
|
drop
function
func1
|
# Does not exist
# Does not exist
--
error
130
3
--
error
130
4
alter
procedure
foo
|
alter
procedure
foo
|
--
error
130
3
--
error
130
4
alter
function
foo
|
alter
function
foo
|
--
error
130
3
--
error
130
4
drop
procedure
foo
|
drop
procedure
foo
|
--
error
130
3
--
error
130
4
drop
function
foo
|
drop
function
foo
|
--
error
130
3
--
error
130
4
call
foo
()
|
call
foo
()
|
drop
procedure
if
exists
foo
|
drop
procedure
if
exists
foo
|
--
error
130
3
--
error
130
4
show
create
procedure
foo
|
show
create
procedure
foo
|
# LEAVE/ITERATE with no match
# LEAVE/ITERATE with no match
--
error
130
6
--
error
130
7
create
procedure
foo
()
create
procedure
foo
()
foo
:
loop
foo
:
loop
leave
bar
;
leave
bar
;
end
loop
|
end
loop
|
--
error
130
6
--
error
130
7
create
procedure
foo
()
create
procedure
foo
()
foo
:
loop
foo
:
loop
iterate
bar
;
iterate
bar
;
end
loop
|
end
loop
|
--
error
130
6
--
error
130
7
create
procedure
foo
()
create
procedure
foo
()
foo
:
begin
foo
:
begin
iterate
foo
;
iterate
foo
;
end
|
end
|
# Redefining label
# Redefining label
--
error
130
7
--
error
130
8
create
procedure
foo
()
create
procedure
foo
()
foo
:
loop
foo
:
loop
foo
:
loop
foo
:
loop
...
@@ -109,7 +109,7 @@ foo: loop
...
@@ -109,7 +109,7 @@ foo: loop
end
loop
foo
|
end
loop
foo
|
# End label mismatch
# End label mismatch
--
error
130
8
--
error
130
9
create
procedure
foo
()
create
procedure
foo
()
foo
:
loop
foo
:
loop
set
@
x
=
2
;
set
@
x
=
2
;
...
@@ -124,12 +124,12 @@ end|
...
@@ -124,12 +124,12 @@ end|
drop
procedure
foo
|
drop
procedure
foo
|
# RETURN in FUNCTION only
# RETURN in FUNCTION only
--
error
131
1
--
error
131
2
create
procedure
foo
()
create
procedure
foo
()
return
42
|
return
42
|
# Doesn't allow queries in FUNCTIONs (for now :-( )
# Doesn't allow queries in FUNCTIONs (for now :-( )
--
error
131
2
--
error
131
3
create
function
foo
()
returns
int
create
function
foo
()
returns
int
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -143,19 +143,19 @@ create procedure p(x int)
...
@@ -143,19 +143,19 @@ create procedure p(x int)
create
function
f
(
x
int
)
returns
int
create
function
f
(
x
int
)
returns
int
return
x
+
42
|
return
x
+
42
|
--
error
131
6
--
error
131
7
call
p
()
|
call
p
()
|
--
error
131
6
--
error
131
7
call
p
(
1
,
2
)
|
call
p
(
1
,
2
)
|
--
error
131
6
--
error
131
7
select
f
()
|
select
f
()
|
--
error
131
6
--
error
131
7
select
f
(
1
,
2
)
|
select
f
(
1
,
2
)
|
drop
procedure
p
|
drop
procedure
p
|
drop
function
f
|
drop
function
f
|
--
error
131
7
--
error
131
8
create
procedure
p
(
val
int
,
out
res
int
)
create
procedure
p
(
val
int
,
out
res
int
)
begin
begin
declare
x
int
default
0
;
declare
x
int
default
0
;
...
@@ -169,7 +169,7 @@ begin
...
@@ -169,7 +169,7 @@ begin
end
if
;
end
if
;
end
|
end
|
--
error
131
7
--
error
131
8
create
procedure
p
(
val
int
,
out
res
int
)
create
procedure
p
(
val
int
,
out
res
int
)
begin
begin
declare
x
int
default
0
;
declare
x
int
default
0
;
...
@@ -184,7 +184,7 @@ begin
...
@@ -184,7 +184,7 @@ begin
end
if
;
end
if
;
end
|
end
|
--
error
131
8
--
error
131
9
create
function
f
(
val
int
)
returns
int
create
function
f
(
val
int
)
returns
int
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -202,12 +202,12 @@ begin
...
@@ -202,12 +202,12 @@ begin
end
if
;
end
if
;
end
|
end
|
--
error
13
19
--
error
13
20
select
f
(
10
)
|
select
f
(
10
)
|
drop
function
f
|
drop
function
f
|
--
error
132
0
--
error
132
1
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
c
cursor
for
insert
into
test
.
t1
values
(
"foo"
,
42
);
declare
c
cursor
for
insert
into
test
.
t1
values
(
"foo"
,
42
);
...
@@ -216,7 +216,7 @@ begin
...
@@ -216,7 +216,7 @@ begin
close
c
;
close
c
;
end
|
end
|
--
error
132
1
--
error
132
2
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -226,7 +226,7 @@ begin
...
@@ -226,7 +226,7 @@ begin
close
c
;
close
c
;
end
|
end
|
--
error
132
2
--
error
132
3
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
c
cursor
for
select
*
from
test
.
t
;
declare
c
cursor
for
select
*
from
test
.
t
;
...
@@ -248,7 +248,7 @@ begin
...
@@ -248,7 +248,7 @@ begin
open
c
;
open
c
;
close
c
;
close
c
;
end
|
end
|
--
error
132
3
--
error
132
4
call
p
()
|
call
p
()
|
drop
procedure
p
|
drop
procedure
p
|
...
@@ -260,11 +260,11 @@ begin
...
@@ -260,11 +260,11 @@ begin
close
c
;
close
c
;
close
c
;
close
c
;
end
|
end
|
--
error
132
4
--
error
132
5
call
p
()
|
call
p
()
|
drop
procedure
p
|
drop
procedure
p
|
--
error
130
3
--
error
130
4
alter
procedure
bar3
sql
security
invoker
|
alter
procedure
bar3
sql
security
invoker
|
--
error
1059
--
error
1059
alter
procedure
bar3
name
alter
procedure
bar3
name
...
@@ -278,7 +278,7 @@ drop table if exists t1|
...
@@ -278,7 +278,7 @@ drop table if exists t1|
create
table
t1
(
val
int
,
x
float
)
|
create
table
t1
(
val
int
,
x
float
)
|
insert
into
t1
values
(
42
,
3.1
),
(
19
,
1.2
)
|
insert
into
t1
values
(
42
,
3.1
),
(
19
,
1.2
)
|
--
error
132
5
--
error
132
6
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -298,7 +298,7 @@ begin
...
@@ -298,7 +298,7 @@ begin
fetch
c
into
x
;
fetch
c
into
x
;
close
c
;
close
c
;
end
|
end
|
--
error
132
6
--
error
132
7
call
p
()
|
call
p
()
|
drop
procedure
p
|
drop
procedure
p
|
...
@@ -313,34 +313,34 @@ begin
...
@@ -313,34 +313,34 @@ begin
fetch
c
into
x
,
y
,
z
;
fetch
c
into
x
,
y
,
z
;
close
c
;
close
c
;
end
|
end
|
--
error
132
6
--
error
132
7
call
p
()
|
call
p
()
|
drop
procedure
p
|
drop
procedure
p
|
--
error
132
8
--
error
132
9
create
procedure
p
(
in
x
int
,
x
char
(
10
))
create
procedure
p
(
in
x
int
,
x
char
(
10
))
begin
begin
end
|
end
|
--
error
132
8
--
error
132
9
create
function
p
(
x
int
,
x
char
(
10
))
create
function
p
(
x
int
,
x
char
(
10
))
begin
begin
end
|
end
|
--
error
13
29
--
error
13
30
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
x
float
;
declare
x
float
;
declare
x
int
;
declare
x
int
;
end
|
end
|
--
error
133
0
--
error
133
1
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
c
condition
for
1064
;
declare
c
condition
for
1064
;
declare
c
condition
for
1065
;
declare
c
condition
for
1065
;
end
|
end
|
--
error
133
1
--
error
133
2
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
c
cursor
for
select
*
from
t1
;
declare
c
cursor
for
select
*
from
t1
;
...
@@ -348,18 +348,18 @@ begin
...
@@ -348,18 +348,18 @@ begin
end
|
end
|
# USE is not allowed
# USE is not allowed
--
error
133
4
--
error
133
5
create
procedure
u
()
create
procedure
u
()
use
sptmp
|
use
sptmp
|
# Enforced standard order of declarations
# Enforced standard order of declarations
--error 133
5
--error 133
6
create procedure p()
create procedure p()
begin
begin
declare c cursor for select * from t1
;
declare c cursor for select * from t1
;
declare
x
int
;
declare
x
int
;
end
|
end
|
--
error
133
5
--
error
133
6
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -367,7 +367,7 @@ begin
...
@@ -367,7 +367,7 @@ begin
declare
foo
condition
for
sqlstate
'42S99'
;
declare
foo
condition
for
sqlstate
'42S99'
;
end
|
end
|
--
error
133
6
--
error
133
7
create
procedure
p
()
create
procedure
p
()
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -392,13 +392,13 @@ drop procedure bug1965|
...
@@ -392,13 +392,13 @@ drop procedure bug1965|
#
#
# BUG#1966
# BUG#1966
#
#
--
error
132
5
--
error
132
6
select
1
into
a
|
select
1
into
a
|
#
#
# BUG#336
# BUG#336
#
#
--
error
133
3
--
error
133
4
create
procedure
bug336
(
id
char
(
16
))
create
procedure
bug336
(
id
char
(
16
))
begin
begin
declare
x
int
;
declare
x
int
;
...
@@ -408,7 +408,7 @@ end|
...
@@ -408,7 +408,7 @@ end|
#
#
# BUG#1654
# BUG#1654
#
#
--
error
131
2
--
error
131
3
create
function
bug1654
()
create
function
bug1654
()
returns
int
returns
int
return
(
select
sum
(
t
.
data
)
from
test
.
t2
t
)
|
return
(
select
sum
(
t
.
data
)
from
test
.
t2
t
)
|
...
@@ -446,7 +446,7 @@ begin
...
@@ -446,7 +446,7 @@ begin
fetch
c1
into
v1
;
fetch
c1
into
v1
;
end
|
end
|
--
error
132
4
--
error
132
5
call
bug2259
()
|
call
bug2259
()
|
drop
procedure
bug2259
|
drop
procedure
bug2259
|
...
@@ -502,7 +502,7 @@ begin
...
@@ -502,7 +502,7 @@ begin
end
case
;
end
case
;
return
2
;
return
2
;
end
|
end
|
--
error
133
7
--
error
133
8
select
bug3287
()
|
select
bug3287
()
|
drop
function
bug3287
|
drop
function
bug3287
|
...
@@ -513,7 +513,7 @@ when 0 then
...
@@ -513,7 +513,7 @@ when 0 then
when
1
then
when
1
then
insert
into
test
.
t1
values
(
x
,
1.1
);
insert
into
test
.
t1
values
(
x
,
1.1
);
end
case
|
end
case
|
--
error
133
7
--
error
133
8
call
bug3287
(
2
)
|
call
bug3287
(
2
)
|
drop
procedure
bug3287
|
drop
procedure
bug3287
|
...
...
mysql-test/t/sp-security.test
View file @
aa35efd2
...
@@ -60,7 +60,7 @@ select * from db1_secret.t1;
...
@@ -60,7 +60,7 @@ select * from db1_secret.t1;
# ...and not this
# ...and not this
--
error
1049
--
error
1049
create
procedure
db1_secret
.
dummy
()
begin
end
;
create
procedure
db1_secret
.
dummy
()
begin
end
;
--
error
130
3
--
error
130
4
drop
procedure
db1_secret
.
dummy
;
drop
procedure
db1_secret
.
dummy
;
...
@@ -80,7 +80,7 @@ select * from db1_secret.t1;
...
@@ -80,7 +80,7 @@ select * from db1_secret.t1;
# ...and not this
# ...and not this
--
error
1049
--
error
1049
create
procedure
db1_secret
.
dummy
()
begin
end
;
create
procedure
db1_secret
.
dummy
()
begin
end
;
--
error
130
3
--
error
130
4
drop
procedure
db1_secret
.
dummy
;
drop
procedure
db1_secret
.
dummy
;
...
...
sql/opt_range.h
View file @
aa35efd2
...
@@ -146,7 +146,7 @@ public:
...
@@ -146,7 +146,7 @@ public:
QS_TYPE_RANGE_DESC
=
2
,
QS_TYPE_RANGE_DESC
=
2
,
QS_TYPE_FULLTEXT
=
3
,
QS_TYPE_FULLTEXT
=
3
,
QS_TYPE_ROR_INTERSECT
=
4
,
QS_TYPE_ROR_INTERSECT
=
4
,
QS_TYPE_ROR_UNION
=
5
,
QS_TYPE_ROR_UNION
=
5
};
};
/* Get type of this quick select - one of the QS_TYPE_* values */
/* Get type of this quick select - one of the QS_TYPE_* values */
...
...
sql/sp.cc
View file @
aa35efd2
...
@@ -265,8 +265,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
...
@@ -265,8 +265,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
*/
*/
List
<
Item
>
vals
=
thd
->
lex
->
value_list
;
List
<
Item
>
vals
=
thd
->
lex
->
value_list
;
mysql_init_query
(
thd
,
TRUE
);
mysql_init_query
(
thd
,
(
uchar
*
)
defstr
.
c_ptr
(),
defstr
.
length
(),
TRUE
);
lex_start
(
thd
,
(
uchar
*
)
defstr
.
c_ptr
(),
defstr
.
length
());
thd
->
lex
->
value_list
=
vals
;
thd
->
lex
->
value_list
=
vals
;
}
}
...
...
sql/sp_head.cc
View file @
aa35efd2
...
@@ -690,17 +690,18 @@ sp_head::reset_lex(THD *thd)
...
@@ -690,17 +690,18 @@ sp_head::reset_lex(THD *thd)
(
void
)
m_lex
.
push_front
(
oldlex
);
(
void
)
m_lex
.
push_front
(
oldlex
);
thd
->
lex
=
sublex
=
new
st_lex
;
thd
->
lex
=
sublex
=
new
st_lex
;
/* Reset most stuff. The length arguments doesn't matter here. */
/* Reset most stuff. The length arguments doesn't matter here. */
lex_start
(
thd
,
oldlex
->
buf
,
oldlex
->
end_of_query
-
oldlex
->
ptr
);
mysql_init_query
(
thd
,
oldlex
->
buf
,
oldlex
->
end_of_query
-
oldlex
->
ptr
,
TRUE
);
sublex
->
yylineno
=
oldlex
->
yylineno
;
/* We must reset ptr and end_of_query again */
/* We must reset ptr and end_of_query again */
sublex
->
ptr
=
oldlex
->
ptr
;
sublex
->
ptr
=
oldlex
->
ptr
;
sublex
->
end_of_query
=
oldlex
->
end_of_query
;
sublex
->
end_of_query
=
oldlex
->
end_of_query
;
sublex
->
tok_start
=
oldlex
->
tok_start
;
sublex
->
tok_start
=
oldlex
->
tok_start
;
sublex
->
yylineno
=
oldlex
->
yylineno
;
/* And keep the SP stuff too */
/* And keep the SP stuff too */
sublex
->
sphead
=
oldlex
->
sphead
;
sublex
->
sphead
=
oldlex
->
sphead
;
sublex
->
spcont
=
oldlex
->
spcont
;
sublex
->
spcont
=
oldlex
->
spcont
;
mysql_init_query
(
thd
,
true
);
// Only init lex
sublex
->
sp_lex_in_use
=
FALSE
;
sublex
->
sp_lex_in_use
=
FALSE
;
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
sql/sql_lex.cc
View file @
aa35efd2
...
@@ -111,8 +111,8 @@ void lex_start(THD *thd, uchar *buf,uint length)
...
@@ -111,8 +111,8 @@ void lex_start(THD *thd, uchar *buf,uint length)
LEX
*
lex
=
thd
->
lex
;
LEX
*
lex
=
thd
->
lex
;
lex
->
thd
=
thd
;
lex
->
thd
=
thd
;
lex
->
next_state
=
MY_LEX_START
;
lex
->
next_state
=
MY_LEX_START
;
lex
->
buf
=
buf
;
lex
->
buf
=
lex
->
ptr
=
buf
;
lex
->
end_of_query
=
(
lex
->
ptr
=
buf
)
+
length
;
lex
->
end_of_query
=
buf
+
length
;
lex
->
yylineno
=
1
;
lex
->
yylineno
=
1
;
lex
->
in_comment
=
0
;
lex
->
in_comment
=
0
;
lex
->
length
=
0
;
lex
->
length
=
0
;
...
...
sql/sql_view.cc
View file @
aa35efd2
...
@@ -563,8 +563,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
...
@@ -563,8 +563,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
now Lex placed in statement memory
now Lex placed in statement memory
*/
*/
table
->
view
=
lex
=
thd
->
lex
=
(
LEX
*
)
new
(
&
thd
->
mem_root
)
st_lex_local
;
table
->
view
=
lex
=
thd
->
lex
=
(
LEX
*
)
new
(
&
thd
->
mem_root
)
st_lex_local
;
lex_start
(
thd
,
(
uchar
*
)
table
->
query
.
str
,
table
->
query
.
length
);
mysql_init_query
(
thd
,
(
uchar
*
)
table
->
query
.
str
,
table
->
query
.
length
,
TRUE
);
mysql_init_query
(
thd
,
true
);
lex
->
select_lex
.
select_number
=
++
thd
->
select_number
;
lex
->
select_lex
.
select_number
=
++
thd
->
select_number
;
old_lex
->
derived_tables
|=
DERIVED_VIEW
;
old_lex
->
derived_tables
|=
DERIVED_VIEW
;
{
{
...
...
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