[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15299244#comment-15299244
 ] 

Bryan Pendleton commented on DERBY-3181:


I think that *should* be all we need to do, but I am not certain.

Can you please try removing that section as an experiment, and maybe
do a clean build and some tests, to see if you encounter any problems?

In the meantime, I think that your existing patch is a clear
improvement over the current behavior, so I have committed it.

I suggest that we leave this issue open while you investigate
whether the query definition can be removed from the properties
file, or whether it is not as simple as that.

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15299241#comment-15299241
 ] 

ASF subversion and git services commented on DERBY-3181:


Commit 1745414 from [~bryanpendleton] in branch 'code/trunk'
[ https://svn.apache.org/r1745414 ]

DERBY-3181: DatabaseMetaData.getBestRowIdentifier behavior with invalid scope

This patch was contributed by Danoja Dias (danojadias at gmail dot com)

The DatabaseMetaData.getBestRowIdentifier method takes a number of arguments,
including "scope", which is supposed to be one of the enumerated values:
bestRowTemporary, bestRowTransaction, and bestRowSession.

If an invalid scope argument was passed to this method, Derby was returning
a hard-coded "empty" row identifier, which was slightly different, in detail,
to the row identifier that is returned for a valid scope argument.

Since JDBC does not require that we return such a row identifier for an
invalid scope argument, it seems cleaner and more useful to throw an
exception with a message indicating that an invalid scope argument was
passed. The caller can then correct their application to make the call with
a valid scope argument, and will then receive a valid row identifier.

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-6889) batch insert not updating generated id

2016-05-24 Thread Rick Hillegas (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-6889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15299237#comment-15299237
 ] 

Rick Hillegas commented on DERBY-6889:
--

The error indicates that you are trying to insert duplicate values into a 
primary key column. Your test is not even taking advantage of the generation 
clause: your test is setting the primary key column by hand. Every time you 
re-run your test, you are inserting the same  hand-set value into the primary 
key column. That is a duplicate value. That's what's causing your error.

> batch insert not updating generated id
> --
>
> Key: DERBY-6889
> URL: https://issues.apache.org/jira/browse/DERBY-6889
> Project: Derby
>  Issue Type: Bug
>Reporter: hooli jooli
>
> More details:
> http://stackoverflow.com/questions/37410841/the-statement-was-aborted-because-it-would-have-caused-a-duplicate-key/37415105?noredirect=1#comment62340116_37415105



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Early Access builds of JDK 9 b118 & JDK 9 with Project Jigsaw, b118 (#4987) are available on java.net

2016-05-24 Thread Rick Hillegas

Thanks, Dalibor!

On 5/24/16 3:22 AM, dalibor topic wrote:

Hi Rick,

On 19.05.2016 14:02, dalibor topic wrote:

On 19.05.2016 04:24, Rick Hillegas wrote:

I have tried building Derby with b118. This produced a new boatload of
deprecation warnings which do not seem to be covered by the summary
description of the changes at
http://download.java.net/java/jdk9/changes/jdk-9+118.html.


Thanks Rick, it seems that the list of changes is incomplete. I'll pass
that on to the team publishing that list.


This has been fixed for b119: 
http://download.java.net/java/jdk9/changes/jdk-9+119.html .



The
deprecations are not described in the jdk 9 javadoc at
http://download.java.net/java/jdk9/docs/api/index.html.


Indeed, the docs there are out of date (b116) - I'll pass that on as
well, thanks!


This should be fixed now. Thanks again for reporting it!

cheers,
dalibor topic




[jira] [Created] (DERBY-6889) batch insert not updating generated id

2016-05-24 Thread hooli jooli (JIRA)
hooli jooli created DERBY-6889:
--

 Summary: batch insert not updating generated id
 Key: DERBY-6889
 URL: https://issues.apache.org/jira/browse/DERBY-6889
 Project: Derby
  Issue Type: Bug
Reporter: hooli jooli


More details:

http://stackoverflow.com/questions/37410841/the-statement-was-aborted-because-it-would-have-caused-a-duplicate-key/37415105?noredirect=1#comment62340116_37415105



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Danoja Dias (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15298292#comment-15298292
 ] 

Danoja Dias commented on DERBY-3181:



I think we should remove from line 887 to line 908 from 
org.apache.derby.impl.jdbc.metadata.properties. Is there any more to remove 
that query? If not I think we can do it as a part of this issue. 


> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15298196#comment-15298196
 ] 

Bryan Pendleton commented on DERBY-3181:


It seems like we maybe don't need the "getBestRowIdentifierEmpty" query
in org.apache.derby.impl.jdbc.metadata.properties anymore? I think it was
only referenced by the call to getPreparedQuery() at line 2160 of
EmbedDatabaseMetaData.java, which now throws the exception instead.

I think that we could file a separate, new JIRA, which is linked to this bug,
and which states that we could remove that system query from 
metadata.properties.

Or, we could do that as part of this issue.

Which way would be better?

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Bryan Pendleton (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15298153#comment-15298153
 ] 

Bryan Pendleton commented on DERBY-3181:


The patch looks great, thanks for adding the new message! I ran the new
code with a 'sqle.printStackTrace' in the exception block and verified that
the new message looks fine and has the expected argument value when
it is thrown. I think we're good to go with this change; I'll do a bit more
testing and commit the change later today.

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Danoja Dias (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15297942#comment-15297942
 ] 

Danoja Dias edited comment on DERBY-3181 at 5/24/16 9:19 AM:
-

Hi Bryan,
I did changes. all tests passed. diff file is attached.

Thanks


was (Author: dnj):
I did changes. all tests passed. diff file is attached.

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Danoja Dias (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Danoja Dias updated DERBY-3181:
---
Attachment: Derby3181.diff

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, Derby3181.diff, repro.java, 
> testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row.

2016-05-24 Thread Danoja Dias (JIRA)

[ 
https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15297942#comment-15297942
 ] 

Danoja Dias commented on DERBY-3181:


I did changes. all tests passed. diff file is attached.

> isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier 
> values are opposite when there is no rows in ResultSet vs. when there is a 
> row.
> --
>
> Key: DERBY-3181
> URL: https://issues.apache.org/jira/browse/DERBY-3181
> Project: Derby
>  Issue Type: Bug
>  Components: JDBC
>Affects Versions: 10.4.1.3
>Reporter: Myrna van Lunteren
>Assignee: Danoja Dias
>Priority: Trivial
>  Labels: derby_triage10_5_2
> Attachments: Derby-3181.diff, repro.java, testChange.diff
>
>
> With code like the following: 
>DatabaseMetaData dmd = conn.getMetaData(); 
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true);
> ResultSetMetaData rsmd = rs.getMetaData(); 
> int actualCols = rsmd.getColumnCount(); 
> for (int i = 0; i < actualCols; i++) 
> { 
>  System.out.print("getColumnName: " + rsmd.getColumnName(i+1) 
> + ", isNullable: "); 
>  System.out.println(rsmd.isNullable(i+1)); 
> } 
> The printed values for isNullable returned are opposite of what they are when 
> the getBestRowIdentifier call looks like this:
> ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true);
> In the latter case, the values are:
> getColumnName: SCOPE, isNullable: 0
> getColumnName: COLUMN_NAME, isNullable: 1
> getColumnName: DATA_TYPE, isNullable: 0
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 0
> getColumnName: BUFFER_LENGTH, isNullable: 0
> getColumnName: DECIMAL_DIGITS, isNullable: 0
> getColumnName: PSEUDO_COLUMN, isNullable: 0
> In the first case, the values are:
> getColumnName: SCOPE, isNullable: 1
> getColumnName: COLUMN_NAME, isNullable: 0
> getColumnName: DATA_TYPE, isNullable: 1
> getColumnName: TYPE_NAME, isNullable: 1
> getColumnName: COLUMN_SIZE, isNullable: 1
> getColumnName: BUFFER_LENGTH, isNullable: 1
> getColumnName: DECIMAL_DIGITS, isNullable: 1
> getColumnName: PSEUDO_COLUMN, isNullable: 1
> The isNullable value should be stable. 
> It's probably worthwhile verifying what the value *should* be in the first 
> place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)