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
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
Show 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);
...
@@ -143,3 +143,24 @@ select * from t1 where 'a' in (a,b,c collate latin1_bin);
a b c
a b c
a c c
a c c
drop table t1;
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);
...
@@ -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'
collate
latin1_bin
in
(
a
,
b
,
c
);
select
*
from
t1
where
'a'
in
(
a
,
b
,
c
collate
latin1_bin
);
select
*
from
t1
where
'a'
in
(
a
,
b
,
c
collate
latin1_bin
);
drop
table
t1
;
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()
...
@@ -1405,7 +1405,8 @@ void Item_func_in::fix_length_and_dec()
Item
**
arg
,
**
arg_end
;
Item
**
arg
,
**
arg_end
;
uint
const_itm
=
1
;
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
)))
(
agg_arg_collations_for_comparison
(
cmp_collation
,
args
,
arg_count
)))
return
;
return
;
...
@@ -1418,7 +1419,7 @@ void Item_func_in::fix_length_and_dec()
...
@@ -1418,7 +1419,7 @@ void Item_func_in::fix_length_and_dec()
*/
*/
if
(
const_itm
&&
!
nulls_in_row
())
if
(
const_itm
&&
!
nulls_in_row
())
{
{
switch
(
args
[
0
]
->
result_type
()
)
{
switch
(
cmp_type
)
{
case
STRING_RESULT
:
case
STRING_RESULT
:
uint
i
;
uint
i
;
array
=
new
in_string
(
arg_count
-
1
,(
qsort2_cmp
)
srtcmp_in
,
array
=
new
in_string
(
arg_count
-
1
,(
qsort2_cmp
)
srtcmp_in
,
...
@@ -1452,7 +1453,7 @@ void Item_func_in::fix_length_and_dec()
...
@@ -1452,7 +1453,7 @@ void Item_func_in::fix_length_and_dec()
else
else
{
{
in_item
=
cmp_item
::
get_comparator
(
args
[
0
]);
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
;
in_item
->
cmp_charset
=
cmp_collation
.
collation
;
}
}
maybe_null
=
args
[
0
]
->
maybe_null
;
maybe_null
=
args
[
0
]
->
maybe_null
;
...
...
sql/item_cmpfunc.h
View file @
e6cd5437
...
@@ -611,6 +611,7 @@ public:
...
@@ -611,6 +611,7 @@ public:
class
Item_func_in
:
public
Item_int_func
class
Item_func_in
:
public
Item_int_func
{
{
Item_result
cmp_type
;
in_vector
*
array
;
in_vector
*
array
;
cmp_item
*
in_item
;
cmp_item
*
in_item
;
bool
have_null
;
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