提交 5064d142 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 ab655816
......@@ -342,7 +342,7 @@ The PG server can be started and stopped from within a Java application as follo
Server server = Server.createPgServer(new String[]{"-baseDir", "~"});
server.start();
...
server.stop();
server.stop();
</pre>
By default, only connections from localhost are allowed. To allow remote connections, use
<code>-pgAllowOthers true</code> when starting the server.
......@@ -356,16 +356,16 @@ and select the PostgreSQL Unicode driver. Then click 'Finish'.
You will be able to change the connection properties:
</p>
<table>
<tr><th>Property</th><th>Example</th><th>Remarks</th></th>
<tr><th>Property</th><th>Example</th><th>Remarks</th></tr>
<tr><td>Data Source</td><td>H2 Test</td><td>The name of the ODBC Data Source</td></tr>
<tr><td>Database</td><td>test</td>
<td>
The database name. Only simple names are supported at this time; <br />
relative or absolute path are not supported in the database name. <br />
By default, the database is stored in the current working directory <br />
where the Server is started except when the -baseDir setting is used. <br />
The name must be at least 3 characters.
</td></tr>
<td>
The database name. Only simple names are supported at this time; <br />
relative or absolute path are not supported in the database name. <br />
By default, the database is stored in the current working directory <br />
where the Server is started except when the -baseDir setting is used. <br />
The name must be at least 3 characters.
</td></tr>
<tr><td>Server</td><td>localhost</td><td>The server name or IP address.<br />By default, only remote connections are allowed</td></tr>
<tr><td>User Name</td><td>sa</td><td>The database user name.</td></tr>
<tr><td>SSL Mode</td><td>disabled</td><td>At this time, SSL is not supported.</td></tr>
......
......@@ -30,7 +30,7 @@ H2 Database Engine
<h3>Download Mirror</h3>
<p>
<a href="http://code.google.com/p/h2database/downloads/list">Platform-Independent Zips</a><br />
<a href="http://code.google.com/p/h2database/downloads/list">Platform-Independent Zip</a><br />
</p>
<h3>Subversion Source Repository</h3>
......
......@@ -1226,8 +1226,8 @@ a lot of data in a database), one sometimes wants to shrink the size of the data
(compact a database). Here is a sample function to do this:
<pre>
public static void compact(String dir, String dbName,
String user, String password) throws Exception {
String url = "jdbc:h2:" + dir + "/" + dbName;
String user, String password) throws Exception {
String url = "jdbc:h2:" + dir + "/" + dbName;
String file = "data/test.sql";
Script.execute(url, user, password, file);
DeleteDbFiles.execute(dir, dbName, true);
......
......@@ -40,42 +40,42 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 / 2007-TODO</h3><ul>
<li>Some Unicode characters where not supported as identifier name.
Thanks Yusuke Fukushima for reporting this problem.
Thanks Yusuke Fukushima for reporting this problem.
</li><li>The default value DEFAULT_MAX_LENGTH_INPLACE_LOB has been changed from 128 to 1024.
</li><li>A server that implements the PostgreSQL protocol is now included and documented.
That means, the PostgreSQL ODBC driver can be used to access a H2 database.
See in the documentation for details.
That means, the PostgreSQL ODBC driver can be used to access a H2 database.
See in the documentation for details.
</li><li>The experimental H2 ODBC driver has been removed.
</li><li>The default value for h2.defaultMaxMemoryUndo is now 50000.
This avoids out of memory problems when using large transactions,
however large transactions are slower because they are buffered to disk.
To disable, use -Dh2.defaultMaxMemoryUndo=2000000000.
This avoids out of memory problems when using large transactions,
however large transactions are slower because they are buffered to disk.
To disable, use -Dh2.defaultMaxMemoryUndo=2000000000.
</li><li>Support for regular expression function REGEXP_REPLACE(expression, regex, replacement)
and regular expression LIKE: expression REGEXP matchExpression. However, indexes are not yet used.
and regular expression LIKE: expression REGEXP matchExpression. However, indexes are not yet used.
</li><li>The old view implementation has been removed.
</li><li>The SysTray tool has been removed, because JDK 1.6 has native support for system tray icons.
Use the Console tool (org.h2.tools.Console) automatically installs a system tray icon if JDK 1.6 is used.
Use the Console tool (org.h2.tools.Console) automatically installs a system tray icon if JDK 1.6 is used.
</li><li>H2 Console: In the last release, the shutdown button did not work. Fixed.
</li><li>Referential integrity can now be disabled using
SET REFERENTIAL_INTEGRITY FALSE. It can also be disable only
for one table using ALTER TABLE SET REFERENTIAL_INTEGRITY FALSE.
SET REFERENTIAL_INTEGRITY FALSE. It can also be disable only
for one table using ALTER TABLE SET REFERENTIAL_INTEGRITY FALSE.
</li><li>The Backup and Restore tools, and the BACKUP command did not back up LOBs when
h2.lobFilesInDirectories was enabled. Fixed.
h2.lobFilesInDirectories was enabled. Fixed.
</li><li>Calculation of cache memory usage has been improved.
</li><li>In some situations record were released too late from the cache. Fixed.
</li><li>The cache size is now measured in KB instead of blocks of 128 byte.
</li><li>CREATE TABLE ... AS SELECT now needs less memory. While inserting the rows, the undo
log is temporarily disabled. This avoid out of memory problems when creating large tables.
log is temporarily disabled. This avoid out of memory problems when creating large tables.
</li><li>The per session undo log can now be disabled. This setting is useful for bulk operations
that don't need to be atomic, like bulk delete or update.
</li><li>The database file could get corruted when there was an OutOfMemoryException in the middle of inserting a row.
that don't need to be atomic, like bulk delete or update.
</li><li>The database file could get corrupted when there was an OutOfMemoryException in the middle of inserting a row.
</li><li>Optimization for WHERE NOT(...) and WHERE [NOT] booleanFlagColumn.
This can be disabled using the system property h2.optimizeNot.
This can be disabled using the system property h2.optimizeNot.
</li><li>Optimization for conditions like WHERE A=B AND B=X (A=X is added). This often appears in joins.
This can be disabled using the system property h2.optimizeTwoEquals.
This can be disabled using the system property h2.optimizeTwoEquals.
</li><li>Documentation: the source code in 'Compacting a Database' was incorrect. Fixed.
</li><li>In the H2 Console, result sets could not be modified because the default result set type is now forward only.
For H2, now uses scrollable result sets. Also for other databases, but only when the query starts with @EDIT.
For H2, now uses scrollable result sets. Also for other databases, but only when the query starts with @EDIT.
</li><li>Views using UNION did not work correctly. Fixed.
</li><li>Function tables did not work with views and EXPLAIN. Fixed.
</li></ul>
......@@ -827,8 +827,8 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>Support Oracle RPAD and LPAD(string, n[, pad]) (truncate the end if longer)
</li><li>Allow editing NULL values in the Console
</li><li>Updatable result sets: DatabaseMetaData.ownUpdatesAreVisible = true (for insert, delete, update)
Simple solution: automatically calls 'refresh' when the result was changed.
Compare with other databases.
Simple solution: automatically calls 'refresh' when the result was changed.
Compare with other databases.
</li></ul>
<h3>Priority 2</h3>
......@@ -1085,7 +1085,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>Index usage for REGEXP LIKE.
</li><li>Add a role DBA (like ADMIN).
</li><li>Automatic mode: jdbc:h2:auto: (embedded mode if possible, if not use server mode).
Problem: what to do when server stops while others are connected to it.
Problem: what to do when server stops while others are connected to it.
</li><li>Access rights: remember the owner of an object. COMMENT: allow owner of object to change it.
</li></ul>
......
......@@ -32,7 +32,7 @@ Tutorial
<a href="#open_office">
Using OpenOffice Base</a><br />
<a href="#web_start">
Java Web Start / JNLP</a><br />
Java Web Start / JNLP</a><br />
<br /><a name="tutorial_starting_h2_console"></a>
<h2>Starting and Using the H2 Console</h2>
......@@ -448,7 +448,7 @@ exception will occur: java.security.AccessControlException: access denied (java.
Example permission tags:
<pre>
&lt;security>
&lt;all-permissions/>
&lt;all-permissions/>
&lt;/security>
</pre>
......
......@@ -2613,7 +2613,7 @@ public class Parser {
} else if (c >= '0' && c <= '9') {
type = CHAR_VALUE;
} else {
// $ is not supported at this time (compatbility for PostgreSQL: $1 )
// $ is not supported at this time (compatibility for PostgreSQL: $1 )
if(Character.isJavaIdentifierPart(c)) {
type = CHAR_NAME;
char u = Character.toUpperCase(c);
......
......@@ -2171,7 +2171,7 @@ REGEXP_REPLACE(inputString, regexString, replacementString): string
Replaces each substring that matches a regular expression.
For details, see the Java String.replaceAll() method.
","
REGEXP_REPLACE('Hoohoho', 'o+', 'o')
REGEXP_REPLACE('Hello World', ' +', ' ')
"
"Functions (String)","REPEAT","
......
......@@ -580,7 +580,7 @@ public class PgServerThread implements Runnable {
boolean tableFound = rs.next();
stat = conn.createStatement();
if(tableFound) {
rs = stat.executeQuery("SELECT VERION FROM PG_CATALOG.PG_VERSION");
rs = stat.executeQuery("SELECT VERSION FROM PG_CATALOG.PG_VERSION");
if(rs.next()) {
if(rs.getInt(1) == 1) {
// already installed
......
......@@ -13,10 +13,10 @@ set search_path = PUBLIC, pg_catalog;
create view pg_catalog.pg_roles -- (oid, rolname, rolcreaterole, rolcreatedb)
as
select
id oid,
cast(name as varchar_ignorecase) rolname,
case when admin then 't' else 'f' end as rolcreaterole,
case when admin then 't' else 'f' end as rolcreatedb
id oid,
cast(name as varchar_ignorecase) rolname,
case when admin then 't' else 'f' end as rolcreaterole,
case when admin then 't' else 'f' end as rolcreatedb
from information_schema.users;
create view pg_catalog.pg_namespace -- (oid, nspname)
......@@ -283,7 +283,7 @@ from pg_catalog.pg_database;
create table pg_catalog.pg_group -- oid, groname
as
select
0 oid,
cast('' as varchar_ignorecase) groname
0 oid,
cast('' as varchar_ignorecase) groname
from pg_catalog.pg_database where 1=0;
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.util;
public class ObjectUtils {
......
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.samples;
import java.sql.Connection;
......@@ -32,7 +36,7 @@ public class MixedMode {
Thread.sleep(1000);
}
} catch(SQLException e) {
System.out.println("Errror: " + e.toString());
System.out.println("Error: " + e.toString());
}
conn.close();
......
......@@ -94,14 +94,16 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
/*
test odbc again a few times (debug catalog creation)
Openfire server uses this script to setup a user permissions
on the fresh-installed server. The database is [current] HSQLDB :
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET SCHEMA PUBLIC
Unfortunately, this does not work (first string has a different semantic)
on the H2...
Unfortunately, this does not work in H2
Wrong user name or password [08004-55]
merge html-ja
......@@ -182,6 +184,20 @@ Document org.h2.samples.MixedMode
http://www.igniterealtime.org/projects/openfire/index.jsp
translation:
src/org.h2.server.web.res/_text_en.properties
src/org.h2.res/messages.properties
src/org.h2.res/help.csv (using ${.} like .jsp?)
javadocs (using generated ${.} ?)
html (using generated ${.} ?)
how do multi line properties files work? xml? [key]...?
converter between properties and [key] ...?
checksum marker
glossary
spell check / word list per language
html-jp
*/
/*
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
CALL REGEXP_REPLACE('Kaboooom', 'o+', 'o');
> 'Kabom'
> -------
> Kabom
CALL REGEXP_REPLACE('abckaboooom', 'o+', 'o');
> 'abckabom'
> ----------
> abckabom
> rows: 1
SELECT 'Hello' ~ 'He.*' T1, 'HELLO' ~ 'He.*' F2, CAST('HELLO' AS VARCHAR_IGNORECASE) ~ 'He.*' T3;
......@@ -136,7 +136,7 @@ explain select * from table(id int = (1, 2), name varchar=('Hello', 'World'));
CREATE TABLE TEST(ID INT PRIMARY KEY, FLAG BOOLEAN, NAME VARCHAR);
> ok
CREATE INDEX IDXFLAG ON TEST(FLAG, NAME);
CREATE INDEX IDX_FLAG ON TEST(FLAG, NAME);
> ok
INSERT INTO TEST VALUES(1, TRUE, 'Hello'), (2, FALSE, 'World');
......@@ -144,26 +144,26 @@ INSERT INTO TEST VALUES(1, TRUE, 'Hello'), (2, FALSE, 'World');
EXPLAIN SELECT * FROM TEST WHERE FLAG;
> PLAN
> --------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDXFLAG: FLAG = TRUE */ WHERE FLAG
> ---------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDX_FLAG: FLAG = TRUE */ WHERE FLAG
> rows: 1
EXPLAIN SELECT * FROM TEST WHERE FLAG AND NAME>'I';
> PLAN
> ----------------------------------------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDXFLAG: FLAG = TRUE AND NAME > 'I' */ WHERE FLAG AND (NAME > 'I')
> -----------------------------------------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDX_FLAG: FLAG = TRUE AND NAME > 'I' */ WHERE FLAG AND (NAME > 'I')
> rows: 1
DROP TABLE TEST;
> ok
CREATE TABLE test_table (firstcol varchar(20), secondcol integer);
CREATE TABLE test_table (first_col varchar(20), second_col integer);
> ok
insert into test_table values('a', 10), ('a', 4), ('b', 30), ('b', 3);
> update count: 4
CREATE VIEW test_view AS SELECT firstcol AS renamed_col, MIN(secondcol) AS also_renamed FROM test_table GROUP BY firstcol;
CREATE VIEW test_view AS SELECT first_col AS renamed_col, MIN(second_col) AS also_renamed FROM test_table GROUP BY first_col;
> ok
SELECT * FROM test_view WHERE renamed_col = 'a';
......
......@@ -128,7 +128,11 @@ public class XMLChecker {
if(pop.equals(name)) {
break;
}
throw new Exception("Unclosed element " + pop + " at " + parser.getRemaining());
String remaining = parser.getRemaining();
if(remaining.length() > 100) {
remaining = remaining.substring(0, 100);
}
throw new Exception("Unclosed element " + pop + " at " + remaining);
}
} else if(event == XMLParser.CHARACTERS) {
// lastElement = parser.getText();
......
......@@ -494,4 +494,8 @@ latin tgconstrname datallowconn atttypmod dattablespace attrelid ctid timestampt
nspname objsubid typnamespace rolcreaterole tgrelid spclocation relhasrules dont indkey postmaster
relkind autovacuum datlastsysoid attisdropped amname datacl deallocate tgdeferrable stats
spcacl relname rolvaliduntil attnotnull authid aclitem
plpgsql interrupting spring oids plperl regex newest
\ No newline at end of file
plpgsql interrupting spring oids plperl regex newest
xhtml transactionally remotly jnlp launch mirror subversion matcher hoohoho matching bulk
prorettype pronamespace groname inlining nopmd openfire joda fastutil ibatis igniterealtime unimi dsi
irstv trac iict geosysin fukushima yusuke msi odbcad recent viewed calculation installs embedding relation
resizing
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论