UDF可移植性? [英] UDF Portability?

查看:102
本文介绍了UDF可移植性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现一个内部公司提供的安全性

算法作为DB2中的UDF。我有提供的C源代码和

能够在它周围放置一个UDF包装器并使用我的开发盒上的

提供的bldrtn脚本进行编译。它似乎正如预期那样工作




在我的QA框中,没有C编译器,所以我不能使用bldrtn

脚本。从我读到的,我以为我可以将二进制

编译文件从机器复制到另一个,运行创建函数

脚本,并完成它。好消息是,该操作的实际机制顺利进行。该函数被创建并且

我可以执行它。坏消息是它会产生垃圾以获得
输出。


当然我开始寻找两台机器之间的差异。

有几个,有些是我直接控制的。关于

的哪些想法最有可能的罪魁祸首?


操作系统:

AIX 5.2(Dev),AIX 5.3( QA)


DB2:

v.8 fixpak 5(Dev),v.8 fixpak 16(QA)


CPU:

PowerPC 604(Dev),PowerPC POWER4(QA)

由于C例程按位操作,我调出CPU。 />
感谢您的想法,


Evan

I''m trying to implement an internal company provided security
algorithm as a UDF within DB2. I have the provided C source code and
was able to put a UDF wrapper around it and compile it using the
provided bldrtn script on my development box. It appears to be working
as expected there.

On my QA box, there is no C compiler, so I can''t use the bldrtn
script. From what I read, I thought I could just copy the binary
compiled file from machine to the other, run the "create function"
script, and be done with it. The good news, is that the actual
mechanics of that operation go smoothly. The function gets created and
I can execute it. The bad news is that it produces garbage for
output.

Of course I started to look for differences between the two machines.
There are several, some out of my direct control. Any thoughts on
which would be the most likely culprit?

OS:
AIX 5.2 (Dev), AIX 5.3 (QA)

DB2:
v. 8 fixpak 5 (Dev), v. 8 fixpak 16 (QA)

CPU:
PowerPC 604 (Dev), PowerPC POWER4 (QA)

I bring up CPU since the C routine does bitwise operations.
Thanks for your thoughts,

Evan

推荐答案

esmith2112写道:
esmith2112 wrote:

我正在尝试实现一个内部公司提供的安全性

算法作为DB2中的UDF。我有提供的C源代码和

能够在它周围放置一个UDF包装器并使用我的开发盒上的

提供的bldrtn脚本进行编译。它似乎正如预期那样工作




在我的QA框中,没有C编译器,所以我不能使用bldrtn

脚本。从我读到的,我以为我可以将二进制

编译文件从机器复制到另一个,运行创建函数

脚本,并完成它。好消息是,该操作的实际机制顺利进行。该函数被创建并且

我可以执行它。坏消息是它会产生垃圾以获得
输出。


当然我开始寻找两台机器之间的差异。

有几个,有些是我直接控制的。关于

的哪些想法最有可能的罪魁祸首?


操作系统:

AIX 5.2(Dev),AIX 5.3( QA)


DB2:

v.8 fixpak 5(Dev),v.8 fixpak 16(QA)


CPU:

PowerPC 604(Dev),PowerPC POWER4(QA)

由于C例程按位操作,我调出CPU。 />

感谢您的想法,
I''m trying to implement an internal company provided security
algorithm as a UDF within DB2. I have the provided C source code and
was able to put a UDF wrapper around it and compile it using the
provided bldrtn script on my development box. It appears to be working
as expected there.

On my QA box, there is no C compiler, so I can''t use the bldrtn
script. From what I read, I thought I could just copy the binary
compiled file from machine to the other, run the "create function"
script, and be done with it. The good news, is that the actual
mechanics of that operation go smoothly. The function gets created and
I can execute it. The bad news is that it produces garbage for
output.

Of course I started to look for differences between the two machines.
There are several, some out of my direct control. Any thoughts on
which would be the most likely culprit?

OS:
AIX 5.2 (Dev), AIX 5.3 (QA)

DB2:
v. 8 fixpak 5 (Dev), v. 8 fixpak 16 (QA)

CPU:
PowerPC 604 (Dev), PowerPC POWER4 (QA)

I bring up CPU since the C routine does bitwise operations.
Thanks for your thoughts,



没有什么可以跳出来的。你能给出更多关于垃圾的详细信息吗?

你能用错误的格式(ascii)将二进制文件FTP化吗?

干杯

Serge


-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室

Nothing jumps out. Can you give more details on the "garbage"?
Could it be you FTPed the binary in the wrong format (ascii)?
Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


我可以执行它。坏消息是它为
产生垃圾
I can execute it. The bad news is that it produces garbage for

输出。
output.



你好Evan,


每次我看到一个udf产生这样的垃圾,原因是创建程序中的错误参数列表是

声明。

很遗憾没有人保护您的共享库免于误解

参数列表。


问候,

Udo


-

来自DB2的Speedgain - DB2 Monitor
http://www.itgain.de/en/produkte/speedgain.html


7月10日,9:19 * am,Serge Rielau< srie ... @ ca.ibm.comwrote:
On Jul 10, 9:19*am, Serge Rielau <srie...@ca.ibm.comwrote:

没有跳出来。你能给出更多关于垃圾的详细信息吗?

你能用错误的格式(ascii)将二进制文件FTP化吗?

干杯

Serge


-

Serge Rielau

DB2解决方案开发

IBM Toronto Lab
Nothing jumps out. Can you give more details on the "garbage"?
Could it be you FTPed the binary in the wrong format (ascii)?
Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab



没有FTP不匹配。绝对使用bin。模式并且只是验证了

文件是否相同。


该函数应该返回一个40字节的十六进制字符串。


GOOD:


db2" values ewm.hash(''abc'')"

1

----------------------------------------

A9993E364706816ABA3E25717850C26C9CD0D89D


1条记录被选中。


坏:


db2" values ewm .hash(''abc'')"

1

---------------------- ------------------

3246463131364534

1条记录已被选中。

对坏的一些观察例如:

1.不是40个字节

2.没有ABCDEF字符

3.无论输入是什么,结果都是一样的。


产生良好结果的系统没有表现出上述行为。

No FTP mismatch. Definitely used "bin" mode and just validated that
files are identical.

The function is supposed to return a 40-byte hex string.

GOOD:

db2 "values ewm.hash(''abc'')"
1
----------------------------------------
A9993E364706816ABA3E25717850C26C9CD0D89D

1 record(s) selected.

BAD:

db2 "values ewm.hash(''abc'')"
1
----------------------------------------
3246463131364534

1 record(s) selected.
Some observations for the "bad" example:
1. Not 40 bytes
2. No ABCDEF characters
3. Result is the same no matter what the input is.

The system that produces the good results exhibits none of the above-
mentioned behaviors.

这篇关于UDF可移植性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆