[
https://issues.apache.org/jira/browse/DERBY-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Myrna van Lunteren resolved DERBY-1355.
---------------------------------------
Resolution: Fixed
Fix Version/s: (was: 10.2.3.0)
Derby Info: (was: [Patch Available])
I applied test and client patches...
I ran the AIjdbc test (with embedded & client), with and without the Client
change, and test shows the problem before the fix, and does not show the
problem after the fix. Ran lang._Suite for good measure.
In addition, I corrected text to be printed out in case of a failure in one of
the
test cases in test AIjdbc.java.
committed fix and test change with revision 545681.
Removed 10.2.3.0 fixin value, because I do not intend to backport this to 10.2,
although backporting at least the client change is probably no big effort for
someone if it's needed.
Thx for the patches Mayuresh!
> ClientDriver ResultSetMetaData.isAutoIncrement(column) always returns false
> ---------------------------------------------------------------------------
>
> Key: DERBY-1355
> URL: https://issues.apache.org/jira/browse/DERBY-1355
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.1.2.1
> Environment: Windows XP
> Reporter: Piet Blok
> Assignee: Mayuresh Nirhali
> Fix For: 10.3.0.0
>
> Attachments: derby1355_testv1.diff, derby1355_v1.diff
>
>
> With ClientDriver, resultSet.getMetaData().isAutoIncrement(column) always
> returns false.
> EmbeddedDriver correctly returns the true value (true or false)
> The following code demonstrates the problem:
> ===================================================================================
> import java.sql.Connection;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.ResultSetMetaData;
> import java.sql.SQLException;
> import java.sql.Statement;
> import org.apache.derby.jdbc.ClientDriver;
> import org.apache.derby.jdbc.EmbeddedDriver;
> public class TestAutoIncrement {
> private static final String URL_EMBEDDED = "jdbc:derby:EmbeddedTestBase;";
> private static final String URL_CLIENT =
> "jdbc:derby://localhost:1527/ClientTestBase;";
> public TestAutoIncrement() {
> super();
> }
> public static void main(String[] args) throws SQLException {
> System.out.println(new ClientDriver().getClass().getName()
> + " registered");
> System.out.println(new EmbeddedDriver().getClass().getName()
> + " registered");
> new TestAutoIncrement().test();
> }
> private void test() throws SQLException {
> if (test(URL_EMBEDDED) != test(URL_CLIENT)) {
> System.out.println("Embedded and client driver behave differently
> for isAutoIncrement().");
> } else {
> System.out.println("Embedded and client driver behave the same
> for isAutoIncrement().");
> }
> }
> private boolean test(String url) throws SQLException {
> boolean ai = false;
> Connection connection = DriverManager.getConnection(url
> + "create=true;");
> Statement statement = connection.createStatement();
> statement
> .execute("CREATE TABLE TEST_TABEL ("
> + "ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY
> (START WITH 1, INCREMENT BY 1),"
> + "VALUE INTEGER NOT NULL, PRIMARY KEY (ID))");
> statement.execute("INSERT INTO TEST_TABEL (VALUE) VALUES(1)");
> ResultSet resultSet = statement
> .executeQuery("SELECT * FROM TEST_TABEL");
> ResultSetMetaData meta = resultSet.getMetaData();
> ai = meta.isAutoIncrement(1);
> System.out.println("For " + url + " " + meta.getColumnName(1)
> + " isAutoIncrement: " + ai);
> connection.close();
> try {
> DriverManager.getConnection(url + "shutdown=true;");
> } catch (SQLException e) {
> System.out.println(e.getMessage());
> }
> return ai;
> }
> }
> ===================================================================================
> The output I receive from the above program is:
> org.apache.derby.jdbc.ClientDriver registered
> org.apache.derby.jdbc.EmbeddedDriver registered
> For jdbc:derby:EmbeddedTestBase; ID isAutoIncrement: true
> Database 'EmbeddedTestBase' shutdown.
> For jdbc:derby://localhost:1527/ClientTestBase; ID isAutoIncrement: false
> DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database
> 'ClientTestBase' shutdown.
> Embedded and client driver behave differently for isAutoIncrement().
> ===================================================================================
> Ouput from sysinfo:
> ------------------ Java Information ------------------
> Java Version: 1.5.0_06
> Java Vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jre1.5.0_06
> Java classpath:
> .;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;C:\WINDOWS\java\classes;C:\WorkSpace\PB
>
> 3.0\bin;C:\WorkSpace\Filipe\bin;C:\Documents and Settings\Piet\My
> Documents\Resources\Jars\ImgrRdr130.jar;C:\Documents and Settings\Piet\My
> Documents\Resources\Jars\lucene-1.4.1.jar;C:\Documents and Settings\Piet\My
> Documents\Resources\Jars\Multivalent20040415.jar;C:\Workspace\Stick\bin;
> OS name: Windows XP
> OS architecture: x86
> OS version: 5.1
> Java user name: Piet
> Java user home: C:\Documents and Settings\Piet
> Java user dir: C:\StickFolder
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.5
> --------- Derby Information --------
> JRE - JDBC: J2SE 5.0 - JDBC 3.0
> [/org/apache/derby/info/DBMS.properties] 10.1.2.1 - (330608)
> [/org/apache/derby/info/tools.properties] 10.1.2.1 - (330608)
> [/org/apache/derby/info/net.properties] 10.1.2.1 - (330608)
> [/org/apache/derby/info/dnc.properties] 10.1.2.1 - (330608)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale : [Nederlands/Nederland [nl_NL]]
> Found support for locale: [de_DE]
> version: 10.1.2.1 - (330608)
> Found support for locale: [es]
> version: 10.1.2.1 - (330608)
> Found support for locale: [fr]
> version: 10.1.2.1 - (330608)
> Found support for locale: [it]
> version: 10.1.2.1 - (330608)
> Found support for locale: [ja_JP]
> version: 10.1.2.1 - (330608)
> Found support for locale: [ko_KR]
> version: 10.1.2.1 - (330608)
> Found support for locale: [pt_BR]
> version: 10.1.2.1 - (330608)
> Found support for locale: [zh_CN]
> version: 10.1.2.1 - (330608)
> Found support for locale: [zh_TW]
> version: 10.1.2.1 - (330608)
> ------------------------------------------------------
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.