Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Incorrect results from Oracle 12c.
- ==================================
- This is a simpler case than found in
- https://antognini.ch/2016/04/wrong-results-involving-index-full-scan-minmax-in-12-1-0-2/
- [oracle@stormking cdb12102 partition]$ sqlplus /nolog @ conn.u.sql
- SQL*Plus: Release 12.1.0.2.0 Production on Mon May 30 13:22:18 2016
- Copyright (c) 1982, 2014, Oracle. All rights reserved.
- Connected.
- SQL> host cat results2.sql
- drop table t ;
- create table t (
- p number,
- i date
- )
- partition by list (p) (
- partition p1 values (1),
- partition p2 values (2),
- partition p3 values (3),
- partition p4 values (4),
- partition p5 values (5),
- partition p6 values (6),
- partition p7 values (7)
- );
- insert into t ( p, i)
- select mod(rownum,7)+1,
- trunc(sysdate+mod(rownum,7))
- from dual
- connect by level <= 365;
- select p, min(i)
- from t
- group by p;
- select min(i) right from t where p = 3;
- create index i on t (i);
- select min(i) wrong from t where p = 3;
- alter session set "_fix_control" = '16346018:off';
- select min(i) from t where p = 3;
- SQL> @ results2.sql
- Table dropped.
- Table created.
- 365 rows created.
- P MIN(I)
- ---------- ----------
- 1 2016-05-30
- 2 2016-05-31
- 3 2016-06-01
- 4 2016-06-02
- 5 2016-06-03
- 6 2016-06-04
- 7 2016-06-05
- 7 rows selected.
- RIGHT
- ----------
- 2016-06-01
- Index created.
- WRONG
- ----------
- 2016-05-30
- Session altered.
- MIN(I)
- ----------
- 2016-06-01
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement