db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olav Sandstaa <Olav.Sands...@Sun.COM>
Subject Re: How to best handle variations in output from ij in sql tests?
Date Tue, 20 Jun 2006 11:07:32 GMT
Hi Rick,

Thanks for the feedback. I agree that most of the differences can be 
handled using a sed script. The main reason for sending the first email 
was that with the client driver running with JDK 1.6 it seems like we 
are no longer getting the trailing  SQLSTATE information written out by 
ij (loss of information). Since this is different from the client when 
running under JDK 1.5 and the embedded driver running with both JDK 1.5 
and 1.6 I think this difference would be handled better by fixing the 
missing output from ij (the chained exception) instead of using a sed 
script.

You seems to agree that this should be looked into. If I do not get any 
other opinions about or any explanation for this difference I will file 
a JIRA for this.

Regards,
Olav

Rick Hillegas wrote:
> Hi Olav,
>
> Thanks for digging into this. The differences in the embedded output 
> are caused by JDBC4's introduction of SQLException subclasses. These 
> now replace Derby's hand-rolled subclass of  SQLException. The old 
> Derby subclass overrode the getMessage() method. That's why you used 
> to see "SQL Exception:..." and now you see 
> "java.sql.SQLSyntaxErrorException:..."  I suppose that we could get 
> close to the old message text if we introduced a Derby subclass for 
> each of the JDBC4 exception subclasses and then override the 
> getMessage() in each of these. This seems like a lot of code bloat 
> without much payback. I think that handling these discrepancies with a 
> sed script is fine.
>
> I don't understand why the trailing SQLSTATE info has been stripped 
> off the network messages. Perhaps network serialization of chained 
> exceptions needs a closer look.
>
> Regards,
> -Rick
>
>
>
> Olav Sandstaa wrote:
>
>> I am working on reducing the number of tests failing when running with
>> JDK 1.6. Some of the tests are now failing due to jdk16 specific
>> master files that have not been updated after introduction of textual
>> changes. To solve some of these failing tests I try eliminate the need
>> for jdk16 specific master files.
>>
>> To avoid creating to more sed rules for filtering some of the
>> differences I wonder if some of the changes better had been fixed by
>> making sure that the output is more consistent between client and
>> embedded driver and between JDK 1.5 and JDK 1.6.
>>
>> I would like to get feedback on whether the following example should
>> best be solved by fixing the difference between the output from ij or
>> by continue to have multiple master files. This example is from the
>> ieptests.sql which now fails with JDK 1.6 with the client driver:
>>
>>
>> SQL that makes the test fail:
>> =============================
>>
>> ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('inventory', 'ORDERTABLE' , 
>> 'extinout/order.dat', null, null, null) ;
>>
>>
>> Java 1.5 Embedded output:
>> =========================
>>
>> ERROR 38000: The exception 'SQL Exception: Schema 'inventory' does 
>> not exist' was thrown while evaluating an expression.
>> ERROR 42Y07: Schema 'inventory' does not exist
>>
>>
>> Java 1.6 Embedded output:
>> =========================
>>
>> ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Schema 
>> 'inventory' does not exist' was thrown while evaluating an expression.
>> ERROR 42Y07: Schema 'inventory' does not exist
>>
>>
>> Java 1.5 Client output:
>> =======================
>>
>> ERROR 38000: The exception 'SQL Exception: Schema 'inventory' does 
>> not exist' was thrown while evaluating an expression. SQLSTATE: 
>> 42Y07: Schema 'inventory' does not exist
>>
>>
>> Java 1.6 Client output:
>> =======================
>>
>> ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Schema 
>> 'inventory' does not exist' was thrown while evaluating an expression.
>>
>>
>> The main difference is:
>>
>> -embedded: with JDK 1.5 the output writes "SQL Exception" while on
>>  JDK 1.6 it is "java.sql.SQLSyntaxErrorException" (more exact, but
>>  less read-friendly?). This difference is handled by seding the
>>  output.
>>
>> -client: with JDK 1.5 the SQL state is included in the output, while
>>  with JDK 1.6 the SQL state is not included. Is this a bug?
>>
>> -embedded vs server: embedded writes the output split over two lines,
>>  while the client has everything on one line. Could this be changed?
>>
>> In addition to the detailed question about the specific output making
>> this test fail, I wonder if we should have some general rules that we
>> should attempt the output (error/warnings/responses) from ij be as
>> similar as possible for (a) between client and server and (b) between
>> different versions of the JVM?
>>
>> Any feedback is appreciated!
>>
>> Thanks,
>> Olav
>
>


Mime
View raw message