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
0d95f36a
Commit
0d95f36a
authored
Mar 20, 2003
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post post merge fix. Made the broken ip test work again.
parent
6822eb5e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
7 deletions
+24
-7
mysql-test/r/sp.result
mysql-test/r/sp.result
+6
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+2
-3
sql/sp_head.cc
sql/sp_head.cc
+11
-3
sql/sp_pcontext.cc
sql/sp_pcontext.cc
+5
-1
No files found.
mysql-test/r/sp.result
View file @
0d95f36a
...
...
@@ -484,6 +484,12 @@ set p = p+2;
end;
end while;
end;
call ip(200);
select * from primes where i=45 or i=100 or i=199;
i p
45 211
100 557
199 1229
drop table primes;
drop procedure opp;
drop procedure ip;
...
...
mysql-test/t/sp.test
View file @
0d95f36a
...
...
@@ -564,11 +564,10 @@ end|
# This isn't the fastest way in the world to compute prime numbers, so
# don't be too ambition. ;-)
#QQ Something broke after the last merge. :-( /2003-03-19
#QQ call ip(200)|
call
ip
(
200
)
|
# We don't want to select the entire table here, just pick a few
# examples.
#QQ
select * from primes where i=45 or i=100 or i=199|
select
*
from
primes
where
i
=
45
or
i
=
100
or
i
=
199
|
drop
table
primes
|
drop
procedure
opp
|
drop
procedure
ip
|
...
...
sql/sp_head.cc
View file @
0d95f36a
...
...
@@ -50,10 +50,15 @@ sp_map_result_type(enum enum_field_types type)
static
Item
*
eval_func_item
(
THD
*
thd
,
Item
*
it
,
enum
enum_field_types
type
)
{
DBUG_ENTER
(
"eval_func_item"
);
it
=
it
->
this_item
();
DBUG_PRINT
(
"info"
,
(
"type: %d"
,
type
));
if
(
it
->
fix_fields
(
thd
,
0
,
NULL
))
return
it
;
// Shouldn't happen?
{
DBUG_PRINT
(
"info"
,
(
"fix_fields() failed"
));
DBUG_RETURN
(
it
);
// Shouldn't happen?
}
/* QQ How do we do this? Is there some better way? */
if
(
type
==
MYSQL_TYPE_NULL
)
...
...
@@ -62,9 +67,11 @@ eval_func_item(THD *thd, Item *it, enum enum_field_types type)
{
switch
(
sp_map_result_type
(
type
))
{
case
INT_RESULT
:
DBUG_PRINT
(
"info"
,
(
"INT_RESULT: %d"
,
it
->
val_int
()));
it
=
new
Item_int
(
it
->
val_int
());
break
;
case
REAL_RESULT
:
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: %g"
,
it
->
val
()));
it
=
new
Item_real
(
it
->
val
());
break
;
default:
...
...
@@ -73,6 +80,7 @@ eval_func_item(THD *thd, Item *it, enum enum_field_types type)
String
tmp
(
buffer
,
sizeof
(
buffer
),
it
->
charset
());
String
*
s
=
it
->
val_str
(
&
tmp
);
DBUG_PRINT
(
"info"
,
(
"default result: %*s"
,
s
->
length
(),
s
->
c_ptr_quick
()))
it
=
new
Item_string
(
sql_strmake
(
s
->
c_ptr_quick
(),
s
->
length
()),
s
->
length
(),
it
->
charset
());
break
;
...
...
@@ -80,7 +88,7 @@ eval_func_item(THD *thd, Item *it, enum enum_field_types type)
}
}
return
it
;
DBUG_RETURN
(
it
)
;
}
sp_head
::
sp_head
(
LEX_STRING
*
name
,
LEX
*
lex
)
...
...
@@ -209,7 +217,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
else
{
if
(
pvar
->
mode
==
sp_param_out
)
nctx
->
push_item
(
it
->
this_item
()
);
// OUT
nctx
->
push_item
(
NULL
);
// OUT
else
nctx
->
push_item
(
eval_func_item
(
thd
,
it
,
pvar
->
type
));
// IN or INOUT
// Note: If it's OUT or INOUT, it must be a variable.
...
...
sql/sp_pcontext.cc
View file @
0d95f36a
...
...
@@ -65,10 +65,14 @@ sp_pcontext::find_pvar(LEX_STRING *name)
while
(
i
--
>
0
)
{
uint
len
=
m_pvar
[
i
].
name
->
const_string
()
->
length
();
if
(
name
->
length
>
len
)
len
=
name
->
length
;
if
(
my_strncasecmp
(
system_charset_info
,
name
->
str
,
m_pvar
[
i
].
name
->
const_string
()
->
ptr
(),
name
->
length
)
==
0
)
len
)
==
0
)
{
return
m_pvar
+
i
;
}
...
...
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