Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 2254122

Summary: [rgw][s3select]: wrong output seen for query "select (true AND false) from s3object;"
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Hemanth Sai <hmaheswa>
Component: RGWAssignee: gal salomon <gsalomon>
Status: CLOSED ERRATA QA Contact: Hemanth Sai <hmaheswa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: akraj, ceph-eng-bugs, cephqe-warriors, gsalomon, tserlin
Target Milestone: ---Keywords: Automation
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.1-119.el9cp Doc Type: Bug Fix
Doc Text:
.SQL statements correctly return results for case-insensitive boolean expressions Previously, SQL statements contained a boolean expression with capital letters in parts of the statement resulting in wrong interpretation and wrong results. With this fix, the interpretation of a statement is case-insensitive and hence, the correct results are returned for any case.
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-13 14:18:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hemanth Sai 2023-12-12 04:36:45 UTC
Description of problem:
wrong output seen for below queries
if the operator is in caps it is returning wrong output

[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select  (true AND false) from s3object;" /dev/stdout
true
true
true

real	0m0.428s
user	0m0.359s
sys	0m0.066s
[cephuser@extensa022 ~]$

[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select  (true and false) from s3object;" /dev/stdout
false
false
false

real	0m0.438s
user	0m0.372s
sys	0m0.062s
[cephuser@extensa022 ~]$


[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select ( true and null ) from s3object;" /dev/stdout
null
null
null

real	0m0.444s
user	0m0.386s
sys	0m0.054s
[cephuser@extensa022 ~]$ 
[cephuser@extensa022 ~]$ 
[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select ( true AND null ) from s3object;" /dev/stdout
true
true
true

real	0m0.430s
user	0m0.371s
sys	0m0.055s
[cephuser@extensa022 ~]$ 


[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select ( null AND false ) from s3object;" /dev/stdout
null
null
null

real	0m0.434s
user	0m0.379s
sys	0m0.050s
[cephuser@extensa022 ~]$ 
[cephuser@extensa022 ~]$ 
[cephuser@extensa022 ~]$ time venv/bin/aws s3api --endpoint-url http://extensa027.ceph.redhat.com:80 select-object-content  --bucket query-validation-bkt1 --key csv_file1 --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --expression "select ( null and false ) from s3object;" /dev/stdout
false
false
false

real	0m0.435s
user	0m0.369s
sys	0m0.062s
[cephuser@extensa022 ~]$

Version-Release number of selected component (if applicable):
ceph version 18.2.0-128.el9cp

How reproducible:
always

Steps to Reproduce:
1.deploy rhcs7.0 cluster with rgw daemon
2.upload an s3select object
3.execute the above queries, it should correct output if the operator in caps also

Actual results:
seeing wrong output when operator in caps and correct output when operator in small letters

Expected results:
should return correct output for queries having operator in caps as well

Additional info:
automation script: https://docs.google.com/document/d/1_eALVAP5erwl1v-bhHuyu0XX6T7776Xg9fIC2Uj8Jg8/edit?usp=sharing

queries generated and executed: https://drive.google.com/drive/folders/1Xin784T6mumv6MXF0MfGce074Lw1STPl

Comment 1 gal salomon 2024-03-21 13:38:19 UTC
fixed on https://github.com/ceph/ceph/pull/55183

Comment 2 tserlin 2024-04-02 20:22:44 UTC
Gal, just getting confirmation that we're awaiting downstream cherry-picks to ceph-7.1-rhel-patches for this BZ? Including a submodule update like you did in the ceph-7.0-rhel-patches branch (for the 7.0 z2 release)?

https://gitlab.cee.redhat.com/ceph/ceph/-/commit/ec3742261bb1223dfe96f8658ea66814ae2f2113#fb32792b6e3b62f26d90c2a52c3d1392f67f82ea_2_1

Thanks,

Thomas

Comment 6 errata-xmlrpc 2024-06-13 14:18:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Critical: Red Hat Ceph Storage 7.1 security, enhancements, and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2024:3925