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
0333deef
Commit
0333deef
authored
Jul 04, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code was reused
parent
a371a6e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
46 deletions
+13
-46
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-34
sql/item_func.cc
sql/item_func.cc
+4
-11
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-1
No files found.
sql/item_cmpfunc.cc
View file @
0333deef
...
...
@@ -32,18 +32,6 @@ static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fnam
fname
);
}
static
void
my_coll_agg3_error
(
DTCollation
&
c1
,
DTCollation
&
c2
,
DTCollation
&
c3
,
const
char
*
fname
)
{
my_error
(
ER_CANT_AGGREGATE_3COLLATIONS
,
MYF
(
0
),
c1
.
collation
->
name
,
c1
.
derivation_name
(),
c2
.
collation
->
name
,
c2
.
derivation_name
(),
c3
.
collation
->
name
,
c3
.
derivation_name
(),
fname
);
}
Item_bool_func2
*
Item_bool_func2
::
eq_creator
(
Item
*
a
,
Item
*
b
)
{
return
new
Item_func_eq
(
a
,
b
);
...
...
@@ -572,18 +560,9 @@ void Item_func_between::fix_length_and_dec()
item_cmp_type
(
args
[
1
]
->
result_type
(),
args
[
2
]
->
result_type
()));
if
(
cmp_type
==
STRING_RESULT
)
{
cmp_collation
.
set
(
args
[
0
]
->
collation
);
if
(
!
cmp_collation
.
aggregate
(
args
[
1
]
->
collation
))
cmp_collation
.
aggregate
(
args
[
2
]
->
collation
);
if
(
cmp_collation
.
derivation
==
DERIVATION_NONE
)
{
my_coll_agg3_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
args
[
2
]
->
collation
,
func_name
());
return
;
}
}
if
(
cmp_type
==
STRING_RESULT
&&
agg_arg_collations_for_comparison
(
cmp_collation
,
args
,
3
))
return
;
/*
Make a special case of compare with date/time and longlong fields.
...
...
@@ -691,8 +670,8 @@ Item_func_ifnull::fix_length_and_dec()
args
[
1
]
->
result_type
()))
!=
REAL_RESULT
)
decimals
=
0
;
if
(
c
ollation
.
set
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
)
)
my_coll_agg_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
func_name
()
);
if
(
c
ached_result_type
==
STRING_RESULT
)
agg_arg_collations
(
collation
,
args
,
arg_count
);
}
...
...
@@ -768,11 +747,8 @@ Item_func_if::fix_length_and_dec()
else
if
(
arg1_type
==
STRING_RESULT
||
arg2_type
==
STRING_RESULT
)
{
cached_result_type
=
STRING_RESULT
;
if
(
collation
.
set
(
args
[
1
]
->
collation
,
args
[
2
]
->
collation
))
{
my_coll_agg_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
func_name
());
if
(
agg_arg_collations
(
collation
,
args
+
1
,
2
))
return
;
}
}
else
{
...
...
@@ -1972,11 +1948,8 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
max_length
=
1
;
decimals
=
0
;
if
(
cmp_collation
.
set
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
))
{
my_coll_agg_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
func_name
());
if
(
agg_arg_collations
(
cmp_collation
,
args
,
2
))
return
1
;
}
used_tables_cache
=
args
[
0
]
->
used_tables
()
|
args
[
1
]
->
used_tables
();
const_item_cache
=
args
[
0
]
->
const_item
()
&&
args
[
1
]
->
const_item
();
...
...
sql/item_func.cc
View file @
0333deef
...
...
@@ -921,14 +921,9 @@ void Item_func_min_max::fix_length_and_dec()
if
(
!
args
[
i
]
->
maybe_null
)
maybe_null
=
0
;
cmp_type
=
item_cmp_type
(
cmp_type
,
args
[
i
]
->
result_type
());
if
(
i
==
0
)
collation
.
set
(
args
[
0
]
->
collation
);
if
(
collation
.
aggregate
(
args
[
i
]
->
collation
))
{
my_coll_agg_error
(
collation
,
args
[
i
]
->
collation
,
func_name
());
break
;
}
}
if
(
cmp_type
==
STRING_RESULT
)
agg_arg_collations_for_comparison
(
collation
,
args
,
arg_count
);
}
...
...
@@ -1103,8 +1098,7 @@ longlong Item_func_coercibility::val_int()
void
Item_func_locate
::
fix_length_and_dec
()
{
maybe_null
=
0
;
max_length
=
11
;
if
(
cmp_collation
.
set
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
))
my_coll_agg_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
func_name
());
agg_arg_collations_for_comparison
(
cmp_collation
,
args
,
2
);
}
longlong
Item_func_locate
::
val_int
()
...
...
@@ -1310,8 +1304,7 @@ void Item_func_find_in_set::fix_length_and_dec()
}
}
}
if
(
cmp_collation
.
set
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
))
my_coll_agg_error
(
args
[
0
]
->
collation
,
args
[
1
]
->
collation
,
func_name
());
agg_arg_collations_for_comparison
(
cmp_collation
,
args
,
2
);
}
static
const
char
separator
=
','
;
...
...
sql/item_strfunc.cc
View file @
0333deef
...
...
@@ -1317,7 +1317,8 @@ void Item_func_trim::fix_length_and_dec()
remove
.
set_ascii
(
" "
,
1
);
}
else
if
(
collation
.
set
(
args
[
1
]
->
collation
,
args
[
0
]
->
collation
))
if
(
collation
.
set
(
args
[
1
]
->
collation
,
args
[
0
]
->
collation
)
||
collation
.
derivation
==
DERIVATION_NONE
)
{
my_coll_agg_error
(
args
[
1
]
->
collation
,
args
[
0
]
->
collation
,
func_name
());
}
...
...
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