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

H2 Console: improved autocomplete feature (also simplified the source code for this feature).

上级 71f69140
...@@ -1459,7 +1459,7 @@ SET WRITE_DELAY 2000 ...@@ -1459,7 +1459,7 @@ SET WRITE_DELAY 2000
" "
"Commands (Other)","SHUTDOWN"," "Commands (Other)","SHUTDOWN","
SHUTDOWN [ IMMEDIATELY | COMPACT ] SHUTDOWN [ IMMEDIATELY | COMPACT | DEFRAG ]
"," ","
This statement closes all open connections to the database and closes the This statement closes all open connections to the database and closes the
database. This command is usually not required, as the database is database. This command is usually not required, as the database is
...@@ -1474,6 +1474,8 @@ but only for at most the time defined by the system property ""h2.maxCompactTime ...@@ -1474,6 +1474,8 @@ but only for at most the time defined by the system property ""h2.maxCompactTime
SHUTDOWN IMMEDIATELY closes the database files without any cleanup and without compacting. SHUTDOWN IMMEDIATELY closes the database files without any cleanup and without compacting.
SHUTDOWN DEFRAG re-orders the pages when closing the database so that table scans are faster.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
SHUTDOWN COMPACT SHUTDOWN COMPACT
......
...@@ -62,6 +62,11 @@ public class TestWeb extends TestBase { ...@@ -62,6 +62,11 @@ public class TestWeb extends TestBase {
result = client.get(url, "query.do?sql=@HISTORY"); result = client.get(url, "query.do?sql=@HISTORY");
result = client.get(url, "getHistory.do?id=4"); result = client.get(url, "getHistory.do?id=4");
assertContains(result, "select * from test"); assertContains(result, "select * from test");
result = client.get(url, "autoCompleteList.do?query=select 'abc");
// expected: '
assertContains(result, "%27");
result = client.get(url, "autoCompleteList.do?query=se"); result = client.get(url, "autoCompleteList.do?query=se");
// long time = System.currentTimeMillis(); // long time = System.currentTimeMillis();
...@@ -81,6 +86,8 @@ public class TestWeb extends TestBase { ...@@ -81,6 +86,8 @@ public class TestWeb extends TestBase {
assertContains(result, "id"); assertContains(result, "id");
result = client.get(url, "autoCompleteList.do?query=select id x from test te where t"); result = client.get(url, "autoCompleteList.do?query=select id x from test te where t");
assertContains(result, "te"); assertContains(result, "te");
result = client.get(url, "autoCompleteList.do?query=select * from test where name = '");
assertContains(result, "%27");
result = client.get(url, "query.do?sql=delete from test"); result = client.get(url, "query.do?sql=delete from test");
result = client.get(url, "query.do?sql=@LOOP 10 @STATEMENT insert into test values(?, 'Hello')"); result = client.get(url, "query.do?sql=@LOOP 10 @STATEMENT insert into test values(?, 'Hello')");
...@@ -116,9 +123,8 @@ public class TestWeb extends TestBase { ...@@ -116,9 +123,8 @@ public class TestWeb extends TestBase {
client.get(url, "admin.do"); client.get(url, "admin.do");
// this would also stop the server // this would also stop the server
// client.get(url, "adminShutdown.do"); // client.get(url, "adminShutdown.do");
server.stop();
} finally { } finally {
// server.stop(); server.stop();
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论