提交 1f473b7c authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 0ea548f0
......@@ -4458,6 +4458,7 @@ public class Parser {
}
public Expression parseExpression(String sql) throws SQLException {
parameters = new ObjectArray();
initialize(sql);
read();
return readExpression();
......
......@@ -135,7 +135,6 @@ public class AlterTableAlterColumn extends SchemaCommand {
case DROP: {
checkNoViews();
if (table.getColumns().length == 1) {
// TODO test each sql exception
throw Message.getSQLException(ErrorCode.CANNOT_DROP_LAST_COLUMN, oldColumn.getSQL());
}
table.checkColumnIsNotReferenced(oldColumn);
......
......@@ -840,7 +840,9 @@ public class Select extends Query {
case ExpressionVisitor.GET_DEPENDENCIES: {
for (int i = 0; i < filters.size(); i++) {
TableFilter filter = (TableFilter) filters.get(i);
filter.getTable().addDependencies(visitor.getDependencies());
Table table = filter.getTable();
visitor.addDependency(table);
table.addDependencies(visitor.getDependencies());
}
break;
}
......
......@@ -346,6 +346,9 @@ public class SysProperties {
return s == null ? defaultValue : s;
}
/**
* INTERNAL
*/
public static int getIntSetting(String name, int defaultValue) {
String s = getProperty(name);
if (s != null) {
......
......@@ -431,9 +431,12 @@ public class Aggregate extends Expression {
if (on instanceof ExpressionColumn) {
ExpressionColumn col = (ExpressionColumn) on;
Column column = col.getColumn();
Table table = col.getTableFilter().getTable();
Index index = table.getIndexForColumn(column, first);
return index;
TableFilter filter = col.getTableFilter();
if (filter != null) {
Table table = filter.getTable();
Index index = table.getIndexForColumn(column, first);
return index;
}
}
return null;
}
......
......@@ -247,6 +247,7 @@ public class ExpressionColumn extends Expression {
case ExpressionVisitor.NOT_FROM_RESOLVER:
return resolver != visitor.getResolver();
case ExpressionVisitor.GET_DEPENDENCIES:
visitor.addDependency(column.getTable());
return true;
default:
throw Message.getInternalError("type=" + visitor.type);
......
......@@ -53,6 +53,7 @@ login.connect=Connect
login.driverClass=Driver Class
login.driverNotFound=Database driver not found<br />See in the Help for how to add drivers
login.goAdmin=Preferences
login.goTools=Tools
login.jdbcUrl=JDBC URL
login.language=Language
login.login=Login
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
<!--
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html><head>
......@@ -20,9 +20,12 @@ Initial Developer: H2 Group
>
${languageCombo}
</select>
&nbsp;&nbsp; <a href="admin.do?jsessionid=${sessionId}">${text.login.goAdmin}</a>
&nbsp;&nbsp; <a href="admin.do?jsessionid=${sessionId}">${text.login.goAdmin}</a>
<!--
&nbsp;&nbsp; <a href="tools.jsp?jsessionid=${sessionId}">${text.login.goTools}</a>
-->
&nbsp;&nbsp; <a href="help.jsp?jsessionid=${sessionId}">${text.a.help}</a>
</p>
</p>
<table class="login" cellspacing="0" cellpadding="0">
<tr class="login">
<th class="login">${text.login.login}</th>
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body class="result">
<div id="output">
<h3>Tools</h3>
<p>
<a href="javascript:go('Backup')">Backup</a>
<a href="javascript:go('Restore')">Restore</a>
<a href="javascript:go('ChangePassword')">ChangePassword</a>
<a href="javascript:go('ConvertTraceFile')">ConvertTraceFile</a>
<a href="javascript:go('CreateCluster')">CreateCluster</a>
<a href="javascript:go('DeleteDbFiles')">DeleteDbFiles</a>
<a href="javascript:go('Recover')">Recover</a>
<a href="javascript:go('RunScript')">RunScript</a>
<a href="javascript:go('Script')">Script</a>
<a href="javascript:go('Server')">Server</a>
</p>
</div>
<table id="h2auto" class="autoComp"><tbody></tbody></table>
</body></html>
\ No newline at end of file
......@@ -68,6 +68,7 @@ public class Recover implements DataHandler {
private void showUsage() {
System.out.println("java "+getClass().getName()+" [-dir <dir>] [-db <database>] [-log true]");
System.out.println("For details, see http://h2database.com/javadoc/org/h2/tools/Recover.html");
}
/**
......
......@@ -394,7 +394,7 @@ public class StringUtils {
return dateFormat.parse(date);
}
} catch (ParseException e) {
throw Message.getSQLException(ErrorCode.PARSE_ERROR_1, date);
throw Message.getSQLException(ErrorCode.PARSE_ERROR_1, new String[]{date}, e);
}
}
......@@ -421,7 +421,7 @@ public class StringUtils {
}
return df;
} catch (Exception e) {
throw Message.getSQLException(ErrorCode.PARSE_ERROR_1, format + "/" + locale + "/" + timezone);
throw Message.getSQLException(ErrorCode.PARSE_ERROR_1, new String []{format + "/" + locale + "/" + timezone}, e);
}
}
......
......@@ -151,10 +151,19 @@ java org.h2.test.TestAll timer
/*
integrate tools in H2 Console
for all tools: add link to javadoc (like Recover)
DbStarter: server.start();
add test case!
C:\temp\crash_db
recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...),
and things should go into the .trace.db file
RECOVER=2 should backup the database, run recovery, open the database
RECOVER=2 to backup the database, run recovery, open the database
Recovery should work with encrypted databases
......
......@@ -31,6 +31,9 @@ public class TestFullText extends TestBase {
} catch (ClassNotFoundException e) {
println("Class not found, not tested: " + luceneFullTextClassName);
// ok
} catch (NoClassDefFoundError e) {
println("Class not found, not tested: " + luceneFullTextClassName);
// ok
}
}
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
CREATE TABLE COUNT(X INT);
> ok
CREATE TABLE ITEMS(ID INT CHECK ID < SELECT MAX(ID) FROM COUNT);
> ok
insert into items values(DEFAULT);
> update count: 1
DROP TABLE COUNT;
> exception
insert into items values(DEFAULT);
> update count: 1
drop table items, count;
> ok
CREATE TABLE TEST(ID INT PRIMARY KEY, LABEL CHAR(20), LOOKUP CHAR(30));
> ok
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论