Qserv and use of the OR operator, unexpected results?

Hi
In testing Qserv queries on some non-LSST data (UKIDSS) we’ve come across a potential oddity with the use of the OR operator. For example, our Filter table contains (select filterID,cutOff from Filter)

±---------±-----------+
| filterID | cutOff |
±---------±-----------+
| 0 | -999999000 |
| 1 | 0.925 |
| 2 | 1.07 |
| 3 | 1.33 |
| 4 | 1.78 |
| 5 | 2.37 |
| 6 | 2.132 |
| 7 | 2.177 |
| 8 | -999999000 |
| 9 | 1.211 |
| 10 | 1.638 |
±---------±-----------+

then in doing

select filterID,cutOff from Filter where cutOff > 2 and (filterID=6 or filterID=9);

I would expect only 1 result row (as it is under mySQL direct)

±---------±-------+
| filterID | cutOff |
±---------±-------+
| 6 | 2.132 |
±---------±-------+

but under Qserv I get

±---------±-------+
| filterID | cutOff |
±---------±-------+
| 6 | 2.132 |
| 9 | 1.211 |
±---------±-------+

and it seems like the brackets are being ignored.

Apologies if this is a known issue or I’m doing something incorrect, apparently we’re running Qserv 12.1-145-g2ab864b4+5.

Anyhow can anyone can confirm that this is unexpected behaviour and if it’s present in the latest Qserv.

Thanks
Mike

Hi Mike – looks like a bug to me! We’ll take a look and update you here.

FYI, this is being tracked as Jira issue DM-15491 (which should be open to public view).

Hi Mike, I just checked in a fix for this issue. It should be in the next weekly build, which happens tonight. Please take a look when you have a chance and let me know if you find any issue with it. Thanks!

Sorry for the delay, just got the latest version installed. Fix works, many thanks.

Mike

1 Like