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
9f661429
Commit
9f661429
authored
Jul 02, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There is no Item->binary() anymore. It was remain from 4.0.
parent
7db27ade
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
25 deletions
+17
-25
sql/item.h
sql/item.h
+0
-3
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+3
-8
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+0
-2
sql/item_func.cc
sql/item_func.cc
+12
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-1
sql/sql_analyse.cc
sql/sql_analyse.cc
+0
-6
sql/sql_analyse.h
sql/sql_analyse.h
+1
-4
No files found.
sql/item.h
View file @
9f661429
...
@@ -185,9 +185,6 @@ class Item {
...
@@ -185,9 +185,6 @@ class Item {
collation
.
collation
=
collation_arg
->
collation
;
collation
.
collation
=
collation_arg
->
collation
;
collation
.
derivation
=
collation_arg
->
derivation
;
collation
.
derivation
=
collation_arg
->
derivation
;
}
}
bool
binary
()
const
{
return
charset
()
->
state
&
MY_CS_BINSORT
?
1
:
0
;
}
virtual
void
set_outer_resolving
()
{}
virtual
void
set_outer_resolving
()
{}
// Row emulation
// Row emulation
...
...
sql/item_cmpfunc.cc
View file @
9f661429
...
@@ -380,12 +380,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
...
@@ -380,12 +380,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
return
1
;
return
1
;
if
(
args
[
0
]
->
maybe_null
)
if
(
args
[
0
]
->
maybe_null
)
maybe_null
=
1
;
maybe_null
=
1
;
/*
TODO: Check if following is right
(set_charset set type of result, not how compare should be used)
*/
if
(
args
[
0
]
->
binary
())
set_charset
(
&
my_charset_bin
);
with_sum_func
=
args
[
0
]
->
with_sum_func
;
with_sum_func
=
args
[
0
]
->
with_sum_func
;
used_tables_cache
=
args
[
0
]
->
used_tables
();
used_tables_cache
=
args
[
0
]
->
used_tables
();
const_item_cache
=
args
[
0
]
->
const_item
();
const_item_cache
=
args
[
0
]
->
const_item
();
...
@@ -933,7 +928,7 @@ Item *Item_func_case::find_item(String *str)
...
@@ -933,7 +928,7 @@ Item *Item_func_case::find_item(String *str)
if
((
tmp
=
args
[
i
]
->
val_str
(
str
)))
// If not null
if
((
tmp
=
args
[
i
]
->
val_str
(
str
)))
// If not null
{
{
/* QQ: COERCIBILITY */
/* QQ: COERCIBILITY */
if
(
first_expr_is_binary
||
args
[
i
]
->
binary
(
))
if
(
first_expr_is_binary
||
(
args
[
i
]
->
charset
()
->
state
&
MY_CS_BINSORT
))
{
{
if
(
sortcmp
(
tmp
,
first_expr_str
,
&
my_charset_bin
)
==
0
)
if
(
sortcmp
(
tmp
,
first_expr_str
,
&
my_charset_bin
)
==
0
)
return
args
[
i
+
1
];
return
args
[
i
+
1
];
...
@@ -1044,7 +1039,7 @@ Item_func_case::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
...
@@ -1044,7 +1039,7 @@ Item_func_case::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
used_tables_cache
|=
(
first_expr
)
->
used_tables
();
used_tables_cache
|=
(
first_expr
)
->
used_tables
();
const_item_cache
&=
(
first_expr
)
->
const_item
();
const_item_cache
&=
(
first_expr
)
->
const_item
();
with_sum_func
=
with_sum_func
||
(
first_expr
)
->
with_sum_func
;
with_sum_func
=
with_sum_func
||
(
first_expr
)
->
with_sum_func
;
first_expr_is_binary
=
first_expr
->
binary
()
;
first_expr_is_binary
=
first_expr
->
charset
()
->
state
&
MY_CS_BINSORT
;
}
}
if
(
else_expr
)
if
(
else_expr
)
{
{
...
...
sql/item_cmpfunc.h
View file @
9f661429
...
@@ -129,8 +129,6 @@ class Item_bool_func2 :public Item_int_func
...
@@ -129,8 +129,6 @@ class Item_bool_func2 :public Item_int_func
bool
have_rev_func
()
const
{
return
rev_functype
()
!=
UNKNOWN_FUNC
;
}
bool
have_rev_func
()
const
{
return
rev_functype
()
!=
UNKNOWN_FUNC
;
}
void
print
(
String
*
str
)
{
Item_func
::
print_op
(
str
);
}
void
print
(
String
*
str
)
{
Item_func
::
print_op
(
str
);
}
bool
is_null
()
{
return
test
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
bool
is_null
()
{
return
test
(
args
[
0
]
->
is_null
()
||
args
[
1
]
->
is_null
());
}
virtual
bool
binary
()
const
{
return
test
(
cmp_collation
.
collation
->
state
&
MY_CS_BINSORT
);
}
static
Item_bool_func2
*
eq_creator
(
Item
*
a
,
Item
*
b
);
static
Item_bool_func2
*
eq_creator
(
Item
*
a
,
Item
*
b
);
static
Item_bool_func2
*
ne_creator
(
Item
*
a
,
Item
*
b
);
static
Item_bool_func2
*
ne_creator
(
Item
*
a
,
Item
*
b
);
...
...
sql/item_func.cc
View file @
9f661429
...
@@ -1353,7 +1353,18 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
...
@@ -1353,7 +1353,18 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
Item
*
item
=
*
arg
;
Item
*
item
=
*
arg
;
if
(
item
->
fix_fields
(
thd
,
tables
,
arg
)
||
item
->
check_cols
(
1
))
if
(
item
->
fix_fields
(
thd
,
tables
,
arg
)
||
item
->
check_cols
(
1
))
return
1
;
return
1
;
if
(
item
->
binary
())
/*
TODO: We should think about this. It is not always
right way just to set an UDF result to return my_charset_bin
if one argument has binary sorting order.
The result collation should be calculated according to arguments
derivations in some cases and should not in other cases.
Moreover, some arguments can represent a numeric input
which doesn't effect the result character set and collation.
There is no a general rule for UDF. Everything depends on
the particular user definted function.
*/
if
(
item
->
charset
()
->
state
&
MY_CS_BINSORT
)
func
->
set_charset
(
&
my_charset_bin
);
func
->
set_charset
(
&
my_charset_bin
);
if
(
item
->
maybe_null
)
if
(
item
->
maybe_null
)
func
->
maybe_null
=
1
;
func
->
maybe_null
=
1
;
...
...
sql/item_strfunc.cc
View file @
9f661429
...
@@ -748,7 +748,7 @@ String *Item_func_replace::val_str(String *str)
...
@@ -748,7 +748,7 @@ String *Item_func_replace::val_str(String *str)
res
->
set_charset
(
collation
.
collation
);
res
->
set_charset
(
collation
.
collation
);
#ifdef USE_MB
#ifdef USE_MB
binary_cmp
=
(
args
[
0
]
->
binary
()
||
args
[
1
]
->
binary
(
)
||
!
use_mb
(
res
->
charset
()));
binary_cmp
=
(
(
res
->
charset
()
->
state
&
MY_CS_BINSORT
)
||
!
use_mb
(
res
->
charset
()));
#endif
#endif
if
(
res2
->
length
()
==
0
)
if
(
res2
->
length
()
==
0
)
...
...
sql/sql_analyse.cc
View file @
9f661429
...
@@ -44,12 +44,6 @@ int sortcmp2(void* cmp_arg __attribute__((unused)),
...
@@ -44,12 +44,6 @@ int sortcmp2(void* cmp_arg __attribute__((unused)),
return
sortcmp
(
a
,
b
,
a
->
charset
());
return
sortcmp
(
a
,
b
,
a
->
charset
());
}
}
int
stringcmp2
(
void
*
cmp_arg
__attribute__
((
unused
)),
const
String
*
a
,
const
String
*
b
)
{
return
sortcmp
(
a
,
b
,
&
my_charset_bin
);
}
int
compare_double2
(
void
*
cmp_arg
__attribute__
((
unused
)),
int
compare_double2
(
void
*
cmp_arg
__attribute__
((
unused
)),
const
double
*
s
,
const
double
*
t
)
const
double
*
s
,
const
double
*
t
)
{
{
...
...
sql/sql_analyse.h
View file @
9f661429
...
@@ -99,8 +99,6 @@ int collect_string(String *element, element_count count,
...
@@ -99,8 +99,6 @@ int collect_string(String *element, element_count count,
int
sortcmp2
(
void
*
cmp_arg
__attribute__
((
unused
)),
int
sortcmp2
(
void
*
cmp_arg
__attribute__
((
unused
)),
const
String
*
a
,
const
String
*
b
);
const
String
*
a
,
const
String
*
b
);
int
stringcmp2
(
void
*
cmp_arg
__attribute__
((
unused
)),
const
String
*
a
,
const
String
*
b
);
class
field_str
:
public
field_info
class
field_str
:
public
field_info
{
{
...
@@ -117,8 +115,7 @@ class field_str :public field_info
...
@@ -117,8 +115,7 @@ class field_str :public field_info
max_arg
(
""
,
default_charset_info
),
sum
(
0
),
max_arg
(
""
,
default_charset_info
),
sum
(
0
),
must_be_blob
(
0
),
was_zero_fill
(
0
),
must_be_blob
(
0
),
was_zero_fill
(
0
),
was_maybe_zerofill
(
0
),
can_be_still_num
(
1
)
was_maybe_zerofill
(
0
),
can_be_still_num
(
1
)
{
init_tree
(
&
tree
,
0
,
0
,
sizeof
(
String
),
a
->
binary
()
?
{
init_tree
(
&
tree
,
0
,
0
,
sizeof
(
String
),
(
qsort_cmp2
)
sortcmp2
,
(
qsort_cmp2
)
stringcmp2
:
(
qsort_cmp2
)
sortcmp2
,
0
,
(
tree_element_free
)
free_string
,
NULL
);
};
0
,
(
tree_element_free
)
free_string
,
NULL
);
};
void
add
();
void
add
();
...
...
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