Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query fails to executed with multiple IN operator in where clause. #702

Open
ParthaI opened this issue Nov 10, 2023 · 0 comments
Open

Query fails to executed with multiple IN operator in where clause. #702

ParthaI opened this issue Nov 10, 2023 · 0 comments

Comments

@ParthaI
Copy link

ParthaI commented Nov 10, 2023

Observations

I tried to run a query on the aws_route53_record table, using zone_id and type in the where clause with IN operators.

case 1: Using zone_id with IN operator and type with OR operator (Working fine)

> select
  name, type
from
  aws_route53_record as a
where
  a.zone_id = 'Z0932967H1B9NJ7ZL7LX' or a.zone_id =  'Z02488371E7NPRCAR7QSQ'
  and a.type in ('CNAME', 'A');
+----------------------+-------+
| name                 | type  |
+----------------------+-------+
| dsads.test343.com.   | A     |
| test.test343.com.    | A     |
| testee.test343.com.  | CNAME |
| test.23.com.         | SOA   |
| test3.test.23.com.   | CNAME |
| test1.test.23.com.   | CNAME |
| txt.test.23.com.     | TXT   |
| tewst44.test.23.com. | A     |
| test.23.com.         | NS    |
+----------------------+-------+

Time: 3.6s. Rows fetched: 12. Hydrate calls: 0.

Case 2: Using zone_id with OR operator and type with IN operator (Working fine)

> select
  name, type
from
  aws_route53_record as a
where
  a.zone_id in ('Z0932967H1B9NJ7ZL7LX', 'Z02488371E7NPRCAR7QSQ') 
  and a.type = 'CNAME' or a.type = 'A'
+----------------------+-------+
| name                 | type  |
+----------------------+-------+
| test1.test.23.com.   | CNAME |
| test3.test.23.com.   | CNAME |
| tewst44.test.23.com. | A     |
| testee.test343.com.  | CNAME |
| dsads.test343.com.   | A     |
| test.test343.com.    | A     |
+----------------------+-------+

Time: 3.5s. Rows fetched: 12. Hydrate calls: 0.

Case 3: Using IN operator for both of the columns (Throws error)

> select
  name, type
from
  aws_route53_record as a
where
  a.zone_id in ('Z0932967H1B9NJ7ZL7LX', 'Z02488371E7NPRCAR7QSQ')
  and a.type in ('CNAME', 'A');

Error: interface conversion: interface {} is []interface {}, not string (SQLSTATE HV000)

+------+------+
| name | type |
+------+------+
+------+------+

Time: 1.7s.

Reproduction Steps

Create multiple AWS Hosted Zones with different types of records as follows.

> select zone_id, name, type from aws_route53_record order by zone_id
+-----------------------+------------------------+-------+
| zone_id               | name                   | type  |
+-----------------------+------------------------+-------+
| xxxxxxxxxxxxxxxxxxxxx | test.test343.com.      | A     |
| xxxxxxxxxxxxxxxxxxxxx | dsads.test343.com.     | A     |
| xxxxxxxxxxxxxxxxxxxxx | test343.com.           | NS    |
| xxxxxxxxxxxxxxxxxxxxx | testee.test343.com.    | CNAME |
| xxxxxxxxxxxxxxxxxxxxx | eqwjwewql.test343.com. | MX    |
| xxxxxxxxxxxxxxxxxxxxx | test343.com.           | SOA   |
| yyyyyyyyyyyyyyyyyyyy  | test1.test.23.com.     | CNAME |
| yyyyyyyyyyyyyyyyyyyy  | txt.test.23.com.       | TXT   |
| yyyyyyyyyyyyyyyyyyyy  | test.23.com.           | NS    |
| yyyyyyyyyyyyyyyyyyyy  | test3.test.23.com.     | CNAME |
| yyyyyyyyyyyyyyyyyyyy  | tewst44.test.23.com.   | A     |
| yyyyyyyyyyyyyyyyyyyy  | test.23.com.           | SOA   |
+-----------------------+------------------------+-------+

Then, try to execute the query as mentioned in the Observations section.

Expected: For all cases, the query should have a smooth execution with expected result.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant