waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

tests fail in linux-ppc64 (IBM pSeries + xlc) #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Installing on linux-ppc64, building gives 3 Warnings + 1 Error when
compiling, and supplied tests gives:

Ran 141 tests in 8.991s

FAILED (failures=32, errors=56)

Attached file is the output from doing
$>python tests.py 2>error.log

Errors should not be due to incorrect locales as LANG=en_US.UTF-8

What version of the product are you using? On what operating system?

SUSE LINUX Enterprise Server 9 (ppc)
DB2 SDK 8.2.9
Python 2.5
IBM XL C/C++ Advanced Edition V8.0 for Linux

Please provide any additional information below.

In ibm_db.c you get 3 warnings (lines 1013, 3632 and 3723) due to function
arguments of wrong type, these can be avoided by explicit casting to the
expected types - this is not critical, but I prefer that distributed code
should be free of such "trivial" things.

You also get a compile error because "SQL_DECFLOAT" is not known - it
appears TWICE??? in lines 7289 and 7290. My not-so-pretty fix is to comment
out both lines as chances are that we will never use this type.

Hopefully someone can help us out, we would VERY much like to switch to
ibm_db because the Python to DB2 interface we use today is unstable.

Original issue reported on code.google.com by Dan.HamD...@gmail.com on 19 Jun 2008 at 12:25

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by abhigyan...@in.ibm.com on 23 Jun 2008 at 4:36

GoogleCodeExporter commented 9 years ago
Hi Dan

I apologize for the late response for the issue. In the issue above, you are 
using DB2 version 8.2 whereas XML 
datatype is only from version 9.1 onwards. Thus all the testcases for XML 
Datatype would fail.

Regarding Decfloat, Please comment out those lines since we take it as a bug in 
previous version. I would 
rectify it in the next release. 

I would further request you to kindly send me the CLI Trace so that I can 
analyze the reason for errors 
reported in the error log. 

Original comment by tarun.pa...@in.ibm.com on 25 Jun 2008 at 9:07

GoogleCodeExporter commented 9 years ago
Hi Tarun,

Attached is the requested CLI trace, it´s huge, but hopefully useful!

Regards

   Dan

Original comment by Dan.HamD...@gmail.com on 26 Jun 2008 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Just browsed through the log myself :-(

I think you need to update the README file to say that the example DB2 database
SAMPLE that ships with DB2 is required to run the tests instead of the SQL 
statement
- and I need to install the database and run the tests again. I'm out of office 
until
Monday, but I'll ask a colleague to look into it. Hopefully he can ldo it 
tomorrow

/Dan

Original comment by Dan.HamD...@gmail.com on 26 Jun 2008 at 2:26

GoogleCodeExporter commented 9 years ago
Hi Dan

It is not necessary to run this with only sample database. If you browse 
through your ibm_db driver folder, 
you would find a file called config.py. This looks like 

test_dir =      'tests'         # Location of testsuite file (relative to 
current directory)

database =      'test'  # Database to connect to
user     =      'db2inst1'      # User ID to connect with
password =      'password'       # Password for given User ID
hostname =      'localhost'     # Hostname
port     =      50000           # Port Number

Do not change the test_dir name since it points to the directory where tests 
are kept. You can set the db un 
and password and stuff in this file and run the tests using "python tests.py".

Please let me know if this works. I think the appropriate change to README 
would be to mention about 
config.py and thanks for this suggestion. We would certainly take this up and 
modify the README file.

Original comment by tarun.pa...@in.ibm.com on 26 Jun 2008 at 5:10

GoogleCodeExporter commented 9 years ago
I discovered config.py myself (a mention of this is very recommendable).
The test scripts reference tables in the SAMPLE database, (look through the 
trace) - 
so either you need to use this database, or you need to change the test scripts 
to 
create the necessary tables and to populate them.

Regards

  Dan

Original comment by Dan.HamD...@gmail.com on 27 Jun 2008 at 6:53

GoogleCodeExporter commented 9 years ago
Hi Dan.

The config.py is meant to have the database name as you want and the test cases 
have no dependency on 
sample database. The trace have that because initially when the test cases were 
run, the config.py database 
variable had name as sample. If you go through the file test_000.py, it is 
populating the database using the 
following code. 

 conn = ibm_db.connect(config.database, config.user, config.password

Thus if for example you wish to run the tests on a database called "mytest" , 
then first create the database 
using CLP by issuing the command - create database mytest. Then change the 
config.py database variable to 
point to mytest and run your test cases. They run absolutely fine on our 
systems.

Thanks and Let me know if this works for you. 

Original comment by tarun.pa...@in.ibm.com on 27 Jun 2008 at 7:22

GoogleCodeExporter commented 9 years ago
Hi,

I have finally had time to dig a little deeper into the test_000.py and the CLI
trace. The missing tables that generate the errors I thought was due to a 
missing
SAMPLE database is because the test_000.py script stops with an error whilst
processing the "INSERT INTO animal_pics" statement and therefore most of the 
tables
are not created nor populated.

As you can see in the trace the error comes when doing a SQLDescribeParam() 
following
the SQLPrepare().
It seems that ibm_db.bind_param() fails if there is a BLOB field involved. Does 
this
give you an idea as to what may be wrong?

By commenting out the animal_pics code, I find that test_000.py stops populating
emp_photo, again there is a BLOB involved...

Regards

Original comment by Dan.HamD...@gmail.com on 2 Jul 2008 at 7:21

GoogleCodeExporter commented 9 years ago
HI Dan

I have tried the piece of code on various systems but I am still not able to 
reproduce the error that you are 
currently getting. I am still working on it and would keep you updated. 
According to the CLI Trace I feel that it 
might not be a problem with driver but DB2 CLI on Suse itself but I am not 
sure. Would keep you posted

Thanks for your patience.

Original comment by tarun.pa...@in.ibm.com on 11 Jul 2008 at 5:06

GoogleCodeExporter commented 9 years ago
Hi Dan..

After lot of unsuccessful attempts, I have not been able reproduce the same 
problem environment. I would 
request you to please follow the following steps and let me know if you face 
the problem still.

1. Go to the folder DB2_HOME/sqllib/samples/cli
2. Copy any file pic1.jpg and paste in this folder.
3. Create a test database as testdb
4. Download the file dantest.t and copy it into the same cli folder.
5. Now execute the command 

$ ./db2cli < dantest.t

6. After this check if the table mentioned in this script is created and by 
doing select * from blob_test, you 
would know if the record is inserted or not.

All I am trying to ensure by all these steps is that if there is any problem 
with CLI itself while running with PPC. 
If that is so, then we would have to raise a ticket with CLI.

Thanks and Regards
Tarun

Original comment by tarun.pa...@in.ibm.com on 4 Aug 2008 at 2:52

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Tarun

 Well. I've followed your steps with success .... and it inserts the picture into the
blob-field in testdb. Output is attached

Original comment by nils.las...@gmail.com on 20 Aug 2008 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Dan,
      It is good that CLI script is working. As Tarun mentioned, we are not able to 
reproduce the problem. Can you send me the CLI trace of the same so that I can 
compare both traces.

Thanks,
Abhigyan

Original comment by abhigyan...@in.ibm.com on 25 Aug 2008 at 9:27

GoogleCodeExporter commented 9 years ago
I have waited 1 month for the response and now closing the issue as invalid as 
I 
couldn't re-produce the problem. Please feel free to change this or open a new 
issue 
as you might see fit.

Thanks,
Abhigyan

Original comment by abhigyan...@in.ibm.com on 29 Sep 2008 at 4:00