id
stringlengths
22
25
commit_message
stringlengths
137
6.96k
diffs
listlengths
0
63
derby-DERBY-2242-740f64e4
DERBY-2242 DERBY-2217 (partial) Allow the DatabaseMetaDataTest to run from within the upgradeTests._Suite setup and add it to be run complete when the new engine is being used (soft upgrade and hard upgrade). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@497519 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-7e854495
DERBY-2242 (partial) adding tests for getColumnPrivileges and getTablePrivileges git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@595876 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-834e80ec
DERBY-2242 (partial) More testing for DatabaseMetaData.getTypeInfo git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@498710 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-835b4700
DERBY-2242 (partial) Add more fixtures to DataabaseMetaDataTest and change some JDBC.assert methods that check the full ResultSet to return the number of rows seen in the ResultSet. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@496773 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/JDBC.java", "hunks": [ { "added": [ " ", " /**", " * Assert a result set is empty.", " * If the result set is not empty it will", " * be drained before the check to see if", " * it is empty.", " * The ResultSet is closed by this method.", "", " */", " public static void assertEmpty(ResultSet rs)", " throws SQLException", " {", " assertDrainResults(rs, 0);", " }" ], "header": "@@ -395,6 +395,20 @@ public class JDBC {", "removed": [] }, { "added": [ " * ", " * The ResultSet is closed by this method.", " * @return the number of rows seen.", "", "\tpublic static int assertDrainResults(ResultSet rs)", "\t\treturn assertDrainResults(rs, -1);" ], "header": "@@ -404,14 +418,18 @@ public class JDBC {", "removed": [ "\tpublic static void assertDrainResults(ResultSet rs)", "\t\tassertDrainResults(rs, -1);" ] }, { "added": [ " * ", " * The ResultSet is closed by this method.", " * @return the number of rows seen.", "\tpublic static int assertDrainResults(ResultSet rs," ], "header": "@@ -419,13 +437,16 @@ public class JDBC {", "removed": [ "\tpublic static void assertDrainResults(ResultSet rs," ] }, { "added": [ "\t\t\tAssert.assertEquals(\"Unexpected row count:\", expectedRows, rows);", " ", " return rows;" ], "header": "@@ -442,7 +463,9 @@ public class JDBC {", "removed": [ "\t\t\tAssert.assertEquals(\"Unexpected row count:\", expectedRows, rows); " ] } ] } ]
derby-DERBY-2242-83d7d005
DERBY-2242 (partial) Add ODBC type information checking for getTypeInfo() in DatabaseMetaDataTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@505023 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-948b7e19
DERBY-2242 (partial); add some comments git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@596177 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-c0d0ae80
DERBY-2242 (partial) Remove harness test dbMetaDataJdbc30.java as the new JUnit DatabaseMetaDataTest covers the tests cases. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@498013 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-c663c379
DERBY-2242 (partial) Add testing of getTables() to DatabaseMetaDataTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@500439 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-dfa772af
DERBY-2242 (partial); implementing the TODO re testUnimplementedSQLObjectAttributes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@590476 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-e3dbf436
DERBY-2242 Add pattern testing to DatabaseMetaDataTest for the getColumnsModify() fixture, hopefully in a way that will allow easy additon of other pattern matching tests for other metadata methods. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@520193 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-fa4893d8
DERBY-2242 (partial) Additional testing of getTypeInfo() for DatabaseMetaDataTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@497919 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2242-ff292616
DERBY-2242 (partial) Add more fixtures to DatabaseMetaDataTest and add list of methods not yet tested. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@496580 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2243-2f7d4961
DERBY-2243 Modifying the return type for methods like - supportsANSI92EntryLevelSQL() - supportsExpressionsInOrderBy() in EmbedDatabaseMetaData.java to return TRUE as Derby does support these features Thus now the behavior is consistent across drivers. Contributed by Saurabh Vyas Saurabh.Vyas@Sun.COM git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@498732 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2243-561f091a
DERBY-2243 Modifying the return type for methods like - supportsANSI92EntryLevelSQL() - supportsExpressionsInOrderBy() in EmbedDatabaseMetaData.java to return TRUE as Derby does support these features Thus now the behavior is consistent across drivers. (forgot this file as part of revision 498732) Contributed by Saurabh Vyas git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@498872 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java", "hunks": [ { "added": [ "\t\t/* DERBY - 2244 : Derby does support Order By Expression (Derby-134)", "\t\t* thus changing the return value to true to relfect that the support", "\t\t* is present", "\t\t*/", "\t\treturn true;" ], "header": "@@ -613,7 +613,11 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\treturn false;" ] }, { "added": [ "\t\t/* DERBY - 2243 : Derby does support ANSI 92 standards,", "\t\t* thus changing the return value to true to relfect that the support", "\t\t* is present", "\t\t*/", "\t\treturn true;" ], "header": "@@ -731,7 +735,11 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\treturn false;" ] } ] } ]
derby-DERBY-2248-b8d1d8ab
DERBY-2248: Add Network Server system test. Committed for Manjula Kutty <manjula.kutty@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@514882 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/system/nstest/utils/MemCheck.java", "hunks": [ { "added": [ "/*", " ", " Derby - Class org.apache.derbyTesting.system.nstest.utils.MemCheck", " ", " Licensed to the Apache Software Foundation (ASF) under one or more", " contributor license agreements. See the NOTICE file distributed with", " this work for additional information regarding copyright ownership.", " The ASF licenses this file to You under the Apache License, Version 2.0", " (the \"License\"); you may not use this file except in compliance with", " the License. You may obtain a copy of the License at", " ", " http://www.apache.org/licenses/LICENSE-2.0", " ", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", " ", " */", "", "package org.apache.derbyTesting.system.nstest.utils;", "", "import java.util.Date;", "", "/**", " * MemCheck - a background thread that prints current memory usage", " */", "public class MemCheck extends Thread {", "", "\tint delay = 200000;", "", "\tpublic boolean stopNow = false;", "", "\tpublic MemCheck() {", "\t}", "", "\tpublic MemCheck(int num) {", "\t\tdelay = num;", "\t}", "", "\t/*", "\t * Implementation of run() method to check memory", "\t * ", "\t */", "\tpublic void run() {", "\t\twhile (stopNow == false) {", "\t\t\ttry {", "\t\t\t\tshowmem();", "\t\t\t\tsleep(delay);", "\t\t\t} catch (java.lang.InterruptedException ie) {", "\t\t\t\tSystem.out.println(\"memcheck: unexpected error in sleep\");", "\t\t\t}", "\t\t}", "\t}", "", "\t/*", "\t * Print the current memory status", "\t */", "\tpublic static void showmem() {", "\t\tRuntime rt = null;", "\t\tDate d = null;", "\t\trt = Runtime.getRuntime();", "\t\td = new Date();", "\t\tSystem.out.println(\"total memory: \" + rt.totalMemory() + \" free: \"", "\t\t\t\t+ rt.freeMemory() + \" \" + d.toString());", "", "\t}", "", "\tpublic static void main(String argv[]) {", "\t\tSystem.out.println(\"memCheck starting\");", "\t\tMemCheck mc = new MemCheck();", "\t\tmc.run();", "\t}", "}" ], "header": "@@ -0,0 +1,75 @@", "removed": [] } ] } ]
derby-DERBY-2249-ee0904b7
DERBY-2249 (partial): Initial commit of files for a new test "toolkit" with the following potential uses: - run a lot of optimizations to look for memory leaks, etc. in the optimizer - run queries that take a long time to optimize, to try to understand why - run queries that are quite complex, to determine whether we select the "best" query plan - run queries that take a long time to execute - run queries on different versions to see the performance gain/loss Contributed by Manjula Kutty (mkutty@remulak.net) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@513562 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/system/optimizer/utils/TestViews.java", "hunks": [ { "added": [ "/*", " ", " Derby - Class org.apache.derbyTesting.system.langtest.utils.TestViews", " ", " Licensed to the Apache Software Foundation (ASF) under one or more", " contributor license agreements. See the NOTICE file distributed with", " this work for additional information regarding copyright ownership.", " The ASF licenses this file to You under the Apache License, Version 2.0", " (the \"License\"); you may not use this file except in compliance with", " the License. You may obtain a copy of the License at", " ", " http://www.apache.org/licenses/LICENSE-2.0", " ", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", " ", " */", "package org.apache.derbyTesting.system.optimizer.utils;", "", "import java.util.ArrayList;", "", "/**", " * ", " * Class TestViews: List of views used in this test are added in this class", " * ", " */", "public class TestViews {", "\tstatic ArrayList dropViews = new ArrayList();", "", "\tstatic ArrayList createViews = new ArrayList();", "", "\tpublic static void init() {", "\t\tsetDropViews();", "\t\tsetCreateViews();", "\t}", "", "\tpublic static void setCreateViews() {", "\t\tcreateViews", "\t\t\t\t.add(\"create view v8 as select all col1,col2,col3,col4,col5,col6,col7 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7 from mytable7 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v8_2 as select all col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable7 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v16 as select all col1,col2,col3,col4,col5,col6,col7 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7 from mytable15 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v16_2 as select all col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable15 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v32 as select all col1,col2,col3,col4,col5,col6,col7 from mytable32 union all select col1,col2,col3,col4,col5,col6,col7 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7 from mytable15 union all select col1,col2,col3,col4,col5,col6,col7 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7 from mytable17 union all select col1,col2,col3,col4,col5,col6,col7 from mytable18 union all select col1,col2,col3,col4,col5,col6,col7 from mytable19 union all select col1,col2,col3,col4,col5,col6,col7 from mytable20 union all select col1,col2,col3,col4,col5,col6,col7 from mytable21 union all select col1,col2,col3,col4,col5,col6,col7 from mytable22 union all select col1,col2,col3,col4,col5,col6,col7 from mytable23 union all select col1,col2,col3,col4,col5,col6,col7 from mytable24 union all select col1,col2,col3,col4,col5,col6,col7 from mytable25 union all select col1,col2,col3,col4,col5,col6,col7 from mytable26 union all select col1,col2,col3,col4,col5,col6,col7 from mytable27 union all select col1,col2,col3,col4,col5,col6,col7 from mytable28 union all select col1,col2,col3,col4,col5,col6,col7 from mytable29 union all select col1,col2,col3,col4,col5,col6,col7 from mytable30 union all select col1,col2,col3,col4,col5,col6,col7 from mytable31 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v32_2 as select all col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable32 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable15 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable17 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable18 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable19 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable20 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable21 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable22 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable23 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable24 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable25 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable26 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable27 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable28 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable29 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable30 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable31 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v42 as select all col1,col2,col3,col4,col5,col6,col7 from mytable32 union all select col1,col2,col3,col4,col5,col6,col7 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7 from mytable15 union all select col1,col2,col3,col4,col5,col6,col7 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7 from mytable17 union all select col1,col2,col3,col4,col5,col6,col7 from mytable18 union all select col1,col2,col3,col4,col5,col6,col7 from mytable19 union all select col1,col2,col3,col4,col5,col6,col7 from mytable20 union all select col1,col2,col3,col4,col5,col6,col7 from mytable21 union all select col1,col2,col3,col4,col5,col6,col7 from mytable22 union all select col1,col2,col3,col4,col5,col6,col7 from mytable23 union all select col1,col2,col3,col4,col5,col6,col7 from mytable24 union all select col1,col2,col3,col4,col5,col6,col7 from mytable25 union all select col1,col2,col3,col4,col5,col6,col7 from mytable26 union all select col1,col2,col3,col4,col5,col6,col7 from mytable27 union all select col1,col2,col3,col4,col5,col6,col7 from mytable28 union all select col1,col2,col3,col4,col5,col6,col7 from mytable29 union all select col1,col2,col3,col4,col5,col6,col7 from mytable30 union all select col1,col2,col3,col4,col5,col6,col7 from mytable31 union all select col1,col2,col3,col4,col5,col6,col7 from mytable54 union all select col1,col2,col3,col4,col5,col6,col7 from mytable55 union all select col1,col2,col3,col4,col5,col6,col7 from mytable56 union all select col1,col2,col3,col4,col5,col6,col7 from mytable57 union all select col1,col2,col3,col4,col5,col6,col7 from mytable58 union all select col1,col2,col3,col4,col5,col6,col7 from mytable59 union all select col1,col2,col3,col4,col5,col6,col7 from mytable60 union all select col1,col2,col3,col4,col5,col6,col7 from mytable61 union all select col1,col2,col3,col4,col5,col6,col7 from mytable62 union all select col1,col2,col3,col4,col5,col6,col7 from mytable63 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v42_2 as select all col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable32 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable1 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable2 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable3 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable4 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable5 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable6 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable7 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable8 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable9 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable10 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable11 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable12 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable13 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable14 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable15 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable16 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable17 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable18 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable19 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable20 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable21 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable22 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable23 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable24 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable25 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable26 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable27 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable28 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable29 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable30 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable31 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable54 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable55 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable56 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable57 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable58 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable59 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable60 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable61 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable62 union all select col1,col2,col3,col4,col5,col6,col7,col8,col9 from mytable63 \");", "\t\t// Nested Views", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level1 as select all col1 as v_level1c1,col2 as v_level1c2,col3 as v_level1c3,col4 as v_level1c4,col5 as v_level1c5,col6 as v_level1c6 ,col7 as v_level1c7 from mytable1 union all select col1 as v_level1c1,col2 as v_level1c2,col3 as v_level1c3,col4 as v_level1c4,col5 as v_level1c5,col6 as v_level1c6 ,col7 as v_level1c7 from mytable2 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level2 as select all col1 as v_level2c1,col2 as v_level2c2,col3 as v_level2c3,col4 as v_level2c4,col5 as v_level2c5,col6 as v_level2c6 ,col7 as v_level2c7 from mytable3 union all select col1 as v_level2c1,col2 as v_level2c2,col3 as v_level2c3,col4 as v_level2c4,col5 as v_level2c5,col6 as v_level2c6 ,col7 as v_level2c7 from mytable4 union all select v_level1c1 as v_level2c1,v_level1c2 as v_level2c2,v_level1c3 as v_level2c3,v_level1c4 as v_level2c4,v_level1c5 as v_level2c5,v_level1c6 as v_level2c6,v_level1c7 as v_level2c7 from v_level1 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level3 as select all col1 as v_level3c1,col2 as v_level3c2,col3 as v_level3c3,col4 as v_level3c4,col5 as v_level3c5,col6 as v_level3c6 ,col7 as v_level3c7 from mytable5 union all select col1 as v_level3c1,col2 as v_level3c2,col3 as v_level3c3,col4 as v_level3c4,col5 as v_level3c5,col6 as v_level3c6 ,col7 as v_level3c7 from mytable6 union all select v_level2c1 as v_level3c1,v_level2c2 as v_level3c2,v_level2c3 as v_level3c3,v_level2c4 as v_level3c4,v_level2c5 as v_level3c5,v_level2c6 as v_level3c6,v_level2c7 as v_level3c7 from v_level2 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level4 as select all col1 as v_level4c1,col2 as v_level4c2,col3 as v_level4c3,col4 as v_level4c4,col5 as v_level4c5,col6 as v_level4c6 ,col7 as v_level4c7 from mytable7 union all select col1 as v_level4c1,col2 as v_level4c2,col3 as v_level4c3,col4 as v_level4c4,col5 as v_level4c5,col6 as v_level4c6 ,col7 as v_level4c7 from mytable8 union all select v_level3c1 as v_level4c1,v_level3c2 as v_level4c2,v_level3c3 as v_level4c3,v_level3c4 as v_level4c4,v_level3c5 as v_level4c5,v_level3c6 as v_level4c6,v_level3c7 as v_level4c7 from v_level3 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level5 as select all col1 as v_level5c1,col2 as v_level5c2,col3 as v_level5c3,col4 as v_level5c4,col5 as v_level5c5,col6 as v_level5c6 ,col7 as v_level5c7 from mytable9 union all select col1 as v_level5c1,col2 as v_level5c2,col3 as v_level5c3,col4 as v_level5c4,col5 as v_level5c5,col6 as v_level5c6 ,col7 as v_level5c7 from mytable10 union all select v_level4c1 as v_level5c1,v_level4c2 as v_level5c2,v_level4c3 as v_level5c3,v_level4c4 as v_level5c4,v_level4c5 as v_level5c5,v_level4c6 as v_level5c6,v_level4c7 as v_level5c7 from v_level4 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level6 as select all col1 as v_level6c1,col2 as v_level6c2,col3 as v_level6c3,col4 as v_level6c4,col5 as v_level6c5,col6 as v_level6c6 ,col7 as v_level6c7 from mytable11 union all select col1 as v_level6c1,col2 as v_level6c2,col3 as v_level6c3,col4 as v_level6c4,col5 as v_level6c5,col6 as v_level6c6 ,col7 as v_level6c7 from mytable12 union all select v_level5c1 as v_level6c1,v_level5c2 as v_level6c2,v_level5c3 as v_level6c3,v_level5c4 as v_level6c4,v_level5c5 as v_level6c5,v_level5c6 as v_level6c6,v_level5c7 as v_level6c7 from v_level5 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level7 as select all col1 as v_level7c1,col2 as v_level7c2,col3 as v_level7c3,col4 as v_level7c4,col5 as v_level7c5,col6 as v_level7c6 ,col7 as v_level7c7 from mytable13 union all select col1 as v_level7c1,col2 as v_level7c2,col3 as v_level7c3,col4 as v_level7c4,col5 as v_level7c5,col6 as v_level7c6 ,col7 as v_level7c7 from mytable14 union all select v_level6c1 as v_level7c1,v_level6c2 as v_level7c2,v_level6c3 as v_level7c3,v_level6c4 as v_level7c4,v_level6c5 as v_level7c5,v_level6c6 as v_level7c6,v_level6c7 as v_level7c7 from v_level6 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view v_level8 as select all col1 as v_level8c1,col2 as v_level8c2,col3 as v_level8c3,col4 as v_level8c4,col5 as v_level8c5,col6 as v_level8c6 ,col7 as v_level8c7 from mytable15 union all select col1 as v_level8c1,col2 as v_level8c2,col3 as v_level8c3,col4 as v_level8c4,col5 as v_level8c5,col6 as v_level8c6 ,col7 as v_level8c7 from mytable16 union all select v_level7c1 as v_level8c1,v_level7c2 as v_level8c2,v_level7c3 as v_level8c3,v_level7c4 as v_level8c4,v_level7c5 as v_level8c5,v_level7c6 as v_level8c6,v_level7c7 as v_level8c7 from v_level7 \");", "\t\t// Aggregate Views", "\t\tcreateViews", "\t\t\t\t.add(\"create view sum_view_8a(col1) as select sum(col1) as sum_view_8ac1 from mytable1 union all select col1 from mytable2 union all select col1 from mytable3 union all select col1 from mytable4 union all select col1 from mytable5 union all select col1 from mytable6 union all select col1 from mytable7 union all select col1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view sum_view_8b(sum_view_8bc1) as select sum(col1 + col8) as sum_view_8bc1 from mytable1 union all select sum(col1 + col8) as sum_view_8bc1 from mytable2 union all select sum(col1 + col8) as sum_view_8bc1 from mytable3 union all select sum(col1 + col8) as sum_view_8bc1 from mytable4 union all select sum(col1 + col8) as sum_view_8bc1 from mytable5 union all select sum(col1 + col8) as sum_view_8bc1 from mytable6 union all select sum(col1 + col8) as sum_view_8bc1 from mytable7 union all select sum(col1 + col8) as sum_view_8bc1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view avg_view_8a(col1) as select avg(col1) as avg_view_8ac1 from mytable1 union all select col1 from mytable2 union all select col1 from mytable3 union all select col1 from mytable4 union all select col1 from mytable5 union all select col1 from mytable6 union all select col1 from mytable7 union all select col1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view avg_view_8b(avg_view_8bc1) as select avg(col1 + col8) as avg_view_8bc1 from mytable1 union all select avg(col1 + col8) as avg_view_8bc1 from mytable2 union all select avg(col1 + col8) as avg_view_8bc1 from mytable3 union all select avg(col1 + col8) as avg_view_8bc1 from mytable4 union all select avg(col1 + col8) as avg_view_8bc1 from mytable5 union all select avg(col1 + col8) as avg_view_8bc1 from mytable6 union all select avg(col1 + col8) as avg_view_8bc1 from mytable7 union all select avg(col1 + col8) as avg_view_8bc1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view count_view_8a(col1) as select count(col1) as count_view_8ac1 from mytable1 union all select col1 from mytable2 union all select col1 from mytable3 union all select col1 from mytable4 union all select col1 from mytable5 union all select col1 from mytable6 union all select col1 from mytable7 union all select col1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view count_view_8b(count_view_8bc1) as select count(col1 + col8) as count_view_8bc1 from mytable1 union all select count(col1 + col8) as count_view_8bc1 from mytable2 union all select count(col1 + col8) as count_view_8bc1 from mytable3 union all select count(col1 + col8) as count_view_8bc1 from mytable4 union all select count(col1 + col8) as count_view_8bc1 from mytable5 union all select count(col1 + col8) as count_view_8bc1 from mytable6 union all select count(col1 + col8) as count_view_8bc1 from mytable7 union all select count(col1 + col8) as count_view_8bc1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view max_view_8a(col1) as select max(col1) as max_view_8ac1 from mytable1 union all select col1 from mytable2 union all select col1 from mytable3 union all select col1 from mytable4 union all select col1 from mytable5 union all select col1 from mytable6 union all select col1 from mytable7 union all select col1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view max_view_8b(max_view_8bc1) as select max(col1 + col8) as max_view_8bc1 from mytable1 union all select max(col1 + col8) as max_view_8bc1 from mytable2 union all select max(col1 + col8) as max_view_8bc1 from mytable3 union all select max(col1 + col8) as max_view_8bc1 from mytable4 union all select max(col1 + col8) as max_view_8bc1 from mytable5 union all select max(col1 + col8) as max_view_8bc1 from mytable6 union all select max(col1 + col8) as max_view_8bc1 from mytable7 union all select max(col1 + col8) as max_view_8bc1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view min_view_8a(col1) as select min(col1) as min_view_8ac1 from mytable1 union all select col1 from mytable2 union all select col1 from mytable3 union all select col1 from mytable4 union all select col1 from mytable5 union all select col1 from mytable6 union all select col1 from mytable7 union all select col1 from mytable8 \");", "\t\tcreateViews", "\t\t\t\t.add(\"create view min_view_8b(min_view_8bc1) as select min(col1 + col8) as min_view_8bc1 from mytable1 union all select min(col1 + col8) as min_view_8bc1 from mytable2 union all select min(col1 + col8) as min_view_8bc1 from mytable3 union all select min(col1 + col8) as min_view_8bc1 from mytable4 union all select min(col1 + col8) as min_view_8bc1 from mytable5 union all select min(col1 + col8) as min_view_8bc1 from mytable6 union all select min(col1 + col8) as min_view_8bc1 from mytable7 union all select min(col1 + col8) as min_view_8bc1 from mytable8 \");", "", "\t}", "", "\tpublic static void setDropViews() {", "\t\t// simple Views", "\t\tdropViews.add(\"DROP VIEW v8\");", "\t\tdropViews.add(\"DROP VIEW v8_2\");", "\t\tdropViews.add(\"DROP VIEW v16\");", "\t\tdropViews.add(\"DROP VIEW v16_2\");", "\t\tdropViews.add(\"DROP VIEW v32\");", "\t\tdropViews.add(\"DROP VIEW v32_2\");", "\t\tdropViews.add(\"DROP VIEW v42\");", "\t\tdropViews.add(\"DROP VIEW v42_2\");", "\t\t// Nested Views", "\t\tdropViews.add(\"DROP VIEW v_level8\");", "\t\tdropViews.add(\"DROP VIEW v_level7\");", "\t\tdropViews.add(\"DROP VIEW v_level6\");", "\t\tdropViews.add(\"DROP VIEW v_level5\");", "\t\tdropViews.add(\"DROP VIEW v_level4\");", "\t\tdropViews.add(\"DROP VIEW v_level3\");", "\t\tdropViews.add(\"DROP VIEW v_level2\");", "\t\tdropViews.add(\"DROP VIEW v_level1\");", "\t\t// Aggregate Views", "\t\tdropViews.add(\"DROP VIEW sum_view_8a\");", "\t\tdropViews.add(\"DROP VIEW sum_view_8b\");", "\t\tdropViews.add(\"DROP VIEW avg_view_8a\");", "\t\tdropViews.add(\"DROP VIEW avg_view_8b\");", "\t\tdropViews.add(\"DROP VIEW count_view_8a\");", "\t\tdropViews.add(\"DROP VIEW count_view_8b\");", "\t\tdropViews.add(\"DROP VIEW max_view_8a\");", "\t\tdropViews.add(\"DROP VIEW max_view_8b\");", "\t\tdropViews.add(\"DROP VIEW min_view_8a\");", "\t\tdropViews.add(\"DROP VIEW min_view_8b\");", "", "\t}", "}" ], "header": "@@ -0,0 +1,130 @@", "removed": [] } ] } ]
derby-DERBY-2254-5891683c
DERBY-2254: Increase overhead requirements which trigger log file switches when the checkpointing thread can't keep up with log writers. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1102417 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/log/LogCounter.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t \"log file position exceeded max log file size. log file position = \" + position );", "\t\t\t\t\t\t\t \"log file number exceeded max log file number. log file number = \" + fileNumber );" ], "header": "@@ -90,9 +90,9 @@ public class LogCounter implements LogInstant {", "removed": [ "\t\t\t\t\t\t\t \"log file position exceeded max log file size\");", "\t\t\t\t\t\t\t \"log file number exceeded max log file number\");" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java", "hunks": [ { "added": [ "\tprivate static final long INT_LENGTH = 4L;", "" ], "header": "@@ -225,6 +225,8 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [] }, { "added": [ "\t\t\t\t\t\tsetEndPosition( theLog.getFilePointer() );" ], "header": "@@ -1032,7 +1034,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\t\tendPosition = theLog.getFilePointer();" ] }, { "added": [ "\t\t\t\t\t\tsetEndPosition( LogCounter.getLogFilePosition(logEnd) );" ], "header": "@@ -1103,7 +1105,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\t\tendPosition = LogCounter.getLogFilePosition(logEnd);" ] }, { "added": [ "\t\t\t\t\tsetEndPosition( endPosition + INT_LENGTH );" ], "header": "@@ -2098,7 +2100,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\tendPosition += 4;" ] }, { "added": [ "\t\t\t\t\tsetEndPosition( newLog.getFilePointer() );" ], "header": "@@ -2118,7 +2120,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\tendPosition = newLog.getFilePointer();" ] }, { "added": [ "\t\t\t\t\tsetEndPosition( firstLog.getFilePointer() );" ], "header": "@@ -3380,7 +3382,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\tendPosition = firstLog.getFilePointer();" ] }, { "added": [ "\t\t\t\t// log file. account for an extra INT_LENGTH because switchLogFile()", " // writes an extra 0 at the end of the log. in addition, a checksum log record", " // may need to be written (see DERBY-2254).", " int checksumLogRecordSize = logOut.getChecksumLogRecordSize();", "\t\t\t\tif ( (endPosition + LOG_RECORD_OVERHEAD + length + INT_LENGTH + checksumLogRecordSize) >=", " LogCounter.MAX_LOGFILE_SIZE)", " if ( (endPosition + LOG_RECORD_OVERHEAD + length + INT_LENGTH + checksumLogRecordSize) >=", " LogCounter.MAX_LOGFILE_SIZE)" ], "header": "@@ -3800,15 +3802,18 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t// log file", "\t\t\t\tif ((endPosition + LOG_RECORD_OVERHEAD + length) >=", "\t\t\t\t\tLogCounter.MAX_LOGFILE_SIZE)", "\t\t\t\t\tif ((endPosition + LOG_RECORD_OVERHEAD + length) >=", "\t\t\t\t\t\tLogCounter.MAX_LOGFILE_SIZE) " ] }, { "added": [ "\t\t\t\tsetEndPosition( endPosition + logOut.reserveSpaceForChecksum(length, logFileNumber,endPosition) );" ], "header": "@@ -3820,7 +3825,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\tendPosition += logOut.reserveSpaceForChecksum(length, logFileNumber,endPosition);" ] }, { "added": [ "\t\t\t\tsetEndPosition( endPosition + (length + LOG_RECORD_OVERHEAD) );" ], "header": "@@ -3849,7 +3854,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\tendPosition += (length + LOG_RECORD_OVERHEAD);" ] }, { "added": [ "\t\t\t\t\tsetEndPosition( endPosition +", "\t\t\t\t\t\t\t\t\t\t\t\t\t logFileNumber,endPosition) );", " { setEndPosition( endPosition + (length + LOG_RECORD_OVERHEAD) ); }", " { setEndPosition( endPosition + bytesToWrite ); }" ], "header": "@@ -4665,19 +4670,19 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ "\t\t\t\t\tendPosition += ", "\t\t\t\t\t\t\t\t\t\t\t\t\t logFileNumber,endPosition);", "\t\t\t\t\t\tendPosition += (length + LOG_RECORD_OVERHEAD);", "\t\t\t\t\t\tendPosition += bytesToWrite;" ] }, { "added": [ " setEndPosition( LogCounter.getLogFilePosition(logEndInstant) );" ], "header": "@@ -5300,7 +5305,7 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [ " endPosition = LogCounter.getLogFilePosition(logEndInstant);" ] }, { "added": [ " /** set the endPosition of the log and make sure the new position won't spill off the end of the log */", " private void setEndPosition( long newPosition )", " {", "\t\tif (SanityManager.DEBUG)", " {", "\t\t\tSanityManager.ASSERT(newPosition < LogCounter.MAX_LOGFILE_SIZE,", "\t\t\t\t\t\t\t \"log file would spill past its legal end if the end were set to = \" + newPosition );", "\t\t}", "", " endPosition = newPosition;", " }" ], "header": "@@ -5738,6 +5743,17 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport", "removed": [] } ] } ]
derby-DERBY-2255-c0c37165
DERBY-2255 - ij will now show a different prompt while in a multi-line interactive statement. Patch contributed by Anders Morken. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@592500 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/StatementFinder.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.tools.i18n.LocalizedOutput;", "import org.apache.derby.iapi.tools.i18n.LocalizedInput;", "" ], "header": "@@ -21,6 +21,9 @@", "removed": [] }, { "added": [ "\tprivate LocalizedOutput promptwriter;", "\tprivate boolean doPrompt;", "\tprivate boolean continuedStatement;" ], "header": "@@ -54,6 +57,9 @@ public class StatementFinder {", "removed": [] }, { "added": [ "\t\tIf the StatementFinder's input stream is connected to", "\t\tSystem.in, a LocalizedOutput stream may be given to print", "\t\tline continuation prompts when StatementFinder reads a newline.", "", "\t\t@param promptDest LocalizedOutput stream to write line", "\t\t\t\t\t\tcontinuation prompts (\"> \") to. If null,", "\t\t\t\t\t\tno such prompts will be written.", "\tpublic StatementFinder(LocalizedInput s, LocalizedOutput promptDest) {", "\t\tif(promptDest != null && s.isStandardInput()) {", "\t\t\tpromptwriter = promptDest;", "\t\t\tdoPrompt = true;", "\t\t} else {", "\t\t\tdoPrompt = false;", "\t\t}", "\t\tIf an output stream was given when constructing this ", "\t\tStatementFinder and the input is standard input, ", "\t\tcontinuation prompting will be enabled.", "", "\tpublic void ReInit(LocalizedInput s) {" ], "header": "@@ -77,19 +83,36 @@ public class StatementFinder {", "removed": [ "\tpublic StatementFinder(Reader s) { ", "\tpublic void ReInit(Reader s) { " ] }, { "added": [ "\t\tif(s.isStandardInput() && promptwriter != null) {", "\t\t\tdoPrompt = true;", "\t\t} else {", "\t\t\tdoPrompt = false;", "\t\t}" ], "header": "@@ -100,6 +123,11 @@ public class StatementFinder {", "removed": [] }, { "added": [ "\t\t\t", "\t\t\tif (!(nextChar == MINUS))", "\t\t\t\tcontinuedStatement=true;" ], "header": "@@ -145,6 +173,9 @@ public class StatementFinder {", "removed": [] }, { "added": [ "\t\t\t\t\tcontinuedStatement=false;", "\t\t\t\tcase NEWLINE:", "\t\t\t\tcase RETURN:", "\t\t\t\t\tif(doPrompt) {", "\t\t\t\t\t\tutilMain.doPrompt(false, promptwriter, \"\");", "\t\t\t\t\t\t/* If the next character is a newline as well,", "\t\t\t\t\t\t we swallow it to avoid double prompting on", "\t\t\t\t\t\t Windows. */", "\t\t\t\t\t\tif(nextChar == RETURN && peekChar() == NEWLINE) {", "\t\t\t\t\t\t\treadChar();", "\t\t\t\t\t\t}", "\t\t\t\t\t}" ], "header": "@@ -157,7 +188,19 @@ public class StatementFinder {", "removed": [] }, { "added": [ "\t\tif (nextChar != commentChar)", "\t\t{", "\t\t\tcontinuedStatement=true;", "\t\t\treturn;", "\t\t}" ], "header": "@@ -204,7 +247,11 @@ public class StatementFinder {", "removed": [ "\t\tif (nextChar != commentChar) return;" ] } ] }, { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java", "hunks": [ { "added": [ "\t\t commandGrabber[ictr] = new StatementFinder(langUtil.getNewInput(System.in), out);" ], "header": "@@ -140,7 +140,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\t\t commandGrabber[ictr] = new StatementFinder(langUtil.getNewInput(System.in));" ] }, { "added": [ " new StatementFinder(langUtil.getNewInput(new BufferedInputStream(newFile, BUFFEREDFILESIZE)), null);" ], "header": "@@ -609,7 +609,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ " new StatementFinder(langUtil.getNewInput(new BufferedInputStream(newFile, BUFFEREDFILESIZE)));" ] }, { "added": [ " new StatementFinder(langUtil.getNewEncodedInput(new BufferedInputStream(is, BUFFEREDFILESIZE), \"UTF8\"), null);" ], "header": "@@ -618,7 +618,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ " new StatementFinder(langUtil.getNewEncodedInput(new BufferedInputStream(is, BUFFEREDFILESIZE), \"UTF8\"));" ] } ] } ]
derby-DERBY-2256-0b0252d8
DERBY-2256: Make sure that IN-list comparisons are done with the "dominant" type when two values have different type precedences. More specifically: - When determining the "judge" type in InListOperatorNode.preprocess(), iterate through all of the values to find out what the dominant type is, and then use that as the "judge" for sorting. Prior to these changes we just used the type of the left operand as judge, but that was not correct. - At execution time (i.e. in DataType.in()), add logic to ensure that all search comparisons are done using the dominant type of the values being compared. - Add appropriate test cases to lang/inbetween.sql. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@523411 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/types/DataType.java", "hunks": [ { "added": [ "\t\t *", "\t\t * NOTE: We may have sorted the IN-lst values at compile time using", "\t\t * a specific (dominant) type, but we did *not* actually cast the", "\t\t * values to that type. So it's possible that different IN-list", "\t\t * values have different precedences (verses each other and also", "\t\t * verses the type of the left operand) when we get here. Thus", "\t\t * when we do any comparisons here we have to make sure we always", "\t\t * compare using the dominant type of the two values being compared.", "\t\t * Otherwise we can end up with wrong results when doing the binary", "\t\t * search (ex. as caused by incorrect truncation). DERBY-2256.", "\t\tint leftPrecedence = left.typePrecedence();", "\t\tDataValueDescriptor comparator = null;", "\t\t\t\tcomparator =", "\t\t\t\t\t(leftPrecedence < inList[mid].typePrecedence())", "\t\t\t\t\t\t? inList[mid]", "\t\t\t\t\t\t: left;", "", "\t\t\t\tretval = comparator.equals(left, inList[mid]);", "\t\t\t\tBooleanDataValue goLeft =", "\t\t\t\t\tcomparator.greaterThan(inList[mid], left);" ], "header": "@@ -976,23 +976,37 @@ public abstract class DataType", "removed": [ "\t\t * NOTE: We've ensured that the IN list and the left all have", "\t\t * the same precedence at compile time. If we don't enforce ", "\t\t * the same precendence then", "\t\t * we could get the wrong result when doing a binary search.", "\t\t\t\tretval = equals(left, inList[mid]);", "\t\t\t\tBooleanDataValue goLeft = greaterThan(inList[mid], left);" ] }, { "added": [ "\t\t *", "\t\t * Note: for the same reasons outlined above we must be sure to always", "\t\t * do the comparisons using the dominant type of the two values being", "\t\t * compared.", "\t\t\tcomparator =", "\t\t\t\t(leftPrecedence < inList[index].typePrecedence())", "\t\t\t\t\t? inList[index]", "\t\t\t\t\t: left;", "", "\t\t\tretval = comparator.equals(left, inList[index]);" ], "header": "@@ -1009,10 +1023,19 @@ public abstract class DataType", "removed": [ "\t\t\tretval = equals(left, inList[index]);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/InListOperatorNode.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.services.loader.ClassFactory;" ], "header": "@@ -36,7 +36,7 @@ import org.apache.derby.iapi.types.DataValueDescriptor;", "removed": [ "" ] }, { "added": [ "\t\t\t\t * are not an exact match then we have to use the *dominant*", "\t\t\t\t * type across all values, where \"all values\" includes the", "\t\t\t\t * left operand. Otherwise we can end up with incorrect", "\t\t\t\t * results.", "\t\t\t\t *", "\t\t\t\t * Note that it is *not* enough to just use the left operand's", "\t\t\t\t * type as the judge because we have no guarantee that the", "\t\t\t\t * left operand has the dominant type. If, for example, the", "\t\t\t\t * left operand has type INTEGER and all (or any) values in", "\t\t\t\t * the IN list have type DECIMAL, use of the left op's type", "\t\t\t\t * would lead to comparisons with truncated values and could", "\t\t\t\t * therefore lead to an incorrect sort order. DERBY-2256.", "\t\t\t\tDataTypeDescriptor targetType = leftOperand.getTypeServices();", "\t\t\t\tTypeId judgeTypeId = targetType.getTypeId();", "", "\t\t\t\t\t/* Iterate through the entire list of values to find out", "\t\t\t\t\t * what the dominant type is.", "\t\t\t\t\t */", "\t\t\t\t\tClassFactory cf = getClassFactory();", "\t\t\t\t\tint sz = rightOperandList.size();", "\t\t\t\t\tfor (int i = 0; i < sz; i++)", "\t\t\t\t\t{", "\t\t\t\t\t\tValueNode vn = (ValueNode)rightOperandList.elementAt(i);", "\t\t\t\t\t\ttargetType =", "\t\t\t\t\t\t\ttargetType.getDominantType(", "\t\t\t\t\t\t\t\tvn.getTypeServices(), cf);", "\t\t\t\t\t}", "\t\t\t\t/* Now wort the list in ascending order using the dominant", "\t\t\t\t * type found above.", "\t\t\t\t */", "\t\t\t\tDataValueDescriptor judgeODV =", "\t\t\t\t\t(DataValueDescriptor)targetType.getTypeId().getNull();", "" ], "header": "@@ -222,19 +222,45 @@ public final class InListOperatorNode extends BinaryListOperatorNode", "removed": [ "\t\t\t\t * are not an exact match, we use the left operand's type", "\t\t\t\t * as the \"judge\", assuming that they are compatible, as", "\t\t\t\t * also the case with DB2.", "\t\t\t\tTypeId judgeTypeId = leftOperand.getTypeServices().getTypeId();", "\t\t\t\tDataValueDescriptor judgeODV = null; //no judge, no argument", "\t\t\t\t\tjudgeODV = (DataValueDescriptor) judgeTypeId.getNull();", "\t\t\t\t// Sort the list in ascending order" ] } ] } ]
derby-DERBY-2258-28a04c75
DERBY-2258 Modified the assert case for XML data type in DatabaseMetaDataTest.java for precision check. Patch contributed by: Saurabh Vyas Saurabh.Vyas@Sun.COM git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@504241 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2258-aa02c639
DERBY-2258 DERBY-2259 DERBY-2260 DERBY-2245 1) metadata.properties : Removed entries for LONG NVARCHAR, NATIONAL CHAR, NATIONAL CHAR VARYING data type & added XML data type in getTypeInfo() 2) DatabaseMetaDataTest.java : Removed check for unsupported types (all supported types are specified in supportedTypes array ) from testGetTypeInfo() method & added support for SQLXML type in the test. This requires extending the test to verify the field values for XML data type (like PRECISION, SEARCHABLE etc) 3) connectionJdbc20.out : It requires removing unsupported data types & adding XML data type in the expected output for the test. 4) Minor changes to getSQLKeywords. Patch contributed by: Saurabh Vyas Saurabh.Vyas@Sun.COM git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@504234 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2259-aa02c639
DERBY-2258 DERBY-2259 DERBY-2260 DERBY-2245 1) metadata.properties : Removed entries for LONG NVARCHAR, NATIONAL CHAR, NATIONAL CHAR VARYING data type & added XML data type in getTypeInfo() 2) DatabaseMetaDataTest.java : Removed check for unsupported types (all supported types are specified in supportedTypes array ) from testGetTypeInfo() method & added support for SQLXML type in the test. This requires extending the test to verify the field values for XML data type (like PRECISION, SEARCHABLE etc) 3) connectionJdbc20.out : It requires removing unsupported data types & adding XML data type in the expected output for the test. 4) Minor changes to getSQLKeywords. Patch contributed by: Saurabh Vyas Saurabh.Vyas@Sun.COM git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@504234 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2260-aa02c639
DERBY-2258 DERBY-2259 DERBY-2260 DERBY-2245 1) metadata.properties : Removed entries for LONG NVARCHAR, NATIONAL CHAR, NATIONAL CHAR VARYING data type & added XML data type in getTypeInfo() 2) DatabaseMetaDataTest.java : Removed check for unsupported types (all supported types are specified in supportedTypes array ) from testGetTypeInfo() method & added support for SQLXML type in the test. This requires extending the test to verify the field values for XML data type (like PRECISION, SEARCHABLE etc) 3) connectionJdbc20.out : It requires removing unsupported data types & adding XML data type in the expected output for the test. 4) Minor changes to getSQLKeywords. Patch contributed by: Saurabh Vyas Saurabh.Vyas@Sun.COM git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@504234 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2264-19ea3276
DERBY-2264 (followup): Disable jdbcapi/DboPowersTest for JSR169 since Derby does not support database encryption for that platform (per the specification for JSR169 attached to DERBY-97). Contributed by: Dag Wanvik (dag.wanvik@sun.com) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@521401 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2264-674c2a4c
DERBY-2264: Commit Dag's DERBY-2264-1.diff patch, which restricts database shutdown to the DBA. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@510173 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ "\t\t\t\tif (!usingNoneAuth) {", "\t\t\t\t\t// DERBY-2264: Only allow db owner to shut down if", "\t\t\t\t\t// authentication is on.", "\t\t\t\t\tcheckIsDBOwner();", "\t\t\t\t}" ], "header": "@@ -273,6 +273,11 @@ public class EmbedConnection implements EngineConnection", "removed": [] }, { "added": [ "\t Examine the attributes set provided for illegal boot", "\t combinations and determine if this is a create boot.", "", "\t @return true iff the attribute <em>create=true</em> is provided. This", "\t means create a standard database. In other cases, returns", "\t false.", "\t @exception SQLException Throw if more than one of", "\t <em>create</em>, <em>createFrom</em>, <em>restoreFrom</em> and", "\t <em>rollForwardRecoveryFrom</em> is used simultaneously. <br>", "", "\t Also, throw if (re)encryption is attempted with one of", "\t <em>createFrom</em>, <em>restoreFrom</em> and", "\t <em>rollForwardRecoveryFrom</em>.", "", "\t*/" ], "header": "@@ -304,23 +309,24 @@ public class EmbedConnection implements EngineConnection", "removed": [ "\t Examine the attributes set provided and determine if this is a create", "\t boot. A boot is a create boot iff.", "", "\t <OL>", "\t <LI>create=true - This means create a standard database.", "\t <LI> createFrom = Path - creates database from backup if it does not exist.", "\t <LI> restoreFrom = Path - database is restored completley from backup.", " if a database exists in the same place it is replaced by the version", "\t\t in the backup otherwise a new one is created using the backup copy.", " <LI> rollForwardRecoveryFrom = Path - rollforward is performed ", " using the version backup and any active and archived log files.", "\t </OL>", "\t @exception SQLException Ooops.", "\t */" ] }, { "added": [ " // check if user has specified re-encryption attributes in", " // combination with createFrom/restoreFrom/rollForwardRecoveryFrom", " // attributes. Re-encryption is not", " // allowed when restoring from backup." ], "header": "@@ -339,9 +345,10 @@ public class EmbedConnection implements EngineConnection", "removed": [ " // check if user has specified re-encryption attributes ", " // in combination with create/restore/recover attributes.", " // re-encryption is not allowed when restoring from backup. " ] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ " \"TEST_DBO\", \"dummy\"); // DRDA doesn't like empty pw" ], "header": "@@ -403,7 +403,7 @@ public class TestConfiguration {", "removed": [ " \"TEST_DBO\", \"\");" ] }, { "added": [ " this.isVerbose = Boolean.valueOf(", " getSystemProperties().getProperty(KEY_VERBOSE)).", " booleanValue();" ], "header": "@@ -493,6 +493,9 @@ public class TestConfiguration {", "removed": [] } ] } ]
derby-DERBY-2264-af7f5e2b
DERBY-2264: Commit Dag's patch DERBY-2264.5.diff, which restricts encryption powers to the DBA. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@518214 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ "\tTransactionResourceImpl tr; // always access tr thru getTR()" ], "header": "@@ -119,7 +119,7 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\tfinal TransactionResourceImpl tr; // always access tr thru getTR()" ] }, { "added": [ "", "\t\t\t// DERBY-2264: keeps track of whether we do a plain boot before an", "\t\t\t// (re)encryption boot to (possibly) authenticate first. We can not", "\t\t\t// authenticate before we have booted, so in order to enforce data", "\t\t\t// base owner powers over encryption, we need a plain boot, then", "\t\t\t// authenticate, then, if all is well, boot with (re)encryption.", "\t\t\t// Encryption at create time is not checked.", "\t\t\tboolean isTwoPhaseEncryptionBoot = (!createBoot &&", "\t\t\t\t\t\t\t\t\t\t\t\tisEncryptionBoot(info));", "", "\t\t\t// Save original properties if we modified them for", "\t\t\t// isTwoPhaseEncryptionBoot.", "\t\t\tProperties savedInfo = null;", "", "\t\t\t\tisTwoPhaseEncryptionBoot = false;", "\t\t\t\tif (isTwoPhaseEncryptionBoot) {", "\t\t\t\t\tsavedInfo = info;", "\t\t\t\t\tinfo = removeEncryptionProps((Properties)info.clone());", "\t\t\t\t}", "", "\t\t\t\t// Return false iff the monitor cannot handle a service of the", "\t\t\t\t// type indicated by the proptocol within the name. If that's", "\t\t\t\t// the case then we are the wrong driver.", "" ], "header": "@@ -215,16 +215,37 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\t// Return false iff the monitor cannot handle a service of the type", "\t\t\t\t// indicated by the proptocol within the name. If that's the case", "\t\t\t\t// then we are the wrong driver." ] }, { "added": [ "\t\t\t\t// if we are shutting down don't attempt to boot or create the", "\t\t\t\t// database" ], "header": "@@ -236,7 +257,8 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\t// if we are shutting down don't attempt to boot or create the database" ] }, { "added": [ "\t\t\tif (isTwoPhaseEncryptionBoot) {", "\t\t\t\t// DERBY-2264: shutdown and boot again with encryption", "\t\t\t\t// attributes active. This is restricted to the database owner.", "\t\t\t\tif (!usingNoneAuth) {", "\t\t\t\t\t// a failure here leaves database booted, but no", "\t\t\t\t\t// (re)encryption has taken place and the connection is", "\t\t\t\t\t// rejected.", "\t\t\t\t\tcheckIsDBOwner(OP_ENCRYPT);", "\t\t\t\t}", "", "\t\t\t\t// shutdown and reboot using saved properties which", "\t\t\t\t// include the (re)encyption attributes", "\t\t\t\tinfo = savedInfo;", "\t\t\t\thandleException(tr.shutdownDatabaseException());", "\t\t\t\trestoreContextStack();", "\t\t\t\ttr = new TransactionResourceImpl(driver, url, info);", "\t\t\t\tactive = true;", "\t\t\t\tsetupContextStack();", "", "\t\t\t\tif (!bootDatabase(info))", "\t\t\t\t{", "\t\t\t\t\tif (SanityManager.DEBUG) {", "\t\t\t\t\t\tSanityManager.THROWASSERT(", "\t\t\t\t\t\t\t\"bootDatabase failed after initial plain boot \" +", "\t\t\t\t\t\t\t\"for (re)encryption\");", "\t\t\t\t\t}", "\t\t\t\t\ttr.clearContextInError();", "\t\t\t\t\tsetInactive();", "\t\t\t\t\treturn;", "\t\t\t\t}", "\t\t\t\t// don't need to check user credentials again, did", "\t\t\t\t// that on first plain boot, so just start", "\t\t\t\ttr.startTransaction();", "\t\t\t}", "", "\t\t\t\t\t// DERBY-2264: Only allow database owner to shut down if", "\t\t\t\t\tcheckIsDBOwner(OP_SHUTDOWN);" ], "header": "@@ -276,12 +298,47 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\t\t// DERBY-2264: Only allow db owner to shut down if", "\t\t\t\t\tcheckIsDBOwner();" ] }, { "added": [ " if (restoreCount != 0 && isEncryptionBoot(p)) {", "\t\t\tthrow newSQLException(SQLState.CONFLICTING_RESTORE_ATTRIBUTES);" ], "header": "@@ -354,14 +411,8 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ " if (restoreCount != 0 && ", " (Boolean.valueOf(p.getProperty(", " Attribute.DATA_ENCRYPTION)).booleanValue() ||", " p.getProperty(Attribute.NEW_BOOT_PASSWORD) != null ||", " p.getProperty(Attribute.NEW_CRYPTO_EXTERNAL_KEY) != null", " )) ", " {", " throw newSQLException(SQLState.CONFLICTING_RESTORE_ATTRIBUTES);" ] }, { "added": [ "\t/**", "\t * Examine boot properties and determine if a boot with the given", "\t * attributes would entail an encryption operation.", "\t *", "\t * @param p the attribute set", "\t * @return true if a boot will encrypt or re-encrypt the database", "\t */", "\tprivate boolean isEncryptionBoot(Properties p)", "\t{", "\t\treturn ((Boolean.valueOf(", "\t\t\t\t\t p.getProperty(Attribute.DATA_ENCRYPTION)).booleanValue()) ||", "\t\t\t\t(p.getProperty(Attribute.NEW_BOOT_PASSWORD) != null) ||", "\t\t\t\t(p.getProperty(Attribute.NEW_CRYPTO_EXTERNAL_KEY) != null));", "\t}", "", "", "\t/**", "\t * Remove any encryption properties from the given properties", "\t *", "\t * @param p the attribute set", "\t * @return clone sans encryption properties", "\t */", "\tprivate Properties removeEncryptionProps(Properties p)", "\t{", "\t\tp.remove(Attribute.DATA_ENCRYPTION);", "\t\tp.remove(Attribute.NEW_BOOT_PASSWORD);", "\t\tp.remove(Attribute.NEW_CRYPTO_EXTERNAL_KEY);", "\t\treturn p;", "\t}", "", "" ], "header": "@@ -376,6 +427,37 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/DropDatabaseSetup.java", "hunks": [ { "added": [ " final String logicalDBName;" ], "header": "@@ -37,7 +37,7 @@ import junit.framework.Test;", "removed": [ " private final String logicalDBName;" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ "", " /**", " * Decorate a test to use a new database that is created upon the", " * first connection request to the database and deleted at", " * tearDown. In contrast to plain singleUseDatabaseDecorator, the", " * database is expected to be shutdown by the test. The", " * configuration differs only from the current configuration by", " * the list of used databases. The new database name is generated", " * automatically as 'singleUse/oneuseXX' where 'XX' is the unique", " * number. The generated database name is added at the end of", " * <code>usedDbNames</code> and assigned as a default database", " * name. This decorator expects the database file to be local so", " * it can be removed.", " * @param test Test to be decorated", " * @return decorated test.", " */", " public static TestSetup singleUseDatabaseDecoratorNoShutdown(Test test)", " {", " String dbName = generateUniqueDatabaseName();", "", " return new DatabaseChangeSetup(", " new DropDatabaseSetup(test, dbName)", " {", " protected void tearDown() throws Exception {", " // test responsible for shutdown", " removeDatabase();", " }", " },", " dbName, dbName, true);", " }", "" ], "header": "@@ -314,7 +314,37 @@ public class TestConfiguration {", "removed": [ " " ] }, { "added": [ "", "", " /**", " * Same as sqlAuthorizationDecorator, except that the database is dropped", " * at teardown and the test is responsible for shutting down the database.", " *", " * @param test Test to be decorated", " * @return decorated test.", " *", " * @see TestConfiguration#sqlAuthorizationDecorator(Test test)", " */", " public static Test sqlAuthorizationDecoratorSingleUse(Test test)", " {", " // Set the SQL authorization mode as a database property", " // with a modified DatabasePropertyTestSetup that does not", " // reset it.", " final Properties sqlAuth = new Properties();", " sqlAuth.setProperty(\"derby.database.sqlAuthorization\", \"true\");", " Test setSQLAuthMode = new DatabasePropertyTestSetup(test,", " sqlAuth, true) {", " protected void tearDown() { }", " };", "", "", " setSQLAuthMode = new DatabaseChangeSetup(", " new DropDatabaseSetup(setSQLAuthMode, DEFAULT_DBNAME_SQL) {", " protected void tearDown() throws Exception {", " // test responsible for shutdown", " removeDatabase();", " }", " },", " DEFAULT_DBNAME_SQL, DEFAULT_DBNAME_SQL, true);", "", " return changeUserDecorator(setSQLAuthMode,", " \"TEST_DBO\",", " \"dummy\"); // DRDA doesn't like empty pw", " }", "" ], "header": "@@ -404,7 +434,45 @@ public class TestConfiguration {", "removed": [] } ] } ]
derby-DERBY-2264-c4e95b5d
DERBY-2264 Patch DERBY-2264-7.diff, which restricts database hard upgrade to the database owner. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@528274 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ "\t\t\t// (re)encryption or hard upgrade boot to (possibly) authenticate", "\t\t\t// first. We can not authenticate before we have booted, so in", "\t\t\t// order to enforce data base owner powers over encryption or", "\t\t\t// upgrade, we need a plain boot, then authenticate, then, if all", "\t\t\t// is well, boot with (re)encryption or upgrade. Encryption at", "\t\t\t// create time is not checked.", "\t\t\tboolean isTwoPhaseUpgradeBoot = (!createBoot &&", "\t\t\t\t\t\t\t\t\t\t\t isHardUpgradeBoot(info));", "\t\t\t// two phase encryption or upgrade boot." ], "header": "@@ -217,16 +217,19 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t// (re)encryption boot to (possibly) authenticate first. We can not", "\t\t\t// authenticate before we have booted, so in order to enforce data", "\t\t\t// base owner powers over encryption, we need a plain boot, then", "\t\t\t// authenticate, then, if all is well, boot with (re)encryption.", "\t\t\t// Encryption at create time is not checked.", "\t\t\t// isTwoPhaseEncryptionBoot." ] }, { "added": [ "\t\t\t\tisTwoPhaseUpgradeBoot = false;", "\t\t\t\tif (isTwoPhaseEncryptionBoot || isTwoPhaseUpgradeBoot) {", "\t\t\t\t\tinfo = removePhaseTwoProps((Properties)info.clone());" ], "header": "@@ -234,12 +237,13 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\tif (isTwoPhaseEncryptionBoot) {", "\t\t\t\t\tinfo = removeEncryptionProps((Properties)info.clone());" ] }, { "added": [ "\t\t\tif (isTwoPhaseEncryptionBoot || isTwoPhaseUpgradeBoot) {", "\t\t\t\t// DERBY-2264: shutdown and boot again with encryption or", "\t\t\t\t// upgrade attributes active. This is restricted to the", "\t\t\t\t// database owner.", "\t\t\t\t\tcheckIsDBOwner(isTwoPhaseEncryptionBoot? OP_ENCRYPT :", "\t\t\t\t\t\t\t\t OP_HARD_UPGRADE);", "\t\t\t\t// include the (re)encyption or upgrade attribute(s)" ], "header": "@@ -298,18 +302,20 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\tif (isTwoPhaseEncryptionBoot) {", "\t\t\t\t// DERBY-2264: shutdown and boot again with encryption", "\t\t\t\t// attributes active. This is restricted to the database owner.", "\t\t\t\t\tcheckIsDBOwner(OP_ENCRYPT);", "\t\t\t\t// include the (re)encyption attributes" ] }, { "added": [ "\t\t\t\t\t\t\t\"for (re)encryption or upgrade\");" ], "header": "@@ -322,7 +328,7 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\t\t\t\t\"for (re)encryption\");" ] }, { "added": [ "\t/**", "\t * Examine boot properties and determine if a boot with the given", "\t * attributes would entail a hard upgrade.", "\t *", "\t * @param p the attribute set", "\t * @return true if a boot will hard upgrade the database", "\t */", "\tprivate boolean isHardUpgradeBoot(Properties p)", "\t{", "\t\treturn Boolean.valueOf(", "\t\t\tp.getProperty(Attribute.UPGRADE_ATTR)).booleanValue();", "\t}", "\t * Remove any encryption or upgarde properties from the given properties", "\tprivate Properties removePhaseTwoProps(Properties p)", "\t\tp.remove(Attribute.UPGRADE_ATTR);" ], "header": "@@ -442,18 +448,31 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t * Remove any encryption properties from the given properties", "\tprivate Properties removeEncryptionProps(Properties p)" ] }, { "added": [ "\tprivate static final int OP_HARD_UPGRADE = 2;" ], "header": "@@ -567,6 +586,7 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [] } ] } ]
derby-DERBY-2264-ca5edbb8
DERBY-2264 Committed DERBY-2264-9.* which restricts database owner powers enforcement to only such cases as when both derby.database.requireAuthentication and derby.database.sqlAuthentication are enabled, based on feed-back from community over upgrading compatibility concerns. Also fixes an issue with interference between feature checking and hard upgrade. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@545370 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ "\t\t\t\tif (!bootDatabase(info, isTwoPhaseUpgradeBoot))" ], "header": "@@ -252,7 +252,7 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\tif (!bootDatabase(info))" ] }, { "added": [ "", "\t\t\t\t// database owner if authentication and sqlAuthorization is on.", "\t\t\t\tif (!usingNoneAuth &&", "\t\t\t\t\t\tgetLanguageConnection().usesSqlAuthorization()) {" ], "header": "@@ -305,10 +305,12 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\t// database owner.", "\t\t\t\tif (!usingNoneAuth) {" ] }, { "added": [ "\t\t\t\tif (!bootDatabase(info, false))" ], "header": "@@ -325,7 +327,7 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\tif (!bootDatabase(info))" ] }, { "added": [ "\t\t\t\tif (!usingNoneAuth &&", "\t\t\t\t\t\tgetLanguageConnection().usesSqlAuthorization()) {", "\t\t\t\t\t// authentication and sqlAuthorization is on." ], "header": "@@ -343,9 +345,10 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\t\t\tif (!usingNoneAuth) {", "\t\t\t\t\t// authentication is on." ] }, { "added": [ "\t * Boot database.", "\t *", "\t * @param info boot properties", "\t *", "\t * @param softAuthenticationBoot If true, don't fail soft upgrade due", "\t * to missing features (phase one of two phased hard upgrade boot).", "\t *", "\t * @return false iff the monitor cannot handle a service", "\t * of the type indicated by the protocol within the name.", "\t * If that's the case then we are the wrong driver.", "\t *", "\t * @throws Throwable if anything else is wrong.", "\tprivate boolean bootDatabase(Properties info,", "\t\t\t\t\t\t\t\t boolean softAuthenticationBoot", "\t\t\t\t\t\t\t\t ) throws Throwable" ], "header": "@@ -1824,14 +1827,23 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\t\tReturn false iff the monitor cannot handle a service", "\t\tof the type indicated by the protocol within the name.", "\t\tIf that's the case then we are the wrong driver.", "", "\t\tThrow exception if anything else is wrong.", "\tprivate boolean bootDatabase(Properties info) throws Throwable" ] } ] } ]
derby-DERBY-2264-df597d11
DERBY-2264: Committed Dag's DERBY-2264-2.diff patch, which addresses some minor comments on the previous patch. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@510586 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2265-dc66b566
DERBY-2265 bad code in functionTests.harness.jvm.guessWSHome - prevented StringIndexOutOfBoundsException with j9 git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@499200 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java", "hunks": [ { "added": [ "\t\tint havejre=jhome.indexOf(sep + \"jre\");", "\t\tif (havejre > 0)", "\t\t{", "\t\t\twshome = jhome.substring(0,jhome.indexOf(sep + \"jre\"));", "\t\t\tif (wshome.lastIndexOf(sep) >= 0)", "\t\t\t\twshome = wshome.substring(0,wshome.lastIndexOf(sep));", "\t\t}", "\t\t{", "\t\t\tif (jhome.lastIndexOf(sep) >= 0)", "\t\t\t\twshome = jhome.substring(0,jhome.lastIndexOf(sep));\t", "\t\t}" ], "header": "@@ -298,8 +298,17 @@ public abstract class jvm {", "removed": [ "\t\twshome = jhome.substring(0,jhome.indexOf(sep + \"jre\"));", "\t\twshome = wshome.substring(0,wshome.lastIndexOf(sep));" ] } ] } ]
derby-DERBY-2269-1a1fb6ae
DERBY-2269 - running tests with SecurityManager with JSR169 support with derbyrun.jar in CLASSPATH causes NoClassDefFounError: javax.naming.Referenceable - added if (!JDBC.supportsJSR169()) blocks to prevent calls to Class.forName("org.apache.derby.derby.jdbc.ClientDataSource"). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@501337 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java", "hunks": [ { "added": [ "\t\t// if we attempt to check on availability of the ClientDataSource with ", "\t\t// JSR169, attempts will be made to load classes not supported in", "\t\t// that environment, such as javax.naming.Referenceable. See DERBY-2269.", "\t\tif (!JDBC.vmSupportsJSR169()) {", "\t\t URL client = getURL(\"org.apache.derby.jdbc.ClientDataSource\");", "\t\t if(client != null)", "\t\t classPathSet.setProperty(\"derbyTesting.clientjar\", stripJar(client));", "\t\t}" ], "header": "@@ -277,9 +277,14 @@ public final class SecurityManagerSetup extends TestSetup {", "removed": [ "\t\tURL client = getURL(\"org.apache.derby.jdbc.ClientDataSource\");", "\t\tif (client != null)", "\t\t classPathSet.setProperty(\"derbyTesting.clientjar\", stripJar(client));" ] } ] } ]
derby-DERBY-2277-a72b9de0
DERBY-2277 - enable jdk17 runs with old test harness Patch contributed by Vermund Ostgaard git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@501994 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/jdk17.java", "hunks": [ { "added": [ "/*", " ", " Derby - Class org.apache.derbyTesting.functionTests.harness.jdk17", " ", " Licensed to the Apache Software Foundation (ASF) under one or more", " contributor license agreements. See the NOTICE file distributed with", " this work for additional information regarding copyright ownership.", " The ASF licenses this file to You under the Apache License, Version 2.0", " (the \"License\"); you may not use this file except in compliance with", " the License. You may obtain a copy of the License at", " ", " http://www.apache.org/licenses/LICENSE-2.0", " ", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", " ", " */", "", "package org.apache.derbyTesting.functionTests.harness;", "", "import java.util.Vector;", "import java.util.StringTokenizer;", "", "", "public class jdk17 extends jvm {", " ", " public String getName(){return \"jdk17\";}", " public jdk17(boolean noasyncgc, boolean verbosegc, boolean noclassgc,", " long ss, long oss, long ms, long mx, String classpath, String prof,", " boolean verify, boolean noverify, boolean nojit, Vector D) {", " super(noasyncgc,verbosegc,noclassgc,ss,oss,ms,mx,classpath,prof,", " verify,noverify,nojit,D);", " }", " ", " public jdk17(String classpath, Vector D) {", " super(classpath,D);", " }", " ", " public jdk17(long ms, long mx, String classpath, Vector D) {", " super(ms,mx,classpath,D);", " }", " ", " public jdk17() { }", " ", " ", " public Vector getCommandLine() {", " StringBuffer sb = new StringBuffer();", " Vector v = super.getCommandLine();", " appendOtherFlags(sb);", " String s = sb.toString();", " StringTokenizer st = new StringTokenizer(s);", " while (st.hasMoreTokens()) {", " v.addElement(st.nextToken());", " }", " return v;", " }", " ", " public void appendOtherFlags(StringBuffer sb) {", " if (noasyncgc) warn(\"jdk17 does not support noasyncgc\");", " if (verbosegc) sb.append(\" -verbose:gc\");", " if (noclassgc) sb.append(\" -Xnoclassgc\");", " if (ss>=0) warn(\"jdk17 does not support ss\");", " if (oss>=0) warn(\"jdk17 does not support oss\");", " if (ms>=0) {", " sb.append(\" -ms\");", " sb.append(ms);", " }", " if (mx>=0) {", " sb.append(\" -mx\");", " sb.append(mx);", " }", " if (classpath!=null) {", " sb.append(\" -classpath \");", " sb.append(classpath);", " }", " if (prof!=null) warn(\"jdk17 does not support prof\");", " if (verify) warn(\"jdk17 does not support verify\");", " if (noverify) warn(\"jdk17 does not support noverify\");", " if (nojit) sb.append(\" -Djava.compiler=NONE\");", " if (D != null)", " for (int i=0; i<D.size();i++) {", " sb.append(\" -D\");", " sb.append((String)(D.elementAt(i)));", " }", " }", " public String getDintro() { return \"-D\"; }", "}" ], "header": "@@ -0,0 +1,90 @@", "removed": [] } ] } ]
derby-DERBY-2278-0d6b4099
DERBY-2278 Adds a new class OEChecks that does the cardinality checks in order to separate out the OE code logic into its own class and separating it out from the junit test framework that we have. This leads to modification in implementation of the fixtures in the Checks.java to appropriately call the methods from the OEChecks. Adds a new class - DriverUtility that can be used to populate the OE database given the drivername and the database connection url and then perform checks on it. Assumption is that the schema is already loaded into the database. Contributed by Sunitha Kambhampati -- ksunithaghm@gmail.com git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@506748 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/system/oe/run/Checks.java", "hunks": [ { "added": [ "import org.apache.derbyTesting.system.oe.util.OEChecks;" ], "header": "@@ -29,6 +29,7 @@ import junit.framework.TestSuite;", "removed": [] }, { "added": [ " ", " /**", " * Run checks on OE database", " */", " private OEChecks check = null;", " ", " public Checks(String name)", " {" ], "header": "@@ -39,11 +40,16 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ "", " public Checks(String name) {", "" ] }, { "added": [ " public void setUp() throws Exception", " {", " this.check = new OEChecks();", " check.initialize(getConnection(),scale);", " }" ], "header": "@@ -56,6 +62,11 @@ public class Checks extends JDBCPerfTestCase {", "removed": [] }, { "added": [ " check.testWarehouseRows();" ], "header": "@@ -247,7 +258,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"WAREHOUSE\", scale);" ] }, { "added": [ " check.testStockRows();" ], "header": "@@ -256,7 +267,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"STOCK\", Load.STOCK_COUNT_W * scale);" ] }, { "added": [ " check.testOrdersRows();" ], "header": "@@ -265,7 +276,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"ORDERS\", Load.ORDERS_COUNT_W * scale);" ] }, { "added": [ " check.testDistrictRows();" ], "header": "@@ -274,7 +285,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"DISTRICT\", Load.DISTRICT_COUNT_W * scale);" ] }, { "added": [ " check.testCustomerRows();" ], "header": "@@ -283,7 +294,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"CUSTOMER\", Load.CUSTOMER_COUNT_W * scale);" ] }, { "added": [ " check.testItemRows();" ], "header": "@@ -292,7 +303,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"ITEM\", Load.ITEM_COUNT);" ] }, { "added": [ " check.testNewOrdersRows();" ], "header": "@@ -301,7 +312,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"NEWORDERS\", Load.NEWORDERS_COUNT_W * scale);" ] }, { "added": [ " check.testHistoryRows();" ], "header": "@@ -310,7 +321,7 @@ public class Checks extends JDBCPerfTestCase {", "removed": [ " checkCountStar(\"HISTORY\", Load.HISTORY_COUNT_W * scale);" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/system/oe/util/OEChecks.java", "hunks": [ { "added": [ "/*", " *", " * Derby - Class org.apache.derbyTesting.system.oe.util.OEChecks", " *", " * Licensed to the Apache Software Foundation (ASF) under one or more", " * contributor license agreements. See the NOTICE file distributed with", " * this work for additional information regarding copyright ownership.", " * The ASF licenses this file to You under the Apache License, Version 2.0", " * (the \"License\"); you may not use this file except in compliance with", " * the License. You may obtain a copy of the License at", " *", " * http://www.apache.org/licenses/LICENSE-2.0", " *", " * Unless required by applicable law or agreed to in writing, ", " * software distributed under the License is distributed on an ", " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ", " * either express or implied. See the License for the specific ", " * language governing permissions and limitations under the License.", " */", "package org.apache.derbyTesting.system.oe.util;", "", "import java.sql.SQLException;", "import java.sql.ResultSet;", "import java.sql.Statement;", "import java.sql.Connection;", "", "import org.apache.derbyTesting.system.oe.client.Load;", "", "/**", " * Do some OEChecks on the Order Entry database.", " */", "public class OEChecks {", "", " /**", " * Warehouse scaling factor", " */", " private short scale = 1;", "", " private Connection conn = null;", "", " public void initialize(Connection conn, short scale)", " throws Exception", " {", " this.conn = conn;", " conn.setAutoCommit(false);", " this.scale = scale;", " }", " ", " /**", " * Return suite of tests that OEChecks the row counts for all the tables in", " * the Order Entry bechmark.", " * ", " * @param scale", " * @return", " */", " public void checkAllRowCounts() throws Exception {", " testWarehouseRows();", " testStockRows();", " testItemRows();", " testCustomerRows();", " testDistrictRows();", " testOrdersRows();", " testNewOrdersRows();", " testOrderLineRows();", " testHistoryRows();", " }", " ", " /**", " * Test cardinality of WAREHOUSE table", " * ", " * @throws Exception", " */", " public void testWarehouseRows() throws Exception {", " checkCountStar(\"WAREHOUSE\", scale);", " }", "", " /**", " * Test cardinality of STOCK table", " * ", " * @throws Exception", " */", " public void testStockRows() throws Exception {", " checkCountStar(\"STOCK\", Load.STOCK_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of ORDERS table", " * ", " * @throws Exception", " */", " public void testOrdersRows() throws Exception {", " checkCountStar(\"ORDERS\", Load.ORDERS_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of DISTRICT table", " * ", " * @throws Exception", " */", " public void testDistrictRows() throws Exception {", " checkCountStar(\"DISTRICT\", Load.DISTRICT_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of CUSTOMER table", " * ", " * @throws Exception", " */", " public void testCustomerRows() throws Exception {", " checkCountStar(\"CUSTOMER\", Load.CUSTOMER_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of ITEM table", " * ", " * @throws Exception", " */", " public void testItemRows() throws Exception {", " checkCountStar(\"ITEM\", Load.ITEM_COUNT);", " }", "", " /**", " * Test cardinality of NEWORDERS table", " * ", " * @throws Exception", " */", " public void testNewOrdersRows() throws Exception {", " checkCountStar(\"NEWORDERS\", Load.NEWORDERS_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of HISTORY table", " * ", " * @throws Exception", " */", " public void testHistoryRows() throws Exception {", " checkCountStar(\"HISTORY\", Load.HISTORY_COUNT_W * scale);", " }", "", " /**", " * Test cardinality of ORDERLINE table", " * ", " * @throws Exception", " */", " public void testOrderLineRows() throws Exception {", " checkWithinOnePercent(\"ORDERLINE\", Load.ORDERLINE_COUNT_WV * scale);", " }", "", " /**", " * Check if number of rows in table is as expected", " * ", " * @param table -", " * table on which to execute the query", " * @param expected -", " * expected number of rows", " * @throws Exception", " */", " private void checkCountStar(String table, int expected) throws Exception {", " if( expected != rowsInTable(table))", " System.out.println(\"ERROR:Number of rows loaded for \" + table +", " \" not correct, expected=\"+expected +\" rows found=\"+ ", " rowsInTable(table));", "", " }", "", " /**", " * Return the number of rows in the table. A simple select count(*) from", " * tableName", " * ", " * @param tableName -", " * name of the table", " * @throws SQLException", " */", " private int rowsInTable(String tableName) throws SQLException {", " Statement stmt = conn.createStatement();", " ResultSet rs = stmt.executeQuery(\"SELECT COUNT(*) FROM \" + tableName);", " rs.next();", " int count = rs.getInt(1);", " conn.commit();", " rs.close();", " stmt.close();", "", " return count;", " }", "", " /**", " * Check if number of rows in table is within one percent of expected value", " * ", " * @param tableName -", " * table on which to execute the query", " * @param expected -", " * expected number of rows", " * @throws Exception", " */", " private void checkWithinOnePercent(String tableName, int expected)", " throws Exception {", "", " double count = rowsInTable(tableName);", " double low = ((double) expected) * 0.99;", " double high = ((double) expected) * 1.01;", " if ( (count < low) || (count >high))", " System.out.println(\"ERROR! Initial rows\" + count + \" in \" + ", " tableName + \" is out of range.[\" + low + \"-\" + high + \"]\");", " ", " }", " ", "}" ], "header": "@@ -0,0 +1,207 @@", "removed": [] } ] } ]
derby-DERBY-2282-a6631d9b
DERBY-2282: Incorrect "transitive closure" logic leads to inconsistent behavior for binary comparison predicates Extended the fix to work on parameters in addition to constants. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@890370 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/PredicateList.java", "hunks": [ { "added": [ " /**", " * Check if a node is representing a constant or a parameter.", " *", " * @param node the node to check", " * @return {@code true} if the node is a constant or a parameter, {@code", " * false} otherwise", " */", " private static boolean isConstantOrParameterNode(ValueNode node) {", " return node instanceof ConstantNode || node instanceof ParameterNode;", " }", "" ], "header": "@@ -1440,6 +1440,17 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre", "removed": [] }, { "added": [ "\t\t\t\t\t\t! isConstantOrParameterNode(opNode.getRightOperand()))" ], "header": "@@ -1510,8 +1521,7 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre", "removed": [ "\t\t\t\t\t ! (opNode.getRightOperand() instanceof ConstantNode ||", "\t\t\t\t\t\t\t opNode.getRightOperand() instanceof ParameterNode))" ] } ] } ]
derby-DERBY-2295-26b12fac
DERBY-2295 Change DropDatabaseSetup to be explicit about which database it is removing and ensure that database is shutdown first. Does not assume the current database is the one to be shutdown. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@509419 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/DropDatabaseSetup.java", "hunks": [ { "added": [ "import java.util.List;", "", "import javax.sql.DataSource;", " * Shutdown and drop the database identified by the logical", " * name passed in when creating this decorator.", "class DropDatabaseSetup extends TestSetup {", " private final String logicalDBName;", " DropDatabaseSetup(Test test, String logicalDBName) {", " this.logicalDBName = logicalDBName;", " * Shutdown the database and then remove all of its files.", " TestConfiguration config = TestConfiguration.getCurrent();", " ", " config.openConnection(logicalDBName).close();", " String dbName = config.getPhysicalDatabaseName(logicalDBName);", " DataSource ds = JDBCDataSource.getDataSource(dbName);", " JDBCDataSource.shutdownDatabase(ds);", " " ], "header": "@@ -23,34 +23,40 @@ import java.io.File;", "removed": [ " * Shutdown and drop the current database at tearDown time.", "class DropDatabaseSetup extends BaseJDBCTestSetup {", " DropDatabaseSetup(Test test) {", " * Drop the last database added to the list of used databases.", " getConnection().close();", " super.tearDown();", " ", " TestConfiguration.getCurrent().shutdownDatabase();", "", " ArrayList usedDbs = TestConfiguration.getCurrent().getUsedDatabaseNames();", " String dbName = (String) usedDbs.get(usedDbs.size()-1);" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ "import java.util.List;" ], "header": "@@ -25,6 +25,7 @@ import java.security.*;", "removed": [] }, { "added": [ " return new DatabaseChangeSetup(new DropDatabaseSetup(test, dbName), dbName, dbName, true);" ], "header": "@@ -312,7 +313,7 @@ public class TestConfiguration {", "removed": [ " return new DatabaseChangeSetup(new DropDatabaseSetup(test), dbName, dbName, true);" ] }, { "added": [ " return new DatabaseChangeSetup(new DropDatabaseSetup(test, logicalDbName)," ], "header": "@@ -333,7 +334,7 @@ public class TestConfiguration {", "removed": [ " return new DatabaseChangeSetup(new DropDatabaseSetup(test)," ] }, { "added": [ " * Return the physical name for a database", " * given its logical name.", " * @return Physical name of the database.", " String getPhysicalDatabaseName(String logicalName) {", " return (String) logicalDbMapping.get(logicalName);" ], "header": "@@ -763,12 +764,13 @@ public class TestConfiguration {", "removed": [ " * Return the names of all used databases.", " * @return The ArrayList containing the database names.", " public ArrayList getUsedDatabaseNames() {", " return usedDbNames;" ] } ] } ]
derby-DERBY-2296-14ed86a4
DERBY-2296 - reinstating setShutdownDB in JDBCDataSource after implementing it for ClientDataSource; simplifying *AuthenticationTest by removing if(usingEmbedded()) and usingDerbyNetClient()) blocks for shutdown is now possible. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@530863 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java", "hunks": [ { "added": [ " setBeanProperty(ds, \"shutdownDatabase\", \"shutdown\");", " clearStringBeanProperty(ds, \"shutdownDatabase\");" ], "header": "@@ -221,20 +221,14 @@ public class JDBCDataSource {", "removed": [ " // commenting out until such time as setShutdownDatabase is", " // supported by client", " //setBeanProperty(ds, \"shutdownDatabase\", \"shutdown\");", " setBeanProperty(ds, \"connectionAttributes\", \"shutdown=true\");", " // here too, commenting out until setShutdownDatabase is ", " // supported by client", " //clearStringBeanProperty(ds, \"shutdownDatabase\");", " clearStringBeanProperty(ds, \"connectionAttributes\");" ] } ] } ]
derby-DERBY-2296-d641aff3
DERBY-2296 - ensure values for createDatabase and shutdownDatabase get reset when the value is invalid. Add test case to DSCreateShutdownDBTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@529838 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/jdbc/ClientBaseDataSource.java", "hunks": [ { "added": [ " else // reset", " this.createDatabase = false;" ], "header": "@@ -877,6 +877,8 @@ public abstract class ClientBaseDataSource implements Serializable, Referenceabl", "removed": [] } ] } ]
derby-DERBY-23-09ecd71c
DERBY-5343: Upgrade tests failing with java.lang.IllegalAccessException Rework the workaround for DERBY-23 added by DERBY-5316 so that it doesn't attempt to modify final fields. Modifying final fields doesn't seem to work prior to Java 5. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1148302 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-23-e9666094
DERBY-5316: Unload old JDBC drivers when done with them in the upgrade tests Added a workaround for DERBY-23. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1145973 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-23-fb57a7b2
DERBY-23 Patch (DERBY-23-npe.diff) that addresses the NullPointerException messages from rawStoreDaemon threads we. Submitted by Knut Anders Hatlen git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@371506 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/context/ContextService.java", "hunks": [ { "added": [ "\t\tThreadLocal tcl = threadContextList;", "\t\tif (tcl == null) {", "\t\t\t// The context service is already stopped.", "\t\t\treturn null;", "\t\t}", "", "\t\tObject list = tcl.get();" ], "header": "@@ -178,7 +178,13 @@ public final class ContextService //OLD extends Hashtable", "removed": [ "\t\tObject list = threadContextList.get();" ] }, { "added": [ "\t\tThreadLocal tcl = threadContextList;", "", "\t\tif (tcl == null) {", "\t\t\t// The context service is already stopped.", "\t\t\treturn;", "\t\t}", "" ], "header": "@@ -213,6 +219,13 @@ public final class ContextService //OLD extends Hashtable", "removed": [] }, { "added": [ "\t\t\t\tif (tcl.get() != cm)", "\t\t\t\t\tSanityManager.THROWASSERT(\"resetCurrentContextManager - invalid thread local \" + Thread.currentThread() + \" - object \" + tcl.get());" ], "header": "@@ -232,8 +245,8 @@ public final class ContextService //OLD extends Hashtable", "removed": [ "\t\t\t\tif (threadContextList.get() != cm)", "\t\t\t\t\tSanityManager.THROWASSERT(\"resetCurrentContextManager - invalid thread local \" + Thread.currentThread() + \" - object \" + threadContextList.get());" ] }, { "added": [ "\t\tjava.util.Stack stack = (java.util.Stack) tcl.get();" ], "header": "@@ -244,7 +257,7 @@ public final class ContextService //OLD extends Hashtable", "removed": [ "\t\tjava.util.Stack stack = (java.util.Stack) threadContextList.get();" ] }, { "added": [ "\t\t\ttcl.set(nextCM);", "\t\tThreadLocal tcl = threadContextList;", "", "\t\tif (tcl == null) {", "\t\t\t// The context service is already stopped.", "\t\t\treturn false;", "\t\t}", "", "\t\tObject list = tcl.get();", "\t\t\ttcl.set(associateCM);" ], "header": "@@ -272,20 +285,27 @@ public final class ContextService //OLD extends Hashtable", "removed": [ "\t\t\tthreadContextList.set(nextCM);", "\t\tObject list = threadContextList.get();", "\t\t\tthreadContextList.set(associateCM);" ] }, { "added": [ "\t\t\t\ttcl.set(associateCM);", "\t\t\ttcl.set(stack);" ], "header": "@@ -295,11 +315,11 @@ public final class ContextService //OLD extends Hashtable", "removed": [ "\t\t\t\tthreadContextList.set(associateCM);", "\t\t\tthreadContextList.set(stack);" ] } ] } ]
derby-DERBY-231-5087be8d
DERBY-231 FOR UPDATE required for updatable result set to work. Submitted by Andreas Korneliussen <Andreas.Korneliussen@Sun.COM> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@332491 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java", "hunks": [ { "added": [ "\tStatementContext pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText," ], "header": "@@ -593,7 +593,7 @@ public interface LanguageConnectionContext extends Context {", "removed": [ "\tStatementContext pushStatementContext(boolean isAtomic, String stmtText," ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/conn/StatementContext.java", "hunks": [ { "added": [ "\t * @param isForReadOnly true if the statement is for producing non-updatable", "\t * resultset" ], "header": "@@ -47,6 +47,8 @@ public interface StatementContext extends Context {", "removed": [] }, { "added": [ " public void setInUse(boolean inTrigger, boolean isAtomic, boolean isForReadOnly,", "\t\t\t String stmtText, ParameterValueSet pvs, long timeoutMillis);" ], "header": "@@ -55,8 +57,8 @@ public interface StatementContext extends Context {", "removed": [ " public void setInUse(boolean inTrigger, boolean isAtomic, String stmtText,", " ParameterValueSet pvs, long timeoutMillis);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java", "hunks": [ { "added": [ " lcc.pushStatementContext(isAtomic, ", "\t\t\t\t\t concurrencyOfThisResultSet==JDBC20Translation.CONCUR_READ_ONLY, ", "\t\t\t\t\t getSQLText(),", "\t\t\t\t\t getParameterValueSet()," ], "header": "@@ -336,8 +336,10 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " lcc.pushStatementContext(isAtomic, getSQLText(),", " getParameterValueSet()," ] }, { "added": [ " statementContext = lcc.pushStatementContext(isAtomic, false, updateWhereCurrentOfSQL.toString(), null, false, 0L);" ], "header": "@@ -3234,7 +3236,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " statementContext = lcc.pushStatementContext(isAtomic, updateWhereCurrentOfSQL.toString(), null, false, 0L);" ] }, { "added": [ " StatementContext statementContext = lcc.pushStatementContext(isAtomic, false, deleteWhereCurrentOfSQL.toString(), null, false, 0L);" ], "header": "@@ -3286,7 +3288,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " StatementContext statementContext = lcc.pushStatementContext(isAtomic, deleteWhereCurrentOfSQL.toString(), null, false, 0L);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java", "hunks": [ { "added": [ "import org.apache.derby.impl.sql.compile.CursorNode;" ], "header": "@@ -61,6 +61,7 @@ import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/GenericStatement.java", "hunks": [ { "added": [ " private final boolean isForReadOnly;", "\t * @param compliationSchema schema", "\t * @param isForReadOnly if the statement is opened with level CONCUR_READ_ONLY", "\tpublic GenericStatement(SchemaDescriptor compilationSchema, String statementText, boolean isForReadOnly)", "\t\tthis.isForReadOnly = isForReadOnly;" ], "header": "@@ -77,19 +77,22 @@ public class GenericStatement", "removed": [ "\t *", "\tpublic GenericStatement(SchemaDescriptor compilationSchema, String statementText)" ] }, { "added": [ "\t\t\t\tstatementContext = lcc.pushStatementContext(true, isForReadOnly, getSource()," ], "header": "@@ -237,7 +240,7 @@ public class GenericStatement", "removed": [ "\t\t\t\tstatementContext = lcc.pushStatementContext(true, getSource()," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java", "hunks": [ { "added": [ " /**", "\t * @see LanguageConnectionContext#prepareInternalStatement", "\t */", " public PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText, boolean isForReadOnly) ", "\t throws StandardException ", " {", "\t return connFactory.getStatement(compilationSchema, sqlText, isForReadOnly).prepare(this);", " ", " /**", "\t * @see LanguageConnectionContext#prepareInternalStatement", "\t */", " public PreparedStatement prepareInternalStatement(String sqlText) ", "\t throws StandardException ", " {", "\t return connFactory.getStatement(sd, sqlText, true).prepare(this);", " " ], "header": "@@ -695,18 +695,24 @@ public class GenericLanguageConnectionContext", "removed": [ "\t/**", "\t\tReturn a Statement object to compile a Statement. The schema ", "\t\tsetting fo the returned statement are that of this connection.", "\t*/", "", "\tpublic PreparedStatement prepareInternalStatement(String sqlText) throws StandardException {", "\t\treturn connFactory.getStatement(sd, sqlText).prepare(this);", "", "\tpublic PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText) throws StandardException {", "\t\treturn connFactory.getStatement(compilationSchema, sqlText).prepare(this);" ] }, { "added": [ "\t * @param isForReadonly whether this statement is for a read only resultset" ], "header": "@@ -1881,6 +1887,7 @@ public class GenericLanguageConnectionContext", "removed": [] }, { "added": [ "\tpublic StatementContext pushStatementContext (boolean isAtomic, boolean isForReadOnly, ", "\t\t\t\t\t\t String stmtText, ParameterValueSet pvs, ", "\t\t\t\t\t\t boolean rollbackParentContext, ", "\t\t\t\t\t\t long timeoutMillis)" ], "header": "@@ -1895,8 +1902,10 @@ public class GenericLanguageConnectionContext", "removed": [ "\tpublic StatementContext pushStatementContext(boolean isAtomic, String stmtText,", "\t\tParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java", "hunks": [ { "added": [ " private\tboolean\t\tisForReadOnly = false;\t" ], "header": "@@ -86,6 +86,7 @@ final class GenericStatementContext", "removed": [] }, { "added": [ " boolean isForReadOnly," ], "header": "@@ -189,6 +190,7 @@ final class GenericStatementContext", "removed": [] }, { "added": [ "\t\tthis.isForReadOnly = isForReadOnly;" ], "header": "@@ -197,6 +199,7 @@ final class GenericStatementContext", "removed": [] }, { "added": [ "\t\tisForReadOnly = false;" ], "header": "@@ -218,6 +221,7 @@ final class GenericStatementContext", "removed": [] } ] } ]
derby-DERBY-2316-9bf3e1a4
DERBY-2316 (partial) Convert compatibility/testScript.xml to JUnit Allow CompatibilityCombinations to run other test suites than the default (...).junitTests.compatibility.CompatibilitySuite. Contributed by Ole Solberg. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@552051 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2318-1d7133ec
DERBY-2318 - preventing a difference between jvms in how a new Throwable stack trace is presented to cause a false test failure. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@518814 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2318-a609b819
DERBY-2318 Cleaned up the code that gets the stack trace, but didn't change anything that would change the behaviour. I don't see any failure on WEME 6.1 though. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@507093 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2330-e604a710
DERBY-2330 Disallow user-defined routines from calling methods internal to Derby. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@545178 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java", "hunks": [ { "added": [ "\t\t\tString schemaName = procedureName.getSchemaName();", "\t\t\t\t\t\t\t\t", "\t\t\tboolean noSchema = schemaName == null;", "\t\t\tSchemaDescriptor sd = getSchemaDescriptor(schemaName, schemaName != null);", " // The field methodName is used by resolveRoutine and", " // is set to the name of the routine (procedureName.getTableName()).", "\t\t\tresolveRoutine(fromList, subqueryList, aggregateVector, sd);", "\t\t\t", "\t\t\tif (ad == null && noSchema && !forCallStatement)", "\t\t\t{", "\t\t\t\t// Resolve to a built-in SYSFUN function but only", "\t\t\t\t// if this is a function call and the call", "\t\t\t\t// was not qualified. E.g. COS(angle). The", "\t\t\t\t// SYSFUN functions are not in SYSALIASES but", "\t\t\t\t// an in-memory table, set up in DataDictioanryImpl.", "\t\t\t\tsd = getSchemaDescriptor(\"SYSFUN\", true);", "\t\t\t\tresolveRoutine(fromList, subqueryList, aggregateVector, sd);", "\t", "\t\t\t/* Throw exception if no routine found */", "\t\t\t\tthrow StandardException.newException(", " SQLState.LANG_NO_SUCH_METHOD_ALIAS, procedureName);" ], "header": "@@ -187,42 +187,35 @@ public class StaticMethodCallNode extends MethodCallNode", "removed": [ "\t\t\tif (ad == null) {", "\t\t\t\tString schemaName = procedureName != null ?", "\t\t\t\t\t\t\t\t\tprocedureName.getSchemaName() : null;", "\t\t\t\t\t\t\t\t\t", "\t\t\t\tboolean noSchema = schemaName == null;", "\t\t\t\tSchemaDescriptor sd = getSchemaDescriptor(schemaName, schemaName != null);", "", "\t\t\t\tresolveRoutine(fromList, subqueryList, aggregateVector, sd);", "\t\t\t\tif (ad == null && noSchema && !forCallStatement)", "\t\t\t\t{", "\t\t\t\t\t// Resolve to a built-in SYSFUN function but only", "\t\t\t\t\t// if this is a function call and the call", "\t\t\t\t\t// was not qualified. E.g. COS(angle). The", "\t\t\t\t\t// SYSFUN functions are not in SYSALIASES but", "\t\t\t\t\t// an in-memory table, set up in DataDictioanryImpl.", "\t\t\t\t\tsd = getSchemaDescriptor(\"SYSFUN\", true);", "\t\t\t\t\t", "\t\t\t\t\tresolveRoutine(fromList, subqueryList, aggregateVector, sd);", "\t\t\t\t}", "\t", "\t\t\t/* Throw exception if no alias found */", "\t\t\t\tObject errName;", "\t\t\t\tif (procedureName == null)", "\t\t\t\t\terrName = methodName;", "\t\t\t\telse", "\t\t\t\t\terrName = procedureName;", "", "\t\t\t\tthrow StandardException.newException(SQLState.LANG_NO_SUCH_METHOD_ALIAS, errName);" ] } ] } ]
derby-DERBY-2331-31d9b6fb
DERBY-2331 (testing) Add some more testing of java class loading order from installed jars. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@547345 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2331-c722b365
DERBY-2331 (cleanup) Cleanup some code in the loading mechanism for installed jar files, mainly adding comments. Add some testing of the order of loading classes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@547305 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/reflect/JarLoader.java", "hunks": [ { "added": [ "final class JarLoader extends SecureClassLoader {" ], "header": "@@ -51,7 +51,7 @@ import org.apache.derby.iapi.services.i18n.MessageService;", "removed": [ "class JarLoader extends SecureClassLoader {" ] }, { "added": [ "\tprotected Class loadClass(String className, boolean resolve) " ], "header": "@@ -148,7 +148,7 @@ class JarLoader extends SecureClassLoader {", "removed": [ "\tpublic Class loadClass(String className, boolean resolve) " ] } ] }, { "file": "java/engine/org/apache/derby/impl/services/reflect/UpdateLoader.java", "hunks": [ { "added": [ "/**", " * UpdateLoader implements then functionality of", " * derby.database.classpath. It manages the ClassLoaders", " * (instances of JarLoader) for each installed jar file.", " * Jar files are installed through the sqlj.install_jar procedure.", " * <BR>", " * Each JarLoader delegates any request through standard mechanisms", " * to load a class to this object, which will then ask each jarLoader in order of", " * derby.database.classpath to load the class through an internal api.", " * This means if the third jar in derby.database.classpath tries to load", " * a class, say from the class for a procedure's method making some", " * reference to it, then the request is delegated to UpdateLoader.", " * UpdateLoader will then try to load the class from each of the jars", " * in order of derby.database.classpath using the jar's installed JarLoader.", " */", "final class UpdateLoader {" ], "header": "@@ -47,7 +47,22 @@ import org.apache.derby.iapi.reference.Module;", "removed": [ "class UpdateLoader {" ] } ] } ]
derby-DERBY-2339-777cc86c
DERBY-2339 Fixed mistake in ClientThread git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@507920 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/ClientThread.java", "hunks": [ { "added": [ " // IOException. Print stack trace and...", " // ... we need to do a controlled shutdown of the", " // server, since SSL for some reason will not", " // work.", " // IOException causes this thread to stop. No", " // console error message if this was caused by a", " // shutdown", " return; // Exit the thread" ], "header": "@@ -95,26 +95,28 @@ final class ClientThread extends Thread {", "removed": [ " // IOException, but we should not continue", " // if we get one. Print stack trace and...", " // ... we need to shutdown the server, since SSL for", " // some reason will not work.", " // IOException are ignored. No console error message", " // if this was caused by a shutdown" ] } ] } ]
derby-DERBY-2341-2fa8526d
DERBY-2341 Ensure modules booting after the store by the database receive the correct properties object that also includes the set of database properties. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@508163 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/db/BasicDatabase.java", "hunks": [ { "added": [], "header": "@@ -144,8 +144,6 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\tprotected Properties allParams;\t// properties to be used *only* while booting.", "" ] }, { "added": [ " // Add the database properties read from disk (not stored", " // in service.properties) into the set seen by booting modules.", "\t\tProperties allParams =", " new DoubleProperties(getAllDatabaseProperties(), startParams);" ], "header": "@@ -185,7 +183,10 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\t\tallParams = new DoubleProperties(getAllDatabaseProperties(), startParams);" ] }, { "added": [ " DataDictionary.MODULE, allParams);", "\t\tbootResourceAdapter(create, allParams);" ], "header": "@@ -196,12 +197,12 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ " DataDictionary.MODULE, startParams);", "\t\tbootResourceAdapter(create, startParams);" ] }, { "added": [], "header": "@@ -229,8 +230,6 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\t\tif (lastToBoot)", "\t\t\tallParams = null; // should not be used anymore" ] }, { "added": [ " /**", " * Get the set of database properties from the set stored", " * on disk outside of service.properties.", " */" ], "header": "@@ -746,6 +745,10 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [] }, { "added": [ "\tprotected void bootResourceAdapter(boolean create, Properties allParams) {" ], "header": "@@ -758,7 +761,7 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\tprotected void bootResourceAdapter(boolean create, Properties startParams) {" ] } ] } ]
derby-DERBY-2342-db2c1c24
DERBY-2342: convert importExport.java to junit git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@514040 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2343-f2fe81a9
DERBY-2343: Update sysinfo_api to current JUnit usage. Includes a note about the classpath issue discovered while updating the test. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@508328 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2345-27be4fc0
DERBY-2345: Fixed bug where Blob.truncate(long) did not work if the blob was materialized in memory. A test was also added. Patch contributed by Anurag Shekhar. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@509375 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2348-68be5f68
DERBY-2348: Put testProtocol.java back in the old harness for now. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@521949 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2348-ea8eec08
DERBY-2348: Move testProtocol.java back to running in the old harness due to differences in output on IBM JVMs git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@521558 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2349-1d0c809d
derby-4477 Selecting / projecting a column whose value is represented by a stream more than once fails Patch derby-4477-partial-2. This patch clones streamable columns in occurence 2..n in ProjectRestrictResultset if they occur more than once in the select list. It also adds the three repro test cases from DERBY-3645, DERBY-3646 and DERBY-2349 to BLOBTest. The patch is not complete and needs to be revisted when cloning of store streams is implemented. Currenly the cloning occurs via materialization and this will exhaust memory when lobs are large. See FIXME in ProjectRestrictResultSet. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@902857 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java", "hunks": [ { "added": [ " @param cloneMapItem Item # for columns that need cloning", " @param reuseResult Whether or not to reuse the result row." ], "header": "@@ -294,7 +294,8 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param reuseResult\tWhether or not to reuse the result row." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java", "hunks": [ { "added": [ "", " ResultColumnList.ColumnMapping mappingArrays =", " resultColumns.mapSourceColumns();", "", " int[] mapArray = mappingArrays.mapArray;", " boolean[] cloneMap = mappingArrays.cloneMap;", "", " int cloneMapItem = acb.addItem(cloneMap);" ], "header": "@@ -1417,8 +1417,15 @@ public class ProjectRestrictNode extends SingleChildResultSetNode", "removed": [ "\t\tint[] mapArray = resultColumns.mapSourceColumns();" ] }, { "added": [ " * arg8: cloneMapItem - item # for mapping of columns that need cloning", " * arg9: reuseResult - whether or not the result row can be reused", " * (ie, will it always be the same)", " * arg10: doesProjection - does this node do a projection", " * arg11: estimated row count", " * arg12: estimated cost", " * arg13: close method", " */" ], "header": "@@ -1456,13 +1463,14 @@ public class ProjectRestrictNode extends SingleChildResultSetNode", "removed": [ "\t\t * arg8: reuseResult - whether or not the result row can be reused", "\t\t *\t\t\t\t\t\t(ie, will it always be the same)", "\t\t * arg9: doesProjection - does this node do a projection", "\t\t * arg10: estimated row count", "\t\t * arg11: estimated cost", "\t\t * arg12: close method", "\t\t */" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java", "hunks": [ { "added": [ "import java.util.Map;", "import java.util.HashMap;" ], "header": "@@ -26,6 +26,8 @@ import java.sql.ResultSetMetaData;", "removed": [] }, { "added": [ " * <p/>", " * Also build an array of boolean for columns that point to the same virtual", " * column and have types that are streamable to be able to determine if", " * cloning is needed at execution time.", " ColumnMapping mapSourceColumns()", " int[] mapArray = new int[size()];", " boolean[] cloneMap = new boolean[size()];", "", " // key: virtual column number, value: index", " Map seenMap = new HashMap();", "" ], "header": "@@ -3496,14 +3498,23 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\tint[] mapSourceColumns()", "\t\tint[]\t\t\tmapArray = new int[size()];" ] }, { "added": [ " ResultColumn rc = vcn.getSourceColumn();", " updateArrays(mapArray, cloneMap, seenMap, rc, index);", "" ], "header": "@@ -3521,7 +3532,9 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\t\t\t\tmapArray[index] = vcn.getSourceColumn().getVirtualColumnId();" ] }, { "added": [ " ResultColumn rc = cr.getSource();", "", " updateArrays(mapArray, cloneMap, seenMap, rc, index);" ], "header": "@@ -3536,7 +3549,9 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\t\t\t\tmapArray[index] = cr.getSource().getVirtualColumnId();" ] }, { "added": [ " ColumnMapping result = new ColumnMapping(mapArray, cloneMap);", " return result;" ], "header": "@@ -3545,7 +3560,8 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\treturn mapArray;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java", "hunks": [ { "added": [ " int cloneMapItem," ], "header": "@@ -212,6 +212,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.services.io.StreamStorable;" ], "header": "@@ -22,6 +22,7 @@", "removed": [] }, { "added": [ "", " /**", " * Holds columns present more than once in the result set and which may be", " * represented by a stream, since such columns need to be cloned.", " */", " private boolean[] cloneMap;", "" ], "header": "@@ -62,6 +63,13 @@ class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [] }, { "added": [ " int cloneMapItem," ], "header": "@@ -80,6 +88,7 @@ class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [] }, { "added": [ " cloneMap =", " ((boolean[])a.getPreparedStatement().getSavedObject(cloneMapItem));", "" ], "header": "@@ -108,6 +117,9 @@ class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [] } ] } ]
derby-DERBY-235-47e6fb7f
committing this patch for DERBY-235 for suresh.thalamati@gmail.com Problem was service name on database creation was getting just set to the canonical name of the database directory without subsub protocol name added in the beginning. Whereas rest of the system seems to expect that the subsub protocol name also is part of the service name. For example if "csf" is subprotocol name , service name should be "csf:C:\suresht\databases\wombat1" not just "C:\suresht\databases\wombat1". Attached diff fixes the problem by prefixing the subsub protocol name to the canonical name, to generate the service name in the case of create also. This was not an issue with default "directory" subsub protocol because the system consistently generates the service name as just the canonical name of the service root. Another doubt I had while fixing this issue why we generate the service name after creating the service root, my guess is because of the following comment in the java docs for java.io.File.getCanonicalPath() method: " Every pathname that denotes an existing file or directory has a unique canonical form. Every pathname that denotes a nonexistent file or directory also has a unique canonical form. The canonical form of the pathname of a nonexistent file or directory may be different from the canonical form of the same pathname after the file or directory is created. Similarly, the canonical form of the pathname of an existing file or directory may be different from the canonical form of the same pathname after the file or directory is deleted. " git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@165645 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java", "hunks": [ { "added": [ "\t\t\tString protocolLeadIn = \"\";", "\t\t\t//prepend the subsub protocol name to the storage factoty canonical", "\t\t\t//name to form the service name except in case of the the ", "\t\t\t//default subsubprototcol(PersistentService.DIRECTORY)", "", "\t\t\tif (!(getType().equals( PersistentService.DIRECTORY))) ", "\t\t\t\tprotocolLeadIn = getType() + \":\";", "", " return protocolLeadIn + (String) AccessController.doPrivileged(" ], "header": "@@ -629,7 +629,15 @@ public class PersistentServiceImpl implements PersistentService", "removed": [ " return (String) AccessController.doPrivileged(" ] } ] } ]
derby-DERBY-2350-1198ab7d
DERBY-2350 Fix XML in triggers by changing code generation to generate different code in the case of XML of the form when referencing old and new column values.: XMLPARSE(DOCUMENT CAST (org.apache.derby.iapi.db.Factory:: getTriggerExecutionContext().getNewRow(). getString(<colPosition>) AS CLOB) PRESERVE WHITESPACE) Also change XML.setValueFromResult() to validate the character stream and set the xType as appropriate after parsing the stream. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@561189 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/types/XML.java", "hunks": [ { "added": [ " private SqlXmlUtil tmpUtil;", "" ], "header": "@@ -139,6 +139,8 @@ public class XML", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java", "hunks": [ { "added": [ "\t\tif ((colDesc = triggerTableDescriptor.getColumnDescriptor(colName)) == ", " null)", "\t\t\tthrow StandardException.newException(", " SQLState.LANG_COLUMN_NOT_FOUND, tabName+\".\"+colName);", "\t\t** \t\tCAST (org.apache.derby.iapi.db.Factory::" ], "header": "@@ -570,15 +570,17 @@ public class CreateTriggerNode extends DDLStatementNode", "removed": [ "\t\tif ((colDesc = triggerTableDescriptor.getColumnDescriptor(colName)) == null)", "\t\t\tthrow StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND, tabName+\".\"+colName);", "\t\t** \t\tcast (org.apache.derby.iapi.db.Factory::" ] } ] } ]
derby-DERBY-2350-a7f52a6e
DERBY-1102 Add missing classes for TriggerTest and latest version of test with reference to DERBY-2350. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@508639 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/streams/StringReaderWithLength.java", "hunks": [ { "added": [ "package org.apache.derbyTesting.functionTests.util.streams;", "", "import java.io.StringReader;", "", "public class StringReaderWithLength extends StringReader {", "", " private final int length;", " ", " public StringReaderWithLength(String arg0) {", " super(arg0);", " this.length = arg0.length();", " }", " ", " public boolean markSupported() {", " return false;", " }", "", " public int getLength()", " {", " return length;", " }", "}" ], "header": "@@ -0,0 +1,22 @@", "removed": [] } ] } ]
derby-DERBY-2351-497ffc7e
DERBY-2351: ORDER BY with expression with distinct in SELECT list. This is a follow-on patch for DERBY-2351, which addresses a number of problems involving column aliasing that occurred with the initial DERBY-2351 patch. After the initial DERBY-2351 patch, queries such as the following one failed: select distinct c1 as a1 from t order by c1 This patch modifies the ORDER BY column matching algorithm to match column references using multiple rules, depending on whether or not the ORDER BY reference is qualified or not: - unqualified references are matched first against the alias name, then against the underlying column name from the source table - qualified references are matched only against the underlying specified table A number of additional test cases are added as part of this patch to verify that the above query, and other similar queries, now work as intended. This patch rejects at least one query known to have worked before: select t1.id as idc1, t1.id as idc2 from t1 order by t1.idc1, t1.idc2; After discussion with Derby developers, this query was felt to be invalid, as there is no such column "idc1" in table "t1". The query should *not* qualify the ORDER BY column references with table "t1": select t1.id as idc1, t1.id as idc2 from t1 order by idc1, idc2; git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@636608 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java", "hunks": [ { "added": [ " boolean columnNameMatches;" ], "header": "@@ -441,6 +441,7 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [] }, { "added": [ "\t\t\t\tcolumnNameMatches =", "\t\t\t\t\tcolumnName.equals( resultColumn.getSourceColumnName() );", "\t\t\telse", "\t\t\t\tcolumnNameMatches =", "\t\t\t\t\tresultColumn.columnNameMatches(columnName);", "" ], "header": "@@ -450,7 +451,13 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [] }, { "added": [ "\t\t\tif (columnNameMatches)" ], "header": "@@ -469,7 +476,7 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\t\tif (columnName.equals( resultColumn.getName()) )" ] }, { "added": [ " boolean columnNameMatches;" ], "header": "@@ -558,6 +565,7 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [] } ] } ]
derby-DERBY-2354-c6ca3043
DERBY-2354: Unable to perform select query using DISTINCT on a read-only database Made databases that are stored in a jar or a zip use a writable directory for temporary files needed by some operations (typically hash scans when the hash table gets too big to be kept in memory). The writable directory can be controlled by the database property derby.storage.tempDirectory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1092067 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -36,6 +36,7 @@ import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -34,6 +34,7 @@ import org.apache.derby.iapi.store.access.conglomerate.ConglomerateFactory;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java", "hunks": [ { "added": [ " ContainerKey newIdentity = (ContainerKey) key;", "", " // If the new identity represents a temporary container, switch to", " // TempRAFContainer.", " if (newIdentity.getSegmentId() == ContainerHandle.TEMPORARY_SEGMENT) {", " return new TempRAFContainer(dataFactory).setIdent(newIdentity);", " }", "", " return setIdent(newIdentity);" ], "header": "@@ -347,7 +347,15 @@ abstract class FileContainer", "removed": [ "\t\treturn setIdent((ContainerKey) key);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java", "hunks": [ { "added": [ "" ], "header": "@@ -22,14 +22,7 @@", "removed": [ "import org.apache.derby.impl.store.raw.data.BaseContainer;", "import org.apache.derby.impl.store.raw.data.BaseContainerHandle;", "import org.apache.derby.impl.store.raw.data.BasePage;", "", "import org.apache.derby.iapi.services.cache.Cacheable;", "import org.apache.derby.iapi.services.context.ContextService;", "import org.apache.derby.iapi.services.monitor.Monitor;", "import org.apache.derby.iapi.services.diag.Performance;" ] }, { "added": [], "header": "@@ -40,18 +33,12 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "import org.apache.derby.iapi.store.raw.Loggable;", "import org.apache.derby.iapi.store.raw.xact.RawTransaction;", "import org.apache.derby.io.StorageFactory;", "import org.apache.derby.io.WritableStorageFactory;", "import java.util.Vector;", "import java.io.DataInput;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/data/TempRAFContainer.java", "hunks": [ { "added": [ "\t\t\tFileContainer realContainer =", "\t\t\t\t\t(FileContainer) dataFactory.newContainerObject();" ], "header": "@@ -65,7 +65,8 @@ class TempRAFContainer extends RAFContainer {", "removed": [ "\t\t\tRAFContainer realContainer = new RAFContainer(dataFactory);" ] } ] } ]
derby-DERBY-2356-37ce91b8
DERBY-2356 Make SSL server authentication optional (submitted by Bernt M. Johnsen) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@511785 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/Connection.java", "hunks": [ { "added": [ " public int clientSSLMode_ = org.apache.derby.jdbc.ClientBaseDataSource.SSL_OFF;" ], "header": "@@ -136,7 +136,7 @@ public abstract class Connection implements java.sql.Connection,", "removed": [ " public boolean useSSL_ = false;" ] }, { "added": [ " 0 /*TODO: SSL & Datasource*/);" ], "header": "@@ -199,7 +199,7 @@ public abstract class Connection implements java.sql.Connection,", "removed": [ " false /*TODO: SSL & Datasource*/);" ] }, { "added": [ " 0 /*TODO: SSL & Datasource*/);" ], "header": "@@ -228,7 +228,7 @@ public abstract class Connection implements java.sql.Connection,", "removed": [ " false /*TODO: SSL & Datasource*/);" ] }, { "added": [ " clientSSLMode_ = ClientDataSource.getClientSSLMode(properties);", " clientSSLMode_);" ], "header": "@@ -321,13 +321,13 @@ public abstract class Connection implements java.sql.Connection,", "removed": [ " useSSL_ = ClientDataSource.getSsl(properties);", " useSSL_);" ] } ] }, { "file": "java/client/org/apache/derby/client/net/NetAgent.java", "hunks": [ { "added": [ " int clientSSLMode_;" ], "header": "@@ -82,7 +82,7 @@ public class NetAgent extends Agent {", "removed": [ " boolean useSSL_;" ] }, { "added": [ " int clientSSLMode) throws SqlException {", " clientSSLMode_ = clientSSLMode;" ], "header": "@@ -109,13 +109,13 @@ public class NetAgent extends Agent {", "removed": [ " boolean useSSL) throws SqlException {", " useSSL_ = useSSL;" ] } ] }, { "file": "java/client/org/apache/derby/client/net/NetConnection.java", "hunks": [ { "added": [ " protected org.apache.derby.client.am.Agent newAgent_(org.apache.derby.client.am.LogWriter logWriter, int loginTimeout, String serverName, int portNumber, int clientSSLMode)", " clientSSLMode);" ], "header": "@@ -1081,14 +1081,14 @@ public class NetConnection extends org.apache.derby.client.am.Connection {", "removed": [ " protected org.apache.derby.client.am.Agent newAgent_(org.apache.derby.client.am.LogWriter logWriter, int loginTimeout, String serverName, int portNumber, boolean useSSL)", " useSSL);" ] } ] }, { "file": "java/client/org/apache/derby/jdbc/ClientBaseDataSource.java", "hunks": [ { "added": [ " public final static int SSL_OFF = 0;", " public final static int SSL_BASIC = 1;", " public final static int SSL_PEER_AUTHENTICATION = 2;", " ", " public static final int getClientSSLMode(Properties properties)", " String s = properties.getProperty(Attribute.SSL_ATTR);", "\t\tif (s != null){", "\t\t\tif (s.equalsIgnoreCase(\"off\")) {", "\t\t\t\treturn SSL_OFF;", " } else if (s.equalsIgnoreCase(\"basic\")) {", "\t\t\t\treturn SSL_BASIC;", "\t\t\t} else if (s.equalsIgnoreCase(\"peerAuthentication\")) {", "\t\t\t\treturn SSL_PEER_AUTHENTICATION;", "\t\t\t} else {", "\t\t\t\t// Default", "\t\t\t\treturn SSL_OFF;", "\t\t\t}", "\t\t} else {", "\t\t\t// Default", "\t\t\treturn SSL_OFF;", "\t\t}" ], "header": "@@ -172,9 +172,28 @@ public abstract class ClientBaseDataSource implements Serializable, Referenceabl", "removed": [ " public static final boolean getSsl(Properties properties)", " return Boolean.valueOf(properties.getProperty(Attribute.SSL_ATTR)).booleanValue();" ] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "\tprivate static final int SSL_BASIC = 1;", "\tprivate static final int SSL_PEER_AUTHENTICATION = 2;" ], "header": "@@ -306,8 +306,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\tprivate static final int SSL_ON = 1;", "\tprivate static final int SSL_CLIENT_AUTH = 2;" ] }, { "added": [ "\t\tcase SSL_BASIC:", "\t\t\treturn (SSLServerSocket)ssf.createServerSocket(portNumber,", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0,", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t hostAddress);", "\t\tcase SSL_PEER_AUTHENTICATION:", "\t\t\tSSLServerSocket sss2= ", "\t\t\t\t(SSLServerSocket)ssf2.createServerSocket(portNumber,", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0,", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t hostAddress);", "\t\t\tsss2.setNeedClientAuth(true);", "\t\t\treturn sss2;" ], "header": "@@ -602,20 +602,21 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tcase SSL_ON:", "\t\t\treturn ssf.createServerSocket(portNumber", "\t\t\t\t\t\t\t\t\t\t ,0,", "\t\t\t\t\t\t\t\t\t\t hostAddress);", "\t\tcase SSL_CLIENT_AUTH:", "\t\t\tSSLServerSocket sss= (SSLServerSocket)ssf2.createServerSocket(portNumber", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,0,", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t hostAddress);", "\t\t\tsss.setNeedClientAuth(true);", "\t\t\treturn sss;" ] }, { "added": [ "\t\tcase SSL_BASIC:", "\t\tcase SSL_PEER_AUTHENTICATION:" ], "header": "@@ -687,12 +688,12 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tcase SSL_ON:", "\t\tcase SSL_CLIENT_AUTH:" ] }, { "added": [ "\t\t\t\t\t\t\t\t\tpublic Object run() ", "\t\t\t\t\t\t\t\t\t\tthrows UnknownHostException,", "\t\t\t\t\t\t\t\t\t\t\t IOException, ", "\t\t\t\t\t\t\t\t\t\t\t java.security.NoSuchAlgorithmException,", "\t\t\t\t\t\t\t\t\t\t\t java.security.KeyManagementException" ], "header": "@@ -2222,7 +2223,11 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t\t\t\t\t\t\t\tpublic Object run() throws UnknownHostException,IOException" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\tswitch(getSSLMode()) {", "\t\t\t\t\t\t\t\t\t\tcase SSL_BASIC:", "\t\t\t\t\t\t\t\t\t\t\tsf = NaiveTrustManager.getSocketFactory();", "\t\t\t\t\t\t\t\t\t\t\tbreak;", "\t\t\t\t\t\t\t\t\t\tcase SSL_PEER_AUTHENTICATION:", "\t\t\t\t\t\t\t\t\t\t\tbreak;", "\t\t\t\t\t\t\t\t\t\tcase SSL_OFF:", "\t\t\t\t\t\t\t\t\t\tdefault:", "\t\t\t\t\t\t\t\t\t\t\tbreak;" ], "header": "@@ -2238,10 +2243,17 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t\t\t\t\t\t\t\t\tif (getSSLMode() > SSL_OFF) {", "\t\t\t\t\t\t\t\t\t\t} else {" ] }, { "added": [ "\t * @param s the SSL-mode string (\"off\"/\"false\", \"on\"/\"true\" or", "\t * \"authenticate\"/\"auth\"", "\t * @return SSL_OFF, SSL_BASIC or SSL_PEER_AUTHENTICATION. Will default to" ], "header": "@@ -2802,9 +2814,9 @@ public final class NetworkServerControlImpl {", "removed": [ "\t * @param s the SSL-mode string (\"off\", \"on\"/\"true\" or", "\t * \"clientAuth\"", "\t * @return SSL_OFF, SSL_ON or SSL_CLIENT_AUTH. Will default to" ] }, { "added": [ "\t\t\t} else if (StringUtil.SQLEqualsIgnoreCase(s,\"basic\")) {", "\t\t\t\treturn SSL_BASIC;", "\t\t\t} else if (StringUtil.SQLEqualsIgnoreCase(s,\"peerAuthentication\")) {\t\t\t\treturn SSL_PEER_AUTHENTICATION;" ], "header": "@@ -2814,13 +2826,9 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t\t} else if (StringUtil.SQLEqualsIgnoreCase(s,\"on\")) {", "\t\t\t\treturn SSL_ON;", "\t\t\t} else if (StringUtil.SQLEqualsIgnoreCase(s,\"true\")) {", "\t\t\t\t// \"true\" equivalent to \"on\"", "\t\t\t\treturn SSL_ON;", "\t\t\t} else if (StringUtil.SQLEqualsIgnoreCase(s,\"clientAuth\")) {", "\t\t\t\treturn SSL_CLIENT_AUTH;" ] }, { "added": [ "\t * @param i The SSL-mode value (SSL_OFF, SSL_BASIC or", "\t * SSL_PEER_AUTHENTICATION)", "\t * \"autneticate\"). Will default to SSL_OFF for other values than" ], "header": "@@ -2834,9 +2842,10 @@ public final class NetworkServerControlImpl {", "removed": [ "\t * @param i The SSL-mode value (SSL_OFF, SSL_ON or AAL_CLIENT_AUTH)", "\t * \"clientAuth\"). Will default to SSL_OFF for other values than" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/reference/Property.java", "hunks": [ { "added": [ " * basic: Encryption, but no SSL client authentication", " * peerAuthentication: Encryption and with SSL client", " * authentication " ], "header": "@@ -782,8 +782,9 @@ public interface Property {", "removed": [ " * on: Encryption, but no SSL client authentication", " * clientAuth: Encryption and with SSL client authentication" ] } ] } ]
derby-DERBY-2359-04db1600
DERBY-2359: Code cleanups for the org.apache.derby.impl.store.access.* packages. Removed unused method init(), removed unused import, removed variable and fixed a little JavaDoc. Patch file: derby-2359-4a-OpenConglomerateScratchSpace.diff git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@609543 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java", "hunks": [ { "added": [], "header": "@@ -31,7 +31,6 @@ import org.apache.derby.iapi.store.raw.Transaction;", "removed": [ "import org.apache.derby.iapi.services.loader.InstanceGetter;" ] }, { "added": [], "header": "@@ -56,7 +55,6 @@ public class OpenConglomerateScratchSpace", "removed": [ " private FormatableBitSet row_for_export_column_list;" ] }, { "added": [ " /**", " * Scratch space used by <code>ConglomerateController</code>.", " * ", " * @see org.apache.derby.iapi.store.access.ConglomerateController#delete", " * @see org.apache.derby.iapi.store.access.ConglomerateController#replace", " */", "", " /**", " * Creates a new scratch space.", " *", " * @param format_ids format identifiers for columns in the row", " * @param collation_ids collation identifiers for the columns in the row", " */" ], "header": "@@ -80,13 +78,25 @@ public class OpenConglomerateScratchSpace", "removed": [ " /* scratch space used by ConglomerateController.delete and replace */" ] }, { "added": [ " null, format_ids, collation_ids);" ], "header": "@@ -127,7 +137,7 @@ public class OpenConglomerateScratchSpace", "removed": [ " row_for_export_column_list, format_ids, collation_ids);" ] }, { "added": [], "header": "@@ -210,16 +220,4 @@ public class OpenConglomerateScratchSpace", "removed": [ "", " /**", " * Initialize scratch space for reuse by possibly different template.", " * <p>", " * Some data is only valid per statement.", " **/", " public void init(", " FormatableBitSet export_column_list)", " {", " row_for_export_template = null;", " row_for_export_column_list = null;", " }" ] } ] } ]
derby-DERBY-2359-18176ce7
DERBY-2359: Reduced visibility of a number of fields. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@527842 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java", "hunks": [ { "added": [ " private static final String PROPERTY_BASECONGLOMID = \"baseConglomerateId\";", " private static final String PROPERTY_ROWLOCCOLUMN = \"rowLocationColumn\";", " static final int FORMAT_NUMBER = StoredFormatIds.ACCESS_B2I_V3_ID;" ], "header": "@@ -137,10 +137,10 @@ import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "removed": [ " public static final String PROPERTY_BASECONGLOMID = \"baseConglomerateId\";", " public static final String PROPERTY_ROWLOCCOLUMN = \"rowLocationColumn\";", "\tpublic static final int FORMAT_NUMBER = StoredFormatIds.ACCESS_B2I_V3_ID;" ] }, { "added": [ "\tlong baseConglomerateId;" ], "header": "@@ -152,7 +152,7 @@ public class B2I extends BTree", "removed": [ "\tprotected long baseConglomerateId;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java", "hunks": [ { "added": [ "\tprivate static final int STATE_CLOSED = 0;", "\tprivate static final int STATE_INITIALIZED = 1;", "\tprivate static final int STATE_INSERTING = 2;", "\tprivate static final int STATE_DONE_INSERTING = 3;", "\tprivate static final int STATE_SCANNING = 4;", "\tprivate static final int STATE_DONE_SCANNING = 5;", "\tprivate int state = STATE_CLOSED;" ], "header": "@@ -67,33 +67,33 @@ final class MergeSort implements Sort", "removed": [ "\tstatic final int STATE_CLOSED = 0;", "\tstatic final int STATE_INITIALIZED = 1;", "\tstatic final int STATE_INSERTING = 2;", "\tstatic final int STATE_DONE_INSERTING = 3;", "\tstatic final int STATE_SCANNING = 4;", "\tstatic final int STATE_DONE_SCANNING = 5;", "\tprotected int state = STATE_CLOSED;" ] }, { "added": [ "\tprivate int columnOrderingMap[];", "\tprivate boolean columnOrderingAscendingMap[];", "\tSortObserver sortObserver;" ], "header": "@@ -115,17 +115,17 @@ final class MergeSort implements Sort", "removed": [ "\tprotected int columnOrderingMap[];", "\tprotected boolean columnOrderingAscendingMap[];", "\tprotected SortObserver sortObserver;" ] }, { "added": [ "\tprivate MergeInserter inserter = null;", "\tprivate Scan scan = null;", "\tprivate Vector mergeRuns = null;", "\tprivate SortBuffer sortBuffer = null;", "\tint sortBufferMax;", "\tint sortBufferMin;" ], "header": "@@ -137,37 +137,37 @@ final class MergeSort implements Sort", "removed": [ "\tprotected MergeInserter inserter = null;", "\tprotected Scan scan = null;", "\tprotected Vector mergeRuns = null;", "\tprotected SortBuffer sortBuffer = null;", "\tprotected int sortBufferMax;", "\tprotected int sortBufferMin;" ] } ] } ]
derby-DERBY-2359-4a2b0d9a
DERBY-2359 (2a): Rename methods starting with uppercase letters (Code cleanups for the org.apache.derby.impl.store.access.* packages). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@517129 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java", "hunks": [ { "added": [ " if ((controlRow = ControlRow.get(open_btree, pageno)) == null)" ], "header": "@@ -121,7 +121,7 @@ public class BTreeController extends OpenBTree implements ConglomerateController", "removed": [ " if ((controlRow = ControlRow.Get(open_btree, pageno)) == null)" ] }, { "added": [ " root = ControlRow.get(split_open_btree, BTree.ROOTPAGEID);" ], "header": "@@ -331,7 +331,7 @@ public class BTreeController extends OpenBTree implements ConglomerateController", "removed": [ " root = ControlRow.Get(split_open_btree, BTree.ROOTPAGEID);" ] }, { "added": [ " ControlRow.get(this, BTree.ROOTPAGEID).search(sp);" ], "header": "@@ -423,7 +423,7 @@ public class BTreeController extends OpenBTree implements ConglomerateController", "removed": [ " ControlRow.Get(this, BTree.ROOTPAGEID).search(sp);" ] }, { "added": [ " ControlRow.compareIndexRowFromPageToKey(" ], "header": "@@ -742,7 +742,7 @@ public class BTreeController extends OpenBTree implements ConglomerateController", "removed": [ " ControlRow.CompareIndexRowFromPageToKey(" ] }, { "added": [ " new_leaf = (LeafControlRow) ControlRow.get(this, new_leaf_pageno);" ], "header": "@@ -837,7 +837,7 @@ public class BTreeController extends OpenBTree implements ConglomerateController", "removed": [ " new_leaf = (LeafControlRow) ControlRow.Get(this, new_leaf_pageno);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java", "hunks": [ { "added": [ " ControlRow.get(this, BTree.ROOTPAGEID).search(sp);" ], "header": "@@ -539,7 +539,7 @@ public class BTreeCostController extends OpenBTree", "removed": [ " ControlRow.Get(this, BTree.ROOTPAGEID).search(sp);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java", "hunks": [ { "added": [ " root = ControlRow.get(open_btree, BTree.ROOTPAGEID);" ], "header": "@@ -118,7 +118,7 @@ class BTreePostCommit implements Serviceable", "removed": [ " root = ControlRow.Get(open_btree, BTree.ROOTPAGEID);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java", "hunks": [ { "added": [ " ControlRow root = ControlRow.get(this, BTree.ROOTPAGEID); " ], "header": "@@ -361,7 +361,7 @@ public abstract class BTreeScan extends OpenBTree implements ScanManager", "removed": [ " ControlRow root = ControlRow.Get(this, BTree.ROOTPAGEID); " ] }, { "added": [ " ControlRow root = ControlRow.get(this, BTree.ROOTPAGEID); " ], "header": "@@ -527,7 +527,7 @@ public abstract class BTreeScan extends OpenBTree implements ScanManager", "removed": [ " ControlRow root = ControlRow.Get(this, BTree.ROOTPAGEID); " ] }, { "added": [ " ControlRow.get(this, pos.current_rh.getPageNumber());" ], "header": "@@ -1077,7 +1077,7 @@ public abstract class BTreeScan extends OpenBTree implements ScanManager", "removed": [ " ControlRow.Get(this, pos.current_rh.getPageNumber());" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java", "hunks": [ { "added": [ " protected final void controlRowInit()" ], "header": "@@ -144,7 +144,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " protected final void ControlRowInit()" ] }, { "added": [ " ControlRow root = ControlRow.get(open_btree, BTree.ROOTPAGEID);" ], "header": "@@ -212,7 +212,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " ControlRow root = ControlRow.Get(open_btree, BTree.ROOTPAGEID);" ] }, { "added": [ " ControlRow.get(open_btree, BTree.ROOTPAGEID);" ], "header": "@@ -621,7 +621,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " ControlRow.Get(open_btree, BTree.ROOTPAGEID);" ] }, { "added": [ " BranchControlRow.allocate(open_btree, childpage," ], "header": "@@ -712,7 +712,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " BranchControlRow.Allocate(open_btree, childpage," ] }, { "added": [ " if (compareIndexRowToKey(" ], "header": "@@ -835,7 +835,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " if (CompareIndexRowToKey(" ] }, { "added": [ " BranchControlRow.allocate(" ], "header": "@@ -1192,7 +1192,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " BranchControlRow.Allocate(" ] }, { "added": [ " private static BranchControlRow allocate(" ], "header": "@@ -1245,7 +1245,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " private static BranchControlRow Allocate(" ] }, { "added": [ " ControlRow.get(open_btree, child_pageno_buf.getLong());" ], "header": "@@ -1411,7 +1411,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " ControlRow.Get(open_btree, child_pageno_buf.getLong());" ] }, { "added": [ " return(ControlRow.get(open_btree, this.getLeftChildPageno()));" ], "header": "@@ -1431,7 +1431,7 @@ public class BranchControlRow extends ControlRow", "removed": [ " return(ControlRow.Get(open_btree, this.getLeftChildPageno()));" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java", "hunks": [ { "added": [ "\t\tcr = ControlRow.getNoWait(btree, pageno);" ], "header": "@@ -469,7 +469,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\t\tcr = ControlRow.GetNoWait(btree, pageno);" ] }, { "added": [ "\t\t\treturn ControlRow.get(open_btree, pageno);" ], "header": "@@ -528,7 +528,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\t\t\treturn ControlRow.Get(open_btree, pageno);" ] }, { "added": [ "\tpublic static ControlRow get(OpenBTree open_btree, long pageNumber)", " return(ControlRow.get(open_btree.container, pageNumber));", "\tpublic static ControlRow get(ContainerHandle container, long pageNumber)" ], "header": "@@ -814,13 +814,13 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\tpublic static ControlRow Get(OpenBTree open_btree, long pageNumber)", " return(ControlRow.Get(open_btree.container, pageNumber));", "\tpublic static ControlRow Get(ContainerHandle container, long pageNumber)" ] }, { "added": [ "\t\treturn getControlRowForPage(container, page);" ], "header": "@@ -841,7 +841,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\t\treturn GetControlRowForPage(container, page);" ] }, { "added": [ "\tpublic static ControlRow getNoWait(" ], "header": "@@ -850,7 +850,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\tpublic static ControlRow GetNoWait(" ] }, { "added": [ "\t\treturn getControlRowForPage(open_btree.container, page);", "\tprotected static ControlRow getControlRowForPage(" ], "header": "@@ -863,10 +863,10 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\t\treturn GetControlRowForPage(open_btree.container, page);", "\tprotected static ControlRow GetControlRowForPage(" ] }, { "added": [ " cr.controlRowInit();" ], "header": "@@ -906,7 +906,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ " cr.ControlRowInit();" ] }, { "added": [ " compareIndexRowFromPageToKey(" ], "header": "@@ -1015,7 +1015,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ " CompareIndexRowFromPageToKey(" ] }, { "added": [ " compareIndexRowFromPageToKey(" ], "header": "@@ -1145,7 +1145,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ " CompareIndexRowFromPageToKey(" ] }, { "added": [ "\tpublic static int compareIndexRowFromPageToKey(" ], "header": "@@ -1238,7 +1238,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\tpublic static int CompareIndexRowFromPageToKey(" ] }, { "added": [ "\tpublic static int compareIndexRowToKey(" ], "header": "@@ -1314,7 +1314,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ "\tpublic static int CompareIndexRowToKey(" ] }, { "added": [ " compareIndexRowToKey(" ], "header": "@@ -1457,7 +1457,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ " CompareIndexRowToKey(" ] }, { "added": [ " compareIndexRowToKey(" ], "header": "@@ -1522,7 +1522,7 @@ public abstract class ControlRow implements AuxObject, TypedFormat", "removed": [ " CompareIndexRowToKey(" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java", "hunks": [ { "added": [ " private static LeafControlRow allocate(" ], "header": "@@ -115,7 +115,7 @@ public class LeafControlRow extends ControlRow", "removed": [ " private static LeafControlRow Allocate(" ] }, { "added": [ " protected final void controlRowInit()" ], "header": "@@ -194,7 +194,7 @@ public class LeafControlRow extends ControlRow", "removed": [ " protected final void ControlRowInit()" ] }, { "added": [ " ControlRow new_root = ControlRow.get(open_btree, BTree.ROOTPAGEID);" ], "header": "@@ -564,7 +564,7 @@ public class LeafControlRow extends ControlRow", "removed": [ " ControlRow new_root = ControlRow.Get(open_btree, BTree.ROOTPAGEID);" ] }, { "added": [ " LeafControlRow.allocate(open_btree, parent_page);" ], "header": "@@ -663,7 +663,7 @@ public class LeafControlRow extends ControlRow", "removed": [ " LeafControlRow.Allocate(open_btree, parent_page);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java", "hunks": [ { "added": [ " root = ControlRow.get(this, BTree.ROOTPAGEID);" ], "header": "@@ -286,7 +286,7 @@ public class OpenBTree", "removed": [ " root = ControlRow.Get(this, BTree.ROOTPAGEID);" ] }, { "added": [ " root = ControlRow.get(this, BTree.ROOTPAGEID);" ], "header": "@@ -564,7 +564,7 @@ public class OpenBTree", "removed": [ " root = ControlRow.Get(this, BTree.ROOTPAGEID);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java", "hunks": [ { "added": [ " ControlRow.get(open_btree, previous_pageno);" ], "header": "@@ -377,7 +377,7 @@ class B2IRowLocking3 implements BTreeLockingPolicy", "removed": [ " ControlRow.Get(open_btree, previous_pageno);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java", "hunks": [ { "added": [ " root = ControlRow.get(container, BTree.ROOTPAGEID);" ], "header": "@@ -133,7 +133,7 @@ public class B2IUndo implements LogicalUndo, Formatable", "removed": [ " root = ControlRow.Get(container, BTree.ROOTPAGEID);" ] }, { "added": [ " control_row = ControlRow.get(open_btree, rechandle.getPageNumber());" ], "header": "@@ -191,7 +191,7 @@ public class B2IUndo implements LogicalUndo, Formatable", "removed": [ " control_row = ControlRow.Get(open_btree, rechandle.getPageNumber());" ] }, { "added": [ " compare_result = ControlRow.compareIndexRowToKey(" ], "header": "@@ -218,7 +218,7 @@ public class B2IUndo implements LogicalUndo, Formatable", "removed": [ " compare_result = ControlRow.CompareIndexRowToKey(" ] }, { "added": [ " ControlRow.get(open_btree, BTree.ROOTPAGEID).search(sp);" ], "header": "@@ -242,7 +242,7 @@ public class B2IUndo implements LogicalUndo, Formatable", "removed": [ " ControlRow.Get(open_btree, BTree.ROOTPAGEID).search(sp);" ] } ] } ]
derby-DERBY-2359-f962ae71
DERBY-2359: Removed a workaround for a problem in mssdk302 git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@522442 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java", "hunks": [ { "added": [], "header": "@@ -27,22 +27,14 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;", "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "", "import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;", "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;", "import org.apache.derby.iapi.store.raw.Transaction;", "import org.apache.derby.iapi.services.io.FormatableBitSet;" ] }, { "added": [], "header": "@@ -79,64 +71,6 @@ public class BTreeForwardScan extends BTreeScan", "removed": [ "\t///////////////////////////////////////////////", "\t// ", "\t// RESOLVE (jamie): i had to add these simple", "\t// super.init() super.close() calls to get mssdk302", "\t// to work. I could not determine what the problem", "\t// is. For the time being, please don't remove", "\t// them even though they don't appear to serve a", "\t// useful purpose.", "\t// ", "\t///////////////////////////////////////////////", "\t", "\t/**", "\tInitialize the scan for use.", "\t<p>", "\tAny changes to this method may have to be reflected in close as well.", " <p>", " The btree init opens the container (super.init), and stores away the", " state of the qualifiers. The actual searching for the first position", " is delayed until the first next() call.", "", "\t@exception StandardException Standard exception policy.", "\t**/", "\tpublic void init(", " TransactionManager xact_manager,", " Transaction rawtran,", " boolean hold,", " int open_mode,", " int lock_level,", " BTreeLockingPolicy btree_locking_policy,", " FormatableBitSet scanColumnList,", " DataValueDescriptor[]\t startKeyValue,", " int startSearchOperator,", " Qualifier qualifier[][],", " DataValueDescriptor[]\t stopKeyValue,", " int stopSearchOperator,", " BTree conglomerate,", " LogicalUndo undo,", " StaticCompiledOpenConglomInfo static_info,", " DynamicCompiledOpenConglomInfo dynamic_info)", " throws StandardException", "\t{", "\t\tsuper.init(", " xact_manager, rawtran, hold, open_mode, lock_level,", " btree_locking_policy, scanColumnList, startKeyValue,", " startSearchOperator, qualifier, stopKeyValue,", "\t\t\tstopSearchOperator, conglomerate, undo, static_info, dynamic_info);", "\t}", "", " /**", " Close the scan.", " **/", " public void close()", " throws StandardException", "\t{", "\t\tsuper.close();", "\t}", "", "" ] } ] } ]
derby-DERBY-2359-fa091460
DERBY-2359 (partial): Removed unused imports (from impl.store.access.*), moved a few blocks of class JavaDoc and fully qualified class-names in some @see tags. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@510538 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/access/CacheableConglomerate.java", "hunks": [ { "added": [], "header": "@@ -21,9 +21,7 @@", "removed": [ "import java.util.Properties;", "import org.apache.derby.iapi.services.cache.CacheManager;" ] }, { "added": [ "\t\t@see org.apache.derby.iapi.services.cache.CacheManager#find" ], "header": "@@ -89,7 +87,7 @@ class CacheableConglomerate implements Cacheable", "removed": [ "\t\t@see CacheManager#find" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java", "hunks": [ { "added": [], "header": "@@ -26,13 +26,10 @@ import org.apache.derby.iapi.reference.Property;", "removed": [ "import org.apache.derby.impl.store.access.UTF;", "import org.apache.derby.impl.store.access.UTFQualifier;", "import org.apache.derby.iapi.services.daemon.Serviceable;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java", "hunks": [ { "added": [], "header": "@@ -35,7 +35,6 @@ import org.apache.derby.iapi.services.monitor.Monitor;", "removed": [ "import org.apache.derby.iapi.services.io.FormatIdUtil;" ] }, { "added": [], "header": "@@ -59,7 +58,6 @@ import org.apache.derby.iapi.store.raw.Transaction;", "removed": [ "import org.apache.derby.iapi.services.io.FormatableHashtable;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/RAMTransaction.java", "hunks": [ { "added": [], "header": "@@ -54,7 +54,6 @@ import org.apache.derby.iapi.store.access.FileResource;", "removed": [ "import org.apache.derby.iapi.store.access.RowSource;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTree.java", "hunks": [ { "added": [], "header": "@@ -21,59 +21,42 @@", "removed": [ "", "import org.apache.derby.iapi.services.monitor.Monitor;", "import org.apache.derby.iapi.services.stream.InfoStreams;", "", "", "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "import org.apache.derby.iapi.store.access.conglomerate.ScanManager;", "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.RowUtil;", "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;", "import org.apache.derby.iapi.types.RowLocation;", "", "", "" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.conglomerate.Conglomerate#drop" ], "header": "@@ -503,7 +486,7 @@ public abstract class BTree extends GenericConglomerate", "removed": [ "\t@see Conglomerate#drop" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.conglomerate.Conglomerate#load" ], "header": "@@ -512,7 +495,7 @@ public abstract class BTree extends GenericConglomerate", "removed": [ "\t@see Conglomerate#load" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java", "hunks": [ { "added": [], "header": "@@ -21,17 +21,13 @@", "removed": [ "import java.io.IOException;", "import org.apache.derby.iapi.services.io.Storable;", "", "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;" ] }, { "added": [], "header": "@@ -39,7 +35,6 @@ import org.apache.derby.iapi.store.access.ConglomerateController;", "removed": [ "import org.apache.derby.iapi.store.access.ScanController;" ] }, { "added": [], "header": "@@ -47,7 +42,6 @@ import org.apache.derby.iapi.store.raw.ContainerHandle;", "removed": [ "import org.apache.derby.iapi.store.raw.RecordHandle;" ] }, { "added": [], "header": "@@ -58,8 +52,6 @@ import org.apache.derby.iapi.services.io.FormatableBitSet;", "removed": [ "", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java", "hunks": [ { "added": [], "header": "@@ -33,22 +33,17 @@ import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;", "removed": [ "import org.apache.derby.iapi.store.access.RowUtil;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.LockingPolicy;", "import org.apache.derby.iapi.store.raw.RawStoreFactory;", "" ] }, { "added": [ "@see org.apache.derby.iapi.store.access.TransactionController#openStoreCost" ], "header": "@@ -74,7 +69,7 @@ An optimal implementation will not get any locks on the underlying", "removed": [ "@see TransactionController#openStoreCost" ] }, { "added": [ "\t * @see org.apache.derby.iapi.store.access.RowUtil" ], "header": "@@ -289,7 +284,7 @@ public class BTreeCostController extends OpenBTree", "removed": [ "\t * @see RowUtil" ] }, { "added": [ "\t * @see org.apache.derby.iapi.store.access.RowUtil" ], "header": "@@ -345,7 +340,7 @@ public class BTreeCostController extends OpenBTree", "removed": [ "\t * @see RowUtil" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java", "hunks": [ { "added": [], "header": "@@ -23,7 +23,6 @@ package org.apache.derby.impl.store.access.btree;", "removed": [ "import org.apache.derby.iapi.services.monitor.Monitor;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java", "hunks": [ { "added": [], "header": "@@ -24,7 +24,6 @@ package org.apache.derby.impl.store.access.btree;", "removed": [ "import org.apache.derby.iapi.services.io.Storable;" ] }, { "added": [], "header": "@@ -35,13 +34,11 @@ import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "removed": [ "import org.apache.derby.iapi.store.access.GenericScanController;", "import org.apache.derby.iapi.store.access.TransactionController;" ] }, { "added": [], "header": "@@ -54,7 +51,6 @@ import org.apache.derby.iapi.types.DataValueDescriptor;", "removed": [ "import org.apache.derby.impl.store.access.conglomerate.ConglomerateUtil;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java", "hunks": [ { "added": [], "header": "@@ -23,8 +23,6 @@ package org.apache.derby.impl.store.access.btree;", "removed": [ "import org.apache.derby.iapi.services.io.FormatIdUtil;", "import org.apache.derby.iapi.services.io.Storable;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java", "hunks": [ { "added": [], "header": "@@ -22,7 +22,6 @@", "removed": [ "import org.apache.derby.iapi.services.io.Storable;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java", "hunks": [ { "added": [], "header": "@@ -21,19 +21,14 @@", "removed": [ "import java.io.PrintStream;", "import org.apache.derby.iapi.services.io.FormatIdUtil;", "import org.apache.derby.iapi.services.io.Storable;", "import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java", "hunks": [ { "added": [], "header": "@@ -27,13 +27,9 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.ScanController;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java", "hunks": [ { "added": [], "header": "@@ -21,7 +21,6 @@", "removed": [ "" ] }, { "added": [], "header": "@@ -34,7 +33,6 @@ import org.apache.derby.iapi.services.io.FormatableBitSet;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;" ] }, { "added": [], "header": "@@ -43,19 +41,15 @@ import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;", "removed": [ "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.services.io.FormatIdUtil;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IController.java", "hunks": [ { "added": [], "header": "@@ -21,17 +21,13 @@", "removed": [ "import java.io.IOException;", "import java.util.Properties;", "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.ScanController;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IForwardScan.java", "hunks": [ { "added": [], "header": "@@ -21,17 +21,12 @@", "removed": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "", "import org.apache.derby.iapi.store.access.GenericScanController;", "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IMaxScan.java", "hunks": [ { "added": [], "header": "@@ -24,13 +24,10 @@ package org.apache.derby.impl.store.access.btree.index;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "import org.apache.derby.iapi.store.access.GenericScanController;", "import org.apache.derby.iapi.types.RowLocation;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2INoLocking.java", "hunks": [ { "added": [], "header": "@@ -21,18 +21,13 @@", "removed": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking1.java", "hunks": [ { "added": [], "header": "@@ -21,20 +21,13 @@", "removed": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "", "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLockingRR.java", "hunks": [ { "added": [], "header": "@@ -25,16 +25,11 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java", "hunks": [ { "added": [], "header": "@@ -28,7 +28,6 @@ import org.apache.derby.iapi.services.io.ArrayInputStream;", "removed": [ "import org.apache.derby.iapi.services.io.FormatIdUtil;" ] }, { "added": [], "header": "@@ -37,13 +36,10 @@ import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "removed": [ "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.LockingPolicy;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/BinaryOrderableWrapper.java", "hunks": [ { "added": [], "header": "@@ -21,7 +21,6 @@", "removed": [ "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/ConglomerateUtil.java", "hunks": [ { "added": [], "header": "@@ -27,12 +27,7 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.error.StandardException;", "", "import org.apache.derby.iapi.store.access.Qualifier;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.store.raw.ContainerHandle;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.java", "hunks": [ { "added": [], "header": "@@ -27,21 +27,13 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;", "import org.apache.derby.iapi.store.access.SpaceInfo;", "import org.apache.derby.iapi.store.raw.ContainerHandle;", "import org.apache.derby.iapi.store.raw.Page;", "import org.apache.derby.iapi.store.raw.RecordHandle;", "import org.apache.derby.iapi.store.raw.Transaction;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/GenericCostController.java", "hunks": [ { "added": [], "header": "@@ -26,15 +26,9 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "import org.apache.derby.iapi.store.access.StoreCostResult;", "", "import org.apache.derby.iapi.types.DataValueDescriptor;", "", "import org.apache.derby.impl.sql.execute.RowUtil;", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java", "hunks": [ { "added": [], "header": "@@ -27,40 +27,28 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;", "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.store.access.SpaceInfo;", "import org.apache.derby.iapi.store.raw.Transaction;", "import org.apache.derby.iapi.types.Orderable;", "", "import java.util.Properties; ", "", "" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#delete" ], "header": "@@ -1099,7 +1087,7 @@ public abstract class GenericScanController", "removed": [ "\t@see ScanController#delete" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#replace" ], "header": "@@ -1353,7 +1341,7 @@ public abstract class GenericScanController", "removed": [ "\t@see ScanController#replace" ] }, { "added": [ " @see org.apache.derby.iapi.store.access.ScanController#fetchWithoutQualify" ], "header": "@@ -1454,7 +1442,7 @@ public abstract class GenericScanController", "removed": [ " @see ScanController#fetchWithoutQualify" ] }, { "added": [ " @see org.apache.derby.iapi.store.access.ScanController#fetch" ], "header": "@@ -1465,7 +1453,7 @@ public abstract class GenericScanController", "removed": [ " @see ScanController#fetch" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/Heap.java", "hunks": [ { "added": [], "header": "@@ -34,7 +34,6 @@ import org.apache.derby.iapi.services.io.FormatableBitSet;", "removed": [ "import org.apache.derby.iapi.services.io.Formatable;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java", "hunks": [ { "added": [], "header": "@@ -23,24 +23,17 @@ package org.apache.derby.impl.store.access.heap;", "removed": [ "import org.apache.derby.iapi.services.io.FormatableBitSet;", "", "import org.apache.derby.iapi.services.io.FormatIdUtil;", "import org.apache.derby.iapi.store.access.conglomerate.MethodFactory;", "import org.apache.derby.iapi.store.access.AccessFactory;", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.Qualifier;" ] }, { "added": [], "header": "@@ -48,7 +41,6 @@ import org.apache.derby.iapi.store.raw.ContainerKey;", "removed": [ "import org.apache.derby.iapi.store.raw.Transaction;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/HeapCostController.java", "hunks": [ { "added": [], "header": "@@ -21,29 +21,20 @@", "removed": [ "import org.apache.derby.iapi.reference.SQLState;", "import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;", "", "import org.apache.derby.iapi.types.RowLocation;", "import org.apache.derby.iapi.store.raw.LockingPolicy;", "import org.apache.derby.iapi.store.raw.RawStoreFactory;", "import org.apache.derby.iapi.store.raw.Transaction;", "import org.apache.derby.iapi.store.access.RowUtil;", "" ] }, { "added": [ "\t * @see org.apache.derby.iapi.store.access.RowUtil" ], "header": "@@ -177,7 +168,7 @@ public class HeapCostController", "removed": [ "\t * @see RowUtil" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/HeapPostCommit.java", "hunks": [ { "added": [], "header": "@@ -23,7 +23,6 @@ package org.apache.derby.impl.store.access.heap;", "removed": [ "import org.apache.derby.iapi.services.monitor.Monitor;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.BackingStoreHashtable;", "import org.apache.derby.iapi.types.RowLocation;" ], "header": "@@ -32,42 +32,26 @@ import org.apache.derby.iapi.reference.SQLState;", "removed": [ "import org.apache.derby.iapi.services.io.Storable;", "", "import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;", "import org.apache.derby.iapi.store.access.ScanController;", "", "import org.apache.derby.iapi.types.RowLocation;", "import org.apache.derby.iapi.store.raw.ContainerHandle;", "import org.apache.derby.iapi.store.raw.LockingPolicy;", "import org.apache.derby.iapi.store.raw.Transaction;", "import org.apache.derby.impl.store.access.conglomerate.ConglomerateUtil;", "import org.apache.derby.iapi.store.access.BackingStoreHashtable;", "import org.apache.derby.iapi.services.io.FormatableBitSet;", "", "import java.util.Hashtable;", "import java.util.Vector;", "" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#next" ], "header": "@@ -266,7 +250,7 @@ class HeapScan", "removed": [ "\t@see ScanController#next" ] }, { "added": [ " * @see org.apache.derby.iapi.store.access.ScanController#positionAtRowLocation" ], "header": "@@ -290,7 +274,7 @@ class HeapScan", "removed": [ " * @see ScanController#positionAtRowLocation" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/ExternalSortFactory.java", "hunks": [ { "added": [], "header": "@@ -31,7 +31,6 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [ "import org.apache.derby.iapi.store.access.conglomerate.MethodFactory;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java", "hunks": [ { "added": [ "// For JavaDoc references (i.e. @see)", "import org.apache.derby.iapi.store.access.conglomerate.ScanManager;", "" ], "header": "@@ -25,18 +25,17 @@ import java.util.Enumeration;", "removed": [ "import org.apache.derby.iapi.services.io.Storable;", "import org.apache.derby.iapi.store.access.conglomerate.ScanManager;", "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.store.access.TransactionController;" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#next" ], "header": "@@ -88,7 +87,7 @@ public class MergeScan extends SortScan", "removed": [ "\t@see ScanController#next" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java", "hunks": [ { "added": [], "header": "@@ -30,7 +30,6 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "import org.apache.derby.iapi.store.access.RowLocationRetRowSource;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java", "hunks": [ { "added": [], "header": "@@ -25,17 +25,13 @@ import org.apache.derby.iapi.reference.SQLState;", "removed": [ "import org.apache.derby.iapi.services.io.Storable;", "import org.apache.derby.iapi.store.access.conglomerate.SortFactory;", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.Qualifier;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/Scan.java", "hunks": [ { "added": [], "header": "@@ -27,9 +27,6 @@ import org.apache.derby.iapi.store.access.BackingStoreHashtable;", "removed": [ "import org.apache.derby.iapi.services.io.Storable;", "", "import org.apache.derby.iapi.types.Orderable;" ] }, { "added": [], "header": "@@ -38,7 +35,6 @@ import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;", "removed": [ "import org.apache.derby.iapi.store.access.ScanController;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/SortBufferRowSource.java", "hunks": [ { "added": [], "header": "@@ -25,12 +25,10 @@ import org.apache.derby.iapi.reference.SQLState;", "removed": [ "import org.apache.derby.iapi.store.access.RowSource;", "import org.apache.derby.iapi.store.access.ScanController;" ] }, { "added": [ "\t * @see org.apache.derby.iapi.store.access.RowSource#needsToClone" ], "header": "@@ -105,7 +103,7 @@ public class SortBufferRowSource extends Scan", "removed": [ "\t * @see RowSource#needsToClone" ] }, { "added": [ " * @see org.apache.derby.iapi.store.access.ScanController#fetchWithoutQualify" ], "header": "@@ -178,7 +176,7 @@ public class SortBufferRowSource extends Scan", "removed": [ " * @see ScanController#fetchWithoutQualify" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/SortBufferScan.java", "hunks": [ { "added": [], "header": "@@ -24,7 +24,6 @@ package org.apache.derby.impl.store.access.sort;", "removed": [ "import org.apache.derby.iapi.store.access.ScanController;" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#next" ], "header": "@@ -64,7 +63,7 @@ public class SortBufferScan extends SortScan", "removed": [ "\t@see ScanController#next" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/sort/SortScan.java", "hunks": [ { "added": [], "header": "@@ -23,16 +23,11 @@ package org.apache.derby.impl.store.access.sort;", "removed": [ "import org.apache.derby.iapi.services.io.FormatableBitSet;", "", "import org.apache.derby.iapi.services.io.Storable;", "import org.apache.derby.iapi.store.access.RowUtil;", "import org.apache.derby.iapi.store.access.ScanController;" ] }, { "added": [ "\t@see org.apache.derby.iapi.store.access.ScanController#fetch" ], "header": "@@ -126,7 +121,7 @@ public abstract class SortScan extends Scan", "removed": [ "\t@see ScanController#fetch" ] }, { "added": [ " @see org.apache.derby.iapi.store.access.ScanController#fetchWithoutQualify" ], "header": "@@ -164,7 +159,7 @@ public abstract class SortScan extends Scan", "removed": [ " @see ScanController#fetchWithoutQualify" ] } ] } ]
derby-DERBY-236-54366745
his patch fixes Derby 236 http://issues.apache.org/jira/browse/DERBY-236 - BootPassword gets written out in plain text in sane mode and in our test environment. Changes include 1. remove sanity debug code in RawStore to not write bootpassword in plain text into the service.properties 2. currently the test harness does not seem to pass on the encryption related properties to the MultiTest and with change in #1, encryption wont be used for stress.multi. So changes made to RunTest to pass on the encryption, testEncryptionAlgorithm values to the MultiTest harness. Also changed mtTestCase to recognize the encryption properties and modify the database url to use for the MultiTest. ran derbyall on jdk142 with no failures verified that encryption run for stress.multi was running ok, by adding keepfiles=true to encryptionAll.properties and checking the service.properties for all the databases created as part of this encryptionAll testrun. submitted by: ksunithaghm@gmail.com git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@169913 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2369-51e8282d
DERBY-2369 Use a single socket for shutdown down the network server and the ping to ensure it is shutdown. Reduce the sleep time between pings to allow faster recognition that the server is down. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@511353 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "\tprivate final static int SHUTDOWN_CHECK_ATTEMPTS = 100;", "\tprivate final static int SHUTDOWN_CHECK_INTERVAL= 100;" ], "header": "@@ -144,8 +144,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\tprivate final static int SHUTDOWN_CHECK_ATTEMPTS = 20;", "\tprivate final static int SHUTDOWN_CHECK_INTERVAL= 500;" ] }, { "added": [], "header": "@@ -878,7 +878,6 @@ public final class NetworkServerControlImpl {", "removed": [ " closeSocket();" ] }, { "added": [ " pingWithNoOpen();", " // as soon as we can't ping return", " closeSocket();", " ", " ", " if (ntry == SHUTDOWN_CHECK_ATTEMPTS)", " consolePropertyMessage(\"DRDA_ShutdownError.S\", new String [] {", " Integer.toString(portNumber), ", " hostArg}); ", " " ], "header": "@@ -896,17 +895,21 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t\t\tping();", "\t\t\t\t// as soon as we can't ping return", "\t\t\t\tif (ntry == SHUTDOWN_CHECK_ATTEMPTS)", "\t\t\t\t\tconsolePropertyMessage(\"DRDA_ShutdownError.S\", new String [] {", "\t\t\t\t\t\tInteger.toString(portNumber), ", "\t\t\t\t\t\thostArg}); " ] }, { "added": [ " /**", " * Ping opening an new socket and close it.", " * @throws Exception", " */", " setUpSocket();", " pingWithNoOpen();", " closeSocket();", " }", " ", " /**", " * Ping the server using the client socket that is already open.", " */", " private void pingWithNoOpen() throws Exception", " {", " " ], "header": "@@ -938,8 +941,23 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\t\t\t" ], "header": "@@ -947,15 +965,13 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t\tsetUpSocket();", " closeSocket();", "" ] } ] } ]
derby-DERBY-237-43261ea4
committing fix for DERBY-237 for ksunithaghm@gmail.com. This patch fixes derby-237: Boot errors from store must not lose error messages/stack traces in between. Actually nested exceptions from the boot error were not lost but their stack traces were not being written out into error stream which is why the entire stack traces of exceptions was not printed out to derby.log git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@169501 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java", "hunks": [ { "added": [ " /**", " * print stack trace from the Throwable including", " * its nested exceptions ", " * @param t trace starts from this error", " */", "\t\tErrorStringBuilder esb = ", " new ErrorStringBuilder(Monitor.getStream().getHeader());", " Monitor.logMessage(esb.get().toString());", " esb.reset();", " }" ], "header": "@@ -3951,14 +3951,19 @@ public class LogToFile implements LogFactory, ModuleControl, ModuleSupportable,", "removed": [ "\t\tMonitor.logMessage(\"-------------------------\\n\");", "\t\tt.printStackTrace(Monitor.getStream().getPrintWriter());", "\t\tMonitor.logMessage(\"-------------------------\\n\");", "\t\tErrorStringBuilder esb = new ErrorStringBuilder(Monitor.getStream().getHeader());", "\t}" ] } ] } ]
derby-DERBY-2370-0787955a
DERBY-2370: Fix incorrect results for EXISTS queries with SET operator expressions. In particular: 1. Adds the ability to mark a FromList as "transparent", and updates FromList.bindExpressions() to pass the outer FROM list down (instead of "this") if the FromList is transparent. 2. Updates FromList.expandAll(...) to account for the fact that outer FROM tables might now appear in a nested FromList (as a result of "transparent" FromLists; see code comments for details). 3. Modifies the "setResultToBooleanTrue()" signature to return a ResultSetNode (it was "void" previously). 4. Modifies ResultSetNode.setResultToBooleanTrue() to always return "this". 5. Modifies SetOperatorNode.setResultToBooleanTrue() so that it now creates an internal "SELECT *" query whose FROM list contains just the SetOperatorNode. Then we transform the "*" for the new SELECT into "TRUE" and leave the SetOperatorNode's result columns UN-transformed. Finally, mark the new SelectNode's FromList as "transparent" and return the new SelectNode. 6. Updates tests where necessary (including changed behavior in union.sql) and adds a new JUnit test, lang/ExistsWithSetOpsTest, to verify new behavior. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@532509 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/FromList.java", "hunks": [ { "added": [ "\t/* Whether or not this FromList is transparent. A \"transparent\" FromList", "\t * is one in which all FromTables are bound based on an outer query's", "\t * FromList. This means that the FromTables in the transparent list are", "\t * allowed to see and reference FromTables in the outer query's list.", "\t * Or put differently, a FromTable which sits in a transparent FromList", "\t * does not \"see\" the transparent FromList when binding; rather, it sees", "\t * (and can therefore reference) the FromList of an outer query.", "\t */", "\tprivate boolean isTransparent;", "\t\tisTransparent = false;" ], "header": "@@ -63,12 +63,22 @@ public class FromList extends QueryTreeNodeVector implements OptimizableList", "removed": [] }, { "added": [ "", "\t\t\t/* If this FromList is transparent then its FromTables should", "\t\t\t * be bound based on the outer query's FROM list.", "\t\t\t */", "\t\t\tfromTable.bindExpressions(", "\t\t\t\tisTransparent ? fromListParam : this);" ], "header": "@@ -333,7 +343,12 @@ public class FromList extends QueryTreeNodeVector implements OptimizableList", "removed": [ "\t\t\tfromTable.bindExpressions(this);" ] }, { "added": [ "\t * of the base tables in the from list at the current nesting level;", "\t * otherwise it will expand into a list of all of the columns in the", "\t * base table that matches the qualification.", "\t * NOTE: Callers are responsible for ordering the FromList by nesting", "\t * level, with tables at the deepest (current) nesting level first. ", "\t * We will expand the \"*\" into a list of all columns from all tables", "\t * having the same nesting level as the first FromTable in this list.", "\t * The check for nesting level exists because it's possible that this", "\t * FromList includes FromTables from an outer query, which can happen", "\t * if there is a \"transparent\" FromList above this one in the query", "\t * tree. Ex:", "\t *", "\t * select j from onerow where exists", "\t * (select 1 from somerow", "\t * union select * from diffrow where onerow.j < diffrow.k)", "\t *", "\t * If \"this\" is the FromList for the right child of the UNION then it will", "\t * contain both \"diffrow\" and \"onerow\", the latter of which was passed", "\t * down via a transparent FromList (to allow binding of the WHERE clause).", "\t * In that case the \"*\" should only expand the result columns of \"diffrow\";", "\t * it should not expand the result columns of \"onerow\" because that table", "\t * is from an outer query. We can achieve this selective expansion by", "\t * looking at nesting levels.", "\t * " ], "header": "@@ -393,10 +408,31 @@ public class FromList extends QueryTreeNodeVector implements OptimizableList", "removed": [ "\t * of the base tables in the from list, otherwise it will expand", "\t * into a list of all of the columns in the base table that matches", "\t * the qualification." ] }, { "added": [ "\t\t * (allTableName is not null) or for all tables in the list at the", "\t\t * current nesting level if the \"*\" is not qualified (allTableName", "\t\t * is null). Current nesting level is determined by the nesting", "\t\t * level of the first FromTable in the list.", "\t\tint targetNestingLevel = ((FromTable)elementAt(0)).getLevel();", "", "\t\t/* Make sure our assumption about nesting-based ordering", "\t\t * has been satisified. I.e. that the list is ordered", "\t\t * with the most deeply nested FromTables first.", "\t\t */", "\t\tif (SanityManager.DEBUG)", "\t\t{", "\t\t\tint prevNL = targetNestingLevel;", "\t\t\tfor (int i = 1; i < size; i++)", "\t\t\t{", "\t\t\t\tint currNL = ((FromTable)elementAt(i)).getLevel();", "\t\t\t\tSanityManager.ASSERT((prevNL >= currNL),", "\t\t\t\t\t\"FROM list should have been ordered by nesting \" +", "\t\t\t\t\t\"level (deepest level first), but it was not.\");", "", "\t\t\t\tprevNL = currNL;", "\t\t\t}", "\t\t}", "", "\t\t\tif (targetNestingLevel != fromTable.getLevel())", "\t\t\t{", "\t\t\t\t/* We only expand result columns for tables at the", "\t\t\t\t * target nesting level. Since the FromTables are", "\t\t\t\t * sorted based on nesting level, we're done if we", "\t\t\t\t * get here.", "\t\t\t\t */", "\t\t\t\tbreak;", "\t\t\t}" ], "header": "@@ -412,13 +448,44 @@ public class FromList extends QueryTreeNodeVector implements OptimizableList", "removed": [ "\t\t * (allTableName is not null) or for all tables in the list if the ", "\t\t * \"*\" is not qualified (allTableName is null)." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java", "hunks": [ { "added": [ "\t * @return ResultSetNode whose resultColumn was transformed; defaults", "\t * to \"this\" here, but can be overridden by subclasses.", "\tpublic ResultSetNode setResultToBooleanTrueNode(boolean onlyConvertAlls)", "\t\tthrows StandardException" ], "header": "@@ -532,11 +532,13 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\tpublic void setResultToBooleanTrueNode(boolean onlyConvertAlls)", "\t\t\t\tthrows StandardException" ] }, { "added": [ "\t\t\treturn this;" ], "header": "@@ -554,7 +556,7 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t\t\treturn;" ] }, { "added": [ "\t\t\t\treturn this;" ], "header": "@@ -563,7 +565,7 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t\t\t\treturn;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java", "hunks": [ { "added": [ "\t\t\tresultSet = resultSet.setResultToBooleanTrueNode(true);" ], "header": "@@ -464,7 +464,7 @@ public class SubqueryNode extends ValueNode", "removed": [ "\t\t\tresultSet.setResultToBooleanTrueNode(true);" ] } ] } ]
derby-DERBY-2378-30644c89
DERBY-2378: Committed derby-2378-01.diff, removing SecureServerTests's dependencies on non-public apis. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@515136 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-238-c1cd0b72
DERBY-238: Fix propogation of testEncryptionAlgorithm property. Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@295037 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java", "hunks": [ { "added": [ "\tstatic String testEncryptionAlgorithm;" ], "header": "@@ -78,6 +78,7 @@ public class RunList", "removed": [] }, { "added": [ " if (testEncryptionAlgorithm != null)", " jvmProps.addElement(\"testEncryptionAlgorithm=\" + testEncryptionAlgorithm);" ], "header": "@@ -388,6 +389,8 @@ public class RunList", "removed": [] }, { "added": [ " testEncryptionAlgorithm = parentProps.getProperty(\"testEncryptionAlgorithm\");" ], "header": "@@ -620,6 +623,7 @@ public class RunList", "removed": [] }, { "added": [ "\t\ttestEncryptionAlgorithm = suiteProperties.getProperty(\"testEncryptionAlgorithm\");" ], "header": "@@ -716,6 +720,7 @@ public class RunList", "removed": [] } ] }, { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java", "hunks": [ { "added": [ "\tstatic String testSpecialProps = \"\"; " ], "header": "@@ -57,6 +57,7 @@ public class RunSuite", "removed": [] }, { "added": [ " testSpecialProps = p.getProperty(\"testSpecialProps\");" ], "header": "@@ -309,6 +310,7 @@ public class RunSuite", "removed": [] }, { "added": [ "\t\tString testprops = sp.getProperty(\"testSpecialProps\");", "\t\tif (testprops != null)", "\t\t{", "\t\t if (testSpecialProps == null)", "\t\t testSpecialProps = testflags;", "\t\t else // add to testSpecialProps", "\t\t testSpecialProps = testSpecialProps + \"^\" + testprops;", "\t\t suiteProperties.put(\"testSpecialProps\", testSpecialProps);", "\t\t}" ], "header": "@@ -393,6 +395,15 @@ public class RunSuite", "removed": [] }, { "added": [ "\t\tString encryptAlgorithm = sp.getProperty(\"testEncryptionAlgorithm\");", "\t\tif (encryptAlgorithm != null)", "\t\t suiteProperties.put(\"testEncryptionAlgorithm\", encryptAlgorithm);" ], "header": "@@ -420,6 +431,9 @@ public class RunSuite", "removed": [] } ] } ]
derby-DERBY-2380-08d2c15c
Remove the Dependent.makeValid() call. No calls are made to makeValid() through this interface. Can be seen by the fact that most of the implementations are empty and not covered by the code covergae with the tests, as well as there is no path to them. The one version that was called was for GenericPreparedStatement in CurrentOfNode, but a better method is the rePrepare() method on PreparedStatement. Related to DERBY-2380. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@513401 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java", "hunks": [ { "added": [ "\t\tif (!upToDate()) {", "\t\t\tPreparedStatement ps = statement.prepare(lcc);", "", "\t\t\tif (SanityManager.DEBUG)", "\t\t\t\tSanityManager.ASSERT(ps == this, \"ps != this\");", "\t\t}" ], "header": "@@ -206,8 +206,12 @@ public class GenericPreparedStatement", "removed": [ "\t\tif (!upToDate())", "\t\t makeValid(lcc);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java", "hunks": [ { "added": [ "\t\tif (preStmt!=null) {", "\t\t\tpreStmt.rePrepare(getLanguageConnectionContext());" ], "header": "@@ -169,10 +169,8 @@ public final class CurrentOfNode extends FromTable {", "removed": [ "\t\tif ((preStmt!=null) && (! preStmt.upToDate())) {", "\t\t\tpreStmt.makeValid(getLanguageConnectionContext()); // need to have the query tree", "\t\t\tif (! preStmt.isValid()) // can't make it valid, say not found", "\t\t\t\tpreStmt = null;" ] } ] } ]
derby-DERBY-2380-180546e3
DERBY-2380 minor cleanup in dependency manager. No code changes apart from making some fields final, but added comments to main objects in BasicDependencyManager as my understanding of the code grows. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@517221 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java", "hunks": [ { "added": [ "import java.util.Enumeration;", "import java.util.Hashtable;", "import java.util.List;", "import java.util.ListIterator;", "import org.apache.derby.catalog.DependableFinder;", "import org.apache.derby.catalog.UUID;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.services.io.FormatableBitSet;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;", "import org.apache.derby.impl.sql.compile.CreateViewNode;" ], "header": "@@ -21,53 +21,34 @@", "removed": [ "import\torg.apache.derby.catalog.Dependable;", "import\torg.apache.derby.catalog.DependableFinder;", "import org.apache.derby.iapi.services.context.ContextService;", "", "import org.apache.derby.iapi.services.monitor.Monitor;", "", "", "import org.apache.derby.impl.sql.compile.CreateViewNode;", "", "import org.apache.derby.iapi.sql.conn.LanguageConnectionFactory;", "", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "", "import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;", "import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;", "", "import org.apache.derby.impl.sql.catalog.DDColumnDependableFinder;", "", "import org.apache.derby.catalog.UUID;", "import org.apache.derby.iapi.reference.SQLState;", "import org.apache.derby.iapi.services.io.FormatableBitSet;", "", "import org.apache.derby.iapi.reference.MessageId;", "", "import org.apache.derby.iapi.error.StandardException;", "", "import java.util.Hashtable;", "import java.util.Enumeration;", "import java.util.ListIterator;", "import java.util.List;" ] }, { "added": [ " ", " /**", " * Map of in-memory dependencies for Dependents.", " * In-memory means that one or both of the Dependent", " * or Provider are non-persistent (isPersistent() returns false).", " * ", " * Key is the UUID of the Dependent (from getObjectID()).", " * Value is a List containing Dependency objects, each", " * of whihc links the same Dependent to a Provider.", " * Dependency objects in the List are unique.", " * ", " */", " private final Hashtable dependents = new Hashtable();", " ", " /**", " * Map of in-memory dependencies for Providers.", " * In-memory means that one or both of the Dependent", " * or Provider are non-persistent (isPersistent() returns false).", " * ", " * Key is the UUID of the Provider (from getObjectID()).", " * Value is a List containing Dependency objects, each", " * of which links the same Provider to a Dependent.", " * Dependency objects in the List are unique.", " * ", " */ ", " private final Hashtable providers = new Hashtable();", "" ], "header": "@@ -79,6 +60,33 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [] }, { "added": [], "header": "@@ -1369,8 +1377,4 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "", "\tprivate\tDataDictionary dataDictionary = null;", "\tprotected Hashtable dependents = new Hashtable();", "\tprotected Hashtable providers = new Hashtable();" ] } ] } ]
derby-DERBY-2380-3b451189
DERBY-2380 (partial) Add the test changes for the change of PreparedStatement no longer bing a provider. (missed from last commit). Changes are as a result of there is no such state as a closed cursor, only open or non-existent, so no longer throw a cursor is closed message, but instead a cursor not found error. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@516286 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2380-6995fff9
DERBY-2380: Make the generated class eligible for gc once the statement is invalidated git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1566635 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java", "hunks": [ { "added": [ " private boolean compilingStatement;" ], "header": "@@ -135,7 +135,7 @@ public class GenericPreparedStatement", "removed": [ "\tboolean compilingStatement;" ] }, { "added": [ " /** Check if this statement is currently being compiled. */", " final synchronized boolean isCompiling() {", " return compilingStatement;", " }", "", " /**", " * Signal that the statement is about to be compiled. This will block", " * others from attempting to compile it.", " */", " final synchronized void beginCompiling() {", " compilingStatement = true;", " setActivationClass(null);", " }", "", " /**", " * Signal that we're done compiling the statement and unblock others", " * that are waiting for the compilation to finish.", " */", " final synchronized void endCompiling() {", " compilingStatement = false;", " notifyAll();", " }", "" ], "header": "@@ -226,6 +226,29 @@ public class GenericPreparedStatement", "removed": [] }, { "added": [ " beginCompiling();" ], "header": "@@ -835,7 +858,7 @@ recompileOutOfDatePlan:", "removed": [ "\t\t\tcompilingStatement = true;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/GenericStatement.java", "hunks": [ { "added": [ " if (!preparedStmt.isCompiling()) {" ], "header": "@@ -266,7 +266,7 @@ public class GenericStatement", "removed": [ "\t\t\t\tif (!preparedStmt.compilingStatement) {" ] }, { "added": [ " preparedStmt.beginCompiling();" ], "header": "@@ -277,8 +277,7 @@ public class GenericStatement", "removed": [ "\t\t\tpreparedStmt.compilingStatement = true;", "\t\t\tpreparedStmt.setActivationClass(null);" ] }, { "added": [ " preparedStmt.endCompiling();" ], "header": "@@ -633,10 +632,7 @@ public class GenericStatement", "removed": [ "\t\t\tsynchronized (preparedStmt) {", "\t\t\t\tpreparedStmt.compilingStatement = false;", "\t\t\t\tpreparedStmt.notifyAll();", "\t\t\t}" ] } ] } ]
derby-DERBY-2381-6eb50429
DERBY-2381 ParameterMappingTest fails due to ArrayIndexOutOfBoundsException executing a procedure Formerly, the server would rely on the input parameter type information received from the client to determine the output parameter type. This patch changes the server to look at the parameter metadata to determine the drda type to send. It also enables the test ParameterMappingTest for client. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@534985 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java", "hunks": [ { "added": [ "\t\t\tint drdaType = FdocaConstants.mapJdbcTypeToDrdaType(colType,nullable,outlen);", "\t\t\t\t" ], "header": "@@ -6299,9 +6299,8 @@ class DRDAConnThread extends Thread {", "removed": [ "\t\t\tint drdaType =", "\t\t\t\t(hasRs ?FdocaConstants.mapJdbcTypeToDrdaType(colType,nullable,outlen): ", "\t\t\t\t stmt.getParamDRDAType(i));" ] }, { "added": [ "\t\t\t\t{", "\t\t\t\t\tprecision = pmeta.getPrecision(i);", "\t\t\t\t\tscale = pmeta.getScale(i);", "\t\t\t\t\t((CallableStatement) stmt.ps).registerOutParameter(i,Types.DECIMAL,scale);", "\t\t\t\t ", "\t\t\t\t}" ], "header": "@@ -6317,9 +6316,12 @@ class DRDAConnThread extends Thread {", "removed": [ "\t\t\t\t\t((CallableStatement) stmt.ps).registerOutParameter(i,Types.DECIMAL);", "\t\t\t\tprecision = pmeta.getPrecision(i);", "\t\t\t\tscale = pmeta.getScale(i);" ] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/DRDAStatement.java", "hunks": [ { "added": [ "\tprivate int[] outputPrecision;", "\tprivate int[] outputScale;", " " ], "header": "@@ -88,6 +88,9 @@ class DRDAStatement", "removed": [] }, { "added": [ "\t\toutputPrecision = null;", "\t\toutputScale = null;" ], "header": "@@ -1080,6 +1083,8 @@ class DRDAStatement", "removed": [] }, { "added": [ " int parameterPrecision = pmeta.getPrecision(i + 1);", " int parameterScale = pmeta.getScale(i + 1);" ], "header": "@@ -1444,6 +1449,8 @@ class DRDAStatement", "removed": [] }, { "added": [ "\t\t\t\t\toutputPrecision = new int [numElems];", "\t\t\t\t\toutputScale = new int [numElems];", "\t\t\t\t\tfor (int j = 0; j < numElems; j++) {", "\t\t\t\t\t\toutputPrecision[j] = NOT_OUTPUT_PARAM;", "\t\t\t\t\t\toutputScale[j] = NOT_OUTPUT_PARAM;", "\t\t\t\t\t}", "\t\t\t\toutputPrecision[i] = parameterPrecision;", "\t\t\t\toutputScale[i] = parameterScale; " ], "header": "@@ -1466,12 +1473,19 @@ class DRDAStatement", "removed": [ "\t\t\t\t\tfor (int j = 0; j < numElems; j++)" ] } ] } ]
derby-DERBY-2385-bbe895f9
DERBY-2385: Commit Narayanan's upgrade_v4.diff patch, which adds LOB-specific procedures. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@533893 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ " create_10_3_system_procedures(tc);" ], "header": "@@ -9330,10 +9330,7 @@ public final class\tDataDictionaryImpl", "removed": [ " create_10_3_system_procedures(tc, sysUtilUUID);", " //create 10.3 functions used by LOB methods.", " UUID sysIBMUUID = getSysIBMSchemaDescriptor().getUUID();", " create_10_3_LOB_Specific_functions(tc, sysIBMUUID);" ] }, { "added": [ " private void create_10_3_system_procedures_SYSIBM(", " TransactionController tc)", " //create 10.3 functions used by LOB methods.", " UUID schema_uuid = getSysIBMSchemaDescriptor().getUUID();" ], "header": "@@ -10122,10 +10119,11 @@ public final class\tDataDictionaryImpl", "removed": [ " private void create_10_3_LOB_Specific_functions(", " TransactionController tc,", " UUID schema_uuid)" ] } ] } ]
derby-DERBY-239-24bbe757
DERBY-239, committing on behalf of Suresh Thalamati. This patch adds code to support online backup when jar operations are running parallel to the backup. Jar files are not logged, but the system catalogs updates are logged when a jar file is added/replaced. If the jar file operations are allowed during the backup, system catalog (sys.sysfiles) table in the backup database can have a reference to a jar file that does not exist in the backup database. And also backup can contain partial written jar files. To make a consistent online backup, this patch: 1) Makes Backup operation wait/fail for all the jar operations activity in progress to complete. 2) Blocks jar file operations when a backup is in progress. This patch also adds a new test to test the online backup with jar operations. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@357269 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/data/RFResource.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.raw.xact.RawTransaction;" ], "header": "@@ -31,6 +31,7 @@ import org.apache.derby.iapi.store.access.FileResource;", "removed": [] }, { "added": [ " ContextManager cm = ", " ContextService.getFactory().getCurrentContextManager();", "", " Transaction tran = ", " factory.getRawStoreFactory().findUserTransaction(", " cm, AccessFactoryGlobals.USER_TRANS_NAME);", " ", " // Prevent backup operation when a jar file is being added", " // by setting the transaction into a backup blocking state.", " // If backup is already in progress this call will wait ", " // for the backup to finish .", " ((RawTransaction)tran).setBackupBlockingState(true);", "" ], "header": "@@ -75,6 +76,19 @@ class RFResource implements FileResource {", "removed": [] }, { "added": [ " // Prevent backup operation when a jar file is being removed", " // by setting the transaction into a backup blocking state.", " // If backup is already in progress this call will wait ", " // for the backup to finish.", " ((RawTransaction)tran).setBackupBlockingState(true);", "" ], "header": "@@ -142,6 +156,12 @@ class RFResource implements FileResource {", "removed": [] } ] } ]
derby-DERBY-239-64ec5e2d
DERBY-239, fixing onlinebackuptest1. committing on behalf of Suresh Thalamati. This pacth fixes store/onlineBackupTest1.java failure on non-windows envirorment. Problem was unlogged operations thread and insert thread are working on the same connection. Test was failing becuase insert thread was committing the unlogged operation that was suppose to block the backup. This pacth modified the test , so that these threads works on different conenctions, Test passed on Windows XP and Linuix. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@354523 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-239-7739ad68
anther patch for DERBY-239, committed on behalf of: Suresh Thalamati. Fix to the problem found by Oystein while reviewing the previous online backup patch(online_backup1.diff). Backup of a container code was doing a seek incorrectly on the file container instead of the backup file. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@329934 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java", "hunks": [ { "added": [ " \"expect \" +", " AllocPage.FORMAT_NUMBER +", " \"got \" +", " FormatIdUtil.readFormatIdInteger(pageData));" ], "header": "@@ -1076,10 +1076,10 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\t \"expect \" +", "\t\t\t\t\t\t\t\t\t\t\t\t AllocPage.FORMAT_NUMBER +", "\t\t\t\t\t\t\t\t\t\t\t\t \"got \" +", "\t\t\t\t\t\t\t\t\t\t\t\t FormatIdUtil.readFormatIdInteger(pageData));" ] }, { "added": [ "\t\t\tbackupRaf.seek(pageOffset);" ], "header": "@@ -1097,7 +1097,7 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ "\t\t\tfileData.seek(pageOffset);" ] } ] } ]
derby-DERBY-239-b4b8d3b4
DERBY-239, committing next phase checkin on behalf of Suresh Thalamati. This patch adds code to support real-time online backup with unlogged operations. A consistent backup can not be made if there are pending transactions with unlogged operations or if unlogged operations occur when backup is in progress. Because container files can be copied to the backup before the transaction is committed and the data pages are flushed as part of the commit. As there is no transaction log for unlogged operations, while restoring from the backup database can not be restored to a consistent state. To make a consistent online backup in this scenario, this patch: 1) blocks online backup until all the transactions with unlogged operation are committed/aborted. 2) implicitly converts all unlogged operations to logged mode for the duration of the online backup, if they are started when backup is in progress. This patch also adds a test to test the online backup in parallel with some DML, > DDL and unlogged operations. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@345355 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/RawStore.java", "hunks": [ { "added": [ "", "\t\tTransaction t = ", " findUserTransaction(", " ContextService.getFactory().getCurrentContextManager(), ", " AccessFactoryGlobals.USER_TRANS_NAME);", "", "\t\ttry {", "\t\t\tcanStartOnlineBackup(t, true);", "\t\t\tbackup(t, new File(backupDir));", "\t\t}finally {", "\t\t\t// let the xactfatory know that backup is done, so that", "\t\t\t// it can allow backup blocking operations. ", "\t\t\txactFactory.backupFinished();", "\t\t}" ], "header": "@@ -478,11 +478,22 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "\t\tTransaction t = findUserTransaction(ContextService.getFactory().getCurrentContextManager(), ", "\t\t\t\t\t\t\t\t\t\t\tAccessFactoryGlobals.USER_TRANS_NAME);", "\t\tbackup(t, new File(backupDir));" ] }, { "added": [ "", "\t/**", "\t * Checks if the online backup can be started.", " *", "\t * A Consistent backup can not be made if there are any backup ", "\t * blocking operations (like unlogged operations) are in progress. ", "\t * Backup is allowed only in brand new transaction to avoid issues", "\t * like users starting a backup in the same transaction that has ", "\t * pending unlogged operations. ", "\t * ", "\t * @param wait if <tt>true</tt>, waits for all the backup blocking ", "\t * operation in progress to finish.", "\t * @return <tt>true</tt> if an online backup can be made.", "\t *\t\t\t <tt>false</tt> otherwise.", "\t * @exception StandardException if the transaction that is used ", "\t * to start the backup is not idle.", "\t */", "\tprivate boolean canStartOnlineBackup(Transaction t, boolean wait) ", "\t\tthrows StandardException {", "\t\t", "\t\t// check if the transaction is in the idle state", "\t\tif(!t.isIdle()) {", "\t\t\t// online backup can only be started in an IDLE transaction.", "\t\t\t// TODO : add the exception here. ", "\t\t}", "\t\t", "\t\t// check if there any backup blocking operations are in progress", "\t\t// and stop new ones from starting until the backup is completed.", "\t\treturn xactFactory.stopBackupBlockingOperations(wait); ", "\t}" ], "header": "@@ -797,6 +808,36 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/xact/Xact.java", "hunks": [ { "added": [ "\t// true, if the transaction executed some operations(like unlogged", "\t// operations) that block the online backup to prevent inconsistent", "\t// backup copy.", "\tprivate boolean inBackupBlockingState;" ], "header": "@@ -242,6 +242,10 @@ public class Xact extends RawTransaction implements Limit {", "removed": [] }, { "added": [ "\t\tinBackupBlockingState = false; ", "" ], "header": "@@ -281,6 +285,8 @@ public class Xact extends RawTransaction implements Limit {", "removed": [] }, { "added": [ "\t\t// any backup blocking operations (like unlogged ops) in this ", "\t\t// transaction are done with post commit/abort work by this time, ", "\t\t// change the transaction to unblock the backup state.", "\t\tsetUnblockBackupState();" ], "header": "@@ -1903,6 +1909,10 @@ public class Xact extends RawTransaction implements Limit {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java", "hunks": [ { "added": [ "", "\tprivate Object backupSemaphore = new Object();", "\tprivate long backupBlockingOperations = 0;", "\tprivate boolean inBackup = false;", "" ], "header": "@@ -97,7 +97,11 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup", "removed": [ "\t" ] } ] } ]
derby-DERBY-239-c10c4049
DERBY-304 submitted on behalf of Suresh Thalamati Fix : 1) Do not allow backup path to be any derby database directory. A directory is assumed to be a derby database directory if it has service.properties file in it. 2) copy files needed from the database home into the backup one by one instead of recursive copy from the top directory. 3) while copying the directories under jar directory, copy each sub directory separately without copying any subdirectories under them (There should not be any unless if user has created explicitly or created backup at that location). 4) Log and Seg0 directory are NOT already copied recursively, this was changed as part of online backup work (DERBY-239). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@379620 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/io/FileUtil.java", "hunks": [ { "added": [ " return copyDirectory( storageFactory, from, to, null, null, true);", "", " String[] filter, ", " boolean copySubDirs)" ], "header": "@@ -223,14 +223,16 @@ nextFile:\tfor (int i = 0; i < list.length; i++) {", "removed": [ " return copyDirectory( storageFactory, from, to, null, null);", " String[] filter)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/JarDDL.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.FileResource;" ], "header": "@@ -25,6 +25,7 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/RawStore.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.FileResource;" ], "header": "@@ -39,6 +39,7 @@ import org.apache.derby.iapi.services.i18n.MessageService;", "removed": [] }, { "added": [], "header": "@@ -98,17 +99,6 @@ import java.security.PrivilegedExceptionAction;", "removed": [ " ", " // files that should not be copied into the backup using simple ", " // directory copy or not needed in the backup at all. ", "\tprivate static final String[] BACKUP_FILTER =", "\t{ DataFactory.TEMP_SEGMENT_NAME, // not required to be in the backup", " DataFactory.DB_LOCKFILE_NAME, // not required to be in the backup", " DataFactory.DB_EX_LOCKFILE_NAME, // not required to be in the backup", " LogFactory.LOG_DIRECTORY_NAME, // written to the backup using log factory", " \"seg0\" // written to the backup using data factory", " };", "" ] }, { "added": [ " private boolean actionCopySubDirs;", " private static final int STORAGE_FILE_LIST_DIRECTORY_ACTION = 13;", " private static final int COPY_STORAGE_FILE_TO_REGULAR_ACTION = 14;", "" ], "header": "@@ -144,10 +134,13 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ " " ] }, { "added": [ "", " // check if a user has given the backup as a database directory by", " // mistake, backup path can not be a derby database directory. ", " // If a directory contains PersistentService.PROPERTIES_NAME, it ", " // is assumed as derby database directory because derby databases", " // always has this file. ", " ", " if (privExists(new File(backupDir, PersistentService.PROPERTIES_NAME))) { ", " throw StandardException.newException(", " SQLState.RAWSTORE_CANNOT_BACKUP_INTO_DATABASE_DIRECTORY,", " (File) backupDir); ", " }" ], "header": "@@ -579,6 +572,18 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [] }, { "added": [ " // create the backup database directory", " if (!privMkdirs(backupcopy))", " throw StandardException.newException(", " SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,", " (File) backupcopy);", " // if they are any jar file stored in the database, copy them into", " // the backup. ", " StorageFile jarDir = ", " storageFactory.newStorageFile(FileResource.JAR_DIRECTORY_NAME);", " if (privExists(jarDir)) {", "", " // find the list of schema directories under the jar dir and", " // then copy only the plain files under those directories. One could", " // just use the recursive copy of directory to copy all the files", " // under the jar dir, but the problem with that is if a user ", " // gives jar directory as the backup path by mistake, copy will ", " // fail while copying the backup dir onto itself in recursion", "", " String [] jarSchemaList = privList(jarDir);", " File backupJarDir = new File(backupcopy, ", " FileResource.JAR_DIRECTORY_NAME);", " // Create the backup jar directory", " if (!privMkdirs(backupJarDir))", " {", " throw StandardException.newException(", " SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,", " (File) backupJarDir);", " }", " for (int i = 0; i < jarSchemaList.length; i++)", " {", " StorageFile jarSchemaDir = ", " storageFactory.newStorageFile(jarDir, jarSchemaList[i]);", " File backupJarSchemaDir = new File(backupJarDir, jarSchemaList[i]);", " if (!privCopyDirectory(jarSchemaDir, backupJarSchemaDir, ", " (byte[])null, null, false)) {", " throw StandardException.", " newException(SQLState.RAWSTORE_ERROR_COPYING_FILE,", " jarSchemaDir, backupJarSchemaDir); ", " }", " }", " }", " // save service properties into the backup, Read in property ", " // from service.properties file, remove logDevice from it, ", " // then write it to the backup.", " StorageFile logdir = logFactory.getLogDirectory();", " ", " try {", " ", " String name = Monitor.getMonitor().getServiceName(this);", " PersistentService ps = Monitor.getMonitor().getServiceType(this);", " String fullName = ps.getCanonicalServiceName(name);", " Properties prop = ps.getServiceProperties(fullName, (Properties)null);", " StorageFile defaultLogDir = ", " storageFactory.newStorageFile( LogFactory.LOG_DIRECTORY_NAME);", "", " if (!logdir.equals(defaultLogDir)) ", " {", " prop.remove(Attribute.LOG_DEVICE);", " if (SanityManager.DEBUG)", " SanityManager.ASSERT(prop.getProperty(Attribute.LOG_DEVICE) == null,", " \"cannot get rid of logDevice property\");", " logHistory(historyFile,", " MessageService.getTextMessage(", " MessageId.STORE_EDITED_SERVICEPROPS));", " }", " ", " // save the service properties into the backup.", " ps.saveServiceProperties( backupcopy.getPath(), prop, false);", " }catch(StandardException se) {", " logHistory(historyFile,", " MessageService.getTextMessage(", " MessageId.STORE_ERROR_EDIT_SERVICEPROPS)", " + se);", " return; // skip the rest and let finally block clean up", " }", " // Incase of encrypted database and the key is an external ", " // encryption key, there is an extra file with name ", " // Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE , this file should be", " // copied in to the backup.", " StorageFile verifyKeyFile = ", " storageFactory.newStorageFile(", " Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE);", " if (privExists(verifyKeyFile)) {", " File backupVerifyKeyFile = ", " new File(backupcopy, Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE);", " if(!privCopyFile(verifyKeyFile, backupVerifyKeyFile))", " throw StandardException.", " newException(SQLState.RAWSTORE_ERROR_COPYING_FILE,", " verifyKeyFile, backupVerifyKeyFile); ", " }", " " ], "header": "@@ -638,61 +643,107 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "", " // copy the files that does not need any special handling and are ", " // needed to be in the database directory to the backup directory. ", " // See BACKUP_FILTER for all the files that are not copied ", " // to the database directory by the call below. After this copy ", " // information from log(transaction log), seg0(data segment) has ", " // to be copied into the backup from the database.", "\t\t\t", " if (!privCopyDirectory(dbase, backupcopy, (byte[])null, BACKUP_FILTER))", " throw StandardException.", " newException(SQLState.RAWSTORE_ERROR_COPYING_FILE,", " dbase, backupcopy);", "\t\t\t", "\t\t\tStorageFile logdir = logFactory.getLogDirectory();", "", "\t\t\t// munge service.properties file if necessary", "\t\t\tStorageFile defaultLogDir = storageFactory.newStorageFile( LogFactory.LOG_DIRECTORY_NAME);", "\t\t\tif (!logdir.equals(defaultLogDir))", "\t\t\t{", "\t\t\t\t// Read in property from service.properties file, remove", "\t\t\t\t// logDevice from it, then write it out again.", "\t\t\t\ttry", "\t\t\t\t{", "\t\t\t\t\tString name = Monitor.getMonitor().getServiceName(this);", "\t\t\t\t\tPersistentService ps = Monitor.getMonitor().getServiceType(this);", "\t\t\t\t\tString fullName = ps.getCanonicalServiceName(name);", "\t\t\t\t\tProperties prop = ps.getServiceProperties(fullName, (Properties)null);", "\t\t\t\t\tprop.remove(Attribute.LOG_DEVICE);", "\t\t\t\t\tif (SanityManager.DEBUG)", "\t\t\t\t\t\tSanityManager.ASSERT(prop.getProperty(Attribute.LOG_DEVICE) == null,", "\t\t\t\t\t\t\t\t\t\t\t \"cannot get rid of logDevice property\");", "\t\t\t\t\tps.saveServiceProperties( backupcopy.getCanonicalPath(), prop, true);", "\t\t\t\t\tlogHistory(historyFile,", " MessageService.getTextMessage(", " MessageId.STORE_EDITED_SERVICEPROPS));", "\t\t\t\t}", "\t\t\t\tcatch(StandardException se)", "\t\t\t\t{", "\t\t\t\t\tlogHistory(historyFile,", " MessageService.getTextMessage(", " MessageId.STORE_ERROR_EDIT_SERVICEPROPS)", " + se);", "\t\t\t\t\treturn; // skip the rest and let finally block clean up", "\t\t\t\t}", "\t\t\t}" ] }, { "added": [ "\t\treturn privCopyDirectory(from, to, (byte[])null, ", " (String[])null, true);" ], "header": "@@ -1124,7 +1175,8 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "\t\treturn privCopyDirectory(from, to, (byte[])null, (String[])null);" ] }, { "added": [ " private synchronized boolean privCopyDirectory(StorageFile from, ", " File to, ", " byte[] buffer, ", " String[] filter,", " boolean copySubdirs)", " actionCopySubDirs = copySubdirs;" ], "header": "@@ -1297,13 +1349,18 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ " private synchronized boolean privCopyDirectory( StorageFile from, File to, byte[] buffer, String[] filter)" ] }, { "added": [ " private synchronized boolean privCopyFile( StorageFile from, File to)", " {", " actionCode = COPY_STORAGE_FILE_TO_REGULAR_ACTION;", " actionStorageFile = from;", " actionRegularFile = to;", "", " try", " {", " Object ret = AccessController.doPrivileged( this);", " return ((Boolean) ret).booleanValue();", " }", " catch( PrivilegedActionException pae) { return false;} // does not throw an exception", " finally", " {", " actionStorageFile = null;", " actionRegularFile = null;", " }", " }", "", "" ], "header": "@@ -1364,6 +1421,26 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [] }, { "added": [ " private synchronized String[] privList(final StorageFile file)", " {", " actionCode = STORAGE_FILE_LIST_DIRECTORY_ACTION;", " actionStorageFile = file;", "", " try", " {", " return (String[]) AccessController.doPrivileged( this);", " }", " catch( PrivilegedActionException pae) { return null;} // does not throw an exception", " finally", " {", " actionStorageFile = null;", " }", " }", " ", "" ], "header": "@@ -1380,6 +1457,23 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [] }, { "added": [ " actionFilter,", " actionCopySubDirs));" ], "header": "@@ -1420,7 +1514,8 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ " actionFilter));" ] } ] } ]
derby-DERBY-239-fbb88668
committing onlinebackup_4.diff for DERBY-239. committing on behalf of Suresh Thalamati. This patch makes online backup call to wait/fail when unlogged operations like create index are pending. It also fixes derby-523 bug my making the existing log archive backup procedure to wait for the unlogged operation to complete. -- Two new procedures are added to allow the users to make backup wait/fail when unlogged operations are pending. -- prevents users starting backup in an non-idle transactions to avoid backup blocking forever if users starts backup in the same transaction as an unlogged operation. -- backup is not really transactional , to avoid any locking issues in the futures; backup procedures ends the transaction by implicitly doing commit when it is successful or rollback on any errors. A new backup test is added to store suite to test the above scenarios. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@354898 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/catalog/SystemProcedures.java", "hunks": [ { "added": [], "header": "@@ -46,7 +46,6 @@ import org.apache.derby.impl.sql.execute.JarDDL;", "removed": [ "import org.apache.derby.iapi.reference.SQLState;" ] } ] }, { "file": "java/engine/org/apache/derby/database/Database.java", "hunks": [ { "added": [ " /**", " * Backup the database to a backup directory. See online documentation", " * for more detail about how to use this feature.", " *", " * @param backupDir the directory name where the database backup should", " * go. This directory will be created if not it does not exist.", " * @param wait if <tt>true</tt>, waits for all the backup blocking ", " * operations in progress to finish.", " * @exception SQLException Thrown on error", " */", " public void backup(String backupDir, boolean wait) ", " throws SQLException;", "\t * Backup the database to a backup directory. See online documentation" ], "header": "@@ -72,19 +72,21 @@ public interface Database", "removed": [ "\t/**", "\t * Backup the database to a backup directory. See on line documentation", "\t * for more detail about how to use this feature.", "\t *", "\t * @param backupDir the directory name where the database backup should", "\t * go. This directory will be created if not it does not exist.", "\t *", "\t * @exception SQLException Thrown on error", "\t */", "\tpublic void backup(String backupDir) throws SQLException;", "\t * Backup the database to a backup directory. See on line documentation" ] }, { "added": [ " /**", " * Backup the database to a backup directory and enable the log archive", " * mode that will keep the archived log files required for roll-forward", " * from this version backup.", " *", " * @param backupDir The directory name where the ", " * database backup should go. This ", " * directory will be created if it ", " * does not exist.", " *", " * @param deleteOnlineArchivedLogFiles If true deletes online archived log", " * files that exist before this backup;", " * otherwise they will not be deleted. ", " *", " * Deletion will occur only after ", " * backup is complete.", " *", " * @param wait if <tt>true</tt>, waits for all ", " * the backup blocking operations in ", " * progress to finish.", " *", " * @exception SQLException Thrown on error", " */", " public void backupAndEnableLogArchiveMode(", " String backupDir,", " boolean deleteOnlineArchivedLogFiles,", " boolean wait) ", " throws SQLException;", " *", "\t * @param backupDir The directory name where the ", " * database backup should go. This ", " * directory will be created if it does", " * not exist.", " *", "\t * @param deleteOnlineArchivedLogFiles If true deletes online archived log", " * files that exist before this backup;", " * otherwise they will not be deleted. ", " *", "\t * Deletion will occur only after ", " * backup is complete.", " *", "\tpublic void backupAndEnableLogArchiveMode(", " File backupDir, ", " boolean deleteOnlineArchivedLogFiles) " ], "header": "@@ -96,38 +98,58 @@ public interface Database", "removed": [ "\t/**", "\t * Backup the database to a backup directory and enable the log archive", "\t * mode that will keep the archived log files required for roll-forward", "\t * from this version backup.", "\t * @param backupDir the directory name where the database backup should", "\t * go. This directory will be created if not it does not exist.", "\t * @param deleteOnlineArchivedLogFiles If true deletes online archived log files", "\t * that exist before this backup; otherwise they will not be deleted. ", "\t * Deletion will occur only after backup is complete.", "\t * @exception SQLException Thrown on error", "\t */", "", "\tpublic void backupAndEnableLogArchiveMode(String backupDir,", "\t\t\t\t\t\t\t\t\t\t\t boolean", "\t\t\t\t\t\t\t\t\t\t\t deleteOnlineArchivedLogFiles) ", "\t\tthrows SQLException;", "\t * @param backupDir the directory name where the database backup should", "\t * go. This directory will be created if not it does not exist.", "\t * @param deleteOnlineArchivedLogFiles If true deletes online archived log files", "\t * that exist before this backup; otherwise they will not be deleted. ", "\t * Deletion will occur only after backup is complete.", "\tpublic void backupAndEnableLogArchiveMode(File backupDir, ", "\t\t\t\t\t\t\t\t\t\t\t boolean", "\t\t\t\t\t\t\t\t\t\t\t deleteOnlineArchivedLogFiles) " ] } ] }, { "file": "java/engine/org/apache/derby/iapi/store/access/AccessFactory.java", "hunks": [ { "added": [ " * Backup the database to backupDir. ", " * <P>Please see cloudscape on line documentation on backup and restore.", " *", " * @param backupDir the name of the directory where the backup should be", " *\t\t stored.", " * @param wait if <tt>true</tt>, waits for all the backup blocking ", " * operations in progress to finish.", " *", " * @exception StandardException Thrown on error", " */", " public void backup(String backupDir, boolean wait) ", " throws StandardException;" ], "header": "@@ -230,15 +230,18 @@ public interface AccessFactory", "removed": [ "\t * Backup the database to backupDir. ", "\t * <P>Please see cloudscape on line documentation on backup and restore.", "\t *", "\t * @param backupDir the name of the directory where the backup should be", "\t *\t\tstored.", "\t *", "\t * @exception StandardException Thrown on error", "\t */", "\tpublic void backup(String backupDir) throws StandardException;" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java", "hunks": [ { "added": [ " * stored.", " * @param wait if <tt>true</tt>, waits for all the backup blocking ", " * operations in progress to finish.", " * ", " * @exception StandardException Thrown on error", " public void backup(", " String backupDir, ", " boolean wait) throws StandardException;" ], "header": "@@ -647,11 +647,15 @@ public interface RawStoreFactory extends Corruptable {", "removed": [ "\t *\t\tstored.", "\t *", "\t * @exception StandardException Thrown on error", "\tpublic void backup(String backupDir) throws StandardException;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/db/BasicDatabase.java", "hunks": [ { "added": [ " public void backup(String backupDir, boolean wait) ", " throws SQLException", " {", "\t\t\taf.backup(backupDir, wait);" ], "header": "@@ -328,16 +328,16 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\tpublic void backup(String backupDir) throws SQLException", "\t{", "\t\t\taf.backup(backupDir);", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ " // add 10.2 specific system procedures", " create_10_2_system_procedures(tc, sysUtilUUID);" ], "header": "@@ -8880,6 +8880,8 @@ public final class\tDataDictionaryImpl", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java", "hunks": [ { "added": [ " public void backup(", " String backupDir, ", " boolean wait) ", " throws StandardException", "\t\trawstore.backup(backupDir, wait);" ], "header": "@@ -926,9 +926,12 @@ public abstract class RAMAccessManager", "removed": [ "\tpublic void backup(String backupDir) throws StandardException", "\t\trawstore.backup(backupDir);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/RawStore.java", "hunks": [ { "added": [ " /**", " * Backup the database to a backup directory.", " * ", " * @param backupDir the name of the directory where the backup should be", " * stored. This directory will be created if it ", " * does not exist.", " * @param wait if <tt>true</tt>, waits for all the backup blocking ", " * operations in progress to finish.", " * @exception StandardException thrown on error", " */", " public void backup(String backupDir, boolean wait) ", " throws StandardException ", " {" ], "header": "@@ -460,8 +460,19 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "\tpublic void backup(String backupDir) throws StandardException", "\t{" ] }, { "added": [ " // check if there any backup blocking operations are in progress", " // and stop new ones from starting until the backup is completed.", " if (!xactFactory.stopBackupBlockingOperations(wait))", " {", " throw StandardException.newException(", " SQLState.BACKUP_BLOCKING_OPERATIONS_IN_PROGRESS); ", " }", "", " // perform backup", " backup(t, new File(backupDir));", " }finally {", " // let the xactfatory know that backup is done, so that", " // it can allow backup blocking operations. ", " xactFactory.backupFinished();", " }" ], "header": "@@ -487,13 +498,21 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "\t\t\tcanStartOnlineBackup(t, true);", "\t\t\tbackup(t, new File(backupDir));", "\t\t}finally {", "\t\t\t// let the xactfatory know that backup is done, so that", "\t\t\t// it can allow backup blocking operations. ", "\t\t\txactFactory.backupFinished();", "\t\t}" ] }, { "added": [ "\t * specified backup location without blocking any user operation for the ", "\t * duration of the backup. Stable copy is made of each page using using ", " * page level latches and in some cases with the help of monitors. ", " * Transaction log is also backed up, this is used to bring the database to ", " * the consistent state on restore.", "\tpublic synchronized void backup(", " Transaction t, ", " File backupDir) ", " throws StandardException" ], "header": "@@ -505,15 +524,18 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "\t * specified backup location without blocking any user operation for the ", "\t * whole duration of the backup. Stable copy is made using using page level", "\t * latches \tand in some cases with the help monitors. Transaction ", "\t * log is also backed up, this will help in bringing the databse to the", "\t * consistent state on restore.", "\tpublic synchronized void backup(Transaction t, File backupDir) throws StandardException" ] }, { "added": [], "header": "@@ -523,7 +545,6 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "" ] }, { "added": [ " /**", " * Backup the database to a backup directory and enable the log archive", "\t * mode that will keep the archived log files required for roll-forward", "\t * from this version backup.", " *", " * @param backupDir the name of the directory where the backup should be", " * stored. This directory will be created if it ", " * does not exist. ", " *", " * @param deleteOnlineArchivedLogFiles ", " * If true deletes online archived ", " * log files that exist before this backup, delete ", " * will occur only after the backup is complete.", " *", " * @param wait if <tt>true</tt>, waits for all the backup blocking ", " * operations in progress to finish.", " *", " * @exception StandardException thrown on error.", " */", " public void backupAndEnableLogArchiveMode(", " String backupDir,", " boolean deleteOnlineArchivedLogFiles,", " boolean wait) ", " boolean enabledLogArchive = false;", " boolean error = true;", " try {", " // Enable the log archive mode, if it is not already enabled.", " if(!logFactory.logArchived()) {", " logFactory.enableLogArchiveMode();", " enabledLogArchive = true ;", " }", "", " backup(backupDir, wait);", " ", " // After successful backup delete the archived log files", " // that are not necessary to do a roll-forward recovery", " // from this backup if requested.", " if (deleteOnlineArchivedLogFiles)", " {", " logFactory.deleteOnlineArchivedLogFiles();", " }", " error = false;", " } finally {", " // On any errors , disable the log archive, if it ", " // is enabled on this call. ", " if(error) {", " if (enabledLogArchive)", " logFactory.disableLogArchiveMode();", " }", " }" ], "header": "@@ -765,20 +786,58 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup", "removed": [ "", "\tpublic void backupAndEnableLogArchiveMode(String backupDir,boolean", "\t\t\t\t\t\t\t\t\t\t\t deleteOnlineArchivedLogFiles) ", "\t\tlogFactory.enableLogArchiveMode();", "\t\tbackup(backupDir);", "\t\t//After successful backup delete the archived log files", "\t\t//that are not necessary to do a roll-forward recovery", "\t\t//from this backup if requested.", "\t\tif(deleteOnlineArchivedLogFiles)", "\t\t{", "\t\t\tlogFactory.deleteOnlineArchivedLogFiles();", "\t\t}" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java", "hunks": [ { "added": [ "", "", " /**", " * Check if a file exists ?", " *", " * @param name the file's name.", " * @return <tt>\"true\"</tt> if the given file exists ", " * <tt>\"false\"</tt> otherwise.", " * @exception Exception if any exception occurs ", " */", " public static String fileExists(String fileName) throws Exception", " {", " File fl = new File(fileName);", " if(fl.exists()) {", " return \"true\";", " }else {", " return \"false\";", " }", " }", "", "", " /**", " *\tRemove a directory and all of its contents.", " * ", " * @param name the file's name.", " * @return <tt>true</tt> if the omplete directory was removed", " * <tt>false</tt> otherwise.f false is returned then some of ", " * the files in the directory may have been removed.", " */", "", "\tprivate static boolean removeDirectory(File directory) {", "", "\t\tif (directory == null)", "\t\t\treturn false;", "\t\tif (!directory.exists())", "\t\t\treturn true;", "\t\tif (!directory.isDirectory())", "\t\t\treturn false;", "", "\t\tString[] list = directory.list();", "", "\t\tif (list != null) {", "\t\t\tfor (int i = 0; i < list.length; i++) {", "\t\t\t\tFile entry = new File(directory, list[i]);", "", "\t\t\t\tif (entry.isDirectory())", "\t\t\t\t{", "\t\t\t\t\tif (!removeDirectory(entry))", "\t\t\t\t\t\treturn false;", "\t\t\t\t}", "\t\t\t\telse", "\t\t\t\t{", "\t\t\t\t\tif (!entry.delete())", "\t\t\t\t\t\treturn false;", "\t\t\t\t}", "\t\t\t}", "\t\t}", "", "\t\treturn directory.delete();", "\t}", "", " /**", " *\tRemove a directory and all of its contents.", " * ", " * @param name the file's name.", " * @return <tt>\"true\"</tt> if the omplete directory was removed", " * <tt>\"false\"</tt> otherwise.f false is returned then some of ", " * the files in the directory may have been removed.", " */", "", "\tpublic static String removeDirectory(String directory)", "\t{", "\t return (removeDirectory(new File(directory)) ? \"true\" : \"false\");", "\t}", " " ], "header": "@@ -66,6 +66,81 @@ public class FTFileUtil", "removed": [] } ] } ]
derby-DERBY-2397-14299573
DERBY-2397 (refactor) Move drop code for ConglomerateDescriptor into ConglomerateDescriptor.drop(). Add various comments from information gained while refactoring code and minor cleanup. One more dropping of a ConglomerateDescriptor needs to be modified to use the drop() method but requires some cleanup for DERBY-1343 git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@518343 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -21,12 +21,16 @@", "removed": [] }, { "added": [ " * ", " * A ConglomerateDescriptor can map to a base table, an index", " * or a index backing a constraint. Multiple ConglomerateDescriptors", " * can map to a single underlying store conglomerate, such as when", " * multiple index definitions share a physical file.", " * ", " * " ], "header": "@@ -37,12 +41,19 @@ import org.apache.derby.iapi.services.monitor.Monitor;", "removed": [] }, { "added": [ "\tprivate transient String[]\tcolumnNames;" ], "header": "@@ -53,7 +64,7 @@ public final class ConglomerateDescriptor extends TupleDescriptor", "removed": [ "\tprivate String[]\tcolumnNames;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java", "hunks": [ { "added": [], "header": "@@ -244,7 +244,6 @@ public class CreateIndexNode extends DDLStatementNode", "removed": [ " long \t\t\t\t\tconglomId = 0;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/CreateConstraintConstantAction.java", "hunks": [ { "added": [ "\t * <P>", "\t * A constraint is represented as:", "\t * <UL>", "\t * <LI> ConstraintDescriptor.", "\t * </UL>", "\t * If a backing index is required then the index will", "\t * be created through an CreateIndexConstantAction setup", "\t * by the compiler.", "\t * <BR>", "\t * Dependencies are created as:", "\t * <UL>", "\t * <LI> ConstraintDescriptor depends on all the providers collected", " * at compile time and passed into the constructor.", "\t * <LI> For a FOREIGN KEY constraint ConstraintDescriptor depends", " * on the ConstraintDescriptor for the referenced constraints", " * and the privileges required to create the constraint.", "\t * </UL>", "", "\t * @see ConstraintDescriptor", "\t * @see CreateIndexConstantAction" ], "header": "@@ -127,7 +127,26 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t *" ] }, { "added": [ " " ], "header": "@@ -214,7 +233,7 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [ "" ] }, { "added": [ "" ], "header": "@@ -226,6 +245,7 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [] }, { "added": [], "header": "@@ -259,10 +279,6 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\t// if no constraintId was specified, we should generate one. this handles", "\t\t// the two cases of Source creation and Target replication. At the source", "\t\t// database, we allocate a new UUID. At the Target, we just use the UUID that", "\t\t// the Source sent along." ] }, { "added": [ "\tboolean isForeignKeyConstraint()" ], "header": "@@ -417,7 +433,7 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\tpublic boolean isForeignKeyConstraint()" ] }, { "added": [], "header": "@@ -475,12 +491,6 @@ public class CreateConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t/**", "\t *\tGet the names of the columns touched by this constraint.", "\t *", "\t *\t@return\tthe array of touched column names.", "\t */", " public\tString[]\tgetColumnNames() { return columnNames; }" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java", "hunks": [ { "added": [ " * ConstantAction to create an index either through", " * a CREATE INDEX statement or as a backing index to", " * a constraint." ], "header": "@@ -61,9 +61,9 @@ import org.apache.derby.iapi.types.RowLocation;", "removed": [ " *\tThis class describes actions that are ALWAYS performed for a", " *\tCREATE TABLE Statement at Execution time.", " *" ] }, { "added": [], "header": "@@ -71,7 +71,6 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\tprivate long\t\t\tconglomId;" ] }, { "added": [ "\t *\tMake the ConstantAction to create an index." ], "header": "@@ -83,7 +82,7 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\t *\tMake the ConstantAction for a CREATE INDEX statement." ] }, { "added": [], "header": "@@ -91,7 +90,6 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\t * @param conglomId\tConglomerate ID of the index, if known in advance" ] }, { "added": [], "header": "@@ -105,7 +103,6 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\t\t\t\t\t\t\t\tlong\t\t\tconglomId," ] }, { "added": [], "header": "@@ -115,7 +112,6 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\t\tthis.conglomId= conglomId;" ] }, { "added": [ "\t *\tThis is the guts of the Execution-time logic for ", " * creating an index.", " *", " * <P>", " * A index is represented as:", " * <UL>", " * <LI> ConglomerateDescriptor.", " * </UL>", " * No dependencies are created.", " \t *", " * @see ConglomerateDescriptor", " * @see SchemaDescriptor" ], "header": "@@ -140,8 +136,18 @@ class CreateIndexConstantAction extends IndexConstantAction", "removed": [ "\t *\tThis is the guts of the Execution-time logic for CREATE INDEX.", "\t *" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java", "hunks": [ { "added": [], "header": "@@ -113,7 +113,6 @@ class DropIndexConstantAction extends IndexConstantAction", "removed": [ "\t\tDependencyManager dm = dd.getDependencyManager();" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java", "hunks": [ { "added": [], "header": "@@ -198,7 +198,6 @@ public class GenericConstantActionFactory", "removed": [ "\t * @param conglomId\tConglomerate ID of the index, if known in advance" ] }, { "added": [], "header": "@@ -213,7 +212,6 @@ public class GenericConstantActionFactory", "removed": [ "\t\tlong\t\t\tconglomId," ] }, { "added": [ "\t\t\t columnNames, isAscending, isConstraint," ], "header": "@@ -223,7 +221,7 @@ public class GenericConstantActionFactory", "removed": [ "\t\t\t conglomId, columnNames, isAscending, isConstraint," ] } ] } ]
derby-DERBY-2397-2d461fa6
DERBY-2397 (partial) Remove old unused drop all meta data statements method. Code is never called and has been copied into the upgrade code for use there. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@557301 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/db/BasicDatabase.java", "hunks": [ { "added": [], "header": "@@ -566,50 +566,6 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property", "removed": [ "\t/**", "\t * Drop all Stored Prepared Statements that", "\t * have been created for JDBC MetaData queries.", "\t * Does NOT commit the current transaction", "\t * upon completation. ", "\t *", "\t * @exception SQLException on error, most likely", "\t *\t\t\ta deadlock or timeout.", "\t */", "\tpublic void dropAllJDBCMetaDataSPSes() throws SQLException", "\t{", "\t\ttry", "\t\t{", "\t\t\tLanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();", "", "\t\t\tDataDictionary dd = lcc.getDataDictionary();", "", "\t\t\tTransactionController tc = lcc.getTransactionExecute();", "", "\t\t\t/*", "\t\t\t** Inform the data dictionary we are going", "\t\t\t** to perform some DDL", "\t\t\t*/", "\t\t\tdd.startWriting(lcc);", "", "\t\t\tfor (java.util.ListIterator li = dd.getAllSPSDescriptors().listIterator(); li.hasNext(); )", "\t\t\t{", "\t\t\t\tSPSDescriptor spsd = (SPSDescriptor) li.next();", "", "\t\t\t\t/*", "\t\t\t\t** Is it in SYS? if so, zap it. Can't drop metadata SPS in SYSIBM, JCC depends on it.", "\t\t\t\t*/", "\t\t\t\tif (spsd.getSchemaDescriptor().isSystemSchema() && !spsd.getSchemaDescriptor().isSYSIBM())", "\t\t\t\t{", "\t\t\t\t\tdd.dropSPSDescriptor(spsd, tc);", "\t\t\t\t\tdd.dropDependentsStoredDependencies(spsd.getUUID(), tc);", "\t\t\t\t}", "\t\t\t}", "\t\t} catch (StandardException se)", "\t\t{", "\t\t\tthrow PublicAPI.wrapStandardException(se);", "\t\t}", "\t}", "" ] } ] } ]
derby-DERBY-2397-4112e91a
DERBY-2397 (cleanup) Move drop code to SchemaDescriptor and AliasDescriptor and clean up various comments related to these objects. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@517756 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -21,7 +21,10 @@", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/SchemaDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.reference.SQLState;" ], "header": "@@ -21,10 +21,15 @@", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/CreateAliasConstantAction.java", "hunks": [ { "added": [ " *\tThis class performs actions that are ALWAYS performed for a", " * These SQL objects are stored in the SYS.SYSALIASES table and", " * represented as AliasDescriptors." ], "header": "@@ -39,9 +39,10 @@ import org.apache.derby.iapi.sql.execute.ConstantAction;", "removed": [ " *\tThis class describes actions that are ALWAYS performed for a", " * These SQL objects are stored in the SYS.SYSALIASES table." ] }, { "added": [ " * <P>", " * A routine (function or procedure) is represented as:", " * <UL>", " * <LI> AliasDescriptor", " * </UL>", " * Routine dependencies are created as:", " * <UL>", " * <LI> None", " * </UL>", " * ", " * <P>", " * A synonym is represented as:", " * <UL>", " * <LI> AliasDescriptor", " * <LI> TableDescriptor", " * </UL>", " * Synonym dependencies are created as:", " * <UL>", " * <LI> None", " * </UL>", " * ", " * In both cases a SchemaDescriptor will be created if", " * needed. No dependency is created on the SchemaDescriptor.", " * ", "\t * @see ConstantAction#executeConstantAction", " * @see AliasDescriptor", " * @see TableDescriptor", " * @see SchemaDescriptor" ], "header": "@@ -141,9 +142,34 @@ class CreateAliasConstantAction extends DDLConstantAction", "removed": [ " * Each will result in a row inserted into SYS.SYSALIASES.", "\t *", "\t *\t@see ConstantAction#executeConstantAction" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropAliasConstantAction.java", "hunks": [ { "added": [ " *\tThis class performs actions that are ALWAYS performed for a", " *\tDROP FUNCTION/PROCEDURE/SYNONYM statement at execution time.", " * All of these SQL objects are represented by an AliasDescriptor." ], "header": "@@ -21,23 +21,19 @@", "removed": [ "import org.apache.derby.catalog.AliasInfo;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;", "import org.apache.derby.iapi.sql.dictionary.TableDescriptor;", "import org.apache.derby.iapi.store.access.TransactionController;", " *\tThis class describes actions that are ALWAYS performed for a", " *\tDROP ALIAS Statement at Execution time." ] }, { "added": [], "header": "@@ -45,7 +41,6 @@ class DropAliasConstantAction extends DDLConstantAction", "removed": [ "\tprivate final String schemaName;" ] }, { "added": [], "header": "@@ -63,7 +58,6 @@ class DropAliasConstantAction extends DDLConstantAction", "removed": [ "\t\tthis.schemaName = sd.getSchemaName();" ] }, { "added": [], "header": "@@ -92,9 +86,6 @@ class DropAliasConstantAction extends DDLConstantAction", "removed": [ "\t\tTransactionController tc = lcc.getTransactionExecute();", "\t\tDependencyManager dm = dd.getDependencyManager();", "" ] }, { "added": [], "header": "@@ -107,11 +98,6 @@ class DropAliasConstantAction extends DDLConstantAction", "removed": [ "\t\tif (sd == null) {", "\t\t\tsd = dd.getSchemaDescriptor(schemaName, lcc.getTransactionExecute(), true);", "\t\t}", "", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.Activation;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;" ], "header": "@@ -21,25 +21,13 @@", "removed": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;", "import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;", "", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.store.access.TransactionController;", "", "import org.apache.derby.iapi.reference.SQLState;", "", "import org.apache.derby.iapi.sql.Activation;", "", "import org.apache.derby.catalog.UUID;", "" ] }, { "added": [], "header": "@@ -92,12 +80,8 @@ class DropSchemaConstantAction extends DDLConstantAction", "removed": [ "\t\tSchemaDescriptor\tsd;", "", "\t\tDependencyManager dm = dd.getDependencyManager();", "\t\tTransactionController tc = lcc.getTransactionExecute();" ] }, { "added": [ " SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);", " sd.drop(lcc);" ], "header": "@@ -110,50 +94,9 @@ class DropSchemaConstantAction extends DDLConstantAction", "removed": [ "\t\tsd = dd.getSchemaDescriptor(schemaName, null, true);", "", " //If user is attempting to drop SESSION schema and there is no physical SESSION schema, then throw an exception", " //Need to handle it this special way is because SESSION schema is also used for temporary tables. If there is no", " //physical SESSION schema, we internally generate an in-memory SESSION schema in order to support temporary tables", " //But there is no way for the user to access that in-memory SESSION schema. Following if will be true if there is", " //no physical SESSION schema and hence getSchemaDescriptor has returned an in-memory SESSION schema", " if (schemaName.equals(SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME) && (sd != null) && (sd.getUUID() == null))", "\t\t\tthrow StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schemaName);", "", "\t\t/*", "\t\t** Make sure the schema is empty.", "\t\t** In the future we want to drop everything", "\t\t** in the schema if it is CASCADE.", "\t\t*/", "\t\tif (!dd.isSchemaEmpty(sd))", "\t\t{", "\t\t\tthrow StandardException.newException(SQLState.LANG_SCHEMA_NOT_EMPTY, schemaName);", "\t\t} ", "", "\t\t/* Prepare all dependents to invalidate. (This is there chance", "\t\t * to say that they can't be invalidated. For example, an open", "\t\t * cursor referencing a table/view that the user is attempting to", "\t\t * drop.) If no one objects, then invalidate any dependent objects.", "\t\t * We check for invalidation before we drop the table descriptor", "\t\t * since the table descriptor may be looked up as part of", "\t\t * decoding tuples in SYSDEPENDS.", "\t\t */", "\t\tdm.invalidateFor(sd, DependencyManager.DROP_SCHEMA, lcc);", "", "\t\tdd.dropSchemaDescriptor(schemaName, tc);", "\t\t/*", "\t\t** If we have dropped the current default schema,", "\t\t** then we will set the default to null. The", "\t\t** LCC is free to set the new default schema to ", "\t \t** some system defined default.", "\t\t*/", "\t\tsd = lcc.getDefaultSchema();", "\t\tif ((sd != null) &&", "\t\t\tschemaName.equals(sd.getSchemaName()))", "\t\t{", "\t\t\tlcc.setDefaultSchema((SchemaDescriptor)null);", "\t\t}" ] } ] } ]
derby-DERBY-2397-9213b423
DERBY-2397 (partial) Move the drop logic for TriggerDecsriptor and ViewDescriptor to be centralized in each class as an instance method. The methods do not yet have a common signature, more investigation is needed for the ViewDescriptor's relationship to its TableDescriptor. Added some comments to CreateViewNode to describe the set of descriptors and dependencies it creates. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@514416 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.Activation;", "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -30,12 +30,14 @@ import java.sql.Timestamp;", "removed": [] }, { "added": [ " drop(lcc);" ], "header": "@@ -702,10 +704,7 @@ public class TriggerDescriptor extends TupleDescriptor", "removed": [ "\t\t\t\tDropTriggerConstantAction.dropTriggerDescriptor(", "\t\t\t\t\tlcc, getDataDictionary().getDependencyManager(),", "\t\t\t\t\tgetDataDictionary(), lcc.getTransactionExecute(), this,", "\t\t\t\t\tnull);" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ "\t\t\t\tdrop(lcc, ", "\t\t\t\t\t\tgetDataDictionary().getTableDescriptor(uuid));" ], "header": "@@ -337,11 +337,9 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [ "\t\t\t\tdropViewWork(getDataDictionary(), ", "\t\t\t\t\t\tgetDataDictionary().getDependencyManager(), lcc,", "\t\t\t\t\t\tlcc.getTransactionExecute(), ", "\t\t\t\t\t\tgetDataDictionary().getTableDescriptor(uuid), false);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java", "hunks": [ { "added": [ " * A view is represented as:", " * <UL>", " * <LI> TableDescriptor with the name of the view and type VIEW_TYPE", " * <LI> Set of ColumnDescriptor's for the column names and types", " * <LI> ViewDescriptor describing the SQL query that makes up the view.", " * </UL>", " * Dependencies are created as:", " * <UL>", " * <LI> ViewDescriptor depends on the Providers that its compiled", " * query depends on.", " * <LI> ViewDescriptor depends on the privileges required to execute the view.", " * </UL>", " * Note there are no dependencies created between the ViewDescriptor, TableDecriptor", " * and the ColumnDescriptor's." ], "header": "@@ -51,6 +51,20 @@ import org.apache.derby.catalog.UUID;", "removed": [] }, { "added": [ "\t * @param tableName\tName of view.", "\t * @param tableType\tType of table (ie. TableDescriptor.VIEW_TYPE)." ], "header": "@@ -72,14 +86,13 @@ class CreateViewConstantAction extends DDLConstantAction", "removed": [ "\t * @param tableName\tName of table.", "\t * @param tableType\tType of table (e.g., BASE).", "\t *\t\t (REMIND tableDescriptor ignored)" ] }, { "added": [ "\t *\tThis is the guts of the Execution-time logic for CREATE VIEW." ], "header": "@@ -117,7 +130,7 @@ class CreateViewConstantAction extends DDLConstantAction", "removed": [ "\t *\tThis is the guts of the Execution-time logic for CREATE TABLE." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropTriggerConstantAction.java", "hunks": [ { "added": [], "header": "@@ -89,8 +89,6 @@ public class DropTriggerConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\tDependencyManager dm = dd.getDependencyManager();", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java", "hunks": [ { "added": [], "header": "@@ -101,8 +101,6 @@ class DropViewConstantAction extends DDLConstantAction", "removed": [ "\t\tDependencyManager dm = dd.getDependencyManager();", "\t\tTransactionController tc = lcc.getTransactionExecute();" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java", "hunks": [ { "added": [ "\t * @param tableType\tType of table (in this case TableDescriptor.VIEW_TYPE)." ], "header": "@@ -314,7 +314,7 @@ public class GenericConstantActionFactory", "removed": [ "\t * @param tableType\tType of table (e.g., BASE)." ] } ] } ]
derby-DERBY-2397-997ee7f3
DERBY-2397 (partial) Move drop code for constraints and indexes into their descriptors as drop() methods instead of static methods in constant actions. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@539071 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/CheckConstraintDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -22,8 +22,11 @@", "removed": [] }, { "added": [ "\tprivate ReferencedColumns\treferencedColumns;", "\tprivate String\t\t\t\t\t\tconstraintText;" ], "header": "@@ -31,8 +34,8 @@ import org.apache.derby.iapi.sql.StatementType;", "removed": [ "\tReferencedColumns\treferencedColumns;", "\tString\t\t\t\t\t\tconstraintText;" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -35,8 +35,7 @@ import org.apache.derby.catalog.Dependable;", "removed": [ "", "import org.apache.derby.impl.sql.execute.DropConstraintConstantAction;" ] }, { "added": [ "\t\t\tdrop(lcc, true);" ], "header": "@@ -607,13 +606,7 @@ public abstract class ConstraintDescriptor", "removed": [ "\t\t\tDropConstraintConstantAction.dropConstraintAndIndex(", "\t\t\t\t\tgetDataDictionary().getDependencyManager(),", "\t\t\t\t\ttable,", "\t\t\t\t\tgetDataDictionary(),", "\t\t\t\t\tthis,", "\t\t\t\t\tlcc.getTransactionExecute(),", "\t\t\t\t\tlcc, true);" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java", "hunks": [ { "added": [ "\t * Drops the given ConstraintDescriptor from the data dictionary." ], "header": "@@ -808,8 +808,7 @@ public interface DataDictionary", "removed": [ "\t * Drops the given ConstraintDescriptor that is associated", "\t * with the given table and constraint type from the data dictionary." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ "\t * Drops the given ConstraintDescriptor from the data dictionary.", "\tpublic void\tdropConstraintDescriptor(" ], "header": "@@ -4944,17 +4944,14 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * Drops the given ConstraintDescriptor that is associated", "\t * with the given table and constraint type from the data dictionary.", "\t * @param table\tThe table from which to drop the", "\t *\t\t\tconstraint descriptor", "\tpublic void\tdropConstraintDescriptor(TableDescriptor table," ] }, { "added": [ "\t\t\tdropConstraintDescriptor(cd, tc);" ], "header": "@@ -5015,7 +5012,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\tdropConstraintDescriptor(table, cd, tc);" ] }, { "added": [ "\t\t\t\t\tcalendarForLastSystemSQLName.setTimeInMillis(timeNow);" ], "header": "@@ -8223,7 +8220,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\tcalendarForLastSystemSQLName.setTime(new Date(timeNow));" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java", "hunks": [ { "added": [ "\t\t\t\t\tdd.dropConstraintDescriptor(cd, tc);" ], "header": "@@ -836,7 +836,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\tdd.dropConstraintDescriptor(td, cd, tc);" ] }, { "added": [ " cd.drop(lcc, true);" ], "header": "@@ -870,8 +870,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\tDropConstraintConstantAction.dropConstraintAndIndex(dm, td, dd,", "\t\t\t\t\t\t\t cd, tc, lcc, true);" ] }, { "added": [ "\t\t\tcd.drop(lcc, false);" ], "header": "@@ -881,8 +880,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\tDropConstraintConstantAction.dropConstraintAndIndex(", " dm, td, dd, cd, tc, lcc, false);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java", "hunks": [ { "added": [ " conDesc.drop(lcc, !cascadeOnRefKey);" ], "header": "@@ -227,7 +227,7 @@ public class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\tdropConstraintAndIndex(dm, td, dd, conDesc, tc, lcc, !cascadeOnRefKey);" ] }, { "added": [ "\t\t\t\tfkcd.drop(lcc, true);" ], "header": "@@ -243,8 +243,7 @@ public class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\t\t\tdropConstraintAndIndex(dm, fkcd.getTableDescriptor(), dd, fkcd,", "\t\t\t\t\t\t\t\ttc, lcc, true);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java", "hunks": [ { "added": [ "\t\t\tcd.drop(lcc, true);" ], "header": "@@ -312,8 +312,7 @@ class DropTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\tDropConstraintConstantAction.dropConstraintAndIndex(dm, td, dd, cd, ", "\t\t\t\t\t\ttc, lcc, true);" ] }, { "added": [ "\t\t\tcd.drop(lcc, false);" ], "header": "@@ -344,8 +343,7 @@ class DropTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\tDropConstraintConstantAction.dropConstraintAndIndex(dm, td, dd, cd, ", "\t\t\t\t\t\ttc, lcc, false);" ] } ] }, { "file": "java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java", "hunks": [ { "added": [ "\tpublic void dropConstraintDescriptor(", " ConstraintDescriptor descriptor, TransactionController tc)" ], "header": "@@ -320,8 +320,8 @@ public class EmptyDictionary implements DataDictionary, ModuleSupportable {", "removed": [ "\tpublic void dropConstraintDescriptor(TableDescriptor table,", "\t\t\tConstraintDescriptor descriptor, TransactionController tc)" ] } ] } ]
derby-DERBY-2397-c2a81618
DERBY-2397 (refactor) Refactor the implementation of the SQLJ routines (INSTALL_JAR, REMOVE_JAR and REPLACE_JAR) so that the methods for the system procedures directly call the code to install, remove or replace a jar file. Previously these routines created ConstantActions and executed those, resulting in four extra classes that just routed the procedures to the real code. Since these executions are not DDL statements they should not use ConstantAction, no Activation was available (since no compilation) which meant that executeConstantAction() was called with null which is not the intended api for a ConstantAction. This resulted in NPEs if modifying code in these jar constant action to use the activation as might be expected from looking at other ConstantAction implementations. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@517770 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/catalog/SystemProcedures.java", "hunks": [ { "added": [ "import java.sql.DatabaseMetaData;", "import java.sql.ResultSet;", "import java.util.StringTokenizer;", "import org.apache.derby.iapi.reference.SQLState;", "import org.apache.derby.iapi.services.i18n.MessageService;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.util.IdUtil;", "import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;", "import org.apache.derby.impl.jdbc.Util;", "import org.apache.derby.impl.load.Export;", "import org.apache.derby.impl.load.Import;", "import org.apache.derby.impl.sql.execute.JarUtil;", "import org.apache.derby.jdbc.InternalDriver;" ], "header": "@@ -21,34 +21,30 @@", "removed": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "", "import org.apache.derby.iapi.services.i18n.MessageService;", "import org.apache.derby.iapi.error.PublicAPI;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.reference.SQLState;", "import java.sql.ResultSet;", "import java.sql.DatabaseMetaData;", "import java.util.StringTokenizer;", "import org.apache.derby.jdbc.InternalDriver;", "import org.apache.derby.impl.jdbc.Util;", "import org.apache.derby.impl.load.Export;", "import org.apache.derby.impl.load.Import;", "import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;", "", "import org.apache.derby.impl.sql.execute.JarDDL;", "import org.apache.derby.iapi.util.IdUtil;" ] }, { "added": [ " ", " LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();", "\t\t\tString schemaName;", "\t\t\tString sqlName;", " ", " if (st.length == 1)", " {", "\t\t\t\tschemaName = lcc.getCurrentSchemaName();", " }", " else", " {", " schemaName = st[0];", " ", " JarUtil.install(lcc, schemaName, sqlName, url);" ], "header": "@@ -969,26 +965,28 @@ public class SystemProcedures {", "removed": [ "\t\t\tString schemaName = null;", "\t\t\tString sqlName = null;", "", "\t\t\tswitch (st.length) {", "\t\t\tcase 1:", "\t\t\t\tschemaName = null;", "\t\t\t\tbreak;", "\t\t\tcase 2:", "\t\t\t\tschemaName = st[0];", "\t\t\tdefault:", "\t\t\t\t; // RESOLVE", "\t\t\tJarDDL.add(schemaName, sqlName, url);" ] }, { "added": [ " ", " LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();", " String schemaName;", " String sqlName;", " ", " if (st.length == 1)", " {", " schemaName = lcc.getCurrentSchemaName();", " sqlName = st[0];", " }", " else", " {", " schemaName = st[0];", " sqlName = st[1];", " }", " ", " JarUtil.replace(lcc,", " schemaName, sqlName, url);" ], "header": "@@ -1009,26 +1007,29 @@ public class SystemProcedures {", "removed": [ "\t\t\tString schemaName = null;", "\t\t\tString sqlName = null;", "", "\t\t\tswitch (st.length) {", "\t\t\tcase 1:", "\t\t\t\tschemaName = null;", "\t\t\t\tsqlName = st[0];", "\t\t\t\tbreak;", "\t\t\tcase 2:", "\t\t\t\tschemaName = st[0];", "\t\t\t\tsqlName = st[1];", "\t\t\tdefault:", "\t\t\t\t; // RESOLVE", "\t\t\t}", "\t\t\tJarDDL.replace(schemaName, sqlName, url);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/db/BasicDatabase.java", "hunks": [ { "added": [ "import org.apache.derby.impl.sql.execute.JarUtil;" ], "header": "@@ -69,6 +69,7 @@ import org.apache.derby.iapi.services.property.PropertySetCallback;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/JarUtil.java", "hunks": [ { "added": [ "import java.io.FileInputStream;", "import java.io.IOException;", "import java.io.InputStream;", "import java.net.MalformedURLException;", "import java.net.URL;", "import java.security.AccessController;", "import java.security.PrivilegedActionException;", "", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.reference.SQLState;", "import org.apache.derby.iapi.services.property.PropertyUtil;", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.util.IdUtil;", "public class JarUtil", " private LanguageConnectionContext lcc;", "\t", "\tprivate JarUtil(LanguageConnectionContext lcc,", " String schemaName, String sqlName)", " this.lcc = lcc;", "\t install a jar file to the current connection's database." ], "header": "@@ -21,64 +21,60 @@", "removed": [ "import org.apache.derby.iapi.util.IdUtil;", "import org.apache.derby.impl.sql.execute.JarDDL;", "import org.apache.derby.iapi.services.property.PropertyUtil;", "import org.apache.derby.iapi.services.context.ContextService;", "import org.apache.derby.iapi.services.sanity.SanityManager;", "import org.apache.derby.iapi.error.StandardException;", "", "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.reference.SQLState;", "import org.apache.derby.catalog.UUID;", "", "import java.io.FileInputStream;", "import java.io.IOException;", "import java.io.InputStream;", "import java.net.MalformedURLException;", "import java.net.URL;", "import java.security.AccessController;", "import java.security.PrivilegedActionException;", "class JarUtil", "\tprivate LanguageConnectionContext lcc;", "\tprivate JarUtil(String schemaName, String sqlName)", " lcc = (LanguageConnectionContext)", "\t\t\tContextService.getContext(LanguageConnectionContext.CONTEXT_ID);", "\t Add a jar file to the current connection's database." ] }, { "added": [ "\tpublic static long", "\tinstall(LanguageConnectionContext lcc,", " String schemaName, String sqlName, String externalPath)", "\t\tJarUtil jutil = new JarUtil(lcc, schemaName, sqlName);" ], "header": "@@ -87,11 +83,12 @@ class JarUtil", "removed": [ "\tstatic long", "\tadd(String schemaName, String sqlName, String externalPath)", "\t\tJarUtil jutil = new JarUtil(schemaName, sqlName);" ] }, { "added": [ " final String jarExternalName = JarUtil.mkExternalName(schemaName," ], "header": "@@ -130,7 +127,7 @@ class JarUtil", "removed": [ " final String jarExternalName = JarDDL.mkExternalName(schemaName," ] }, { "added": [ "\tpublic static void", "\tdrop(LanguageConnectionContext lcc, String schemaName, String sqlName)", "\t\tJarUtil jutil = new JarUtil(lcc, schemaName,sqlName);" ], "header": "@@ -155,11 +152,11 @@ class JarUtil", "removed": [ "\tstatic void", "\tdrop(String schemaName, String sqlName)", "\t\tJarUtil jutil = new JarUtil(schemaName,sqlName);" ] }, { "added": [ "\t\t\tfr.remove(JarUtil.mkExternalName(schemaName, sqlName, fr.getSeparatorChar())," ], "header": "@@ -211,7 +208,7 @@ class JarUtil", "removed": [ "\t\t\tfr.remove(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar())," ] }, { "added": [ "\tpublic static long", "\treplace(LanguageConnectionContext lcc, String schemaName, String sqlName,", "\t\tJarUtil jutil = new JarUtil(lcc, schemaName,sqlName);" ], "header": "@@ -230,12 +227,12 @@ class JarUtil", "removed": [ "\tstatic long", "\treplace(String schemaName, String sqlName,", "\t\tJarUtil jutil = new JarUtil(schemaName,sqlName);" ] }, { "added": [ " JarUtil.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());" ], "header": "@@ -280,7 +277,7 @@ class JarUtil", "removed": [ " JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/ReplaceJarConstantAction.java", "hunks": [ { "added": [], "header": "@@ -1,88 +0,0 @@", "removed": [ "/*", "", " Derby - Class org.apache.derby.impl.sql.execute.ReplaceJarConstantAction", "", " Licensed to the Apache Software Foundation (ASF) under one or more", " contributor license agreements. See the NOTICE file distributed with", " this work for additional information regarding copyright ownership.", " The ASF licenses this file to you under the Apache License, Version 2.0", " (the \"License\"); you may not use this file except in compliance with", " the License. You may obtain a copy of the License at", "", " http://www.apache.org/licenses/LICENSE-2.0", "", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", "", " */", "", "package org.apache.derby.impl.sql.execute;", "", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.sql.Activation;", "import org.apache.derby.iapi.sql.execute.ConstantAction;", "/**", " *\tConstant action to Add an external Jar file to a database. ", " *", " */", "class ReplaceJarConstantAction extends DDLConstantAction", "{", "\tprivate final String schemaName;", "\tprivate final String sqlName;", "\tprivate final String externalPath;", "\t//////////////////////////////////////////////////////////////", "\t//", "\t// CONSTRUCTORS", "\t//", "\t//////////////////////////////////////////////////////////////", "", "\t/**", "\t *\tMake the ConstantAction to replace a jar file in a database.", "\t *", "\t *\t@param\tschemaName\t\t\tThe SchemaName for the jar file.", "\t *\t@param\tsqlName\t\t\t The sqlName for the jar file.", "\t * @param externalPath The name of the file that holds the jar.", "\t */", "\tReplaceJarConstantAction(", "\t\t\t\t\t\t\t\t\tString schemaName,", "\t\t\t\t\t\t\t\t\tString sqlName,", "\t\t\t\t\t\t\t\t\tString externalPath)", "\t{", "\t\tthis.schemaName = schemaName;", "\t\tthis.sqlName = sqlName;", "\t\tthis.externalPath = externalPath;", "\t}", "", "\t//////////////////////////////////////////////////////////////", "\t//", "\t// OBJECT SHADOWS", "\t//", "\t//////////////////////////////////////////////////////////////", "", "\tpublic\tString\ttoString()", "\t{", "\t\t// Do not put this under SanityManager.DEBUG - it is needed for", "\t\t// error reporting.", "\t\treturn \"REPLACE JAR FILE \" + schemaName + \".\" + sqlName;", "\t}", "", "\t//////////////////////////////////////////////////////////////", "\t//", "\t// CONSTANT ACTION METHODS", "\t//", "\t//////////////////////////////////////////////////////////////", "\t/**", "\t * @see ConstantAction#executeConstantAction", "\t * @exception StandardException Thrown on failure", "\t */", "\tpublic void\texecuteConstantAction( Activation activation )", "\t\t\t\t\t\tthrows StandardException", "\t{", "\t\tJarUtil.replace(schemaName,", "\t\t\t\t\t\t\t\t\t sqlName,", "\t\t\t\t\t\t\t\t\t externalPath);", "\t}", "}" ] } ] } ]
derby-DERBY-2402-f9a06892
DERBY-5459 Result set metadata are out of sync on client after underlying table is altered Patch derby-5459-3. We now resend the result set metadata to the client when the cursor is opened if the prepared statement gets recompiled due to it being out of date when the server tries to execute it (DRDAConnThread line 871). To detect this we introduce a version counter which is incremented each time a statement is (re)compiled and make a note which version's metadata gets sent to the client as part of the explicit prepare. That version is compared with the current version when we execute to make the decision whether to resend metadata or not. This also fixes DERBY-2402, a duplicate. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1205426 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java", "hunks": [ { "added": [ " database.getCurrentStatement().sqldaType = sqldaType;" ], "header": "@@ -828,6 +828,7 @@ class DRDAConnThread extends Thread {", "removed": [] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/DRDAStatement.java", "hunks": [ { "added": [ " /**", " * If this changes, we need to re-send result set metadata to client, since", " * a change indicates the engine has recompiled the prepared statement.", " */", " long versionCounter;", "", " /**", " * Saved value returned from {@link DRDAConnThread#from", " * parsePRPSQLSTT}. Used to determine if the statment is such that we may", " * need to re-send metadata at execute time, see {@link #versionCounter}.", " */", " int sqldaType;", "" ], "header": "@@ -284,6 +284,19 @@ class DRDAStatement", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java", "hunks": [ { "added": [ " /**", " * Incremented for each (re)compile.", " */", " private long versionCounter;", "" ], "header": "@@ -173,6 +173,11 @@ public class GenericPreparedStatement", "removed": [] } ] } ]
derby-DERBY-2404-166c2728
DERBY-2404: Remove hardcoded hostname / port in BadConnectionTest, get the hostname and port from TestConfiguration at setUp time instead. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@515297 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2417-7a9732b4
Add a test fixture to CursorTest that tests Statement.setCursorName only effects the next execution. Doesn't work on client due to DERBY-2417. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@516075 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-2418-9e3ce38b
DERBY-2418: testProtocol should not use a hardcoded port number Committed for Julius Stroffek <Julius.Stroffek@sun.com> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@521977 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/TestFile.java", "hunks": [ { "added": [ "import org.apache.derby.drda.NetworkServerControl;" ], "header": "@@ -21,6 +21,7 @@", "removed": [] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/TestProto.java", "hunks": [ { "added": [ " private int port;", "\t// constructors", " public TestProto(String filename, int port) ", " {", " this.port = port;" ], "header": "@@ -129,11 +129,13 @@ public class TestProto {", "removed": [ "\t// constructor", "\tpublic TestProto(String filename) ", "\t{" ] }, { "added": [ " }" ], "header": "@@ -153,8 +155,8 @@ public class TestProto {", "removed": [ "\t}" ] }, { "added": [ " \tString hostName=getHostName();", " try {" ], "header": "@@ -179,10 +181,9 @@ public class TestProto {", "removed": [ " \tString hostName=getHostName();", " try", "\t\t{" ] } ] } ]
derby-DERBY-2419-530c8771
DERBY-2419: Tighten encapsulation of state in TestConfiguration Made port and hostname private, and adjusted affected tests. Introduced DerbyConstants to hold constants used by/in the JUnit tests. Patch file: derby-2419-3a-further_encapsulation.diff git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@955529 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ " private final static int DEFAULT_PORT = 1527;", " private final static String DEFAULT_HOSTNAME = \"localhost\";" ], "header": "@@ -65,10 +65,9 @@ public class TestConfiguration {", "removed": [ " public final static int DEFAULT_PORT = 1527;", " public final static String DEFAULT_HOSTNAME = \"localhost\";", " public final static String DEFAULT_SSL = \"off\";" ] }, { "added": [], "header": "@@ -93,8 +92,6 @@ public class TestConfiguration {", "removed": [ " ", " public final static String TEST_DBO = \"TEST_DBO\";" ] }, { "added": [ " DerbyConstants.TEST_DBO, \"dummy\"); // DRDA doesn't like empty pw" ], "header": "@@ -830,7 +827,7 @@ public class TestConfiguration {", "removed": [ " TEST_DBO, \"dummy\"); // DRDA doesn't like empty pw" ] }, { "added": [ " DerbyConstants.TEST_DBO," ], "header": "@@ -866,7 +863,7 @@ public class TestConfiguration {", "removed": [ " TEST_DBO," ] }, { "added": [ " usersWithDBO[0] = DerbyConstants.TEST_DBO;" ], "header": "@@ -891,7 +888,7 @@ public class TestConfiguration {", "removed": [ " usersWithDBO[0] = TEST_DBO;" ] } ] } ]
derby-DERBY-2419-6264d1e3
DERBY-2419: Refactor some code in TestConfiguration so that SecureServerTest does not need to access TestConfiguration constants which ought to be private. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@519945 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ "" ], "header": "@@ -255,6 +255,7 @@ public class TestConfiguration {", "removed": [] }, { "added": [ " {", " Test test = new NetworkServerTestSetup(suite, false);", " ", " return defaultServerDecorator(test);", " }", " ", " /**", " * Decorate a test to use suite's default host and port.", " */", " public static Test defaultServerDecorator(Test test)", "", " //", " // This looks bogus to me. Shouldn't this get the hostname and port", " // which are specific to this test run (perhaps overridden on the", " // command line)?", " //" ], "header": "@@ -268,15 +269,28 @@ public class TestConfiguration {", "removed": [ " ", " Test test = new NetworkServerTestSetup(suite, false);", " " ] } ] } ]
derby-DERBY-2427-497f79d9
DERBY-2427: Disable ClobStoredProcedureTest and BlobStoredProcedureTest for weme6.1 since they are intended for client/server testing and weme6.1 is not currently supported for that framework. Contributed by: V. Narayanan (v.narayanan@sun.com) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@519190 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-243-1d2a5693
DERBY-243 Change connection toString to print connection id contributed by David Van Couvering git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@189704 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ " ", " /** Cached string representation of the connection id */", " private String idString;" ], "header": "@@ -143,6 +143,9 @@ public class EmbedConnection implements java.sql.Connection", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java", "hunks": [ { "added": [ " /** Static counter for connection ids */", " private static int idCounter = 0;", " ", " /** The id for this connection. */", " private int connectionId;", " ", " /** String representation of id */", " private String idString;", " " ], "header": "@@ -57,6 +57,15 @@ import javax.sql.ConnectionEvent;", "removed": [] }, { "added": [ " ", " private synchronized int nextId()", " {", " return idCounter++;", " }", " connectionId = nextId();", "" ], "header": "@@ -74,9 +83,16 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne", "removed": [] } ] } ]
derby-DERBY-2432-cccf5dda
DERBY-2432: Implement transaction timeout for XA transactions Contributed by Julius Stroffek. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@547674 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/NetXACallInfo.java", "hunks": [ { "added": [ " /** XA transaction timeout in milliseconds. The value less than 0 means", " * that the time out is not specified. The value 0 means infinite timeout. */", " long xaTimeoutMillis_;" ], "header": "@@ -45,6 +45,9 @@ import org.apache.derby.client.am.Connection;", "removed": [] }, { "added": [ " xaTimeoutMillis_ = -1;" ], "header": "@@ -74,6 +77,7 @@ public class NetXACallInfo {", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/net/NetXAConnectionRequest.java", "hunks": [ { "added": [ " long xaTimeout = callInfo.xaTimeoutMillis_;" ], "header": "@@ -53,6 +53,7 @@ public class NetXAConnectionRequest extends NetResultSetRequest {", "removed": [] }, { "added": [ " // Check whether the timeout value was specified.", " // Value less than 0 means no timeout is specified.", " if (xaTimeout >= 0) {", " writeXATimeout(CodePoint.TIMEOUT, xaTimeout);", " }" ], "header": "@@ -72,6 +73,11 @@ public class NetXAConnectionRequest extends NetResultSetRequest {", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/net/NetXAResource.java", "hunks": [ { "added": [ " /** The value of the transaction timeout in seconds. */", " private int timeoutSeconds = 0;", "" ], "header": "@@ -113,6 +113,9 @@ public class NetXAResource implements XAResource {", "removed": [] }, { "added": [ " * Obtain the current transaction timeout value set for this XAResource", " * instance. If XAResource.setTransactionTimeout was not use prior to", " * invoking this method, the return value is 0; otherwise, the value", " * used in the previous setTransactionTimeout call is returned.", " * @return the transaction timeout value in seconds. If the returned value", " * is equal to Integer.MAX_VALUE it means no timeout." ], "header": "@@ -312,14 +315,13 @@ public class NetXAResource implements XAResource {", "removed": [ " * Obtain the current transaction timeout value set for this XAResource instance. If", " * <CODE>XAResource.setTransactionTimeout</CODE> was not use prior to invoking this method, the return value is the", " * default timeout set for the resource manager; otherwise, the value used in the previous", " * <CODE>setTransactionTimeout</CODE> call is returned.", " *", " * @return the transaction timeout value in seconds.", " * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL." ] }, { "added": [ " conn_.agent_.logWriter_.traceExit(this, \"getTransactionTimeout\", timeoutSeconds);", " return timeoutSeconds;" ], "header": "@@ -331,9 +333,9 @@ public class NetXAResource implements XAResource {", "removed": [ " conn_.agent_.logWriter_.traceExit(this, \"getTransactionTimeout\", 0);", " return 0; // we don't support transaction timeout" ] }, { "added": [ " * Set the current transaction timeout value for this XAResource", " * instance. Once set, this timeout value is effective until", " * setTransactionTimeout is invoked again with a different value. To reset", " * the timeout value to the default value used by the resource manager,", " * set the value to zero. If the timeout operation is performed", " * successfully, the method returns true; otherwise false. If a resource", " * manager does not support transaction timeout value to be set", " * explicitly, this method returns false.", " * Value of 0 means the reasource manager's default value.", " * Value of Integer.MAX_VALUE means no timeout.", " * @return true if transaction timeout value is set successfully;", " * otherwise false.", " * @exception XAException - An error has occurred. Possible exception", " * values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.", " conn_.agent_.logWriter_.traceEntry(this, \"setTransactionTimeout\");", " }", " if (seconds < 0) {", " // throw an exception if invalid value was specified", " throw new XAException(XAException.XAER_INVAL);", " timeoutSeconds = seconds;", " if (conn_.agent_.loggingEnabled()) {", " conn_.agent_.logWriter_.traceExit(this, \"setTransactionTimeout\", true);", " }", " return true;" ], "header": "@@ -521,23 +523,38 @@ public class NetXAResource implements XAResource {", "removed": [ " * <P>Set the current transaction timeout value for this <CODE>XAResource</CODE> instance. This value overwrites the", " * default transaction timeout value in the resource manager. The newly assigned timeout value is effective for the", " * life of this <CODE>XAResource</CODE> instance unless a new value is set.<P>", " * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.", " conn_.agent_.logWriter_.traceExit(this, \"setTransactionTimeout\", false);", " return false; // we don't support transaction timeout in our layer.", " /* int rc = xaSetTransTimeOut(seconds);", " if (rc != XAResource.XA_OK)", " throwXAException(rc); */" ] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java", "hunks": [ { "added": [ "\t\t// The value -1 means no value of timeout received", "\t\tlong xaTimeout = -1;", "\t\tboolean readXATimeout = false;" ], "header": "@@ -67,6 +67,9 @@ class DRDAXAProtocol {", "removed": [] }, { "added": [ "\t\t\t\t\txaTimeout = parseXATimeout();", "\t\t\t\t\treadXATimeout = true;" ], "header": "@@ -81,8 +84,8 @@ class DRDAXAProtocol {", "removed": [ "\t\t\t\t\t// optional/ignorable.", "\t\t\t\t\treader.skipBytes();" ] }, { "added": [ "\t\t\t\tstartXATransaction(xid, xaflags, xaTimeout);" ], "header": "@@ -117,7 +120,7 @@ class DRDAXAProtocol {", "removed": [ "\t\t\t\tstartXATransaction(xid,xaflags);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "hunks": [ { "added": [ " /**", " * Do not use this method directly use XATransactionState.xa_prepare", " * instead because it also maintains/cancels the timout task which is", " * scheduled to cancel/rollback the global transaction.", " */" ], "header": "@@ -2052,6 +2052,11 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [] }, { "added": [ " /**", " * Do not use this method directly use XATransactionState.xa_commit", " * instead because it also maintains/cancels the timout task which is", " * scheduled to cancel/rollback the global transaction.", " */" ], "header": "@@ -2090,6 +2095,11 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [] }, { "added": [ "", " /**", " * Do not use this method directly use XATransactionState.xa_rollback", " * instead because it also maintains/cancels the timout task which is", " * scheduled to cancel/rollback the global transaction.", " */", "\tpublic final void xa_rollback() throws SQLException {" ], "header": "@@ -2108,8 +2118,14 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [ "\tpublic final void xa_rollback() throws SQLException {" ] }, { "added": [ "", "" ], "header": "@@ -2126,6 +2142,8 @@ public abstract class EmbedConnection implements EngineConnection", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;" ], "header": "@@ -25,6 +25,7 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbedXAResource.java", "hunks": [ { "added": [ "", "" ], "header": "@@ -22,6 +22,8 @@", "removed": [] }, { "added": [ "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.services.property.PropertyUtil;", "import org.apache.derby.iapi.reference.Property;" ], "header": "@@ -34,12 +36,16 @@ import org.apache.derby.iapi.reference.JDBC30Translation;", "removed": [] }, { "added": [ " /** The value of the transaction timeout on this resource. */", " private int timeoutSeconds;", " // Setup the default value for the transaction timeout.", " this.timeoutSeconds = 0;" ], "header": "@@ -49,10 +55,14 @@ class EmbedXAResource implements XAResource {", "removed": [] }, { "added": [ " *" ], "header": "@@ -60,7 +70,7 @@ class EmbedXAResource implements XAResource {", "removed": [ "" ] }, { "added": [ " tranState.xa_commit(onePhase);" ], "header": "@@ -126,10 +136,8 @@ class EmbedXAResource implements XAResource {", "removed": [ " EmbedConnection conn = tranState.conn;", " ", " conn.xa_commit(onePhase);" ] }, { "added": [ " int ret = tranState.xa_prepare();" ], "header": "@@ -270,11 +278,9 @@ class EmbedXAResource implements XAResource {", "removed": [ " EmbedConnection conn = tranState.conn;", " ", " int ret = conn.xa_prepare();" ] }, { "added": [ "\t\t\t\t\tif (SanityManager.DEBUG) {" ], "header": "@@ -283,8 +289,7 @@ class EmbedXAResource implements XAResource {", "removed": [ "\t\t\t\t\tif (SanityManager.DEBUG)", "\t\t\t\t\t{" ] }, { "added": [ " * invoking this method, the return value is 0; otherwise, the value", " * used in the previous setTransactionTimeout call is returned.", " * @return the transaction timeout value in seconds. If the returned value", " * is equal to Integer.MAX_VALUE it means no timeout.", " public synchronized int getTransactionTimeout() {", " return timeoutSeconds;" ], "header": "@@ -301,14 +306,14 @@ class EmbedXAResource implements XAResource {", "removed": [ " * invoking this method, the return value is the default timeout set for", " * the resource manager; otherwise, the value used in the previous", " * setTransactionTimeout call is returned.", " * @return the transaction timeout value in seconds.", " public int getTransactionTimeout() {", " return 0;" ] }, { "added": [ " tranState.xa_rollback();" ], "header": "@@ -477,7 +482,7 @@ class EmbedXAResource implements XAResource {", "removed": [ " tranState.conn.xa_rollback();" ] }, { "added": [ " * Value of 0 means the reasource manager's default value.", " * Value of Integer.MAX_VALUE means no timeout.", " public synchronized boolean setTransactionTimeout(int seconds)", " throws XAException {", " if (seconds < 0) {", " // throw an exception if invalid value was specified", " throw new XAException(XAException.XAER_INVAL);", " }", " timeoutSeconds = seconds;", " return true;", " }", "", " /** Returns the default value for the transaction timeout in milliseconds", " * setted up by the system properties.", " *", " * @see Property.PROP_XA_TRANSACTION_TIMEOUT", " * @see Property.DEFAULT_XA_TRANSACTION_TIMEOUT", " */", " private long getDefaultXATransactionTimeout() throws XAException {", " try {", " LanguageConnectionContext lcc = con.getLanguageConnection();", " TransactionController tc = lcc.getTransactionExecute();", "", " long timeoutMillis = 1000 * (long) PropertyUtil.getServiceInt(", " tc,", " Property.PROP_XA_TRANSACTION_TIMEOUT,", " 0,", " Integer.MAX_VALUE,", " Property.DEFAULT_XA_TRANSACTION_TIMEOUT", " );", "", " return timeoutMillis;", " } catch (SQLException sqle) {", " throw wrapInXAException(sqle);", " } catch (StandardException se) {", " throw wrapInXAException(se);", " }" ], "header": "@@ -498,14 +503,49 @@ class EmbedXAResource implements XAResource {", "removed": [ " public boolean setTransactionTimeout(int seconds) {", " return false;" ] }, { "added": [ " tranState = new XATransactionState(", " con.realConnection.getContextManager(),", " con.realConnection, this, xid_im);", " if (!ra.addConnection(xid_im, tranState))", " currentXid = xid_im;", "", " // If the the timeout specified is equal to Integer.MAX_VALUE", " // it means that transaction timeout is disabled.", " if (timeoutSeconds != Integer.MAX_VALUE) {", " // Find out the value of the transaction timeout", " long timeoutMillis;", " if (timeoutSeconds > 0) {", " timeoutMillis = 1000*timeoutSeconds;", " } else {", " timeoutMillis = getDefaultXATransactionTimeout();", " }", " // If we have non-zero transaction timeout schedule a timeout task.", " // The only way how timeoutMillis might be equeal to 0 is that", " // it was specified as a default transaction timeout", " if (timeoutMillis > 0) {", " tranState.scheduleTimeoutTask(timeoutMillis);", " }", " }", "" ], "header": "@@ -616,13 +656,32 @@ class EmbedXAResource implements XAResource {", "removed": [ " ", " if (!ra.addConnection(xid_im, ", " new XATransactionState(", " con.realConnection.getContextManager(), ", " con.realConnection, this, xid_im)))" ] }, { "added": [ " void returnConnectionToResource(XATransactionState tranState," ], "header": "@@ -780,7 +839,7 @@ class EmbedXAResource implements XAResource {", "removed": [ " private void returnConnectionToResource(XATransactionState tranState, " ] } ] }, { "file": "java/engine/org/apache/derby/jdbc/XATransactionState.java", "hunks": [ { "added": [ "import java.sql.SQLException;", "import java.util.Timer;", "import java.util.TimerTask;", "import org.apache.derby.iapi.services.monitor.Monitor;", "import org.apache.derby.iapi.services.timer.TimerFactory;" ], "header": "@@ -22,6 +22,11 @@", "removed": [] }, { "added": [ " /** Rollback-only due to timeout */", " final static int TRO_TIMEOUT = -3;" ], "header": "@@ -37,6 +42,8 @@ import javax.transaction.xa.XAException;", "removed": [] }, { "added": [ " /** Has this transaction been finished (committed", " * or rolled back)? */", " boolean isFinished;", "", " /** A timer task scheduled for the time when the transaction will timeout. */", " CancelXATransactionTask timeoutTask = null;", "", "", " /** The implementation of TimerTask to cancel a global transaction. */", " private class CancelXATransactionTask extends TimerTask {", "", " /** Creates the cancelation object to be passed to a timer. */", " public CancelXATransactionTask() {", " XATransactionState.this.timeoutTask = this;", " }", "", " /** Runs the cancel task of the global transaction */", " public void run() {", " try {", " XATransactionState.this.cancel();", " } catch (XAException ex) {", " Monitor.logThrowable(ex);", " }", " }", " }", "", "", "" ], "header": "@@ -74,6 +81,34 @@ final class XATransactionState extends ContextImpl {", "removed": [] }, { "added": [ " this.isFinished = false;" ], "header": "@@ -83,6 +118,7 @@ final class XATransactionState extends ContextImpl {", "removed": [] }, { "added": [ " case XATransactionState.TRO_DEADLOCK:", " case XATransactionState.TRO_TIMEOUT:" ], "header": "@@ -147,6 +183,8 @@ final class XATransactionState extends ContextImpl {", "removed": [] }, { "added": [ "" ], "header": "@@ -163,6 +201,7 @@ final class XATransactionState extends ContextImpl {", "removed": [] } ] } ]
derby-DERBY-2433-d9e02474
DERBY-2433: Change the message which the network server prints if it needs to install a security manager but you have not configured a user-authorization scheme. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@542866 13f79535-47bb-0310-9956-ffa450edef68
[]