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
9248f0d7
Commit
9248f0d7
authored
Mar 13, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Item_func_isnotnull::not_null_tables - return 0 if not top-level item
parent
8986ffeb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
mysql-test/r/join_outer.result
mysql-test/r/join_outer.result
+3
-0
mysql-test/t/join_outer.test
mysql-test/t/join_outer.test
+1
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+5
-3
No files found.
mysql-test/r/join_outer.result
View file @
9248f0d7
...
@@ -650,6 +650,9 @@ select * from t1 natural left join t2 natural left join t3;
...
@@ -650,6 +650,9 @@ select * from t1 natural left join t2 natural left join t3;
i i i
i i i
1 NULL NULL
1 NULL NULL
2 2 2
2 2 2
select * from t1 natural left join t2 where (t2.i is not null)=0;
i i
1 NULL
drop table t1,t2,t3;
drop table t1,t2,t3;
create table t1 (f1 integer,f2 integer,f3 integer);
create table t1 (f1 integer,f2 integer,f3 integer);
create table t2 (f2 integer,f4 integer);
create table t2 (f2 integer,f4 integer);
...
...
mysql-test/t/join_outer.test
View file @
9248f0d7
...
@@ -430,6 +430,7 @@ insert into t1 values(1),(2);
...
@@ -430,6 +430,7 @@ insert into t1 values(1),(2);
insert
into
t2
values
(
2
),(
3
);
insert
into
t2
values
(
2
),(
3
);
insert
into
t3
values
(
2
),(
4
);
insert
into
t3
values
(
2
),(
4
);
select
*
from
t1
natural
left
join
t2
natural
left
join
t3
;
select
*
from
t1
natural
left
join
t2
natural
left
join
t3
;
select
*
from
t1
natural
left
join
t2
where
(
t2
.
i
is
not
null
)
=
0
;
drop
table
t1
,
t2
,
t3
;
drop
table
t1
,
t2
,
t3
;
#
#
...
...
sql/item_cmpfunc.h
View file @
9248f0d7
...
@@ -905,8 +905,9 @@ public:
...
@@ -905,8 +905,9 @@ public:
class
Item_func_isnotnull
:
public
Item_bool_func
class
Item_func_isnotnull
:
public
Item_bool_func
{
{
bool
abort_on_null
;
public:
public:
Item_func_isnotnull
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
Item_func_isnotnull
(
Item
*
a
)
:
Item_bool_func
(
a
)
,
abort_on_null
(
0
)
{}
longlong
val_int
();
longlong
val_int
();
enum
Functype
functype
()
const
{
return
ISNOTNULL_FUNC
;
}
enum
Functype
functype
()
const
{
return
ISNOTNULL_FUNC
;
}
void
fix_length_and_dec
()
void
fix_length_and_dec
()
...
@@ -915,10 +916,11 @@ public:
...
@@ -915,10 +916,11 @@ public:
}
}
const
char
*
func_name
()
const
{
return
"isnotnull"
;
}
const
char
*
func_name
()
const
{
return
"isnotnull"
;
}
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NULL
;
}
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NULL
;
}
table_map
not_null_tables
()
const
{
return
used_tables
()
;
}
table_map
not_null_tables
()
const
{
return
abort_on_null
?
used_tables
()
:
0
;
}
Item
*
neg_transformer
(
THD
*
thd
);
Item
*
neg_transformer
(
THD
*
thd
);
void
print
(
String
*
str
);
void
print
(
String
*
str
);
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
void
top_level_item
()
{
abort_on_null
=
1
;
}
};
};
...
@@ -1004,7 +1006,7 @@ public:
...
@@ -1004,7 +1006,7 @@ public:
/* Item_cond() is only used to create top level items */
/* Item_cond() is only used to create top level items */
Item_cond
()
:
Item_bool_func
(),
abort_on_null
(
1
)
Item_cond
()
:
Item_bool_func
(),
abort_on_null
(
1
)
{
const_item_cache
=
0
;
}
{
const_item_cache
=
0
;
}
Item_cond
(
Item
*
i1
,
Item
*
i2
)
Item_cond
(
Item
*
i1
,
Item
*
i2
)
:
Item_bool_func
(),
abort_on_null
(
0
)
:
Item_bool_func
(),
abort_on_null
(
0
)
{
{
list
.
push_back
(
i1
);
list
.
push_back
(
i1
);
...
...
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