暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

原创 eygle 2009-05-05
1108
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


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论