db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4284) All Columns become Nullable when Using left join
Date Fri, 28 Aug 2009 20:51:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12748976#action_12748976

Knut Anders Hatlen commented on DERBY-4284:

Many regression tests failed with the change (2 failures in suites.All, 21 failures in derbyall).
I haven't studied the failures in detail, but it looks like most of them, if not all, are
caused by differences in ij's formatting when columns are changed from nullable to non-nullable.
For instance, a CHAR(2) NOT column is given space for two characters in the output, whereas
a CHAR(2) column is given space for four characters (to allow NULL to be printed). I believe
this difference is to be expected.

The code below illustrates how ij formats nullable and non-nullable columns differently:

ij> create table t(col1 char(2) not null, col2 char(2));
0 rows inserted/updated/deleted
ij> select * from t;

0 rows selected

> All Columns become Nullable when Using left join
> ------------------------------------------------
>                 Key: DERBY-4284
>                 URL: https://issues.apache.org/jira/browse/DERBY-4284
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions:
>         Environment: Microsoft Windows XP SP3, Sun JDK 6 Update 14
>            Reporter: Chua Chee Seng
>            Assignee: Knut Anders Hatlen
>         Attachments: Main.java
> Consider following:-
> create table person (
>   id varchar(20) not null,
>   name varchar(100) not null
> );
> create table car (
>   id varchar(20) not null,
>   person_id varchar(20) not null,
>   model varchar(100) not null,
>   plat_no varchar(100) not null
> );
> When select :-
> select
> p.name,
> c.model,
> c.plat_no
> from person p
> left join car c on (p.id = c.person_id);
> From the ResultSet, get the ResultSetMetaData and inspect each column's isNullable()
value, which is always = 1 (always nullable).  Expected : column 'p.name' isNullable = 0 (not
nullable), but I get 'p.name' isNullable = 1 (nullable)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message