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
e6cd5437
Commit
e6cd5437
authored
Jul 18, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IN now aggregates all argument types for comparison
parent
c8ecb452
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
mysql-test/r/func_in.result
mysql-test/r/func_in.result
+21
-0
mysql-test/t/func_in.test
mysql-test/t/func_in.test
+8
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+4
-3
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-0
No files found.
mysql-test/r/func_in.result
View file @
e6cd5437
...
...
@@ -143,3 +143,24 @@ select * from t1 where 'a' in (a,b,c collate latin1_bin);
a b c
a c c
drop table t1;
select '1.0' in (1,2);
'1.0' in (1,2)
1
select 1 in ('1.0',2);
1 in ('1.0',2)
1
select 1 in (1,'2.0');
1 in (1,'2.0')
1
select 1 in ('1.0',2.0);
1 in ('1.0',2.0)
1
select 1 in (1.0,'2.0');
1 in (1.0,'2.0')
1
select 1 in ('1.1',2);
1 in ('1.1',2)
0
select 1 in ('1.1',2.0);
1 in ('1.1',2.0)
0
mysql-test/t/func_in.test
View file @
e6cd5437
...
...
@@ -73,3 +73,11 @@ select * from t1 where 'a' collate latin1_general_ci in (a,b,c);
select
*
from
t1
where
'a'
collate
latin1_bin
in
(
a
,
b
,
c
);
select
*
from
t1
where
'a'
in
(
a
,
b
,
c
collate
latin1_bin
);
drop
table
t1
;
select
'1.0'
in
(
1
,
2
);
select
1
in
(
'1.0'
,
2
);
select
1
in
(
1
,
'2.0'
);
select
1
in
(
'1.0'
,
2.0
);
select
1
in
(
1.0
,
'2.0'
);
select
1
in
(
'1.1'
,
2
);
select
1
in
(
'1.1'
,
2.0
);
sql/item_cmpfunc.cc
View file @
e6cd5437
...
...
@@ -1405,7 +1405,8 @@ void Item_func_in::fix_length_and_dec()
Item
**
arg
,
**
arg_end
;
uint
const_itm
=
1
;
if
((
args
[
0
]
->
result_type
()
==
STRING_RESULT
)
&&
agg_cmp_type
(
&
cmp_type
,
args
,
arg_count
);
if
((
cmp_type
==
STRING_RESULT
)
&&
(
agg_arg_collations_for_comparison
(
cmp_collation
,
args
,
arg_count
)))
return
;
...
...
@@ -1418,7 +1419,7 @@ void Item_func_in::fix_length_and_dec()
*/
if
(
const_itm
&&
!
nulls_in_row
())
{
switch
(
args
[
0
]
->
result_type
()
)
{
switch
(
cmp_type
)
{
case
STRING_RESULT
:
uint
i
;
array
=
new
in_string
(
arg_count
-
1
,(
qsort2_cmp
)
srtcmp_in
,
...
...
@@ -1452,7 +1453,7 @@ void Item_func_in::fix_length_and_dec()
else
{
in_item
=
cmp_item
::
get_comparator
(
args
[
0
]);
if
(
args
[
0
]
->
result_type
()
==
STRING_RESULT
)
if
(
cmp_type
==
STRING_RESULT
)
in_item
->
cmp_charset
=
cmp_collation
.
collation
;
}
maybe_null
=
args
[
0
]
->
maybe_null
;
...
...
sql/item_cmpfunc.h
View file @
e6cd5437
...
...
@@ -611,6 +611,7 @@ class cmp_item_sort_string_in_static :public cmp_item_string
class
Item_func_in
:
public
Item_int_func
{
Item_result
cmp_type
;
in_vector
*
array
;
cmp_item
*
in_item
;
bool
have_null
;
...
...
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