eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 预防猪流感 - 一个都不能少 | Blog首页 | 北京恩墨科技有限公司 即日宣告成立 »

Oracle的to_date转换可能导致的错误SQL结果
modb.pro

David.Guo同学遇到了如下一个Bug,以前也遇到过,今个转录一下了。
David的图说明了所有问题,看似毫无问题的一个查询出现了错误的结果:

其实可以看看执行计划的谓词转换,看看具体问题的出现原因。

Metalink上的Bug 4156916 - Dump / wrong results from TO_DATE without a full date format mask 可能与此有关。

这个BUG的内容记录是:

Description

Wrong results or dumps possible from queries having
predicates using TO_DATE (explicit or implicit) without
a full date format mask.


Workaround:
Set the following two events
event 38055 level 1 (disable redundant range predicate removal)
event 10078 level 1 (disable removal of constant predicates)

通过Event 38055 和 10078 可以实现Workaround。
这个Bug的影响范围和修复版本如下:

Affects:

Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions < 10.2
Versions confirmed as being affected
Platforms affected Generic (all / most platforms affected)

Fixed:

This issue is fixed in


参考Metalink文档ID:4156916.8。

David的链接: http://www.oracledba.com.cn/blog/archives/463



历史上的今天...
    >> 2008-05-05文章:

By eygle on 2009-05-05 13:05 | Comments (5) | Case | 2274 |

5 Comments

这个转载图片,需要付费的哟:)

可以手机扣费么?

暂时不支持手机钱包
支持信用卡,储蓄卡,现金还有支付宝,你可以选一个了

什么场合会用到9999/mm/dd这种格式,为什么不是yyyy/mm/dd

楼上…… 你真幽默 :)


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com