使用 Perl 从 Sybase 提取数据时的日期时间问题

发布于 2025-01-12 12:28:59 字数 975 浏览 2 评论 0原文

我们有一个用于在 Solaris 上运行的 Perl 脚本,它从 Sybase 中提取数据并存储 在平面文件中。该脚本曾经运行良好。

不过最近Perl版本升级,底层OS也改为Linux。但是,升级后我们发现,当通过相同的 Perl 脚本从 Sybase 提取相同的数据时,所有具有毫秒精度的 datetime 类型列都会增加 1 毫秒。

例如 -

  • Sybase 中的源列值:2012-03-15 10:14:04.235

  • 升级前提取:2012-03-15 10:14:04.235(完全相同)

  • 升级后提取:2012-03-15 10:14:04.236 (额外 1 毫秒)

从上面可以看出,存在 1 毫秒的差异 (.235 -> .236)

软件版本升级前

Perl:           5.008004 (sun4-solaris-64int)
OS  :           Solaris  (2.10)
DBI :           1.58
DBD :: Sybase : 1.08

软件版本升级后-升级:

Perl:           5.016003 (x86_64-linux-thread-multi)
OS  :           Linux    (2.6.32-754.12.1.e16.x86_64)
DBI :           1.643
DBD :: Sybase : 1.15

有人可以帮我找出造成 1 毫秒差异的根本原因并帮助我缓解问题吗?这到底是一个已知问题,还是我们遗漏了什么?

We have a Perl script that used to run on Solaris which extracts data from Sybase and stores
in flat files. The script used to work fine.

However, recently, there has been an upgrade of Perl version and the underlying OS has been changed to Linux. But, after the upgrade we found that while extracting the same data from Sybase through the same Perl script, all datetime type columns with milliseconds precision were being incremented by 1 millisecond.

For e.g. -

  • Source Column value in Sybase : 2012-03-15 10:14:04.235

  • Extract Before Upgrade: 2012-03-15 10:14:04.235 (exactly same)

  • Extract After Upgrade: 2012-03-15 10:14:04.236 (1 millisecond additional)

As could be seen from above, there is a difference of 1 millisecond (.235 -> .236)

Software Versions Pre-Upgrade:

Perl:           5.008004 (sun4-solaris-64int)
OS  :           Solaris  (2.10)
DBI :           1.58
DBD :: Sybase : 1.08

Software Versions Post-Upgrade:

Perl:           5.016003 (x86_64-linux-thread-multi)
OS  :           Linux    (2.6.32-754.12.1.e16.x86_64)
DBI :           1.643
DBD :: Sybase : 1.15

Can someone please help me identify the root cause of this difference of 1 millisecond and help me alleviate the issue? Is this in anyway a known issue, or are we missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文