Hi,

I have duplicated Andy Hassall's results.

The missing make files are available in the examples download,
"linux_11gR1_examples.zip".  After installing these, the DBD::Oracle
driver configured without the "-l" switch.

The two test failures are caused by none of the rows being inserted
into the test table when one of the rows cannot be inserted during an
array insert.  The proper result is for 9 of the 10 rows to be
inserted.

It appears the behavior of Oracle 11gR1 has changed from Oracle 10gR2
for array inserts with OCI_BATCH_ERRORS set when one of the rows fails
to insert.

I modified the $ORACLE_HOME/rdbms/demo/cdemodr1.{c,h,sql} files to
mimic the DBD::Oracle test behavior, and compiled and ran the program
under Oracle 10gR2 and 11gR1.  With Oracle 10gR2 9 of 10 rows are
inserted, and with 11gR1 only 8 of the 10 rows are inserted, the last
row failing to make it into the table.  Interestingly, under both
versions of Oracle the program reports that the last row did not get
inserted.

When all of the rows can be successfully inserted, the program inserts
all 10 rows and reports that all 10 have been inserted under both
versions of Oracle.  It is only when one row is made illegal, and
fails to insert, that there is a difference in behavior.

This seems to me to be a bug in Oracle 11gR1.  However, I do not know
why it causes all the rows to fail to insert in the DBD::Oracle test
script.

I am attaching a tar file with my modified program with a makefile and
sql script.  The program connects to scott/tiger and expects a table
called foo.  This table can be created with the sql script.

You need to modify the foo table to get all 10 rows to insert.  As is,
the 5th row will fail to insert since the value for column c1 is too
big for a NUMBER(2) column.

"make test" will compile and run the program.

Do a "make clean" before running "make test" again if connecting to a
different version of Oracle.  The version of Oracle used, and the
database connected to, are determined by the values of ORACLE_HOME and
ORACLE_SID in the environment.

Here are the results in the foo table under Oracle 10gR2:

SQL> DESC foo
 Name Null?    Type
 ---- -------- ---------
 C1   NOT NULL NUMBER(2)
 C2   NOT NULL NUMBER(2)

SQL> SELECT * FROM foo;

no rows selected

<run program>

SQL> /

C1 C2
-- --
 1  2
 2  3
 3  4
 4  5
 6  7
 7  8
 8  9
 9 10
10 11

9 rows selected.

SQL> 

Here are the results in the foo table under Oracle 11gR1:

SQL> DESC foo
 Name Null?    Type
 ---- -------- ---------
 C1   NOT NULL NUMBER(2)
 C2   NOT NULL NUMBER(2)

SQL> SELECT * FROM foo;

no rows selected

<run program>

SQL> /

C1 C2
-- --
 1  2
 2  3
 3  4
 4  5
 6  7
 7  8
 8  9
 9 10

8 rows selected.

SQL> 

Cheers,

Maximilian Mohun

[EMAIL PROTECTED] ("John Scoles") writes:

> Looks very good actually.  I think a little tweak of the Makefile is
> all that needs to be done,. The other two errors I think are caused
> by permission problems with the Oracle user who is doing the test.
> I have seen similar ones with 10g instaltions.  But I an not 100% on
> that.  Sould be able to look at this this month.
>
> Cheers
> John Scoles
>
> "Andy Hassall" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Initial results:
>>
>> Default build method fails as the Oracle makefiles (oracle.mk etc.)
>> have apparently disappeared:
>>
>> Using Oracle in /Disk0/app/oracle/product/11.1.0
>> DEFINE _SQLPLUS_RELEASE = "1101000600" (CHAR)
>> Oracle version 11.1.0.6 (11.1)
>>
>>         Unable to locate an oracle.mk, proc.mk or other suitable *.mk
>>         file in your Oracle installation.  (I looked in
>>         /Disk0/app/oracle/product/11.1.0/rdbms/demo/demo_xe.mk 
>> /Disk0/app/oracle/product/11.1.0/rdbms/lib/oracle.mk 
>> /Disk0/app/oracle/product/11.1.0/rdbms/demo/oracle.mk 
>> /Disk0/app/oracle/product/11.1.0/rdbms/demo/demo_rdbms.mk 
>> /Disk0/app/oracle/product/11.1.0/precomp/demo/proc/proc.mk 
>> /Disk0/app/oracle/product/11.1.0/precomp/demo/proc/demo_proc.mk 
>> /Disk0/app/oracle/product/11.1.0/proc/lib/proc.mk 
>> /Disk0/app/oracle/product/11.1.0/proc16/lib/proc16.mk under 
>> /Disk0/app/oracle/product/11.1.0)
>>
>>
>> However, building with "perl Makefile.PL -l" is successful.
>>
>> Tests are almost all successful, but there are some failures in the
>> array interface:
>>
>> t/26exe_array...........ok 3/14
>> #   Failed test '... we should have 19 tuple_status'
>> #   at t/26exe_array.t line 120.
>> #          got: 10
>> #     expected: 19
>> t/26exe_array...........NOK 14/14
>> #   Failed test '... we should have 48 rows'
>> #   at t/26exe_array.t line 146.
>> #          got: 30
>> #     expected: 48
>> # Looks like you failed 2 tests of 14.
>> t/26exe_array...........dubious
>>         Test returned status 2 (wstat 512, 0x200)
>> DIED. FAILED tests 11, 14
>>         Failed 2/14 tests, 85.71% okay
>>
>>
>> Not sure what these are about yet - whether it's a bug in
>> DBD::Oracle, Oracle, or a backwards compatibility break in the OCI
>> API.
>>
>> Other than those failures, the rest appears to pass tests and work
>> OK which is encouraging.
>>
>> -- 
>> Andy Hassall :: [EMAIL PROTECTED] :: http://www.andyh.co.uk
>> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool 

Attachment: insert_array.tar.gz
Description: Oracle OCI test array insert program.

Reply via email to