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
05f25fea
Commit
05f25fea
authored
Nov 20, 2003
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle null values correctly in SP local variables.
parent
96f12528
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
3 deletions
+39
-3
mysql-test/r/sp.result
mysql-test/r/sp.result
+12
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+7
-0
sql/item.h
sql/item.h
+20
-3
No files found.
mysql-test/r/sp.result
View file @
05f25fea
...
@@ -85,11 +85,23 @@ declare lf double;
...
@@ -85,11 +85,23 @@ declare lf double;
declare ls varchar(32);
declare ls varchar(32);
set ld = null, li = null, lf = null, ls = null;
set ld = null, li = null, lf = null, ls = null;
insert into t3 values (ld, li, lf, ls);
insert into t3 values (ld, li, lf, ls);
insert into t3 (i, f, s) values ((ld is null), 1, "ld is null"),
((li is null), 1, "li is null"),
((li = 0), null, "li = 0"),
((lf is null), 1, "lf is null"),
((lf = 0), null, "lf = 0"),
((ls is null), 1, "ls is null");
end;
end;
call nullset();
call nullset();
select * from t3;
select * from t3;
d i f s
d i f s
NULL NULL NULL NULL
NULL NULL NULL NULL
NULL 1 1 ld is null
NULL 1 1 li is null
NULL NULL NULL li = 0
NULL 1 1 lf is null
NULL NULL NULL lf = 0
NULL 1 1 ls is null
drop table t3;
drop table t3;
drop procedure nullset;
drop procedure nullset;
create procedure mixset(x char(16), y int)
create procedure mixset(x char(16), y int)
...
...
mysql-test/t/sp.test
View file @
05f25fea
...
@@ -124,6 +124,13 @@ begin
...
@@ -124,6 +124,13 @@ begin
set
ld
=
null
,
li
=
null
,
lf
=
null
,
ls
=
null
;
set
ld
=
null
,
li
=
null
,
lf
=
null
,
ls
=
null
;
insert
into
t3
values
(
ld
,
li
,
lf
,
ls
);
insert
into
t3
values
(
ld
,
li
,
lf
,
ls
);
insert
into
t3
(
i
,
f
,
s
)
values
((
ld
is
null
),
1
,
"ld is null"
),
((
li
is
null
),
1
,
"li is null"
),
((
li
=
0
),
null
,
"li = 0"
),
((
lf
is
null
),
1
,
"lf is null"
),
((
lf
=
0
),
null
,
"lf = 0"
),
((
ls
is
null
),
1
,
"ls is null"
);
end
|
end
|
call
nullset
()
|
call
nullset
()
|
...
...
sql/item.h
View file @
05f25fea
...
@@ -256,17 +256,34 @@ public:
...
@@ -256,17 +256,34 @@ public:
inline
double
val
()
inline
double
val
()
{
{
return
this_item
()
->
val
();
Item
*
it
=
this_item
();
double
ret
=
it
->
val
();
Item
::
null_value
=
it
->
null_value
;
return
ret
;
}
}
inline
longlong
val_int
()
inline
longlong
val_int
()
{
{
return
this_item
()
->
val_int
();
Item
*
it
=
this_item
();
longlong
ret
=
it
->
val_int
();
Item
::
null_value
=
it
->
null_value
;
return
ret
;
}
}
inline
String
*
val_str
(
String
*
sp
)
inline
String
*
val_str
(
String
*
sp
)
{
{
return
this_item
()
->
val_str
(
sp
);
Item
*
it
=
this_item
();
String
*
ret
=
it
->
val_str
(
sp
);
Item
::
null_value
=
it
->
null_value
;
return
ret
;
}
inline
bool
is_null
()
{
Item
*
it
=
this_item
();
bool
ret
=
it
->
is_null
();
Item
::
null_value
=
it
->
null_value
;
return
ret
;
}
}
inline
void
make_field
(
Send_field
*
field
)
inline
void
make_field
(
Send_field
*
field
)
...
...
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