2 @message |
assert
+ Initial script failed, check output:
+ Statement failed, SQLSTATE = HY000
+ ALTER CHARACTER SET "SYSTEM"."UTF8" failed
+ -Cannot CREATE/ALTER/DROP CHARACTER SET in SYSTEM schema
+ After line 16 in file /var/tmp/qa_2024/test_11666/gh_8061.tmp.sql
- 1000
- select c3.cust_no
- from customer c3
- where exists (
- select s3.cust_no
- from sales s3
- where s3.cust_no = c3.cust_no and
- exists (
- select x.emp_no
- from employee x
- where
- x.job_country = c3.country
- )
- )
- Subqueries that are correlated to non-parent; for example,
- subquery SQ3 is contained by SQ2 (parent of SQ3) and SQ2 in turn is contained
- by SQ1 and SQ3 is correlated to tables defined in SQ1.
- Sub-query
- ....-> Filter
- ........-> Table "EMPLOYEE" as "X" Full Scan
- Sub-query
- ....-> Filter (preliminary)
- ........-> Filter
- ............-> Table "SALES" as "S3" Access By ID
- ................-> Bitmap
- ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
- Select Expression
- ....-> Filter
- ........-> Table "CUSTOMER" as "C3" Full Scan
- 2000
- select c3.cust_no
- from customer c3
- where exists (
- select s3.cust_no
- from sales s3
- where s3.cust_no = c3.cust_no
- group by s3.cust_no
- )
- A group-by subquery is correlated; in this case, unnesting implies doing join
- after group-by. Changing the given order of the two operations may not be always legal.
- Sub-query
- ....-> Aggregate
- ........-> Filter
- ............-> Table "SALES" as "S3" Access By ID
- ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
- Select Expression
- ....-> Filter
- ........-> Table "CUSTOMER" as "C3" Full Scan
- 3000
- select s1.cust_no
- from sales s1
- where exists (
- select 1 from customer c1 where s1.cust_no = c1.cust_no
- union all
- select 1 from employee x1 where s1.sales_rep = x1.emp_no
- )
- For disjunctive subqueries, the outer columns in the connecting
- or correlating conditions are not the same.
- Sub-query
- ....-> Union
- ........-> Filter
- ............-> Table "CUSTOMER" as "C1" Access By ID
- ................-> Bitmap
- ....................-> Index "CUSTOMER_PK" Unique Scan
- ........-> Filter
- ............-> Table "EMPLOYEE" as "X1" Access By ID
- ................-> Bitmap
- ....................-> Index "EMPLOYEE_PK" Unique Scan
- Select Expression
- ....-> Filter
- ........-> Table "SALES" as "S1" Full Scan
- 4000
- select x1.emp_no
- from employee x1
- where
- (
- x1.job_country = 'USA' or
- exists (
- select 1
- from sales s1
- where s1.sales_rep = x1.emp_no
- )
- )
- An `OR` condition in compound WHERE expression, see https://jonathanlewis.wordpress.com/2007/02/26/subquery-with-or/
- Sub-query
- ....-> Filter
- ........-> Table "SALES" as "S1" Access By ID
- ............-> Bitmap
- ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
- Select Expression
- ....-> Filter
- ........-> Table "EMPLOYEE" as "X1" Full Scan
LOG DETAILS:
2025-06-24 05:22:57.008
2025-06-24 05:22:57.014 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-24 05:22:57.020 tmp_sql = PosixPath('/var/tmp/qa_2024/test_11666/gh_8061.tmp.sql')
2025-06-24 05:22:57.025 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-24 05:22:57.030
2025-06-24 05:22:57.036 @pytest.mark.version('>=5.0.1')
2025-06-24 05:22:57.042 def test_1(act: Action, tmp_sql: Path, capsys):
2025-06-24 05:22:57.052 employee_data_sql = zipfile.Path(act.files_dir / 'standard_sample_databases.zip', at='sample-DB_-_firebird.sql')
2025-06-24 05:22:57.061 tmp_sql.write_bytes(employee_data_sql.read_bytes())
2025-06-24 05:22:57.068
2025-06-24 05:22:57.075 act.isql(switches = ['-q'], charset='utf8', input_file = tmp_sql, combine_output = True)
2025-06-24 05:22:57.080
2025-06-24 05:22:57.085 if act.return_code == 0:
2025-06-24 05:22:57.091
2025-06-24 05:22:57.097 srv_cfg = driver_config.register_server(name = f'srv_cfg_8061_addi', config = '')
2025-06-24 05:22:57.102 db_cfg_name = f'db_cfg_8061_addi'
2025-06-24 05:22:57.108 db_cfg_object = driver_config.register_database(name = db_cfg_name)
2025-06-24 05:22:57.114 db_cfg_object.server.value = srv_cfg.name
2025-06-24 05:22:57.119 db_cfg_object.database.value = str(act.db.db_path)
2025-06-24 05:22:57.127 if act.is_version('<6'):
2025-06-24 05:22:57.137 db_cfg_object.config.value = f"""
2025-06-24 05:22:57.145 SubQueryConversion = true
2025-06-24 05:22:57.151 """
2025-06-24 05:22:57.161
2025-06-24 05:22:57.169 with connect(db_cfg_name, user = act.db.user, password = act.db.password) as con:
2025-06-24 05:22:57.175 cur = con.cursor()
2025-06-24 05:22:57.181 for q_idx, q_tuple in query_map.items():
2025-06-24 05:22:57.186 test_sql, qry_comment = q_tuple[:2]
2025-06-24 05:22:57.191 ps = cur.prepare(test_sql)
2025-06-24 05:22:57.196 print(q_idx)
2025-06-24 05:22:57.201 print(test_sql)
2025-06-24 05:22:57.207 print(qry_comment)
2025-06-24 05:22:57.213 print( '\n'.join([replace_leading(s) for s in ps.detailed_plan.split('\n')]) )
2025-06-24 05:22:57.218 ps.free()
2025-06-24 05:22:57.224
2025-06-24 05:22:57.232 else:
2025-06-24 05:22:57.242 # If retcode !=0 then we can print the whole output of failed gbak:
2025-06-24 05:22:57.250 print('Initial script failed, check output:')
2025-06-24 05:22:57.260 for line in act.clean_stdout.splitlines():
2025-06-24 05:22:57.270 print(line)
2025-06-24 05:22:57.279 act.reset()
2025-06-24 05:22:57.287
2025-06-24 05:22:57.295 act.expected_stdout = f"""
2025-06-24 05:22:57.304 1000
2025-06-24 05:22:57.314 {query_map[1000][0]}
2025-06-24 05:22:57.321 {query_map[1000][1]}
2025-06-24 05:22:57.328 Sub-query
2025-06-24 05:22:57.334 ....-> Filter
2025-06-24 05:22:57.345 ........-> Table "EMPLOYEE" as "X" Full Scan
2025-06-24 05:22:57.355 Sub-query
2025-06-24 05:22:57.362 ....-> Filter (preliminary)
2025-06-24 05:22:57.372 ........-> Filter
2025-06-24 05:22:57.380 ............-> Table "SALES" as "S3" Access By ID
2025-06-24 05:22:57.387 ................-> Bitmap
2025-06-24 05:22:57.394 ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-24 05:22:57.400 Select Expression
2025-06-24 05:22:57.406 ....-> Filter
2025-06-24 05:22:57.412 ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-24 05:22:57.418
2025-06-24 05:22:57.427 2000
2025-06-24 05:22:57.436 {query_map[2000][0]}
2025-06-24 05:22:57.449 {query_map[2000][1]}
2025-06-24 05:22:57.457 Sub-query
2025-06-24 05:22:57.465 ....-> Aggregate
2025-06-24 05:22:57.471 ........-> Filter
2025-06-24 05:22:57.478 ............-> Table "SALES" as "S3" Access By ID
2025-06-24 05:22:57.487 ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-24 05:22:57.498 Select Expression
2025-06-24 05:22:57.506 ....-> Filter
2025-06-24 05:22:57.513 ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-24 05:22:57.520
2025-06-24 05:22:57.526 3000
2025-06-24 05:22:57.532 {query_map[3000][0]}
2025-06-24 05:22:57.538 {query_map[3000][1]}
2025-06-24 05:22:57.543 Sub-query
2025-06-24 05:22:57.547 ....-> Union
2025-06-24 05:22:57.551 ........-> Filter
2025-06-24 05:22:57.561 ............-> Table "CUSTOMER" as "C1" Access By ID
2025-06-24 05:22:57.575 ................-> Bitmap
2025-06-24 05:22:57.586 ....................-> Index "CUSTOMER_PK" Unique Scan
2025-06-24 05:22:57.594 ........-> Filter
2025-06-24 05:22:57.601 ............-> Table "EMPLOYEE" as "X1" Access By ID
2025-06-24 05:22:57.607 ................-> Bitmap
2025-06-24 05:22:57.613 ....................-> Index "EMPLOYEE_PK" Unique Scan
2025-06-24 05:22:57.618 Select Expression
2025-06-24 05:22:57.624 ....-> Filter
2025-06-24 05:22:57.630 ........-> Table "SALES" as "S1" Full Scan
2025-06-24 05:22:57.637
2025-06-24 05:22:57.644 4000
2025-06-24 05:22:57.650 {query_map[4000][0]}
2025-06-24 05:22:57.656 {query_map[4000][1]}
2025-06-24 05:22:57.661 Sub-query
2025-06-24 05:22:57.667 ....-> Filter
2025-06-24 05:22:57.672 ........-> Table "SALES" as "S1" Access By ID
2025-06-24 05:22:57.678 ............-> Bitmap
2025-06-24 05:22:57.688 ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
2025-06-24 05:22:57.695 Select Expression
2025-06-24 05:22:57.702 ....-> Filter
2025-06-24 05:22:57.708 ........-> Table "EMPLOYEE" as "X1" Full Scan
2025-06-24 05:22:57.714 """
2025-06-24 05:22:57.720 act.stdout = capsys.readouterr().out
2025-06-24 05:22:57.726 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-24 05:22:57.731 E assert
2025-06-24 05:22:57.738 E + Initial script failed, check output:
2025-06-24 05:22:57.748 E + Statement failed, SQLSTATE = HY000
2025-06-24 05:22:57.756 E + ALTER CHARACTER SET "SYSTEM"."UTF8" failed
2025-06-24 05:22:57.763 E + -Cannot CREATE/ALTER/DROP CHARACTER SET in SYSTEM schema
2025-06-24 05:22:57.771 E + After line 16 in file /var/tmp/qa_2024/test_11666/gh_8061.tmp.sql
2025-06-24 05:22:57.782 E - 1000
2025-06-24 05:22:57.791 E - select c3.cust_no
2025-06-24 05:22:57.798 E - from customer c3
2025-06-24 05:22:57.804 E - where exists (
2025-06-24 05:22:57.810 E - select s3.cust_no
2025-06-24 05:22:57.817 E - from sales s3
2025-06-24 05:22:57.824 E - where s3.cust_no = c3.cust_no and
2025-06-24 05:22:57.830 E - exists (
2025-06-24 05:22:57.836 E - select x.emp_no
2025-06-24 05:22:57.843 E - from employee x
2025-06-24 05:22:57.851 E - where
2025-06-24 05:22:57.862 E - x.job_country = c3.country
2025-06-24 05:22:57.870 E - )
2025-06-24 05:22:57.877 E - )
2025-06-24 05:22:57.887 E - Subqueries that are correlated to non-parent; for example,
2025-06-24 05:22:57.897 E - subquery SQ3 is contained by SQ2 (parent of SQ3) and SQ2 in turn is contained
2025-06-24 05:22:57.905 E - by SQ1 and SQ3 is correlated to tables defined in SQ1.
2025-06-24 05:22:57.911 E - Sub-query
2025-06-24 05:22:57.917 E - ....-> Filter
2025-06-24 05:22:57.923 E - ........-> Table "EMPLOYEE" as "X" Full Scan
2025-06-24 05:22:57.929 E - Sub-query
2025-06-24 05:22:57.935 E - ....-> Filter (preliminary)
2025-06-24 05:22:57.942 E - ........-> Filter
2025-06-24 05:22:57.951 E - ............-> Table "SALES" as "S3" Access By ID
2025-06-24 05:22:57.958 E - ................-> Bitmap
2025-06-24 05:22:57.967 E - ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-24 05:22:57.974 E - Select Expression
2025-06-24 05:22:57.981 E - ....-> Filter
2025-06-24 05:22:57.987 E - ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-24 05:22:57.994 E - 2000
2025-06-24 05:22:58.004 E - select c3.cust_no
2025-06-24 05:22:58.014 E - from customer c3
2025-06-24 05:22:58.023 E - where exists (
2025-06-24 05:22:58.033 E - select s3.cust_no
2025-06-24 05:22:58.041 E - from sales s3
2025-06-24 05:22:58.053 E - where s3.cust_no = c3.cust_no
2025-06-24 05:22:58.065 E - group by s3.cust_no
2025-06-24 05:22:58.075 E - )
2025-06-24 05:22:58.082 E - A group-by subquery is correlated; in this case, unnesting implies doing join
2025-06-24 05:22:58.088 E - after group-by. Changing the given order of the two operations may not be always legal.
2025-06-24 05:22:58.094 E - Sub-query
2025-06-24 05:22:58.099 E - ....-> Aggregate
2025-06-24 05:22:58.103 E - ........-> Filter
2025-06-24 05:22:58.108 E - ............-> Table "SALES" as "S3" Access By ID
2025-06-24 05:22:58.113 E - ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-24 05:22:58.118 E - Select Expression
2025-06-24 05:22:58.123 E - ....-> Filter
2025-06-24 05:22:58.127 E - ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-24 05:22:58.132 E - 3000
2025-06-24 05:22:58.137 E - select s1.cust_no
2025-06-24 05:22:58.143 E - from sales s1
2025-06-24 05:22:58.148 E - where exists (
2025-06-24 05:22:58.153 E - select 1 from customer c1 where s1.cust_no = c1.cust_no
2025-06-24 05:22:58.158 E - union all
2025-06-24 05:22:58.163 E - select 1 from employee x1 where s1.sales_rep = x1.emp_no
2025-06-24 05:22:58.168 E - )
2025-06-24 05:22:58.174 E - For disjunctive subqueries, the outer columns in the connecting
2025-06-24 05:22:58.180 E - or correlating conditions are not the same.
2025-06-24 05:22:58.185 E - Sub-query
2025-06-24 05:22:58.192 E - ....-> Union
2025-06-24 05:22:58.200 E - ........-> Filter
2025-06-24 05:22:58.210 E - ............-> Table "CUSTOMER" as "C1" Access By ID
2025-06-24 05:22:58.218 E - ................-> Bitmap
2025-06-24 05:22:58.227 E - ....................-> Index "CUSTOMER_PK" Unique Scan
2025-06-24 05:22:58.234 E - ........-> Filter
2025-06-24 05:22:58.238 E - ............-> Table "EMPLOYEE" as "X1" Access By ID
2025-06-24 05:22:58.243 E - ................-> Bitmap
2025-06-24 05:22:58.247 E - ....................-> Index "EMPLOYEE_PK" Unique Scan
2025-06-24 05:22:58.254 E - Select Expression
2025-06-24 05:22:58.260 E - ....-> Filter
2025-06-24 05:22:58.266 E - ........-> Table "SALES" as "S1" Full Scan
2025-06-24 05:22:58.272 E - 4000
2025-06-24 05:22:58.281 E - select x1.emp_no
2025-06-24 05:22:58.292 E - from employee x1
2025-06-24 05:22:58.302 E - where
2025-06-24 05:22:58.311 E - (
2025-06-24 05:22:58.319 E - x1.job_country = 'USA' or
2025-06-24 05:22:58.329 E - exists (
2025-06-24 05:22:58.339 E - select 1
2025-06-24 05:22:58.351 E - from sales s1
2025-06-24 05:22:58.362 E - where s1.sales_rep = x1.emp_no
2025-06-24 05:22:58.372 E - )
2025-06-24 05:22:58.381 E - )
2025-06-24 05:22:58.388 E - An `OR` condition in compound WHERE expression, see https://jonathanlewis.wordpress.com/2007/02/26/subquery-with-or/
2025-06-24 05:22:58.394 E - Sub-query
2025-06-24 05:22:58.399 E - ....-> Filter
2025-06-24 05:22:58.408 E - ........-> Table "SALES" as "S1" Access By ID
2025-06-24 05:22:58.415 E - ............-> Bitmap
2025-06-24 05:22:58.421 E - ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
2025-06-24 05:22:58.429 E - Select Expression
2025-06-24 05:22:58.435 E - ....-> Filter
2025-06-24 05:22:58.441 E - ........-> Table "EMPLOYEE" as "X1" Full Scan
2025-06-24 05:22:58.446
2025-06-24 05:22:58.455 tests/bugs/gh_8061_addi_test.py:225: AssertionError
2025-06-24 05:22:58.464 ---------------------------- Captured stdout setup -----------------------------
2025-06-24 05:22:58.471 Creating db: localhost:/var/tmp/qa_2024/test_11666/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_sql = PosixPath('/var/tmp/qa_2024/test_11666/gh_8061.tmp.sql')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0.1')
def test_1(act: Action, tmp_sql: Path, capsys):
employee_data_sql = zipfile.Path(act.files_dir / 'standard_sample_databases.zip', at='sample-DB_-_firebird.sql')
tmp_sql.write_bytes(employee_data_sql.read_bytes())
act.isql(switches = ['-q'], charset='utf8', input_file = tmp_sql, combine_output = True)
if act.return_code == 0:
srv_cfg = driver_config.register_server(name = f'srv_cfg_8061_addi', config = '')
db_cfg_name = f'db_cfg_8061_addi'
db_cfg_object = driver_config.register_database(name = db_cfg_name)
db_cfg_object.server.value = srv_cfg.name
db_cfg_object.database.value = str(act.db.db_path)
if act.is_version('<6'):
db_cfg_object.config.value = f"""
SubQueryConversion = true
"""
with connect(db_cfg_name, user = act.db.user, password = act.db.password) as con:
cur = con.cursor()
for q_idx, q_tuple in query_map.items():
test_sql, qry_comment = q_tuple[:2]
ps = cur.prepare(test_sql)
print(q_idx)
print(test_sql)
print(qry_comment)
print( '\n'.join([replace_leading(s) for s in ps.detailed_plan.split('\n')]) )
ps.free()
else:
# If retcode !=0 then we can print the whole output of failed gbak:
print('Initial script failed, check output:')
for line in act.clean_stdout.splitlines():
print(line)
act.reset()
act.expected_stdout = f"""
1000
{query_map[1000][0]}
{query_map[1000][1]}
Sub-query
....-> Filter
........-> Table "EMPLOYEE" as "X" Full Scan
Sub-query
....-> Filter (preliminary)
........-> Filter
............-> Table "SALES" as "S3" Access By ID
................-> Bitmap
....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
Select Expression
....-> Filter
........-> Table "CUSTOMER" as "C3" Full Scan
2000
{query_map[2000][0]}
{query_map[2000][1]}
Sub-query
....-> Aggregate
........-> Filter
............-> Table "SALES" as "S3" Access By ID
................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
Select Expression
....-> Filter
........-> Table "CUSTOMER" as "C3" Full Scan
3000
{query_map[3000][0]}
{query_map[3000][1]}
Sub-query
....-> Union
........-> Filter
............-> Table "CUSTOMER" as "C1" Access By ID
................-> Bitmap
....................-> Index "CUSTOMER_PK" Unique Scan
........-> Filter
............-> Table "EMPLOYEE" as "X1" Access By ID
................-> Bitmap
....................-> Index "EMPLOYEE_PK" Unique Scan
Select Expression
....-> Filter
........-> Table "SALES" as "S1" Full Scan
4000
{query_map[4000][0]}
{query_map[4000][1]}
Sub-query
....-> Filter
........-> Table "SALES" as "S1" Access By ID
............-> Bitmap
................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
Select Expression
....-> Filter
........-> Table "EMPLOYEE" as "X1" Full Scan
"""
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E + Initial script failed, check output:
E + Statement failed, SQLSTATE = HY000
E + ALTER CHARACTER SET "SYSTEM"."UTF8" failed
E + -Cannot CREATE/ALTER/DROP CHARACTER SET in SYSTEM schema
E + After line 16 in file /var/tmp/qa_2024/test_11666/gh_8061.tmp.sql
E - 1000
E - select c3.cust_no
E - from customer c3
E - where exists (
E - select s3.cust_no
E - from sales s3
E - where s3.cust_no = c3.cust_no and
E - exists (
E - select x.emp_no
E - from employee x
E - where
E - x.job_country = c3.country
E - )
E - )
E - Subqueries that are correlated to non-parent; for example,
E - subquery SQ3 is contained by SQ2 (parent of SQ3) and SQ2 in turn is contained
E - by SQ1 and SQ3 is correlated to tables defined in SQ1.
E - Sub-query
E - ....-> Filter
E - ........-> Table "EMPLOYEE" as "X" Full Scan
E - Sub-query
E - ....-> Filter (preliminary)
E - ........-> Filter
E - ............-> Table "SALES" as "S3" Access By ID
E - ................-> Bitmap
E - ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
E - Select Expression
E - ....-> Filter
E - ........-> Table "CUSTOMER" as "C3" Full Scan
E - 2000
E - select c3.cust_no
E - from customer c3
E - where exists (
E - select s3.cust_no
E - from sales s3
E - where s3.cust_no = c3.cust_no
E - group by s3.cust_no
E - )
E - A group-by subquery is correlated; in this case, unnesting implies doing join
E - after group-by. Changing the given order of the two operations may not be always legal.
E - Sub-query
E - ....-> Aggregate
E - ........-> Filter
E - ............-> Table "SALES" as "S3" Access By ID
E - ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
E - Select Expression
E - ....-> Filter
E - ........-> Table "CUSTOMER" as "C3" Full Scan
E - 3000
E - select s1.cust_no
E - from sales s1
E - where exists (
E - select 1 from customer c1 where s1.cust_no = c1.cust_no
E - union all
E - select 1 from employee x1 where s1.sales_rep = x1.emp_no
E - )
E - For disjunctive subqueries, the outer columns in the connecting
E - or correlating conditions are not the same.
E - Sub-query
E - ....-> Union
E - ........-> Filter
E - ............-> Table "CUSTOMER" as "C1" Access By ID
E - ................-> Bitmap
E - ....................-> Index "CUSTOMER_PK" Unique Scan
E - ........-> Filter
E - ............-> Table "EMPLOYEE" as "X1" Access By ID
E - ................-> Bitmap
E - ....................-> Index "EMPLOYEE_PK" Unique Scan
E - Select Expression
E - ....-> Filter
E - ........-> Table "SALES" as "S1" Full Scan
E - 4000
E - select x1.emp_no
E - from employee x1
E - where
E - (
E - x1.job_country = 'USA' or
E - exists (
E - select 1
E - from sales s1
E - where s1.sales_rep = x1.emp_no
E - )
E - )
E - An `OR` condition in compound WHERE expression, see https://jonathanlewis.wordpress.com/2007/02/26/subquery-with-or/
E - Sub-query
E - ....-> Filter
E - ........-> Table "SALES" as "S1" Access By ID
E - ............-> Bitmap
E - ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
E - Select Expression
E - ....-> Filter
E - ........-> Table "EMPLOYEE" as "X1" Full Scan
tests/bugs/gh_8061_addi_test.py:225: AssertionError
|