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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
cbc318fc
Commit
cbc318fc
authored
Nov 20, 2014
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing some duplicate code: deriving Item_func_opt_neg from Item_bool_func.
parent
52b3d95f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+5
-7
No files found.
sql/item_cmpfunc.h
View file @
cbc318fc
...
...
@@ -122,6 +122,8 @@ class Item_bool_func :public Item_int_func
Item_bool_func
()
:
Item_int_func
()
{}
Item_bool_func
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_bool_func
(
Item
*
a
,
Item
*
b
)
:
Item_int_func
(
a
,
b
)
{}
Item_bool_func
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_int_func
(
a
,
b
,
c
)
{}
Item_bool_func
(
List
<
Item
>
&
list
)
:
Item_int_func
(
list
)
{
}
Item_bool_func
(
THD
*
thd
,
Item_bool_func
*
item
)
:
Item_int_func
(
thd
,
item
)
{}
bool
is_bool_func
()
{
return
1
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
1
;
}
...
...
@@ -644,16 +646,16 @@ class Item_func_ne :public Item_bool_rowready_func2
*/
class
Item_func_opt_neg
:
public
Item_
int
_func
class
Item_func_opt_neg
:
public
Item_
bool
_func
{
public:
bool
negated
;
/* <=> the item represents NOT <func> */
bool
pred_level
;
/* <=> [NOT] <func> is used on a predicate level */
public:
Item_func_opt_neg
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_
int
_func
(
a
,
b
,
c
),
negated
(
0
),
pred_level
(
0
)
{}
:
Item_
bool
_func
(
a
,
b
,
c
),
negated
(
0
),
pred_level
(
0
)
{}
Item_func_opt_neg
(
List
<
Item
>
&
list
)
:
Item_
int
_func
(
list
),
negated
(
0
),
pred_level
(
0
)
{}
:
Item_
bool
_func
(
list
),
negated
(
0
),
pred_level
(
0
)
{}
public:
inline
void
negate
()
{
negated
=
!
negated
;
}
inline
void
top_level_item
()
{
pred_level
=
1
;
}
...
...
@@ -684,9 +686,7 @@ class Item_func_between :public Item_func_opt_neg
bool
fix_fields
(
THD
*
,
Item
**
);
void
fix_length_and_dec
();
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
bool
is_bool_func
()
{
return
1
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
uint
decimal_precision
()
const
{
return
1
;
}
bool
eval_not_null_tables
(
uchar
*
opt_arg
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
);
bool
count_sargable_conds
(
uchar
*
arg
);
...
...
@@ -1352,7 +1352,6 @@ class Item_func_in :public Item_func_opt_neg
longlong
val_int
();
bool
fix_fields
(
THD
*
,
Item
**
);
void
fix_length_and_dec
();
uint
decimal_precision
()
const
{
return
1
;
}
void
cleanup
()
{
uint
i
;
...
...
@@ -1373,7 +1372,6 @@ class Item_func_in :public Item_func_opt_neg
enum
Functype
functype
()
const
{
return
IN_FUNC
;
}
const
char
*
func_name
()
const
{
return
" IN "
;
}
bool
nulls_in_row
();
bool
is_bool_func
()
{
return
1
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
bool
eval_not_null_tables
(
uchar
*
opt_arg
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
);
...
...
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