提交 d6ce16e1 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 7d79a0e6
......@@ -201,6 +201,9 @@ To use the MVCC feature, append MVCC=TRUE to the database URL:
jdbc:h2:~/test;MVCC=TRUE
</pre>
</p>
<p>
The MVCC feature is not fully tested yet.
</p>
<br /><a name="clustering"></a>
<h2>Clustering / High Availability</h2>
......
......@@ -16,9 +16,9 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>The performance of text comparison has been improved when using locale sensitive
string comparison (SET COLLATOR). Now CollationKey is used with a LRU cache.
The default cache size is 10000, and can be changed using the system property
h2.collatorCacheSize. Use 0 to disable the cache.
string comparison (SET COLLATOR). Now CollationKey is used with a LRU cache.
The default cache size is 10000, and can be changed using the system property
h2.collatorCacheSize. Use 0 to disable the cache.
</li><li>UPDATE SET column=DEFAULT is now supported.
</li></ul>
......
......@@ -185,8 +185,6 @@ C:\Programs\hsqldb\lib\hsqldb.jar.
</p><p>
Multiple drivers can be set; each entry needs to be separated with a ';' (Windows) or ':' (other operating systems).
Spaces in the path names are supported. The settings must not be quoted.
</p><p>
Only the Java version supports additional drivers (this feature is not supported by the Native version).
</p>
<h3>Using the Application</h3>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -90,7 +90,7 @@ public class RuleElement implements Rule {
return null;
} else {
query = link.matchRemove(query, sentence);
if (query != null && !name.startsWith("@") && (link.name() == null || !link.name().startsWith("@"))) {
if (query != null && name != null && !name.startsWith("@") && (link.name() == null || !link.name().startsWith("@"))) {
while (query.length() > 0 && Character.isWhitespace(query.charAt(0))) {
query = query.substring(1);
}
......
......@@ -197,7 +197,7 @@ public class CreateTable extends SchemaCommand {
}
int scale = expr.getScale();
if (scale > 0 && (dt.defaultScale == 0 || dt.defaultScale > scale)) {
precision = dt.defaultScale;
scale = dt.defaultScale;
}
Column col = new Column(name, type, precision, scale, displaySize);
addColumn(col);
......
......@@ -61,8 +61,8 @@ public class SelectUnion extends Query {
orderList = order;
}
private Value[] convert(Value[] values) throws SQLException {
for (int i = 0; i < values.length; i++) {
private Value[] convert(Value[] values, int columnCount) throws SQLException {
for (int i = 0; i < columnCount; i++) {
Expression e = (Expression) expressions.get(i);
values[i] = values[i].convertTo(e.getType());
}
......@@ -116,19 +116,19 @@ public class SelectUnion extends Query {
case UNION_ALL:
case UNION: {
while (l.next()) {
result.addRow(convert(l.currentRow()));
result.addRow(convert(l.currentRow(), columnCount));
}
while (r.next()) {
result.addRow(convert(r.currentRow()));
result.addRow(convert(r.currentRow(), columnCount));
}
break;
}
case EXCEPT: {
while (l.next()) {
result.addRow(convert(l.currentRow()));
result.addRow(convert(l.currentRow(), columnCount));
}
while (r.next()) {
result.removeDistinct(convert(r.currentRow()));
result.removeDistinct(convert(r.currentRow(), columnCount));
}
break;
}
......@@ -136,10 +136,10 @@ public class SelectUnion extends Query {
LocalResult temp = new LocalResult(session, expressions, columnCount);
temp.setDistinct();
while (l.next()) {
temp.addRow(convert(l.currentRow()));
temp.addRow(convert(l.currentRow(), columnCount));
}
while (r.next()) {
Value[] values = convert(r.currentRow());
Value[] values = convert(r.currentRow(), columnCount);
if (temp.containsDistinct(values)) {
result.addRow(values);
}
......
......@@ -160,6 +160,7 @@ public class SysProperties {
* System property <code>h2.lobFilesInDirectories</code> (default: false).<br />
* Store LOB files in subdirectories.
*/
// TODO change in version 1.1
// TODO: also remove DataHandler.allocateObjectId, createTempFile when setting this to true and removing it
public static final boolean LOB_FILES_IN_DIRECTORIES = getBooleanSetting("h2.lobFilesInDirectories", false);
......@@ -252,6 +253,7 @@ public class SysProperties {
* System property <code>h2.optimizeInJoin</code> (default: false).<br />
* Optimize IN(...) comparisons by converting them to inner joins.
*/
// TODO change in version 1.1
public static final boolean OPTIMIZE_IN_JOIN = getBooleanSetting("h2.optimizeInJoin", false);
/**
......
......@@ -261,7 +261,11 @@ public class ConnectionInfo {
}
public String getProperty(String key) {
return prop.getProperty(key);
Object value = prop.get(key);
if (value == null || !(value instanceof String)) {
return null;
}
return value.toString();
}
public String getProperty(String key, String defaultValue) {
......
......@@ -146,6 +146,7 @@ public class Database implements DataHandler {
private boolean multiVersion;
private DatabaseCloser closeOnExit;
private Mode mode = Mode.getInstance(Mode.REGULAR);
// TODO change in version 1.1
private boolean multiThreaded;
private int maxOperationMemory = SysProperties.DEFAULT_MAX_OPERATION_MEMORY;
......
......@@ -993,8 +993,11 @@ public class Function extends Expression implements FunctionCall {
String fieldSeparatorRead = v3 == null ? null : v3.getString();
String fieldDelimiter = v4 == null ? null : v4.getString();
String escapeCharacter = v5 == null ? null : v5.getString();
Value v6 = getNullOrValue(session, args, 6);
String nullString = v6 == null ? null : v6.getString();
Csv csv = Csv.getInstance();
setCsvDelimiterEscape(csv, fieldSeparatorRead, fieldDelimiter, escapeCharacter);
csv.setNullString(nullString);
char fieldSeparator = csv.getFieldSeparatorRead();
String[] columns = StringUtils.arraySplit(columnList, fieldSeparator, true);
ValueResultSet vr = ValueResultSet.get(csv.read(fileName, columns, charset));
......@@ -1017,9 +1020,12 @@ public class Function extends Expression implements FunctionCall {
String fieldDelimiter = v4 == null ? null : v4.getString();
String escapeCharacter = v5 == null ? null : v5.getString();
Value v6 = getNullOrValue(session, args, 6);
String lineSeparator = v6 == null ? null : v6.getString();
String nullString = v6 == null ? null : v6.getString();
Value v7 = getNullOrValue(session, args, 7);
String lineSeparator = v7 == null ? null : v7.getString();
Csv csv = Csv.getInstance();
setCsvDelimiterEscape(csv, fieldSeparatorWrite, fieldDelimiter, escapeCharacter);
csv.setNullString(nullString);
if (lineSeparator != null) {
csv.setLineSeparator(lineSeparator);
}
......
......@@ -26,6 +26,19 @@ import org.h2.value.ValueNull;
/**
* This is the most common type of index, a b tree index.
* The index structure is:
* <ul>
* <li>There is one {@link BtreeHead} that points to the root page.
* The head always stays where it is.
* </li><li>There is a number of {@link BtreePage}s. Each page is eighter
* a {@link BtreeNode} or a {@link BtreeLeaf}.
* </li><li>A node page links to other leaf pages or to node pages.
* Leaf pages don't point to other pages (but may have a parent).
* </li><li>The uppermost page is the root page. If pages
* are added or deleted, the root page may change.
* </li>
* </ul>
* Only the data of the indexed columns are stored in the index.
*/
public class BtreeIndex extends BaseIndex implements RecordReader {
......
......@@ -153,12 +153,14 @@ public class MultiVersionCursor implements Cursor {
}
}
if (compare > 0) {
onBase = true;
needNewBase = true;
return true;
}
if (!isDeleted) {
throw Message.getInternalError();
}
onBase = false;
needNewDelta = true;
return true;
}
......
......@@ -71,7 +71,7 @@
90048=Datenbank Datei Version wird nicht unterst\u00FCtzt oder ung\u00FCltiger Dateikopf in Datei {0}
90049=Verschl\u00FCsselungsfehler in Datei {0}
90050=Falsches Passwort Format, ben\u00F6tigt wird\: Datei-Passwort <Leerschlag> Benutzer-Passwort
90051=Befehl wurde abgebrochen
90051=Befehl wurde abgebrochen oder das Session-Timeout ist abgelaufen
90052=Unterabfrage gibt mehr als eine Feld zur\u00FCck
90053=Skalar-Unterabfrage enth\u00E4lt mehr als eine Zeile
90054=Ung\u00FCltige Verwendung der Aggregat Funktion {0}
......
......@@ -71,7 +71,7 @@
90048=Unsupported database file version or invalid file header in file {0}
90049=Encryption error in file {0}
90050=Wrong password format, must be\: file password <space> user password
90051=Statement was cancelled
90051=Statement was cancelled or the session timed out
90052=Subquery is not a single column query
90053=Scalar subquery contains more than one row
90054=Invalid use of aggregate function {0}
......
......@@ -71,7 +71,7 @@
90048=\u30D5\u30A1\u30A4\u30EB {0} \u306F\u3001\u672A\u30B5\u30DD\u30FC\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304B\u3001\u4E0D\u6B63\u306A\u30D5\u30A1\u30A4\u30EB\u30D8\u30C3\u30C0\u3092\u6301\u3064\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30D5\u30A1\u30A4\u30EB\u3067\u3059
90049=\u30D5\u30A1\u30A4\u30EB {0} \u306E\u6697\u53F7\u5316\u30A8\u30E9\u30FC\u3067\u3059
90050=\u4E0D\u6B63\u306A\u30D1\u30B9\u30EF\u30FC\u30C9\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3067\u3059\u3002\u6B63\u3057\u304F\u306F\: \u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\u30EF\u30FC\u30C9 <\u7A7A\u767D> \u30E6\u30FC\u30B6\u30D1\u30B9\u30EF\u30FC\u30C9
90051=\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F
90051=\# \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F
90052=\u30B5\u30D6\u30AF\u30A8\u30EA\u304C\u5358\u4E00\u5217\u306E\u30AF\u30A8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093
90053=\u6570\u5024\u30B5\u30D6\u30AF\u30A8\u30EA\u304C\u8907\u6570\u306E\u884C\u3092\u542B\u3093\u3067\u3044\u307E\u3059
90054=\u96C6\u5408\u95A2\u6570 {0} \u306E\u4E0D\u6B63\u306A\u4F7F\u7528
......
......@@ -71,7 +71,7 @@
90048=Nieprawidlowa wersja pliku bazy danych lub nieprawidlowy naglowek pliku {0}
90049=Blad szyfowania pliku {0}
90050=Zly format hasla, powinno byc\: plik haslo <spacja> uzytkownik haslo
90051=Statement was cancelled
90051=Statement was cancelled or the session timed out
90052=Podzapytanie nie jest zapytaniem opartym o jedna kolumne
90053=Scalar subquery contains more than one row
90054=Nieprawidlowe uzycie funkcji agregujacej {0}
......
......@@ -71,7 +71,7 @@
90048=Vers\u00E3o do arquivo de base de dados n\u00E3o \u00E9 suportado, ou o cabe\u00E7alho do arquivo \u00E9 inv\u00E1lido, no arquivo {0}
90049=Erro de encripta\u00E7\u00E3o no arquivo {0}
90050=Erro no formato da senha, deveria ser\: arquivo de senha <espa\u00E7o> senha do usu\u00E1rio
90051=O Statement foi cancelado
90051=\#O Statement foi cancelado
90052=A Subquery n\u00E3o \u00E9 de coluna \u00FAnica
90053=A Subquery cont\u00E9m mais de uma linha
90054=Uso inv\u00E1lido da fun\u00E7\u00E3o {0} agregada
......
......@@ -2649,13 +2649,15 @@ CURRVAL('TEST_SEQ')
"
"Functions (System)","CSVREAD","
CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorString [, fieldDelimiterString [, escapeCharacterString]]]]]): resultSet
CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorString [, fieldDelimiterString
[, escapeCharacterString [, nullString]]]]]]): resultSet
","
Returns the result set of reading the CSV (comma separated values) file.
If the column names are specified (a comma separated list of column names),
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
of the file is interpreted as the column names.
The default charset is the default value for this system, and the default field separator is a comma.
Missing unquoted values as well as data that matches the null string is parsed as NULL.
This function can be used like a table: SELECT * FROM CSVREAD(...).
Instead of a file, an URL may be used, for example jar:file:///c:/temp/example.zip!/org/example/nested.zip.
Admin rights are required to execute this command.
......@@ -2665,11 +2667,12 @@ CALL CSVREAD('test.csv')
"Functions (System)","CSVWRITE","
CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparatorString [, fieldDelimiterString
[, escapeCharacterString [, lineSeparatorString]]]]]): int
[, escapeCharacterString [, nullString [, lineSeparatorString]]]]]]): int
","
Writes a CSV (comma separated values).
The file is overwritten if it exists.
The default charset is the default value for this system, and the default field separator is a comma.
The null string is used when writing NULL (by default nothing is written when NULL appears).
The default line separator is the default value for this system ('line.separator' system property).
The returned value is the number or rows written.
Admin rights are required to execute this command.
......
......@@ -38,4 +38,8 @@ public class SimpleRowValue implements SearchRow {
data = v;
}
public String toString() {
return "( /* " + pos + " */ " + data.getSQL() + " )";
}
}
......@@ -217,7 +217,7 @@ public class TcpServer implements Service {
}
}
public synchronized void stop() {
public void stop() {
// TODO server: share code between web and tcp servers
// need to remove the server first, otherwise the connection is broken
// while the server is still registered in this map
......@@ -264,12 +264,14 @@ public class TcpServer implements Service {
}
if (shutdownMode == SHUTDOWN_NORMAL) {
server.stopManagementDb();
server.stop = true;
try {
Socket s = NetUtils.createLoopbackSocket(port, false);
s.close();
} catch (Exception e) {
// try to connect - so that accept returns
synchronized (TcpServer.class) {
server.stop = true;
try {
Socket s = NetUtils.createLoopbackSocket(port, false);
s.close();
} catch (Exception e) {
// try to connect - so that accept returns
}
}
} else if (shutdownMode == SHUTDOWN_FORCE) {
server.stop();
......
......@@ -374,6 +374,9 @@ public class DbContextRule implements Rule {
if (set != null && !set.contains(table)) {
continue;
}
if (table == null || table.columns == null) {
continue;
}
for (int j = 0; j < table.columns.length; j++) {
String name = StringUtils.toUpperEnglish(table.columns[j].name);
if (up.startsWith(name)) {
......
......@@ -31,7 +31,6 @@ adminTitle=H2 Console Optionen
helpAction=Aktion
helpAddAnotherRow=F&uuml;gt einen weiteren Datensatz hinzu
helpAddDrivers=Datenbank Treiber hinzuf&uuml;gen
helpAddDriversOnlyJava=Zus&auml;tzliche Treiber werden nur von der Java Version unterst&uuml;tzt (nicht von der Native Version).
helpAddDriversText=Es ist m&ouml;glich zus&auml;tzliche Datenbank-Treiber zu laden, indem die Pfade der Treiber-Dateien in den Umgebungsvariablen H2DRIVERS oder CLASSPATH eingetragen werden. Beispiel (Windows)\: Um den Datenbank-Treiber mit dem Jar-File C\:\\Programs\\hsqldb\\lib\\hsqldb.jar hinzuzuf&uuml;gen, setzen Sie den die Umgebungvariable H2DRIVERS auf C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=F&uuml;gt einen Datensatz hinzu
helpCommandHistory=Zeigt die Befehls-Chronik
......
......@@ -31,7 +31,6 @@ adminTitle=H2 Console Preferences
helpAction=Action
helpAddAnotherRow=Add another row
helpAddDrivers=Adding Database Drivers
helpAddDriversOnlyJava=Only the Java version supports additional drivers (this feature is not supported by the Native version).
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Add a new row
helpCommandHistory=Shows the Command History
......
......@@ -31,7 +31,6 @@ adminTitle=Preferencias de H2 Consola
helpAction=Action
helpAddAnotherRow=A&ntilde;adir otra fila
helpAddDrivers=A&ntilde;adiendo drivers de base de datos
helpAddDriversOnlyJava=Solo la versi&oacute;n Java soporta otros drivers (esta caracteristica no esta soportada por la versi&oacute;n nativa).
helpAddDriversText=Se pueden registrar otros drivers a&ntilde;adiendo el archivo Jar del driver a la variable de entorno H2DRIVERS o CLASSPATH. Por ejemplo (Windows)\: Para a&ntilde;adir la librer&iacute;a del driver de base de datos C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, hay que establecer la variable de entorno H2DRIVERS a C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=A&ntilde;adir una fila nueva
helpCommandHistory=Ver hist&oacute;rico de comandos
......
......@@ -31,7 +31,6 @@ adminTitle=Console H2 de param&eacute;trage des options
helpAction=Action
helpAddAnotherRow=Ajouter un autre enregistrement
helpAddDrivers=Ajouter de drivers de base de donn&eacute;es
helpAddDriversOnlyJava=Seule la version Java permet d'ajouter des drivers suppl&eacute;mentaires. (Cette fonctionnalit&eacute; n'est pas support&eacute;e dans la version Native).
helpAddDriversText=Des drivers additionels peuvent &ecirc;tre configur&eacute;s en d&eacute;clarant l'emplacement du fichier Jar contenant ces drivers dans les variables d'environnement H2DRIVERS ou CLASSPATH. Exemple (Windows)\: Pour ajouter la librairie C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, d&eacute;finir la valeur de la variable d'environnement H2DRIVERS en C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Ajouter un nouvel enregistrement
helpCommandHistory=Affiche l'historique des commandes
......
......@@ -31,8 +31,7 @@ adminTitle=H2 Konzol tulajdons&aacute;gai
helpAction=Parancs
helpAddAnotherRow=Rekord hozz&aacute;ad&aacute;sa
helpAddDrivers=Adatb&aacute;zis-illeszt&\#337;programok hozz&aacute;ad&aacute;sa
helpAddDriversOnlyJava=Illeszt&\#337;programok hozz&aacute;ad&aacute;s&aacute;t csak a Java verzi&oacute; t&aacute;mogatja, a nat&iacute;v verzi&oacute; nem.
helpAddDriversText=Tov&aacute;bbi adatb&aacute;zis-illeszt&\#337;programok regisztr&aacute;l&aacute;sakor a H2DRIVERS vagy CLASSPATH k&ouml;rnyezeti v&aacute;ltoz&oacute;khoz kell adni a .jar illeszt&\#337;program-f&aacute;jlok el&eacute;r&eacute;si &uacute;tvonalait. P&eacute;ld&aacute;ul (Windows eset&eacute;n) a C\:\\Programs\\hsqldb\\lib\\hsqldb.jar illeszt&\#337;program regisztr&aacute;l&aacute;s&aacute;hoz a H2DRIVERS k&ouml;rnyezeti v&aacute;ltoz&oacute;nak az al&aacute;bbi &eacute;rt&eacute;k&eacute;t kell megadni\: C\:\\Programs\\hsqldb\\lib\\hsqldb.jar
helpAddDriversText=Tov&aacute;bbi adatb&aacute;zis-illeszt&\#337;programok regisztr&aacute;l&aacute;sakor a H2DRIVERS vagy CLASSPATH k&ouml;rnyezeti v&aacute;ltoz&oacute;khoz kell adni a .jar illeszt&\#337;program-f&aacute;jlok el&eacute;r&eacute;si &uacute;tvonalait. P&eacute;ld&aacute;ul (Windows eset&eacute;n) a C\:\\Programs\\hsqldb\\lib\\hsqldb.jar illeszt&\#337;program regisztr&aacute;l&aacute;s&aacute;hoz a H2DRIVERS k&ouml;rnyezeti v&aacute;ltoz&oacute;nak az al&aacute;bbi &eacute;rt&eacute;k&eacute;t kell megadni\: C\:\\Programs\\hsqldb\\lib\\hsqldb.jar
helpAddRow=Rekord hozz&aacute;ad&aacute;sa
helpCommandHistory=Kor&aacute;bbi utas&iacute;t&aacute;sok megjelen&iacute;t&eacute;se
helpCreateTable=&Uacute;j t&aacute;bla l&eacute;trehoz&aacute;sa
......@@ -69,7 +68,7 @@ result.autoCommitOff=Automatikus j&oacute;v&aacute;hagy&aacute;s kikapcsolva
result.autoCommitOn=Automatikus j&oacute;v&aacute;hagy&aacute;s bekapcsolva
result.maxrowsSet=Rekordok maxim&aacute;lis sz&aacute;ma be&aacute;ll&iacute;tva
result.noRows=nincs rekord
result.noRunningStatement=Utas&iacute;t&aacute;s jelenleg nincs folyamatban
result.noRunningStatement=Utas&iacute;t&aacute;s jelenleg nincs folyamatban
result.rows=rekordok
result.statementWasCancelled=Az utas&iacute;t&aacute;s v&eacute;grehajt&aacute;sa megszakadt
result.updateCount=Friss&iacute;t&eacute;s
......
......@@ -31,7 +31,6 @@ adminTitle=Pilihan di Konsol H2
helpAction=Aksi
helpAddAnotherRow=Menambah sebuah baris
helpAddDrivers=Menambah pengendali basis data
helpAddDriversOnlyJava=Hanya versi Java saja yang mendukung pengendali tambahan (fitur ini tidak didukung oleh versi Native).
helpAddDriversText=Pengendali basis data tambahan dapat didaftarkan dengan cara menambah lokasi file Jar dari si pengendali ke variabel lingkungan H2DRIVERS atau CLASSPATH. Contoh (Windows)\: Untuk menambah librari pengendali basis data C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, atur variabel lingkungan H2DRIVERS menjadi C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Tambah sebuah baris baru
helpCommandHistory=Tampilkan sejarah perintah
......
......@@ -31,7 +31,6 @@ adminTitle=Pannello di controllo preferenze H2
helpAction=Azione
helpAddAnotherRow=Aggiunge un'altra riga
helpAddDrivers=Aggiunta di altri driver per l'accesso al database
helpAddDriversOnlyJava=Solo la versione Java supporta drivers aggiuntivi (questa caratteristica non e' supportata dalla versione Nativa).
helpAddDriversText=I drivers per il database possono essere inseriti aggiungendo la posizione del file Jar del driver stesso alle variabili di ambiente H2DRIVERS o CLASSPATH. Esempio (Windows)\: Per aggiungere alla libreria il drivers per il database C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, basta modificare la variabile di ambiente H2DRIVERS in C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Aggiunge una nuova riga
helpCommandHistory=Mostra l'elenco dei comandi eseguiti
......
......@@ -31,7 +31,6 @@ adminTitle=H2\u30B3\u30F3\u30BD\u30FC\u30EB\u8A2D\u5B9A
helpAction=\u30A2\u30AF\u30B7\u30E7\u30F3
helpAddAnotherRow=\u5225\u306E\u884C\u3092\u8FFD\u52A0
helpAddDrivers=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30C9\u30E9\u30A4\u30D0\u306E\u8FFD\u52A0
helpAddDriversOnlyJava=\u8FFD\u52A0\u30C9\u30E9\u30A4\u30D0\u6A5F\u80FD\u306F\u3001Java\u7248\u306E\u307F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059 (\u30CD\u30A4\u30C6\u30A3\u30D6\u7248\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093)\u3002
helpAddDriversText=\u8FFD\u52A0\u30C9\u30E9\u30A4\u30D0\u306F\u3001Jar\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240\u3092\u74B0\u5883\u5909\u6570 H2DRIVERS\u3001\u307E\u305F\u306F CLASSPATH \u306B\u8FFD\u52A0\u3059\u308B\u3053\u3068\u3067\u767B\u9332\u3067\u304D\u307E\u3059\u3002\u4F8B (Windows)\: \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30C9\u30E9\u30A4\u30D0\u30E9\u30A4\u30D6\u30E9\u30EA C\:\\Programs\\hsqldb\\lib\\hsqldb.jar \u3092\u8FFD\u52A0\u3059\u308B\u306B\u306F\u3001\u74B0\u5883\u5909\u6570 H2DRIVERS \u306B\u3001C\:\\Programs\\hsqldb\\lib\\hsqldb.jar \u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002
helpAddRow=\u65B0\u3057\u3044\u884C\u3092\u8FFD\u52A0
helpCommandHistory=\u30B3\u30DE\u30F3\u30C9\u5C65\u6B74\u3092\u8868\u793A
......
......@@ -31,7 +31,6 @@ adminTitle=H2 Console instellingen
helpAction=Gebeurtenis
helpAddAnotherRow=Voeg nogmaals een nieuwe regel toe
helpAddDrivers=Toevoegen drivers voor een database
helpAddDriversOnlyJava=ALleen de Java-versie staat het toevoegen van extra drivers toe (deze mogelijkheid is niet ondersteund door de Native-version)
helpAddDriversText=Extra drivers voor een database kunnen worden geregistreerd door het toevoegen van het Jar-bestand van de driver aan de omgevingsvariabelen H2DRIVERS of CLASSPATH. Voorbeeld (Windows)\: om de driver bibliotheek C\:\\Programs\\hsqldb\\lib\\hsqldb.jar toe te voegen, moet de omgevingsvariabele H2DRIVERS op C\:\\Programs\\hsqldb\\lib\\hsqldb.jar gezet worden.
helpAddRow=Voeg een nieuwe regel toe
helpCommandHistory=Toont de geschiedenis van commando's
......
......@@ -31,7 +31,6 @@ adminTitle=Ustawienia konsoli H2
helpAction=Akcja
helpAddAnotherRow=Dodaj kolejny rekord
helpAddDrivers=Dodatkowe sterowniki baz danych
helpAddDriversOnlyJava=Tylko implementacja w Javie pozwala na dodawanie dodatkowych sterownik&oacute;w (nie wspierane przez wersje natywn&\#261;).
helpAddDriversText=Additional database drivers can be registerd by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Dodaj nowy rekord
helpCommandHistory=Pokazuje histori&\#281; komend
......@@ -94,7 +93,7 @@ toolbar.maxRows=Maksymalna ilo&\#347;&\#263; rekord&oacute;w
toolbar.refresh=Od&\#347;wie&\#380;
toolbar.rollback=Cofnij zmiany
toolbar.run=Wykonaj (Ctrl+Enter)
toolbar.sqlStatement=Zapytanie SQL
toolbar.sqlStatement=Zapytanie SQL
tree.admin=Administrator
tree.current=Bierz&\#261;ca warto&\#347;&\#263;
tree.hashed=Haszowany
......
......@@ -31,7 +31,6 @@ adminTitle=Configura&ccedil;&atilde;o do H2 Terminal
helpAction=A&ccedil;&atilde;o
helpAddAnotherRow=Adicionar outra linha
helpAddDrivers=Adicionar drivers de Base de Dados
helpAddDriversOnlyJava=Apenas a vers&atilde;o Java permite que sejam adicionados novos drivers (est&aacute; op&ccedil;&atilde;o n&atilde;o &eacute; suportada pela vers&atilde;o nativa)
helpAddDriversText=&Eacute; poss&iacute;vel registrar outros drivers, adicionando o arquivo JAR respectivo na vari&aacute;vel de ambiente H2DRIVERS ou CLASSPATH. Exemplo (Windows)\: Para adicionar o driver que est&aacute; em C\:\\Programs\\hsqldb\\lib\\hsqldb.jar altere o valor da vari&aacute;vel de ambiente H2DRIVERS para C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Adicionar uma linha nova
helpCommandHistory=Mostrar o hist&oacute;rico de comandos
......
......@@ -31,7 +31,6 @@ adminTitle=Preferencias da Consola H2
helpAction=Ac&ccedil;&atilde;o
helpAddAnotherRow=Adicionar outra linha
helpAddDrivers=Adicionar drivers de Base de Dados
helpAddDriversOnlyJava=Apenas a vers&atilde;o Java permite que sejam adicionados novos drivers (esta op&ccedil;&atilde;o n&atilde;o &eacute; suportado pela vers&atilde;o nativa)
helpAddDriversText=&Eacute; poss&iacute;vel registar outros drivers, adicionando o ficheiro JAR respectivo, &agrave; vari&aacute;vel de ambiente H2DRIVERS ou CLASSPATH. Exemplo (Windows)\: Para adicionar o driver que se encontra em C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, alterar o valor da vari&aacute;vel de ambiente H2DRIVERS para C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Adicionar uma linha nova
helpCommandHistory=Mostrar o hist&oacute;rico de comandos
......
......@@ -31,7 +31,6 @@ adminTitle=H2 Console Preferences
helpAction=&\#1044;&\#1077;&\#1081;&\#1089;&\#1090;&\#1074;&\#1080;&\#1077;
helpAddAnotherRow=&\#1044;&\#1086;&\#1073;&\#1072;&\#1074;&\#1080;&\#1090;&\#1100; &\#1089;&\#1090;&\#1088;&\#1086;&\#1082;&\#1091;
helpAddDrivers=&\#1044;&\#1072;&\#1073;&\#1072;&\#1074;&\#1083;&\#1103;&\#1077;&\#1084; &\#1076;&\#1088;&\#1072;&\#1081;&\#1074;&\#1077;&\#1088; &\#1073;&\#1072;&\#1079;&\#1099; &\#1076;&\#1072;&\#1085;&\#1085;&\#1099;&\#1093;
helpAddDriversOnlyJava=&\#1058;&\#1086;&\#1083;&\#1100;&\#1082;&\#1086; &\#1074;&\#1077;&\#1088;&\#1089;&\#1080;&\#1103; Java &\#1087;&\#1086;&\#1076;&\#1076;&\#1077;&\#1088;&\#1078;&\#1080;&\#1074;&\#1072;&\#1077;&\#1090; &\#1076;&\#1086;&\#1087;&\#1086;&\#1083;&\#1085;&\#1080;&\#1090;&\#1077;&\#1083;&\#1100;&\#1085;&\#1099;&\#1077; &\#1076;&\#1088;&\#1072;&\#1081;&\#1074;&\#1077;&\#1088;&\#1072; (&\#1101;&\#1090;&\#1072; &\#1086;&\#1087;&\#1094;&\#1080;&\#1103; &\#1085;&\#1077; &\#1087;&\#1086;&\#1076;&\#1076;&\#1077;&\#1088;&\#1078;&\#1080;&\#1074;&\#1072;&\#1077;&\#1090;&\#1089;&\#1103; &\#1088;&\#1086;&\#1076;&\#1085;&\#1086;&\#1081; (&\#1090;&\#1077;&\#1082;&\#1091;&\#1097;&\#1077;&\#1081;) &\#1074;&\#1077;&\#1088;&\#1089;&\#1080;&\#1077;&\#1081;).
helpAddDriversText=&\#1044;&\#1086;&\#1087;&\#1086;&\#1083;&\#1085;&\#1080;&\#1090;&\#1077;&\#1083;&\#1100;&\#1085;&\#1099;&\#1077; &\#1076;&\#1088;&\#1072;&\#1081;&\#1074;&\#1077;&\#1088;&\#1099; &\#1073;&\#1072;&\#1079;&\#1099; &\#1076;&\#1072;&\#1085;&\#1085;&\#1099;&\#1093; &\#1084;&\#1086;&\#1075;&\#1091;&\#1090; &\#1073;&\#1099;&\#1090;&\#1100; &\#1079;&\#1072;&\#1088;&\#1077;&\#1075;&\#1077;&\#1089;&\#1090;&\#1088;&\#1080;&\#1088;&\#1086;&\#1074;&\#1072;&\#1085;&\#1099; &\#1076;&\#1086;&\#1073;&\#1072;&\#1074;&\#1083;&\#1077;&\#1085;&\#1080;&\#1077;&\#1084; &\#1089;&\#1086;&\#1086;&\#1090;&\#1074;&\#1077;&\#1090;&\#1089;&\#1090;&\#1074;&\#1091;&\#1102;&\#1097;&\#1080;&\#1093; Jar-&\#1092;&\#1072;&\#1081;&\#1083;&\#1086;&\#1074; &\#1074; &\#1087;&\#1077;&\#1088;&\#1077;&\#1084;&\#1077;&\#1085;&\#1085;&\#1091;&\#1102; &\#1089;&\#1088;&\#1077;&\#1076;&\#1099; H2DRIVERS &\#1080;&\#1083;&\#1080; &\#1074; CLASSPATH. &\#1055;&\#1088;&\#1080;&\#1084;&\#1077;&\#1088; (Windows)\: &\#1063;&\#1090;&\#1086;&\#1073;&\#1099; &\#1076;&\#1086;&\#1073;&\#1072;&\#1080;&\#1090;&\#1100; &\#1073;&\#1080;&\#1073;&\#1083;&\#1080;&\#1086;&\#1090;&\#1077;&\#1082;&\#1091; &\#1076;&\#1088;&\#1072;&\#1081;&\#1074;&\#1077;&\#1088;&\#1072; &\#1073;&\#1072;&\#1079;&\#1099; &\#1076;&\#1072;&\#1085;&\#1085;&\#1099;&\#1093; C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, &\#1091;&\#1089;&\#1090;&\#1072;&\#1085;&\#1086;&\#1074;&\#1080;&\#1090;&\#1077; &\#1074; &\#1087;&\#1077;&\#1088;&\#1077;&\#1084;&\#1077;&\#1085;&\#1085;&\#1091;&\#1102; &\#1089;&\#1088;&\#1077;&\#1076;&\#1099; H2DRIVERS &\#1079;&\#1085;&\#1072;&\#1095;&\#1077;&\#1085;&\#1080;&\#1077; C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=&\#1044;&\#1086;&\#1073;&\#1072;&\#1074;&\#1080;&\#1090;&\#1100; &\#1085;&\#1086;&\#1074;&\#1091;&\#1102; &\#1089;&\#1090;&\#1088;&\#1086;&\#1082;&\#1091;
helpCommandHistory=&\#1055;&\#1086;&\#1082;&\#1072;&\#1079;&\#1099;&\#1074;&\#1072;&\#1077;&\#1090; &\#1080;&\#1089;&\#1090;&\#1086;&\#1088;&\#1080;&\#1102; &\#1074;&\#1099;&\#1087;&\#1086;&\#1083;&\#1077;&\#1085;&\#1085;&\#1099;&\#1093; &\#1082;&\#1086;&\#1084;&\#1072;&\#1085;&\#1076;
......
......@@ -31,7 +31,6 @@ adminTitle=H2 Konsol ayarlar&\#305;
helpAction=Aksiyon
helpAddAnotherRow=Yeni bir sat&\#305;r ekle
helpAddDrivers=Veritaban&\#305; s&\#252;r&\#252;c&\#252;s&\#252; ekle
helpAddDriversOnlyJava=Ek s&\#252;r&\#252;c&\#252;ler sadece Java s&\#252;r&\#252;m&\#252; ile kullan&\#305;labilir.
helpAddDriversText=Yeni veri taban&\#305; s&\#252;r&\#252;c&\#252;leri eklemek i&\#231;in, s&\#252;r&\#252;c&\#252; dosyalar&\#305;n&\#305;n yerini H2DRIVERS yada CLASSPATH &\#231;evre de&\#287;i&\#351;kenlerine ekleyebilirsiniz. &\#214;rnek (Windows)\: S&\#252;r&\#252;c&\#252; dosyas&\#305; C\:\\Programs\\hsqldb\\lib\\hsqldb.jar ise H2DRIVERS de&\#287;i&\#351;kenini C\:\\Programs\\hsqldb\\lib\\hsqldb.jar olarak girin.
helpAddRow=Veri taban&\#305;na yeni bir sat&\#305;r ekler
helpCommandHistory=Komut tarih&\#231;esini g&\#246;sterir
......
......@@ -31,7 +31,6 @@ adminTitle=&\#x041D;&\#x0430;&\#x0441;&\#x0442;&\#x0440;&\#x043E;&\#x0439;&\#x04
helpAction=&\#x0414;&\#x0456;&\#x044F;
helpAddAnotherRow=&\#x0414;&\#x043E;&\#x0434;&\#x0430;&\#x0442;&\#x0438; &\#x043D;&\#x043E;&\#x0432;&\#x0438;&\#x0439; &\#x0440;&\#x044F;&\#x0434;&\#x043E;&\#x043A;
helpAddDrivers=&\#x0414;&\#x043E;&\#x0434;&\#x0430;&\#x0442;&\#x0438; &\#x0434;&\#x0440;&\#x0430;&\#x0439;&\#x0432;&\#x0435;&\#x0440; &\#x0431;&\#x0430;&\#x0437;&\#x0438; &\#x0434;&\#x0430;&\#x043D;&\#x0438;&\#x0445;
helpAddDriversOnlyJava=&\#x041B;&\#x0438;&\#x0448;&\#x0435; Java &\#x0432;&\#x0435;&\#x0440;&\#x0441;&\#x0456;&\#x044F; &\#x043F;&\#x0456;&\#x0434;&\#x0442;&\#x0440;&\#x0438;&\#x043C;&\#x0443;&\#x0454; &\#x0434;&\#x043E;&\#x0434;&\#x0430;&\#x0442;&\#x043A;&\#x043E;&\#x0432;&\#x0456; &\#x0434;&\#x0440;&\#x0430;&\#x0439;&\#x0432;&\#x0435;&\#x0440;&\#x0438; (&\#x0446;&\#x044F; &\#x043C;&\#x043E;&\#x0436;&\#x043B;&\#x0438;&\#x0432;&\#x0456;&\#x0441;&\#x0442;&\#x044C; &\#x043D;&\#x0435; &\#x043F;&\#x0456;&\#x0434;&\#x0442;&\#x0440;&\#x0438;&\#x043C;&\#x0443;&\#x0454;&\#x0442;&\#x044C;&\#x0441;&\#x044F; &\#x0440;&\#x0456;&\#x0434;&\#x043D;&\#x043E;&\#x044E; &\#x0432;&\#x0435;&\#x0440;&\#x0441;&\#x0456;&\#x0454;&\#x044E;).
helpAddDriversText=&\#x041D;&\#x043E;&\#x0432;&\#x0456; &\#x0434;&\#x0440;&\#x0430;&\#x0439;&\#x0432;&\#x0435;&\#x0440;&\#x0438; &\#x0431;&\#x0430;&\#x0437; &\#x0434;&\#x0430;&\#x043D;&\#x0438;&\#x0445; &\#x043C;&\#x043E;&\#x0436;&\#x0443;&\#x0442;&\#x044C; &\#x0431;&\#x0443;&\#x0442;&\#x0438; &\#x0437;&\#x0430;&\#x0440;&\#x0435;&\#x0454;&\#x0441;&\#x0442;&\#x0440;&\#x043E;&\#x0432;&\#x0430;&\#x043D;&\#x0456; &\#x0434;&\#x043E;&\#x0434;&\#x0430;&\#x0432;&\#x0430;&\#x043D;&\#x043D;&\#x044F;&\#x043C; &\#x0448;&\#x043B;&\#x044F;&\#x0445;&\#x0443; &\#x0434;&\#x043E; Jar-&\#x0444;&\#x0430;&\#x0439;&\#x043B;&\#x0443; &\#x0437; &\#x0434;&\#x0440;&\#x0430;&\#x0439;&\#x0432;&\#x0435;&\#x0440;&\#x043E;&\#x043C; &\#x0434;&\#x043E; &\#x0437;&\#x043C;&\#x0456;&\#x043D;&\#x043D;&\#x043E;&\#x0457; &\#x043E;&\#x0442;&\#x043E;&\#x0447;&\#x0435;&\#x043D;&\#x043D;&\#x044F; H2DRIVERS &\#x0430;&\#x0431;&\#x043E; CLASSPATH. &\#x041D;&\#x0430;&\#x043F;&\#x0440;&\#x0438;&\#x043A;&\#x043B;&\#x0430;&\#x0434; (Windows)\: &\#x0429;&\#x043E;&\#x0431; &\#x0434;&\#x043E;&\#x0434;&\#x0430;&\#x0442;&\#x0438; &\#x0434;&\#x0440;&\#x0430;&\#x0439;&\#x0432;&\#x0435;&\#x0440; &\#x0431;&\#x0430;&\#x0437;&\#x0438; &\#x0434;&\#x0430;&\#x043D;&\#x0438;&\#x0445; C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, &\#x0432;&\#x0441;&\#x0442;&\#x0430;&\#x043D;&\#x043E;&\#x0432;&\#x0456;&\#x0442;&\#x044C; &\#x0437;&\#x043C;&\#x0456;&\#x043D;&\#x043D;&\#x0443; &\#x043E;&\#x0442;&\#x043E;&\#x0447;&\#x0435;&\#x043D;&\#x043D;&\#x044F; H2DRIVERS &\#x0440;&\#x0456;&\#x0432;&\#x043D;&\#x043E;&\#x044E; C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=&\#x0414;&\#x043E;&\#x0434;&\#x0430;&\#x0442;&\#x0438; &\#x043D;&\#x043E;&\#x0432;&\#x0438;&\#x0439; &\#x0440;&\#x044F;&\#x0434;&\#x043E;&\#x043A;
helpCommandHistory=&\#x041F;&\#x043E;&\#x043A;&\#x0430;&\#x0437;&\#x0443;&\#x0454; &\#x0456;&\#x0441;&\#x0442;&\#x043E;&\#x0440;&\#x0456;&\#x044E; &\#x043A;&\#x043E;&\#x043C;&\#x0430;&\#x043D;&\#x0434;
......
......@@ -31,7 +31,6 @@ adminTitle=H2 \u63A7\u5236\u53F0\u914D\u7F6E
helpAction=\u6D3B\u52A8
helpAddAnotherRow=\u589E\u52A0\u53E6\u4E00\u884C
helpAddDrivers=\u589E\u52A0\u6570\u636E\u5E93\u9A71\u52A8
helpAddDriversOnlyJava=\u53EA\u6709Java\u7248\u672C\u652F\u6301\u589E\u52A0\u9A71\u52A8\uFF08\u672C\u5730\u7248\u672C\u4E0D\u652F\u6301\u8FD9\u4E2A\u7279\u6027\uFF09\u3002
helpAddDriversText=\u53EF\u4EE5\u901A\u8FC7\u6DFB\u52A0\u7CFB\u7EDF\u73AF\u5883\u53D8\u91CFH2DRIVERS \u6216\u8005 CLASSPATH \u6765\u589E\u52A0\u6570\u636E\u5E93\u9A71\u52A8\u6CE8\u518C\u3002\u4F8B\u5982\uFF08Windows\uFF09\uFF1A\u8981\u589E\u52A0\u6570\u636E\u5E93\u9A71\u52A8C\:\\Programs\\hsqldb\\lib\\hsqldb.jar\uFF0C\u53EF\u4EE5\u589E\u52A0\u7CFB\u7EDF\u73AF\u5883\u53D8\u91CFH2DRIVERS\u5E76\u8BBE\u7F6E\u5230C\:\\Programs\\hsqldb\\lib\\hsqldb.jar\u3002
helpAddRow=\u589E\u52A0\u65B0\u7684\u4E00\u884C
helpCommandHistory=\u663E\u793A\u5386\u53F2SQL\u547D\u4EE4
......
......@@ -74,8 +74,6 @@ function set(s) {
<h3>${text.helpAddDrivers}</h3>
<p>
${text.helpAddDriversText}
</p><p>
${text.helpAddDriversOnlyJava}
</p>
</div>
......
......@@ -67,6 +67,7 @@ public abstract class Table extends SchemaObjectBase {
private ObjectArray views;
private boolean checkForeignKeyConstraints = true;
private boolean onCommitDrop, onCommitTruncate;
private Row nullRow;
/**
* Lock the table for the given session.
......@@ -385,13 +386,15 @@ public abstract class Table extends SchemaObjectBase {
}
public Row getNullRow() {
// TODO memory usage: if rows are immutable, we could use a static null
// row
Row row = new Row(new Value[columns.length], 0);
for (int i = 0; i < columns.length; i++) {
row.setValue(i, ValueNull.INSTANCE);
synchronized (this) {
if (nullRow == null) {
nullRow = new Row(new Value[columns.length], 0);
for (int i = 0; i < columns.length; i++) {
nullRow.setValue(i, ValueNull.INSTANCE);
}
}
return nullRow;
}
return row;
}
public Column[] getColumns() {
......
......@@ -242,7 +242,7 @@ public class TableFilter implements ColumnResolver {
state = AFTER_LAST;
} else {
if ((++scanCount & 4095) == 0) {
logScanCount();
checkTimeout();
}
if (cursor.next()) {
currentSearchRow = cursor.getSearchRow();
......@@ -267,21 +267,19 @@ public class TableFilter implements ColumnResolver {
continue;
}
boolean joinConditionOk = isOk(joinCondition);
if (state == FOUND && joinConditionOk) {
foundOne = true;
if (state == FOUND) {
if (joinConditionOk) {
foundOne = true;
} else {
continue;
}
}
if (join != null) {
join.reset();
}
boolean doContinue = false;
if (join != null) {
if (!join.next()) {
doContinue = true;
continue;
}
}
if (doContinue) {
continue;
}
// check if it's ok
if (state == NULL_ROW || joinConditionOk) {
return true;
......@@ -291,7 +289,8 @@ public class TableFilter implements ColumnResolver {
return false;
}
private void logScanCount() {
private void checkTimeout() throws SQLException {
session.checkCancelled();
// System.out.println(this.alias+ " " + table.getName() + ": " + scanCount);
}
......
......@@ -34,6 +34,8 @@ import org.h2.util.StringUtils;
/**
* A facility to read from and write to CSV (comma separated values) files.
*
* @author Thomas Mueller, Sylvain Cuaz
*/
public class Csv implements SimpleRowSource {
......@@ -47,6 +49,7 @@ public class Csv implements SimpleRowSource {
private char fieldDelimiter = '\"';
private char escapeCharacter = '\"';
private String lineSeparator = SysProperties.LINE_SEPARATOR;
private String nullString = "";
private String fileName;
private Reader reader;
private Writer writer;
......@@ -256,6 +259,8 @@ public class Csv implements SimpleRowSource {
} else {
writer.write(s);
}
} else if (nullString.length() > 0) {
writer.write(nullString);
}
}
if (rowSeparatorWrite != null) {
......@@ -351,8 +356,10 @@ public class Csv implements SimpleRowSource {
// ignore spaces
continue;
} else if (ch == fieldSeparatorRead) {
// null
break;
} else if (ch == fieldDelimiter) {
// delimited value
StringBuffer buff = new StringBuffer();
boolean containsEscape = false;
while (true) {
......@@ -403,6 +410,7 @@ public class Csv implements SimpleRowSource {
}
break;
} else if (ch == commentLineStart) {
// comment until end of line
while (true) {
ch = readChar();
if (ch < 0 || ch == '\r' || ch == '\n') {
......@@ -412,6 +420,7 @@ public class Csv implements SimpleRowSource {
endOfLine = true;
break;
} else {
// undelimited value
StringBuffer buff = new StringBuffer();
buff.append((char) ch);
while (true) {
......@@ -427,7 +436,8 @@ public class Csv implements SimpleRowSource {
}
buff.append((char) ch);
}
value = buff.toString().trim();
// check undelimited value for nullString
value = readNull(buff.toString().trim());
break;
}
}
......@@ -435,6 +445,10 @@ public class Csv implements SimpleRowSource {
return StringCache.get(value);
}
private String readNull(String s) {
return s.equals(nullString) ? null : s;
}
private String unEscape(String s) {
StringBuffer buff = new StringBuffer(s.length());
int start = 0;
......@@ -622,4 +636,13 @@ public class Csv implements SimpleRowSource {
this.lineSeparator = lineSeparator;
}
/**
* Set the value that represents NULL.
*
* @param nullString the null
*/
public void setNullString(String nullString) {
this.nullString = nullString;
}
}
......@@ -51,6 +51,8 @@ public class RandomUtils {
}
};
Thread t = new Thread(runnable);
// let the process terminate even if generating the seed is really slow
t.setDaemon(true);
t.start();
Thread.yield();
try {
......
......@@ -14,25 +14,29 @@ import org.h2.constant.SysProperties;
public class StartBrowser {
public static void openURL(String url) {
String osName = SysProperties.getStringSetting("os.name", "Linux");
String osName = SysProperties.getStringSetting("os.name", "linux").toLowerCase();
Runtime rt = Runtime.getRuntime();
try {
if (osName.startsWith("Windows")) {
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
} else if (osName.startsWith("Mac OS X")) {
// Runtime.getRuntime().exec("open -a safari " + url);
// Runtime.getRuntime().exec("open " + url + "/index.html");
Runtime.getRuntime().exec("open " + url);
if (osName.indexOf("windows") >= 0) {
rt.exec(new String[] { "rundll32", "url.dll,FileProtocolHandler", url });
} else if (osName.indexOf("mac") >= 0) {
Runtime.getRuntime().exec(new String[] { "open", url });
} else {
try {
Runtime.getRuntime().exec("firefox " + url);
} catch (Exception e) {
String[] browsers = { "firefox", "mozilla-firefox", "mozilla", "konqueror", "netscape", "opera" };
boolean ok = false;
for (int i = 0; i < browsers.length; i++) {
try {
Runtime.getRuntime().exec("mozilla-firefox " + url);
} catch (Exception e2) {
// No success in detection.
System.out.println("Please open a browser and go to " + url);
rt.exec(new String[] { browsers[i], url });
ok = true;
break;
} catch (Exception e) {
// ignore and try the next
}
}
if (!ok) {
// No success in detection.
System.out.println("Please open a browser and go to " + url);
}
}
} catch (IOException e) {
System.out.println("Failed to start a browser to open the URL " + url);
......
......@@ -66,6 +66,7 @@ import org.h2.test.jdbcx.TestXA;
import org.h2.test.jdbcx.TestXASimple;
import org.h2.test.mvcc.TestMvcc1;
import org.h2.test.mvcc.TestMvcc2;
import org.h2.test.mvcc.TestMvcc3;
import org.h2.test.server.TestNestedLoop;
import org.h2.test.server.TestPgServer;
import org.h2.test.server.TestWeb;
......@@ -155,55 +156,10 @@ java org.h2.test.TestAll timer
/*
apple:
- console doesn't always work in safari, fix
C:\temp\db
select.sql
ant 'get' for dependencies
H2 is an SQL database engine written in Java.
It is very fast and small (about 1 MB).
Embedded, server, and clustering modes are available.
A browser based console application is included.
Disk based and in-memory tables and databases are supported.
Some of its features are transactions isolation, multi-version concurrency
(MVCC), level locking, encrypted databases, fulltext search,
and strong security.
The main API is JDBC, however ODBC and others are also
supported via PostgreSQL network protocol compatibility.
I was looking at MVCC today, I hope it will solve some of my problems
in future. MVCC is listed in the "Advanced Topics" documentation
without any warnings. However, I have encountered a major problem. All
you need to do is use jdbc:h2:test;MVCC=true with a range comparison
in a WHERE clause on an indexed column:
SET AUTOCOMMIT TRUE;
DROP TABLE IF EXISTS test;
CREATE TABLE test (id IDENTITY, A INT, B INT);
CREATE INDEX A ON test(A);
INSERT INTO test VALUES(0, 0, 0);
INSERT INTO test VALUES(2, 2, 2);
SET AUTOCOMMIT FALSE;
SELECT * FROM test WHERE id BETWEEN 0 AND 2;
-- Returned the correct result: TABLE(ID INT=(0,2), A INT=(0,2), B INT=(0,2))
INSERT INTO test VALUES(1, 1, 1);
SELECT * FROM test;
-- Returned the correct result: TABLE(ID INT=(0,2,1), A INT=(0,2,1), B INT=(0,2,1))
SELECT * FROM test WHERE id IS NOT NULL;
-- Returned the correct result: TABLE(ID INT=(0,2,1), A INT=(0,2,1), B INT=(0,2,1))
SELECT * FROM test WHERE id <> 99;
-- Returned the correct result: TABLE(ID INT=(0,2,1), A INT=(0,2,1), B INT=(0,2,1))
SELECT * FROM test WHERE id < 99;
-- Returned WRONG result: TABLE(ID INT=(1,1,2), A INT=(1,1,2), B INT=(1,1,2))
SELECT * FROM test WHERE id >= 0;
-- Returned WRONG result: TABLE(ID INT=(1,1,2), A INT=(1,1,2), B INT=(1,1,2))
SELECT * FROM test WHERE A >= 0;
-- Returned WRONG result: TABLE(ID INT=(1,1,2), A INT=(1,1,2), B INT=(1,1,2))
SELECT * FROM test WHERE B >= 0;
-- Returned the correct result: TABLE(ID INT=(0,2,1), A INT=(0,2,1), B INT=(0,2,1))
If you have a 2nd connection open while the 1st connection's
transaction is uncommitted, the 2nd connection also returns the wrong
result set! This is the same whether the lock mode is READ_COMMITTED
or SERIALIZABLE.
test startbrowser with ubuntu
fix or disable the linear hash index
......@@ -212,9 +168,25 @@ link to new changelog and roadmap, remove pages from google groups
Can sometimes not delete log file? need test case
ant 'get' for dependencies
Add where required // TODO: change in version 1.1
History:
When using multi-version concurrency (MVCC=TRUE), duplicate rows could appear in the result set when running queries
with uncommitted changes in the same session.
H2 Console: remote connections were very slow because getHostName/getRemoteHost was used. Fixed (now using getHostAddress/getRemoteAddr.
H2 Console: on Linux, Firefox is now started if available. This has been tested on Ubuntu.
H2 Console: the start window works better with IKVM
H2 Console: improved compatibility with Safari (Safari requires keep-alive)
Random: the process didn't stop if generating the random seed using the standard
way (SecureRandom.generateSeed) was very slow. Now using a daemon thread
to avoid this problem.
SELECT UNION with a different number of ORDER BY columns did throw an ArrayIndexOutOfBoundsException.
When using view, the precision of column was changed to the default scale for some data types.
CSVWRITE now supports a 'null string' that is used for parsing and writing NULL.
Some long running queries could not be cancelled.
Queries with many outer join tables were very slow. Fixed.
Roadmap:
......@@ -490,6 +462,7 @@ Roadmap:
// mvcc
new TestMvcc1().runTest(this);
new TestMvcc2().runTest(this);
new TestMvcc3().runTest(this);
// synth
new TestCrashAPI().runTest(this);
......
......@@ -17,6 +17,7 @@ import java.util.Random;
import org.h2.test.TestBase;
import org.h2.tools.Csv;
import org.h2.util.FileUtils;
import org.h2.util.IOUtils;
import org.h2.util.StringUtils;
......@@ -26,6 +27,7 @@ import org.h2.util.StringUtils;
public class TestCsv extends TestBase {
public void test() throws Exception {
testNull();
testRandomData();
testEmptyFieldDelimiter();
testFieldDelimiter();
......@@ -35,6 +37,52 @@ public class TestCsv extends TestBase {
testPipe();
}
/**
* Test custom NULL string.
*
* @author Sylvain Cuaz, Thomas Mueller
*/
public void testNull() throws Exception {
deleteDb("csv");
File f = new File(baseDir + "/testNull.csv");
FileUtils.delete(f.getAbsolutePath());
RandomAccessFile file = new RandomAccessFile(f, "rw");
String csvContent = "\"A\",\"B\",\"C\",\"D\"\n\\N,\"\",\"\\N\",";
file.write(csvContent.getBytes("UTF-8"));
file.close();
Csv csv = Csv.getInstance();
csv.setNullString("\\N");
ResultSet rs = csv.read(f.getPath(), null, "UTF8");
ResultSetMetaData meta = rs.getMetaData();
check(meta.getColumnCount(), 4);
check(meta.getColumnLabel(1), "A");
check(meta.getColumnLabel(2), "B");
check(meta.getColumnLabel(3), "C");
check(meta.getColumnLabel(4), "D");
check(rs.next());
check(rs.getString(1), null);
check(rs.getString(2), "");
// null is never quoted
check(rs.getString(3), "\\N");
// an empty string is always parsed as null
check(rs.getString(4), null);
checkFalse(rs.next());
Connection conn = getConnection("csv");
Statement stat = conn.createStatement();
stat.execute("call csvwrite('" + f.getPath() + "', 'select NULL as a, '''' as b, ''\\N'' as c, NULL as d', 'UTF8', ',', '\"', NULL, '\\N', '\n')");
FileReader reader = new FileReader(f);
// on read, an empty string is treated like null,
// but on write a null is always written with the nullString
String data = IOUtils.readStringAndClose(reader, -1);
check(csvContent + "\\N", data.trim());
conn.close();
FileUtils.delete(f.getAbsolutePath());
}
private void testRandomData() throws Exception {
deleteDb("csv");
Connection conn = getConnection("csv");
......@@ -82,7 +130,7 @@ public class TestCsv extends TestBase {
f.delete();
Connection conn = getConnection("csv");
Statement stat = conn.createStatement();
stat.execute("call csvwrite('"+baseDir+"/test.csv', 'select 1 id, ''Hello'' name', null, '|', '', null, chr(10))");
stat.execute("call csvwrite('"+baseDir+"/test.csv', 'select 1 id, ''Hello'' name', null, '|', '', null, null, chr(10))");
FileReader reader = new FileReader(baseDir + "/test.csv");
String text = IOUtils.readStringAndClose(reader, -1).trim();
text = StringUtils.replaceAll(text, "\n", " ");
......
......@@ -8,6 +8,7 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Driver;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.sql.Types;
......@@ -29,6 +30,7 @@ public class TestMetaData extends TestBase {
deleteDb("metaData");
conn = getConnection("metaData");
testColumnPrecision();
testColumnDefault();
testCrossReferences();
testProcedureColumns();
......@@ -191,6 +193,27 @@ public class TestMetaData extends TestBase {
}
private void testColumnPrecision() throws Exception {
Statement stat = conn.createStatement();
stat.execute("CREATE TABLE ONE(X NUMBER(12,2), Y FLOAT)");
stat.execute("CREATE TABLE TWO AS SELECT * FROM ONE");
ResultSet rs;
ResultSetMetaData meta;
rs = stat.executeQuery("SELECT * FROM ONE");
meta = rs.getMetaData();
check(12, meta.getPrecision(1));
check(17, meta.getPrecision(2));
check(Types.DECIMAL, meta.getColumnType(1));
check(Types.DOUBLE, meta.getColumnType(2));
rs = stat.executeQuery("SELECT * FROM TWO");
meta = rs.getMetaData();
check(12, meta.getPrecision(1));
check(17, meta.getPrecision(2));
check(Types.DECIMAL, meta.getColumnType(1));
check(Types.DOUBLE, meta.getColumnType(2));
stat.execute("DROP TABLE ONE, TWO");
}
private void testColumnDefault() throws Exception {
DatabaseMetaData meta = conn.getMetaData();
ResultSet rs;
......
/*
* Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.test.mvcc;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import org.h2.test.TestBase;
/**
* Additional MVCC (multi version concurrency) test cases.
*/
public class TestMvcc3 extends TestBase {
public void test() throws Exception {
if (!config.mvcc) {
return;
}
deleteDb("mvcc3");
Connection conn = getConnection("mvcc3");
Statement stat = conn.createStatement();
stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY)");
stat.execute("INSERT INTO TEST VALUES(0)");
conn.setAutoCommit(false);
stat.execute("INSERT INTO TEST VALUES(1)");
ResultSet rs = stat.executeQuery("SELECT * FROM TEST ORDER BY ID");
rs.next();
check(0, rs.getInt(1));
rs.next();
check(1, rs.getInt(1));
conn.close();
}
}
--- special grammar and test cases ---------------------------------------------------------------------------------------------
(SELECT X FROM DUAL ORDER BY X+2) UNION SELECT X FROM DUAL;
> X
> -
> 1
> 1
> rows (ordered): 2
create table test(a int, b int default 1);
> ok
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论