Case
2009-05-05
Oracle的to_date转换可能导致的错误SQL结果
David.Guo同学遇到了如下一个Bug,以前也遇到过,今个转录一下了。
David的图说明了所有问题,看似毫无问题的一个查询出现了错误的结果:
Metalink上的Bug 4156916 - Dump / wrong results from TO_DATE without a full date format mask 可能与此有关。
这个BUG的内容记录是:
参考Metalink文档ID:4156916.8。
David的链接: http://www.oracledba.com.cn/blog/archives/463
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 DBA警世录:威胁来自数据库之外
这个转载图片,需要付费的哟:)
可以手机扣费么?
暂时不支持手机钱包
支持信用卡,储蓄卡,现金还有支付宝,你可以选一个了
什么场合会用到9999/mm/dd这种格式,为什么不是yyyy/mm/dd
楼上…… 你真幽默 :)