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
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()
...
@@ -1281,9 +1281,13 @@ int Arg_comparator::compare_row()
case
Item_func
:
:
GT_FUNC
:
case
Item_func
:
:
GT_FUNC
:
case
Item_func
:
:
GE_FUNC
:
case
Item_func
:
:
GE_FUNC
:
return
-
1
;
// <, <=, > and >= always fail on NULL
return
-
1
;
// <, <=, > and >= always fail on NULL
default:
// EQ_FUNC
case
Item_func
:
:
EQ_FUNC
:
if
(((
Item_
bool_func2
*
)
owner
)
->
abort_on_null
)
if
(((
Item_
func_eq
*
)
owner
)
->
abort_on_null
)
return
-
1
;
// We do not need correct NULL returning
return
-
1
;
// We do not need correct NULL returning
break
;
default:
DBUG_ASSERT
(
0
);
break
;
}
}
was_null
=
1
;
was_null
=
1
;
owner
->
null_value
=
0
;
owner
->
null_value
=
0
;
...
...
sql/item_cmpfunc.h
View file @
5443b9db
...
@@ -293,12 +293,10 @@ class Item_bool_func2 :public Item_bool_func
...
@@ -293,12 +293,10 @@ class Item_bool_func2 :public Item_bool_func
{
/* Bool with 2 string args */
{
/* Bool with 2 string args */
protected:
protected:
Arg_comparator
cmp
;
Arg_comparator
cmp
;
bool
abort_on_null
;
public:
public:
Item_bool_func2
(
Item
*
a
,
Item
*
b
)
Item_bool_func2
(
Item
*
a
,
Item
*
b
)
:
Item_bool_func
(
a
,
b
),
cmp
(
tmp_arg
,
tmp_arg
+
1
),
:
Item_bool_func
(
a
,
b
),
cmp
(
tmp_arg
,
tmp_arg
+
1
)
{
sargable
=
TRUE
;
}
abort_on_null
(
FALSE
)
{
sargable
=
TRUE
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
int
set_cmp_func
()
int
set_cmp_func
()
{
{
...
@@ -316,7 +314,6 @@ public:
...
@@ -316,7 +314,6 @@ public:
bool
is_null
()
{
return
MY_TEST
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
bool
is_null
()
{
return
MY_TEST
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
CHARSET_INFO
*
compare_collation
()
const
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp
.
cmp_collation
.
collation
;
}
{
return
cmp
.
cmp_collation
.
collation
;
}
void
top_level_item
()
{
abort_on_null
=
TRUE
;
}
Arg_comparator
*
get_comparator
()
{
return
&
cmp
;
}
Arg_comparator
*
get_comparator
()
{
return
&
cmp
;
}
void
cleanup
()
void
cleanup
()
{
{
...
@@ -326,7 +323,6 @@ public:
...
@@ -326,7 +323,6 @@ public:
COND
*
remove_eq_conds
(
THD
*
thd
,
Item
::
cond_result
*
cond_value
,
COND
*
remove_eq_conds
(
THD
*
thd
,
Item
::
cond_result
*
cond_value
,
bool
top_level
);
bool
top_level
);
friend
class
Arg_comparator
;
};
};
class
Item_bool_rowready_func2
:
public
Item_bool_func2
class
Item_bool_rowready_func2
:
public
Item_bool_func2
...
@@ -369,7 +365,6 @@ public:
...
@@ -369,7 +365,6 @@ public:
enum
Functype
functype
()
const
{
return
XOR_FUNC
;
}
enum
Functype
functype
()
const
{
return
XOR_FUNC
;
}
const
char
*
func_name
()
const
{
return
"xor"
;
}
const
char
*
func_name
()
const
{
return
"xor"
;
}
longlong
val_int
();
longlong
val_int
();
void
top_level_item
()
{}
Item
*
neg_transformer
(
THD
*
thd
);
Item
*
neg_transformer
(
THD
*
thd
);
bool
subst_argument_checker
(
uchar
**
arg
)
bool
subst_argument_checker
(
uchar
**
arg
)
{
{
...
@@ -478,15 +473,18 @@ public:
...
@@ -478,15 +473,18 @@ public:
class
Item_func_eq
:
public
Item_bool_rowready_func2
class
Item_func_eq
:
public
Item_bool_rowready_func2
{
{
bool
abort_on_null
;
public:
public:
Item_func_eq
(
Item
*
a
,
Item
*
b
)
:
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
();
longlong
val_int
();
enum
Functype
functype
()
const
{
return
EQ_FUNC
;
}
enum
Functype
functype
()
const
{
return
EQ_FUNC
;
}
enum
Functype
rev_functype
()
const
{
return
EQ_FUNC
;
}
enum
Functype
rev_functype
()
const
{
return
EQ_FUNC
;
}
cond_result
eq_cmp_result
()
const
{
return
COND_TRUE
;
}
cond_result
eq_cmp_result
()
const
{
return
COND_TRUE
;
}
const
char
*
func_name
()
const
{
return
"="
;
}
const
char
*
func_name
()
const
{
return
"="
;
}
void
top_level_item
()
{
abort_on_null
=
true
;
}
Item
*
negated_item
();
Item
*
negated_item
();
COND
*
build_equal_items
(
THD
*
thd
,
COND_EQUAL
*
inherited
,
COND
*
build_equal_items
(
THD
*
thd
,
COND_EQUAL
*
inherited
,
bool
link_item_fields
,
bool
link_item_fields
,
...
@@ -508,6 +506,7 @@ public:
...
@@ -508,6 +506,7 @@ public:
*/
*/
uint
in_equality_no
;
uint
in_equality_no
;
virtual
uint
exists2in_reserved_items
()
{
return
1
;
};
virtual
uint
exists2in_reserved_items
()
{
return
1
;
};
friend
class
Arg_comparator
;
};
};
class
Item_func_equal
:
public
Item_bool_rowready_func2
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