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
3fbc765b
Commit
3fbc765b
authored
Jul 04, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better arguments format to allow reuse more code
parent
de9ba384
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
sql/item_func.cc
sql/item_func.cc
+10
-10
sql/item_func.h
sql/item_func.h
+2
-2
sql/item_strfunc.cc
sql/item_strfunc.cc
+6
-6
No files found.
sql/item_func.cc
View file @
3fbc765b
...
...
@@ -64,15 +64,15 @@ static void my_coll_agg_error(Item** args, uint ac, const char *fname)
my_error
(
ER_CANT_AGGREGATE_NCOLLATIONS
,
MYF
(
0
),
fname
);
}
bool
Item_func
::
agg_arg_collations
(
DTCollation
&
c
,
uint
from
,
uint
arg
c
)
bool
Item_func
::
agg_arg_collations
(
DTCollation
&
c
,
Item
**
av
,
uint
a
c
)
{
uint
i
;
c
.
set
(
a
rgs
[
from
]
->
collation
);
for
(
i
=
from
+
1
;
i
<
arg
c
;
i
++
)
c
.
set
(
a
v
[
0
]
->
collation
);
for
(
i
=
1
;
i
<
a
c
;
i
++
)
{
if
(
c
.
aggregate
(
a
rgs
[
i
]
->
collation
))
if
(
c
.
aggregate
(
a
v
[
i
]
->
collation
))
{
my_coll_agg_error
(
a
rgs
+
from
,
argc
-
from
,
func_name
());
my_coll_agg_error
(
a
v
,
ac
,
func_name
());
return
TRUE
;
}
}
...
...
@@ -80,14 +80,14 @@ bool Item_func::agg_arg_collations(DTCollation &c, uint from, uint argc)
}
bool
Item_func
::
agg_arg_collations_for_comparison
(
DTCollation
&
c
,
uint
from
,
uint
arg
c
)
Item
**
av
,
uint
a
c
)
{
if
(
agg_arg_collations
(
c
,
from
,
arg
c
))
return
FALS
E
;
if
(
agg_arg_collations
(
c
,
av
,
a
c
))
return
TRU
E
;
if
(
c
.
derivation
==
DERIVATION_NONE
)
{
my_coll_agg_error
(
a
rgs
+
from
,
argc
-
from
,
func_name
());
my_coll_agg_error
(
a
v
,
ac
,
func_name
());
return
TRUE
;
}
return
FALSE
;
...
...
sql/item_func.h
View file @
3fbc765b
...
...
@@ -136,8 +136,8 @@ public:
void
set_outer_resolving
();
Item
*
get_tmp_table_item
(
THD
*
thd
);
bool
agg_arg_collations
(
DTCollation
&
c
,
uint
from
,
uint
argc
);
bool
agg_arg_collations_for_comparison
(
DTCollation
&
c
,
uint
from
,
uint
argc
);
bool
agg_arg_collations
(
DTCollation
&
c
,
Item
**
items
,
uint
nitems
);
bool
agg_arg_collations_for_comparison
(
DTCollation
&
c
,
Item
**
items
,
uint
nitems
);
};
...
...
sql/item_strfunc.cc
View file @
3fbc765b
...
...
@@ -324,7 +324,7 @@ void Item_func_concat::fix_length_and_dec()
bool
first_coll
=
1
;
max_length
=
0
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
...
@@ -823,7 +823,7 @@ void Item_func_replace::fix_length_and_dec()
maybe_null
=
1
;
}
if
(
agg_arg_collations_for_comparison
(
collation
,
0
,
3
))
if
(
agg_arg_collations_for_comparison
(
collation
,
args
,
3
))
return
;
}
...
...
@@ -1029,7 +1029,7 @@ void Item_func_substr_index::fix_length_and_dec()
{
max_length
=
args
[
0
]
->
max_length
;
if
(
agg_arg_collations_for_comparison
(
collation
,
0
,
2
))
if
(
agg_arg_collations_for_comparison
(
collation
,
args
,
2
))
return
;
}
...
...
@@ -1658,7 +1658,7 @@ void Item_func_elt::fix_length_and_dec()
max_length
=
0
;
decimals
=
0
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
...
@@ -1758,7 +1758,7 @@ void Item_func_make_set::fix_length_and_dec()
{
max_length
=
arg_count
-
1
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
...
@@ -2431,7 +2431,7 @@ void Item_func_export_set::fix_length_and_dec()
uint
sep_length
=
(
arg_count
>
3
?
args
[
3
]
->
max_length
:
1
);
max_length
=
length
*
64
+
sep_length
*
63
;
if
(
agg_arg_collations
(
collation
,
1
,
min
(
4
,
arg_count
)
))
if
(
agg_arg_collations
(
collation
,
args
+
1
,
min
(
4
,
arg_count
)
-
1
))
return
;
}
...
...
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