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
bd210585
Commit
bd210585
authored
Mar 13, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding "const" qualifier to Item::compare_collation()
parent
4d0e5218
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
sql/field.cc
sql/field.cc
+1
-1
sql/item.h
sql/item.h
+1
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-2
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+10
-9
No files found.
sql/field.cc
View file @
bd210585
...
...
@@ -6476,7 +6476,7 @@ bool Field_longstr::can_optimize_group_min_max(const Item_bool_func2 *cond,
return
false
;
// Don't use an index when comparing strings of different collations.
return
charset
()
==
((
Item_bool_func2
*
)
cond
)
->
compare_collation
();
return
charset
()
==
cond
->
compare_collation
();
}
...
...
sql/item.h
View file @
bd210585
...
...
@@ -1136,7 +1136,7 @@ public:
virtual
Item
*
get_tmp_table_item
(
THD
*
thd
)
{
return
copy_or_same
(
thd
);
}
static
CHARSET_INFO
*
default_charset
();
virtual
CHARSET_INFO
*
compare_collation
()
{
return
NULL
;
}
virtual
CHARSET_INFO
*
compare_collation
()
const
{
return
NULL
;
}
/*
For backward compatibility, to make numeric
...
...
sql/item_cmpfunc.cc
View file @
bd210585
...
...
@@ -6279,9 +6279,9 @@ void Item_equal::print(String *str, enum_query_type query_type)
}
CHARSET_INFO
*
Item_equal
::
compare_collation
()
CHARSET_INFO
*
Item_equal
::
compare_collation
()
const
{
Item_equal_fields_iterator
it
(
*
this
);
Item_equal_fields_iterator
it
(
*
((
Item_equal
*
)
this
)
);
Item
*
item
=
it
++
;
return
item
->
collation
.
collation
;
}
...
...
sql/item_cmpfunc.h
View file @
bd210585
...
...
@@ -399,7 +399,8 @@ public:
}
bool
is_null
()
{
return
MY_TEST
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp
.
cmp_collation
.
collation
;
}
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
()
...
...
@@ -700,7 +701,7 @@ public:
bool
fix_fields
(
THD
*
,
Item
**
);
void
fix_length_and_dec
();
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp_collation
.
collation
;
}
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
);
...
...
@@ -1319,7 +1320,7 @@ public:
const
char
*
func_name
()
const
{
return
"case"
;
}
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
Item
*
find_item
(
String
*
str
);
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp_collation
.
collation
;
}
void
cleanup
();
void
agg_str_lengths
(
Item
*
arg
);
void
agg_num_lengths
(
Item
*
arg
);
...
...
@@ -1388,7 +1389,7 @@ public:
enum
Functype
functype
()
const
{
return
IN_FUNC
;
}
const
char
*
func_name
()
const
{
return
" IN "
;
}
bool
nulls_in_row
();
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp_collation
.
collation
;
}
bool
eval_not_null_tables
(
uchar
*
opt_arg
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
);
};
...
...
@@ -1428,7 +1429,8 @@ class Item_func_null_predicate :public Item_bool_func
public:
Item_func_null_predicate
(
Item
*
a
)
:
Item_bool_func
(
a
)
{
sargable
=
true
;
}
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NULL
;
}
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
const
{
return
args
[
0
]
->
collation
.
collation
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
1
;
maybe_null
=
0
;
}
};
...
...
@@ -1574,8 +1576,7 @@ public:
in case of a "PAD SPACE" collation, but only if "expr2" has '%'
at the end.
*/
return
((
Item_func_like
*
)
this
)
->
compare_collation
()
==
&
my_charset_bin
?
COND_TRUE
:
COND_OK
;
return
compare_collation
()
==
&
my_charset_bin
?
COND_TRUE
:
COND_OK
;
}
const
char
*
func_name
()
const
{
return
"like"
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
...
...
@@ -1689,7 +1690,7 @@ public:
print_op
(
str
,
query_type
);
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp_collation
.
collation
;
}
};
...
...
@@ -1952,7 +1953,7 @@ public:
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
uchar
*
arg
);
Item
*
transform
(
Item_transformer
transformer
,
uchar
*
arg
);
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
CHARSET_INFO
*
compare_collation
();
CHARSET_INFO
*
compare_collation
()
const
;
void
set_context_field
(
Item_field
*
ctx_field
)
{
context_field
=
ctx_field
;
}
void
set_link_equal_fields
(
bool
flag
)
{
link_equal_fields
=
flag
;
}
...
...
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