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
077b8328
Commit
077b8328
authored
Jul 04, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better arguments format to allow reuse more code
parent
d512f007
Changes
3
Show 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 @
077b8328
...
@@ -64,15 +64,15 @@ static void my_coll_agg_error(Item** args, uint ac, const char *fname)
...
@@ -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
);
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
;
uint
i
;
c
.
set
(
a
rgs
[
from
]
->
collation
);
c
.
set
(
a
v
[
0
]
->
collation
);
for
(
i
=
from
+
1
;
i
<
arg
c
;
i
++
)
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
;
return
TRUE
;
}
}
}
}
...
@@ -80,14 +80,14 @@ bool Item_func::agg_arg_collations(DTCollation &c, uint from, uint argc)
...
@@ -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
,
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
))
if
(
agg_arg_collations
(
c
,
av
,
a
c
))
return
FALS
E
;
return
TRU
E
;
if
(
c
.
derivation
==
DERIVATION_NONE
)
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
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
...
sql/item_func.h
View file @
077b8328
...
@@ -136,8 +136,8 @@ class Item_func :public Item_result_field
...
@@ -136,8 +136,8 @@ class Item_func :public Item_result_field
void
set_outer_resolving
();
void
set_outer_resolving
();
Item
*
get_tmp_table_item
(
THD
*
thd
);
Item
*
get_tmp_table_item
(
THD
*
thd
);
bool
agg_arg_collations
(
DTCollation
&
c
,
uint
from
,
uint
argc
);
bool
agg_arg_collations
(
DTCollation
&
c
,
Item
**
items
,
uint
nitems
);
bool
agg_arg_collations_for_comparison
(
DTCollation
&
c
,
uint
from
,
uint
argc
);
bool
agg_arg_collations_for_comparison
(
DTCollation
&
c
,
Item
**
items
,
uint
nitems
);
};
};
...
...
sql/item_strfunc.cc
View file @
077b8328
...
@@ -324,7 +324,7 @@ void Item_func_concat::fix_length_and_dec()
...
@@ -324,7 +324,7 @@ void Item_func_concat::fix_length_and_dec()
bool
first_coll
=
1
;
bool
first_coll
=
1
;
max_length
=
0
;
max_length
=
0
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
@@ -823,7 +823,7 @@ void Item_func_replace::fix_length_and_dec()
...
@@ -823,7 +823,7 @@ void Item_func_replace::fix_length_and_dec()
maybe_null
=
1
;
maybe_null
=
1
;
}
}
if
(
agg_arg_collations_for_comparison
(
collation
,
0
,
3
))
if
(
agg_arg_collations_for_comparison
(
collation
,
args
,
3
))
return
;
return
;
}
}
...
@@ -1029,7 +1029,7 @@ void Item_func_substr_index::fix_length_and_dec()
...
@@ -1029,7 +1029,7 @@ void Item_func_substr_index::fix_length_and_dec()
{
{
max_length
=
args
[
0
]
->
max_length
;
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
;
return
;
}
}
...
@@ -1658,7 +1658,7 @@ void Item_func_elt::fix_length_and_dec()
...
@@ -1658,7 +1658,7 @@ void Item_func_elt::fix_length_and_dec()
max_length
=
0
;
max_length
=
0
;
decimals
=
0
;
decimals
=
0
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
@@ -1758,7 +1758,7 @@ void Item_func_make_set::fix_length_and_dec()
...
@@ -1758,7 +1758,7 @@ void Item_func_make_set::fix_length_and_dec()
{
{
max_length
=
arg_count
-
1
;
max_length
=
arg_count
-
1
;
if
(
agg_arg_collations
(
collation
,
0
,
arg_count
))
if
(
agg_arg_collations
(
collation
,
args
,
arg_count
))
return
;
return
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
...
@@ -2431,7 +2431,7 @@ void Item_func_export_set::fix_length_and_dec()
...
@@ -2431,7 +2431,7 @@ void Item_func_export_set::fix_length_and_dec()
uint
sep_length
=
(
arg_count
>
3
?
args
[
3
]
->
max_length
:
1
);
uint
sep_length
=
(
arg_count
>
3
?
args
[
3
]
->
max_length
:
1
);
max_length
=
length
*
64
+
sep_length
*
63
;
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
;
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