Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.0.8
-
None
-
CentOS 7
-
2017-9, 2017-20, 2017-21
Description
The following query produces unexpected results. The predicates are acting as an OR instead of AND.
select
|
fk
|
,tags
|
,sum(clicks) |
from
|
cs_test cs
|
inner join |
dim_test d on cs.fk=d.id |
where
|
locate('cpa',tags) > 0 |
AND locate('1clickflow',tags) > 0 |
group by 1,2 |
Results:
fk | tags | clicks |
---|---|---|
1 | cpa | 60 |
3 | cpa|1clickflow | 1200 |
2 | cpa|1clickflow | 6 |
Expected results:
fk | tags | clicks |
---|---|---|
3 | cpa|1clickflow | 1200 |
2 | cpa|1clickflow | 6 |
The query is produced by Tableau and cannot be tweaked. mysqldump file attached in order to create example tables.