[中文]
Author:
fuyuncat
Source:
www.HelloDBA.com
Date:
2017-05-25 22:59:12
Below sample code can reproduce this bug.
Major conditions include,
- There is NULLable column in the table
- There are null and non-null values in this column
- The statistics data of the column has been collected.
SQL代码
- HelloDBA.COM:dbat1:> rsqlplus / as sysdba
- SQL*Plus: Release 12.2.0.1.0 Production on Fri May 26 09:00:44 2017
- Copyright (c) 1982, 2016, Oracle. All rights reserved.
- Connected to:
- Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
- HelloDBA.COM> drop table tt1;
- Table dropped.
- HelloDBA.COM> create table tt1 (c1 number, c2 date);
- Table created.
- HelloDBA.COM> insert into tt1 values(1, sysdate);
- 1 row created.
- HelloDBA.COM> insert into tt1 values(1, null);
- 1 row created.
- HelloDBA.COM> commit;
- Commit complete.
- HelloDBA.COM> exec dbms_stats.gather_table_stats('SYS', 'TT1', METHOD_OPT=>'for all columns');
- PL/SQL procedure successfully completed.
- explain plan for
- txo as (select distinct c1
- from ut ,
- dual),
- with
- ut as (select c1
- from tt1
- where nvl (c2 ,
- trunc (sysdate ) ) >= trunc (sysdate ) ),
- txo as (select distinct c1
- from ut ,
- dual),
- u as (select * from ut)
- select *
- from u ,
- txo
- 14 ;
- explain plan for
- *
- ERROR at line 1:
- ORA-03113: end-of-file on communication channel
- Process ID: 69693
- Session ID: 662 Serial number: 29873
Previous:Oracle 12c new SQL Hints | Next: |
Return To this Category |