2 @message |
assert
+ Initial script failed, check output:
+ Statement failed, SQLSTATE = 22021
+ unsuccessful metadata update
+ -ALTER CHARACTER SET "SYSTEM"."UTF8" failed
+ -COLLATION "SYSTEM"."CI_COLL" for CHARACTER SET "SYSTEM"."UTF8" is not defined
+ After line 16 in file /var/tmp/qa_2024/test_11669/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-28 05:16:48.121
2025-06-28 05:16:48.127 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-28 05:16:48.133 tmp_sql = PosixPath('/var/tmp/qa_2024/test_11669/gh_8061.tmp.sql')
2025-06-28 05:16:48.139 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-28 05:16:48.144
2025-06-28 05:16:48.150 @pytest.mark.version('>=5.0.1')
2025-06-28 05:16:48.156 def test_1(act: Action, tmp_sql: Path, capsys):
2025-06-28 05:16:48.162 employee_data_sql = zipfile.Path(act.files_dir / 'standard_sample_databases.zip', at='sample-DB_-_firebird.sql')
2025-06-28 05:16:48.168 tmp_sql.write_bytes(employee_data_sql.read_bytes())
2025-06-28 05:16:48.175
2025-06-28 05:16:48.182 act.isql(switches = ['-q'], charset='utf8', input_file = tmp_sql, combine_output = True)
2025-06-28 05:16:48.188
2025-06-28 05:16:48.195 if act.return_code == 0:
2025-06-28 05:16:48.202
2025-06-28 05:16:48.211 srv_cfg = driver_config.register_server(name = f'srv_cfg_8061_addi', config = '')
2025-06-28 05:16:48.219 db_cfg_name = f'db_cfg_8061_addi'
2025-06-28 05:16:48.230 db_cfg_object = driver_config.register_database(name = db_cfg_name)
2025-06-28 05:16:48.239 db_cfg_object.server.value = srv_cfg.name
2025-06-28 05:16:48.246 db_cfg_object.database.value = str(act.db.db_path)
2025-06-28 05:16:48.252 if act.is_version('<6'):
2025-06-28 05:16:48.258 db_cfg_object.config.value = f"""
2025-06-28 05:16:48.270 SubQueryConversion = true
2025-06-28 05:16:48.276 """
2025-06-28 05:16:48.288
2025-06-28 05:16:48.303 with connect(db_cfg_name, user = act.db.user, password = act.db.password) as con:
2025-06-28 05:16:48.316 cur = con.cursor()
2025-06-28 05:16:48.328 for q_idx, q_tuple in query_map.items():
2025-06-28 05:16:48.339 test_sql, qry_comment = q_tuple[:2]
2025-06-28 05:16:48.349 ps = cur.prepare(test_sql)
2025-06-28 05:16:48.356 print(q_idx)
2025-06-28 05:16:48.363 print(test_sql)
2025-06-28 05:16:48.372 print(qry_comment)
2025-06-28 05:16:48.384 print( '\n'.join([replace_leading(s) for s in ps.detailed_plan.split('\n')]) )
2025-06-28 05:16:48.395 ps.free()
2025-06-28 05:16:48.405
2025-06-28 05:16:48.412 else:
2025-06-28 05:16:48.418 # If retcode !=0 then we can print the whole output of failed gbak:
2025-06-28 05:16:48.424 print('Initial script failed, check output:')
2025-06-28 05:16:48.430 for line in act.clean_stdout.splitlines():
2025-06-28 05:16:48.438 print(line)
2025-06-28 05:16:48.445 act.reset()
2025-06-28 05:16:48.451
2025-06-28 05:16:48.460 act.expected_stdout = f"""
2025-06-28 05:16:48.470 1000
2025-06-28 05:16:48.478 {query_map[1000][0]}
2025-06-28 05:16:48.485 {query_map[1000][1]}
2025-06-28 05:16:48.491 Sub-query
2025-06-28 05:16:48.499 ....-> Filter
2025-06-28 05:16:48.509 ........-> Table "EMPLOYEE" as "X" Full Scan
2025-06-28 05:16:48.517 Sub-query
2025-06-28 05:16:48.524 ....-> Filter (preliminary)
2025-06-28 05:16:48.530 ........-> Filter
2025-06-28 05:16:48.537 ............-> Table "SALES" as "S3" Access By ID
2025-06-28 05:16:48.542 ................-> Bitmap
2025-06-28 05:16:48.548 ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-28 05:16:48.554 Select Expression
2025-06-28 05:16:48.565 ....-> Filter
2025-06-28 05:16:48.574 ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-28 05:16:48.582
2025-06-28 05:16:48.588 2000
2025-06-28 05:16:48.595 {query_map[2000][0]}
2025-06-28 05:16:48.603 {query_map[2000][1]}
2025-06-28 05:16:48.614 Sub-query
2025-06-28 05:16:48.624 ....-> Aggregate
2025-06-28 05:16:48.631 ........-> Filter
2025-06-28 05:16:48.637 ............-> Table "SALES" as "S3" Access By ID
2025-06-28 05:16:48.643 ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-28 05:16:48.650 Select Expression
2025-06-28 05:16:48.660 ....-> Filter
2025-06-28 05:16:48.669 ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-28 05:16:48.676
2025-06-28 05:16:48.683 3000
2025-06-28 05:16:48.689 {query_map[3000][0]}
2025-06-28 05:16:48.695 {query_map[3000][1]}
2025-06-28 05:16:48.701 Sub-query
2025-06-28 05:16:48.707 ....-> Union
2025-06-28 05:16:48.711 ........-> Filter
2025-06-28 05:16:48.716 ............-> Table "CUSTOMER" as "C1" Access By ID
2025-06-28 05:16:48.721 ................-> Bitmap
2025-06-28 05:16:48.726 ....................-> Index "CUSTOMER_PK" Unique Scan
2025-06-28 05:16:48.731 ........-> Filter
2025-06-28 05:16:48.737 ............-> Table "EMPLOYEE" as "X1" Access By ID
2025-06-28 05:16:48.743 ................-> Bitmap
2025-06-28 05:16:48.755 ....................-> Index "EMPLOYEE_PK" Unique Scan
2025-06-28 05:16:48.766 Select Expression
2025-06-28 05:16:48.774 ....-> Filter
2025-06-28 05:16:48.781 ........-> Table "SALES" as "S1" Full Scan
2025-06-28 05:16:48.789
2025-06-28 05:16:48.796 4000
2025-06-28 05:16:48.801 {query_map[4000][0]}
2025-06-28 05:16:48.813 {query_map[4000][1]}
2025-06-28 05:16:48.822 Sub-query
2025-06-28 05:16:48.831 ....-> Filter
2025-06-28 05:16:48.842 ........-> Table "SALES" as "S1" Access By ID
2025-06-28 05:16:48.850 ............-> Bitmap
2025-06-28 05:16:48.857 ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
2025-06-28 05:16:48.864 Select Expression
2025-06-28 05:16:48.869 ....-> Filter
2025-06-28 05:16:48.875 ........-> Table "EMPLOYEE" as "X1" Full Scan
2025-06-28 05:16:48.879 """
2025-06-28 05:16:48.884 act.stdout = capsys.readouterr().out
2025-06-28 05:16:48.890 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-28 05:16:48.894 E assert
2025-06-28 05:16:48.899 E + Initial script failed, check output:
2025-06-28 05:16:48.905 E + Statement failed, SQLSTATE = 22021
2025-06-28 05:16:48.910 E + unsuccessful metadata update
2025-06-28 05:16:48.914 E + -ALTER CHARACTER SET "SYSTEM"."UTF8" failed
2025-06-28 05:16:48.919 E + -COLLATION "SYSTEM"."CI_COLL" for CHARACTER SET "SYSTEM"."UTF8" is not defined
2025-06-28 05:16:48.924 E + After line 16 in file /var/tmp/qa_2024/test_11669/gh_8061.tmp.sql
2025-06-28 05:16:48.929 E - 1000
2025-06-28 05:16:48.934 E - select c3.cust_no
2025-06-28 05:16:48.940 E - from customer c3
2025-06-28 05:16:48.947 E - where exists (
2025-06-28 05:16:48.953 E - select s3.cust_no
2025-06-28 05:16:48.960 E - from sales s3
2025-06-28 05:16:48.965 E - where s3.cust_no = c3.cust_no and
2025-06-28 05:16:48.971 E - exists (
2025-06-28 05:16:48.975 E - select x.emp_no
2025-06-28 05:16:48.980 E - from employee x
2025-06-28 05:16:48.985 E - where
2025-06-28 05:16:48.990 E - x.job_country = c3.country
2025-06-28 05:16:48.995 E - )
2025-06-28 05:16:49.002 E - )
2025-06-28 05:16:49.013 E - Subqueries that are correlated to non-parent; for example,
2025-06-28 05:16:49.021 E - subquery SQ3 is contained by SQ2 (parent of SQ3) and SQ2 in turn is contained
2025-06-28 05:16:49.030 E - by SQ1 and SQ3 is correlated to tables defined in SQ1.
2025-06-28 05:16:49.036 E - Sub-query
2025-06-28 05:16:49.041 E - ....-> Filter
2025-06-28 05:16:49.047 E - ........-> Table "EMPLOYEE" as "X" Full Scan
2025-06-28 05:16:49.052 E - Sub-query
2025-06-28 05:16:49.059 E - ....-> Filter (preliminary)
2025-06-28 05:16:49.065 E - ........-> Filter
2025-06-28 05:16:49.071 E - ............-> Table "SALES" as "S3" Access By ID
2025-06-28 05:16:49.077 E - ................-> Bitmap
2025-06-28 05:16:49.083 E - ....................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-28 05:16:49.089 E - Select Expression
2025-06-28 05:16:49.095 E - ....-> Filter
2025-06-28 05:16:49.101 E - ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-28 05:16:49.108 E - 2000
2025-06-28 05:16:49.113 E - select c3.cust_no
2025-06-28 05:16:49.119 E - from customer c3
2025-06-28 05:16:49.125 E - where exists (
2025-06-28 05:16:49.132 E - select s3.cust_no
2025-06-28 05:16:49.138 E - from sales s3
2025-06-28 05:16:49.148 E - where s3.cust_no = c3.cust_no
2025-06-28 05:16:49.157 E - group by s3.cust_no
2025-06-28 05:16:49.165 E - )
2025-06-28 05:16:49.171 E - A group-by subquery is correlated; in this case, unnesting implies doing join
2025-06-28 05:16:49.177 E - after group-by. Changing the given order of the two operations may not be always legal.
2025-06-28 05:16:49.181 E - Sub-query
2025-06-28 05:16:49.186 E - ....-> Aggregate
2025-06-28 05:16:49.192 E - ........-> Filter
2025-06-28 05:16:49.198 E - ............-> Table "SALES" as "S3" Access By ID
2025-06-28 05:16:49.203 E - ................-> Index "SALES_CUSTOMER_FK_CUST_NO" Range Scan (full match)
2025-06-28 05:16:49.209 E - Select Expression
2025-06-28 05:16:49.214 E - ....-> Filter
2025-06-28 05:16:49.220 E - ........-> Table "CUSTOMER" as "C3" Full Scan
2025-06-28 05:16:49.225 E - 3000
2025-06-28 05:16:49.235 E - select s1.cust_no
2025-06-28 05:16:49.245 E - from sales s1
2025-06-28 05:16:49.253 E - where exists (
2025-06-28 05:16:49.259 E - select 1 from customer c1 where s1.cust_no = c1.cust_no
2025-06-28 05:16:49.265 E - union all
2025-06-28 05:16:49.270 E - select 1 from employee x1 where s1.sales_rep = x1.emp_no
2025-06-28 05:16:49.275 E - )
2025-06-28 05:16:49.279 E - For disjunctive subqueries, the outer columns in the connecting
2025-06-28 05:16:49.284 E - or correlating conditions are not the same.
2025-06-28 05:16:49.288 E - Sub-query
2025-06-28 05:16:49.293 E - ....-> Union
2025-06-28 05:16:49.299 E - ........-> Filter
2025-06-28 05:16:49.307 E - ............-> Table "CUSTOMER" as "C1" Access By ID
2025-06-28 05:16:49.319 E - ................-> Bitmap
2025-06-28 05:16:49.327 E - ....................-> Index "CUSTOMER_PK" Unique Scan
2025-06-28 05:16:49.335 E - ........-> Filter
2025-06-28 05:16:49.341 E - ............-> Table "EMPLOYEE" as "X1" Access By ID
2025-06-28 05:16:49.346 E - ................-> Bitmap
2025-06-28 05:16:49.357 E - ....................-> Index "EMPLOYEE_PK" Unique Scan
2025-06-28 05:16:49.367 E - Select Expression
2025-06-28 05:16:49.375 E - ....-> Filter
2025-06-28 05:16:49.385 E - ........-> Table "SALES" as "S1" Full Scan
2025-06-28 05:16:49.394 E - 4000
2025-06-28 05:16:49.402 E - select x1.emp_no
2025-06-28 05:16:49.410 E - from employee x1
2025-06-28 05:16:49.422 E - where
2025-06-28 05:16:49.433 E - (
2025-06-28 05:16:49.444 E - x1.job_country = 'USA' or
2025-06-28 05:16:49.452 E - exists (
2025-06-28 05:16:49.460 E - select 1
2025-06-28 05:16:49.466 E - from sales s1
2025-06-28 05:16:49.474 E - where s1.sales_rep = x1.emp_no
2025-06-28 05:16:49.484 E - )
2025-06-28 05:16:49.492 E - )
2025-06-28 05:16:49.500 E - An `OR` condition in compound WHERE expression, see https://jonathanlewis.wordpress.com/2007/02/26/subquery-with-or/
2025-06-28 05:16:49.507 E - Sub-query
2025-06-28 05:16:49.519 E - ....-> Filter
2025-06-28 05:16:49.527 E - ........-> Table "SALES" as "S1" Access By ID
2025-06-28 05:16:49.534 E - ............-> Bitmap
2025-06-28 05:16:49.541 E - ................-> Index "SALES_EMPLOYEE_FK_SALES_REP" Range Scan (full match)
2025-06-28 05:16:49.547 E - Select Expression
2025-06-28 05:16:49.553 E - ....-> Filter
2025-06-28 05:16:49.558 E - ........-> Table "EMPLOYEE" as "X1" Full Scan
2025-06-28 05:16:49.564
2025-06-28 05:16:49.571 tests/bugs/gh_8061_addi_test.py:225: AssertionError
2025-06-28 05:16:49.582 ---------------------------- Captured stdout setup -----------------------------
2025-06-28 05:16:49.590 Creating db: localhost:/var/tmp/qa_2024/test_11669/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_11669/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 = 22021
E + unsuccessful metadata update
E + -ALTER CHARACTER SET "SYSTEM"."UTF8" failed
E + -COLLATION "SYSTEM"."CI_COLL" for CHARACTER SET "SYSTEM"."UTF8" is not defined
E + After line 16 in file /var/tmp/qa_2024/test_11669/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
|