提交 544c4a38 authored 作者: Thomas Mueller's avatar Thomas Mueller

The following system properties are no longer supported:,…

The following system properties are no longer supported:, h2.allowBigDecimalExtensions, h2.emptyPassword, h2.minColumnNameMap, h2.returnLobObjects, h2.webMaxValueLength.
上级 fd4d97e8
...@@ -18,7 +18,13 @@ Change Log ...@@ -18,7 +18,13 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>When using a VPN, starting a H2 server did not work (for some VPN software). <ul><li>The following system properties are no longer supported:
<code>h2.allowBigDecimalExtensions</code>,
<code>h2.emptyPassword</code>,
<code>h2.minColumnNameMap</code>,
<code>h2.returnLobObjects</code>,
<code>h2.webMaxValueLength</code>.
</li><li>When using a VPN, starting a H2 server did not work (for some VPN software).
</li><li>Oracle compatibility: support for DECODE(...). </li><li>Oracle compatibility: support for DECODE(...).
</li><li>Lucene fulltext search: creating an index is now faster if the table already contains data. </li><li>Lucene fulltext search: creating an index is now faster if the table already contains data.
Thanks a lot to Angel Leon from the FrostWire Team for the patch! Thanks a lot to Angel Leon from the FrostWire Team for the patch!
......
...@@ -42,7 +42,10 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -42,7 +42,10 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
<h2>Priority 2</h2> <h2>Priority 2</h2>
<ul><li>Support hints for the optimizer (which index to use, enforce the join order). <ul><li>Support hints for the optimizer (which index to use, enforce the join order).
</li><li>Full outer joins. </li><li>Full outer joins.
</li><li>Access rights: remember the owner of an object. Create, alter and drop privileges. COMMENT: allow owner of object to change it. Issue 208. Access rights for schemas. </li><li>Access rights: remember the owner of an object.
Create, alter and drop privileges.
COMMENT: allow owner of object to change it.
Issue 208: Access rights for schemas.
</li><li>Test multi-threaded in-memory db access. </li><li>Test multi-threaded in-memory db access.
</li><li>MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes. </li><li>MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes.
</li><li>Migrate database tool (also from other database engines). For Oracle, maybe use </li><li>Migrate database tool (also from other database engines). For Oracle, maybe use
......
...@@ -8,7 +8,6 @@ package org.h2.command.ddl; ...@@ -8,7 +8,6 @@ package org.h2.command.ddl;
import org.h2.command.CommandInterface; import org.h2.command.CommandInterface;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.engine.Database; import org.h2.engine.Database;
import org.h2.engine.Session; import org.h2.engine.Session;
import org.h2.engine.User; import org.h2.engine.User;
...@@ -77,7 +76,7 @@ public class CreateUser extends DefineCommand { ...@@ -77,7 +76,7 @@ public class CreateUser extends DefineCommand {
} else if (password != null) { } else if (password != null) {
char[] passwordChars = getCharArray(password); char[] passwordChars = getCharArray(password);
byte[] userPasswordHash; byte[] userPasswordHash;
if (userName.length() == 0 && passwordChars.length == 0 && SysProperties.EMPTY_PASSWORD) { if (userName.length() == 0 && passwordChars.length == 0) {
userPasswordHash = new byte[0]; userPasswordHash = new byte[0];
} else { } else {
userPasswordHash = SHA256.getKeyPasswordHash(userName, passwordChars); userPasswordHash = SHA256.getKeyPasswordHash(userName, passwordChars);
......
...@@ -76,14 +76,6 @@ public class SysProperties { ...@@ -76,14 +76,6 @@ public class SysProperties {
*/ */
public static final String USER_HOME = Utils.getProperty("user.home", ""); public static final String USER_HOME = Utils.getProperty("user.home", "");
/**
* System property <code>h2.allowBigDecimalExtensions</code> (default:
* false).<br />
* When enabled, classes that extend BigDecimal are supported in
* PreparedStatement.setBigDecimal.
*/
public static final boolean ALLOW_BIG_DECIMAL_EXTENSIONS = Utils.getProperty("h2.allowBigDecimalExtensions", false);
/** /**
* System property <code>h2.allowedClasses</code> (default: *).<br /> * System property <code>h2.allowedClasses</code> (default: *).<br />
* Comma separated list of class names or prefixes. * Comma separated list of class names or prefixes.
...@@ -179,12 +171,6 @@ public class SysProperties { ...@@ -179,12 +171,6 @@ public class SysProperties {
*/ */
public static final int DELAY_WRONG_PASSWORD_MAX = Utils.getProperty("h2.delayWrongPasswordMax", 4000); public static final int DELAY_WRONG_PASSWORD_MAX = Utils.getProperty("h2.delayWrongPasswordMax", 4000);
/**
* System property <code>h2.emptyPassword</code> (default: true).<br />
* Don't use a secure hash if the user name and password are empty or not set.
*/
public static final boolean EMPTY_PASSWORD = Utils.getProperty("h2.emptyPassword", true);
/** /**
* System property <code>h2.lobCloseBetweenReads</code> (default: false).<br /> * System property <code>h2.lobCloseBetweenReads</code> (default: false).<br />
* Close LOB files between read operations. * Close LOB files between read operations.
...@@ -241,13 +227,6 @@ public class SysProperties { ...@@ -241,13 +227,6 @@ public class SysProperties {
*/ */
public static final boolean MODIFY_ON_WRITE = Utils.getProperty("h2.modifyOnWrite", false); public static final boolean MODIFY_ON_WRITE = Utils.getProperty("h2.modifyOnWrite", false);
/**
* System property <code>h2.minColumnNameMap</code> (default: 3).<br />
* The minimum number of columns where a hash table is created when result set
* methods with column name (instead of column index) parameter are called.
*/
public static final int MIN_COLUMN_NAME_MAP = Utils.getProperty("h2.minColumnNameMap", 3);
/** /**
* System property <code>h2.nioLoadMapped</code> (default: false).<br /> * System property <code>h2.nioLoadMapped</code> (default: false).<br />
* If the mapped buffer should be loaded when the file is opened. * If the mapped buffer should be loaded when the file is opened.
...@@ -298,14 +277,6 @@ public class SysProperties { ...@@ -298,14 +277,6 @@ public class SysProperties {
*/ */
public static final String PREFIX_TEMP_FILE = Utils.getProperty("h2.prefixTempFile", "h2.temp"); public static final String PREFIX_TEMP_FILE = Utils.getProperty("h2.prefixTempFile", "h2.temp");
/**
* System property <code>h2.returnLobObjects</code> (default: true).<br />
* When true, ResultSet.getObject for CLOB or BLOB will return a
* java.sql.Clob / java.sql.Blob object. When set to false, it will return a
* java.io.Reader / java.io.InputStream.
*/
public static final boolean RETURN_LOB_OBJECTS = Utils.getProperty("h2.returnLobObjects", true);
/** /**
* System property <code>h2.runFinalize</code> (default: true).<br /> * System property <code>h2.runFinalize</code> (default: true).<br />
* Run finalizers to detect unclosed connections. * Run finalizers to detect unclosed connections.
...@@ -395,14 +366,6 @@ public class SysProperties { ...@@ -395,14 +366,6 @@ public class SysProperties {
public static final boolean USE_THREAD_CONTEXT_CLASS_LOADER = public static final boolean USE_THREAD_CONTEXT_CLASS_LOADER =
Utils.getProperty("h2.useThreadContextClassLoader", false); Utils.getProperty("h2.useThreadContextClassLoader", false);
/**
* System property <code>h2.webMaxValueLength</code> (default: 100000).<br />
* The H2 Console will abbreviate (truncate) result values larger than this size.
* The data in the database is not truncated, it is only to avoid out of memory
* in the H2 Console application.
*/
public static final int WEB_MAX_VALUE_LENGTH = Utils.getProperty("h2.webMaxValueLength", 100000);
private static final String H2_BASE_DIR = "h2.baseDir"; private static final String H2_BASE_DIR = "h2.baseDir";
private SysProperties() { private SysProperties() {
......
...@@ -306,7 +306,7 @@ public class ConnectionInfo implements Cloneable { ...@@ -306,7 +306,7 @@ public class ConnectionInfo implements Cloneable {
if (passwordHash) { if (passwordHash) {
return StringUtils.convertHexToBytes(new String(password)); return StringUtils.convertHexToBytes(new String(password));
} }
if (userName.length() == 0 && password.length == 0 && SysProperties.EMPTY_PASSWORD) { if (userName.length() == 0 && password.length == 0) {
return new byte[0]; return new byte[0];
} }
return SHA256.getKeyPasswordHash(userName, password); return SHA256.getKeyPasswordHash(userName, password);
......
...@@ -1756,21 +1756,13 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1756,21 +1756,13 @@ public class JdbcConnection extends TraceObject implements Connection {
Object o; Object o;
switch (v.getType()) { switch (v.getType()) {
case Value.CLOB: { case Value.CLOB: {
if (SysProperties.RETURN_LOB_OBJECTS) {
int id = getNextId(TraceObject.CLOB); int id = getNextId(TraceObject.CLOB);
o = new JdbcClob(this, v, id); o = new JdbcClob(this, v, id);
} else {
o = v.getObject();
}
break; break;
} }
case Value.BLOB: { case Value.BLOB: {
if (SysProperties.RETURN_LOB_OBJECTS) {
int id = getNextId(TraceObject.BLOB); int id = getNextId(TraceObject.BLOB);
o = new JdbcBlob(this, v, id); o = new JdbcBlob(this, v, id);
} else {
o = v.getObject();
}
break; break;
} }
case Value.JAVA_OBJECT: case Value.JAVA_OBJECT:
......
...@@ -2853,7 +2853,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -2853,7 +2853,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
if (columnLabel == null) { if (columnLabel == null) {
throw DbException.getInvalidValueException("columnLabel", null); throw DbException.getInvalidValueException("columnLabel", null);
} }
if (columnCount >= SysProperties.MIN_COLUMN_NAME_MAP) { if (columnCount >= 3) {
// use a hash table if more than 2 columns
if (columnLabelMap == null) { if (columnLabelMap == null) {
HashMap<String, Integer> map = New.hashMap(columnCount); HashMap<String, Integer> map = New.hashMap(columnCount);
// column labels have higher priority // column labels have higher priority
......
...@@ -1683,7 +1683,7 @@ public class WebApp { ...@@ -1683,7 +1683,7 @@ public class WebApp {
String d = rs.getString(columnIndex); String d = rs.getString(columnIndex);
if (d == null) { if (d == null) {
return "<i>null</i>"; return "<i>null</i>";
} else if (d.length() > SysProperties.WEB_MAX_VALUE_LENGTH) { } else if (d.length() > 100000) {
String s; String s;
if (isBinary(rs.getMetaData().getColumnType(columnIndex))) { if (isBinary(rs.getMetaData().getColumnType(columnIndex))) {
s = PageParser.escapeHtml(d.substring(0, 6)) + "... (" + (d.length() / 2) + " ${text.result.bytes})"; s = PageParser.escapeHtml(d.substring(0, 6)) + "... (" + (d.length() / 2) + " ${text.result.bytes})";
......
...@@ -22,9 +22,7 @@ import java.sql.Types; ...@@ -22,9 +22,7 @@ import java.sql.Types;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.UUID; import java.util.UUID;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.engine.SessionInterface; import org.h2.engine.SessionInterface;
import org.h2.jdbc.JdbcBlob; import org.h2.jdbc.JdbcBlob;
import org.h2.jdbc.JdbcClob; import org.h2.jdbc.JdbcClob;
...@@ -32,9 +30,9 @@ import org.h2.jdbc.JdbcConnection; ...@@ -32,9 +30,9 @@ import org.h2.jdbc.JdbcConnection;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.store.LobStorage; import org.h2.store.LobStorage;
import org.h2.tools.SimpleResultSet; import org.h2.tools.SimpleResultSet;
import org.h2.util.Utils;
import org.h2.util.New; import org.h2.util.New;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import org.h2.util.Utils;
/** /**
* This class contains meta data information about data types, * This class contains meta data information about data types,
...@@ -661,19 +659,11 @@ public class DataType { ...@@ -661,19 +659,11 @@ public class DataType {
// "java.lang.String"; // "java.lang.String";
return String.class.getName(); return String.class.getName();
case Value.BLOB: case Value.BLOB:
if (SysProperties.RETURN_LOB_OBJECTS) {
// "java.sql.Blob"; // "java.sql.Blob";
return java.sql.Blob.class.getName(); return java.sql.Blob.class.getName();
}
// "java.io.InputStream";
return java.io.InputStream.class.getName();
case Value.CLOB: case Value.CLOB:
if (SysProperties.RETURN_LOB_OBJECTS) {
// "java.sql.Clob"; // "java.sql.Clob";
return java.sql.Clob.class.getName(); return java.sql.Clob.class.getName();
}
// "java.io.Reader";
return java.io.Reader.class.getName();
case Value.DOUBLE: case Value.DOUBLE:
// "java.lang.Double"; // "java.lang.Double";
return Double.class.getName(); return Double.class.getName();
......
...@@ -9,9 +9,7 @@ package org.h2.value; ...@@ -9,9 +9,7 @@ package org.h2.value;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.util.MathUtils; import org.h2.util.MathUtils;
...@@ -54,7 +52,7 @@ public class ValueDecimal extends Value { ...@@ -54,7 +52,7 @@ public class ValueDecimal extends Value {
private ValueDecimal(BigDecimal value) { private ValueDecimal(BigDecimal value) {
if (value == null) { if (value == null) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} else if (!SysProperties.ALLOW_BIG_DECIMAL_EXTENSIONS && !value.getClass().equals(BigDecimal.class)) { } else if (!value.getClass().equals(BigDecimal.class)) {
throw DbException.get(ErrorCode.INVALID_CLASS_2, throw DbException.get(ErrorCode.INVALID_CLASS_2,
BigDecimal.class.getName(), value.getClass().getName()); BigDecimal.class.getName(), value.getClass().getName());
} }
......
...@@ -14,8 +14,6 @@ import java.sql.ResultSetMetaData; ...@@ -14,8 +14,6 @@ import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.sql.Types; import java.sql.Types;
import org.h2.constant.SysProperties;
import org.h2.engine.Constants; import org.h2.engine.Constants;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.value.DataType; import org.h2.value.DataType;
...@@ -239,21 +237,11 @@ public class TestMetaData extends TestBase { ...@@ -239,21 +237,11 @@ public class TestMetaData extends TestBase {
stat.execute("INSERT INTO t VALUES('', '')"); stat.execute("INSERT INTO t VALUES('', '')");
ResultSet rs = stat.executeQuery("SELECT blob,clob FROM t"); ResultSet rs = stat.executeQuery("SELECT blob,clob FROM t");
ResultSetMetaData rsMeta = rs.getMetaData(); ResultSetMetaData rsMeta = rs.getMetaData();
if (SysProperties.RETURN_LOB_OBJECTS) {
assertEquals("java.sql.Blob", rsMeta.getColumnClassName(1)); assertEquals("java.sql.Blob", rsMeta.getColumnClassName(1));
assertEquals("java.sql.Clob", rsMeta.getColumnClassName(2)); assertEquals("java.sql.Clob", rsMeta.getColumnClassName(2));
} else {
assertEquals("java.io.InputStream", rsMeta.getColumnClassName(1));
assertEquals("java.io.Reader", rsMeta.getColumnClassName(2));
}
rs.next(); rs.next();
if (SysProperties.RETURN_LOB_OBJECTS) {
assertTrue(rs.getObject(1) instanceof java.sql.Blob); assertTrue(rs.getObject(1) instanceof java.sql.Blob);
assertTrue(rs.getObject(2) instanceof java.sql.Clob); assertTrue(rs.getObject(2) instanceof java.sql.Clob);
} else {
assertEquals("java.io.ByteArrayInputStream", rs.getObject(1).getClass().getName());
assertEquals("java.io.BufferedReader", rs.getObject(2).getClass().getName());
}
stat.executeUpdate("DROP TABLE t"); stat.executeUpdate("DROP TABLE t");
} }
......
...@@ -27,9 +27,7 @@ import java.sql.Types; ...@@ -27,9 +27,7 @@ import java.sql.Types;
import java.util.Calendar; import java.util.Calendar;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/** /**
...@@ -1015,11 +1013,7 @@ public class TestResultSet extends TestBase { ...@@ -1015,11 +1013,7 @@ public class TestResultSet extends TestBase {
10, Integer.MAX_VALUE }, new int[] { 0, 0 }); 10, Integer.MAX_VALUE }, new int[] { 0, 0 });
rs.next(); rs.next();
Object obj = rs.getObject(2); Object obj = rs.getObject(2);
if (SysProperties.RETURN_LOB_OBJECTS) {
assertTrue(obj instanceof java.sql.Clob); assertTrue(obj instanceof java.sql.Clob);
} else {
assertTrue(obj instanceof java.io.Reader);
}
string = rs.getString(2); string = rs.getString(2);
assertTrue(string != null && string.equals("Test")); assertTrue(string != null && string.equals("Test"));
assertTrue(!rs.wasNull()); assertTrue(!rs.wasNull());
......
...@@ -19,9 +19,7 @@ import java.sql.Statement; ...@@ -19,9 +19,7 @@ import java.sql.Statement;
import java.sql.Time; import java.sql.Time;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.sql.Types; import java.sql.Types;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/** /**
...@@ -288,13 +286,8 @@ public class TestUpdatableResultSet extends TestBase { ...@@ -288,13 +286,8 @@ public class TestUpdatableResultSet extends TestBase {
assertEquals("java.lang.Long", meta.getColumnClassName(12)); assertEquals("java.lang.Long", meta.getColumnClassName(12));
assertEquals("java.lang.Integer", meta.getColumnClassName(13)); assertEquals("java.lang.Integer", meta.getColumnClassName(13));
assertEquals("java.lang.Short", meta.getColumnClassName(14)); assertEquals("java.lang.Short", meta.getColumnClassName(14));
if (SysProperties.RETURN_LOB_OBJECTS) {
assertEquals("java.sql.Clob", meta.getColumnClassName(15)); assertEquals("java.sql.Clob", meta.getColumnClassName(15));
assertEquals("java.sql.Blob", meta.getColumnClassName(16)); assertEquals("java.sql.Blob", meta.getColumnClassName(16));
} else {
assertEquals("java.io.Reader", meta.getColumnClassName(15));
assertEquals("java.io.InputStream", meta.getColumnClassName(16));
}
rs.moveToInsertRow(); rs.moveToInsertRow();
rs.updateInt(1, 0); rs.updateInt(1, 0);
rs.updateNull(2); rs.updateNull(2);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论