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
5443b9db
Commit
5443b9db
authored
May 28, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving "bool abort_on_null" from Item_bool_func2 to Item_func_eq,
as it's not used by the other Item_bool_func2 descendands.
parent
979c5049
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+6
-2
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+6
-7
No files found.
sql/item_cmpfunc.cc
View file @
5443b9db
...
...
@@ -1281,9 +1281,13 @@ int Arg_comparator::compare_row()
case
Item_func
:
:
GT_FUNC
:
case
Item_func
:
:
GE_FUNC
:
return
-
1
;
// <, <=, > and >= always fail on NULL
default:
// EQ_FUNC
if
(((
Item_
bool_func2
*
)
owner
)
->
abort_on_null
)
case
Item_func
:
:
EQ_FUNC
:
if
(((
Item_
func_eq
*
)
owner
)
->
abort_on_null
)
return
-
1
;
// We do not need correct NULL returning
break
;
default:
DBUG_ASSERT
(
0
);
break
;
}
was_null
=
1
;
owner
->
null_value
=
0
;
...
...
sql/item_cmpfunc.h
View file @
5443b9db
...
...
@@ -293,12 +293,10 @@ class Item_bool_func2 :public Item_bool_func
{
/* Bool with 2 string args */
protected:
Arg_comparator
cmp
;
bool
abort_on_null
;
public:
Item_bool_func2
(
Item
*
a
,
Item
*
b
)
:
Item_bool_func
(
a
,
b
),
cmp
(
tmp_arg
,
tmp_arg
+
1
),
abort_on_null
(
FALSE
)
{
sargable
=
TRUE
;
}
:
Item_bool_func
(
a
,
b
),
cmp
(
tmp_arg
,
tmp_arg
+
1
)
{
sargable
=
TRUE
;
}
void
fix_length_and_dec
();
int
set_cmp_func
()
{
...
...
@@ -316,7 +314,6 @@ class Item_bool_func2 :public Item_bool_func
bool
is_null
()
{
return
MY_TEST
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp
.
cmp_collation
.
collation
;
}
void
top_level_item
()
{
abort_on_null
=
TRUE
;
}
Arg_comparator
*
get_comparator
()
{
return
&
cmp
;
}
void
cleanup
()
{
...
...
@@ -326,7 +323,6 @@ class Item_bool_func2 :public Item_bool_func
COND
*
remove_eq_conds
(
THD
*
thd
,
Item
::
cond_result
*
cond_value
,
bool
top_level
);
friend
class
Arg_comparator
;
};
class
Item_bool_rowready_func2
:
public
Item_bool_func2
...
...
@@ -369,7 +365,6 @@ class Item_func_xor :public Item_bool_func2
enum
Functype
functype
()
const
{
return
XOR_FUNC
;
}
const
char
*
func_name
()
const
{
return
"xor"
;
}
longlong
val_int
();
void
top_level_item
()
{}
Item
*
neg_transformer
(
THD
*
thd
);
bool
subst_argument_checker
(
uchar
**
arg
)
{
...
...
@@ -478,15 +473,18 @@ class Item_func_nop_all :public Item_func_not_all
class
Item_func_eq
:
public
Item_bool_rowready_func2
{
bool
abort_on_null
;
public:
Item_func_eq
(
Item
*
a
,
Item
*
b
)
:
Item_bool_rowready_func2
(
a
,
b
),
in_equality_no
(
UINT_MAX
)
Item_bool_rowready_func2
(
a
,
b
),
abort_on_null
(
false
),
in_equality_no
(
UINT_MAX
)
{}
longlong
val_int
();
enum
Functype
functype
()
const
{
return
EQ_FUNC
;
}
enum
Functype
rev_functype
()
const
{
return
EQ_FUNC
;
}
cond_result
eq_cmp_result
()
const
{
return
COND_TRUE
;
}
const
char
*
func_name
()
const
{
return
"="
;
}
void
top_level_item
()
{
abort_on_null
=
true
;
}
Item
*
negated_item
();
COND
*
build_equal_items
(
THD
*
thd
,
COND_EQUAL
*
inherited
,
bool
link_item_fields
,
...
...
@@ -508,6 +506,7 @@ class Item_func_eq :public Item_bool_rowready_func2
*/
uint
in_equality_no
;
virtual
uint
exists2in_reserved_items
()
{
return
1
;
};
friend
class
Arg_comparator
;
};
class
Item_func_equal
:
public
Item_bool_rowready_func2
...
...
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