Skip to content

Commit

Permalink
Fix building of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
katzyn committed Apr 14, 2024
1 parent 913692e commit 9713b54
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
9 changes: 6 additions & 3 deletions h2/src/main/org/h2/bnf/context/DbContextRule.java
Expand Up @@ -89,7 +89,8 @@ public boolean autoComplete(Sentence sentence) {
best = quotedName;
bestSchema = schema;
}
} else if (s.isEmpty() || StringUtils.startsWithIgnoringCase(name, query) || StringUtils.startsWithIgnoringCase(quotedName, query)) {
} else if (s.isEmpty() || StringUtils.startsWithIgnoringCase(name, query)
|| StringUtils.startsWithIgnoringCase(quotedName, query)) {
if (s.length() < name.length()) {
sentence.add(name, name.substring(s.length()), type);
sentence.add(schema.quotedName + ".",
Expand All @@ -116,12 +117,14 @@ public boolean autoComplete(Sentence sentence) {
String name = table.getName();
String quotedName = StringUtils.quoteIdentifier(name);

if (StringUtils.startsWithIgnoringCase(query, name) || StringUtils.startsWithIgnoringCase("\"" + query, quotedName)) {
if (StringUtils.startsWithIgnoringCase(query, name)
|| StringUtils.startsWithIgnoringCase("\"" + query, quotedName)) {
if (best == null || name.length() > best.length()) {
best = name;
bestTable = table;
}
} else if (s.isEmpty() || StringUtils.startsWithIgnoringCase(name, query) || StringUtils.startsWithIgnoringCase(quotedName, query)) {
} else if (s.isEmpty() || StringUtils.startsWithIgnoringCase(name, query)
|| StringUtils.startsWithIgnoringCase(quotedName, query)) {
if (s.length() < name.length()) {
sentence.add(table.getQuotedName(),
table.getQuotedName().substring(s.length()),
Expand Down
6 changes: 4 additions & 2 deletions h2/src/main/org/h2/command/CommandRemote.java
Expand Up @@ -286,7 +286,8 @@ public BatchResult executeBatchUpdate(ArrayList<Value[]> batchParameters, Object
}
if (readGeneratedKeys) {
int columnCount = transfer.readInt();
ResultRemote remoteGeneratedKeys = new ResultRemote(session, transfer, objectId, columnCount, Integer.MAX_VALUE);
ResultRemote remoteGeneratedKeys = new ResultRemote(session, transfer, objectId,
columnCount, Integer.MAX_VALUE);
generatedKeys.add(remoteGeneratedKeys);
remoteGeneratedKeys.close();
}
Expand All @@ -310,7 +311,8 @@ public BatchResult executeBatchUpdate(ArrayList<Value[]> batchParameters, Object
autoCommit = transfer.readBoolean();
if (readGeneratedKeys) {
int columnCount = transfer.readInt();
ResultRemote remoteGeneratedKeys = new ResultRemote(session, transfer, objectId, columnCount, Integer.MAX_VALUE);
ResultRemote remoteGeneratedKeys = new ResultRemote(session, transfer, objectId,
columnCount, Integer.MAX_VALUE);
generatedKeys.add(remoteGeneratedKeys);
remoteGeneratedKeys.close();
}
Expand Down
5 changes: 3 additions & 2 deletions h2/src/main/org/h2/mvstore/RandomAccessStore.java
Expand Up @@ -741,8 +741,9 @@ protected void doHousekeeping(MVStore mvStore) throws InterruptedException {
if (idle) {
int currentChunksFillRate = getChunksFillRate();
long currentTotalChunksSize = size() * getFillRate() / 100;
stopIdleHousekeeping = currentTotalChunksSize > chunksTotalSize || currentTotalChunksSize == chunksTotalSize && currentChunksFillRate <= chunksFillRate;
}
stopIdleHousekeeping = currentTotalChunksSize > chunksTotalSize
|| currentTotalChunksSize == chunksTotalSize && currentChunksFillRate <= chunksFillRate;
}
}

private int getTargetFillRate(boolean idle) {
Expand Down
19 changes: 9 additions & 10 deletions h2/src/test/org/h2/test/server/TestWeb.java
Expand Up @@ -566,8 +566,7 @@ private void testWebApp() throws Exception {
private void testSpecialAutoComplete() throws Exception {
Server server = new Server();
server.setOut(new PrintStream(new ByteArrayOutputStream()));
server.runTool("-ifNotExists", "-web", "-webPort", "8182",
"-properties", "null", "-tcp", "-tcpPort", "9101");
server.runTool("-ifNotExists", "-web", "-webPort", "8182", "-properties", "null", "-tcp", "-tcpPort", "9101");
try {
String url = "http://localhost:8182";
WebClient client;
Expand All @@ -578,19 +577,19 @@ private void testSpecialAutoComplete() throws Exception {
client.get(url, "login.jsp");

result = client.get(url, "login.do?driver=org.h2.Driver" +
"&url=jdbc:h2:mem:" + getTestName() +
"&user=sa&password=sa&name=_test_");
"&url=jdbc:h2:mem:" + getTestName() +
"&user=sa&password=sa&name=_test_");
result = client.get(url, "header.jsp");

result = client.get(url, "query.do?sql=" +
"create schema test_schema;" +
"create schema \"quoted schema\";" +
"create table test_schema.test_table(id int primary key, name varchar);" +
"insert into test_schema.test_table values(1, 'Hello');" +
"create table \"quoted schema\".\"quoted tablename\"(id int primary key, name varchar);");
"create schema test_schema;" +
"create schema \"quoted schema\";" +
"create table test_schema.test_table(id int primary key, name varchar);" +
"insert into test_schema.test_table values(1, 'Hello');" +
"create table \"quoted schema\".\"quoted tablename\"(id int primary key, name varchar);");
result = client.get(url, "query.do?sql=create sequence test_schema.test_sequence");
result = client.get(url, "query.do?sql=" +
"create view test_schema.test_view as select * from test");
"create view test_schema.test_view as select * from test");
result = client.get(url, "tables.do");

result = client.get(url, "query.jsp");
Expand Down
2 changes: 1 addition & 1 deletion h2/src/tools/org/h2/build/doc/dictionary.txt
Expand Up @@ -856,4 +856,4 @@ bck clo cur hwm materializedview udca vol connectionpooldatasource xadatasource
ampm sssssff sstzh tzs yyyysssss newsequentialid solidus openjdk furthermore ssff secons nashorn fractions
btrim underscores ffl decomposed decomposition subfield infinities retryable salted establish
hatchet fis loom birthdate penrosed eve graalvm roberto polyglot truffle scriptengine unstarted conversation
recompilations
recompilations normalizer tablename tablenames

0 comments on commit 9713b54

Please sign in to comment.