Unverified 提交 3d3df51c authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov 提交者: GitHub

Merge pull request #1736 from katzyn/compatibility

Fix ExpressionColumn.getSQL() for DATABASE_TO_UPPER=FALSE
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Issue #1735: Creating views with DATABASE_TO_UPPER=FALSE fails
</li>
<li>Issue #1732: source.html does not work
</li>
<li>Issue #1730: Show error in H2 Console if specified driver is not compatible with URL
......
......@@ -59,22 +59,11 @@ public class ExpressionColumn extends Expression {
@Override
public StringBuilder getSQL(StringBuilder builder) {
boolean quote = database.getSettings().databaseToUpper;
if (schemaName != null) {
if (quote) {
Parser.quoteIdentifier(builder, schemaName);
} else {
builder.append(schemaName);
}
builder.append('.');
Parser.quoteIdentifier(builder, schemaName).append('.');
}
if (tableAlias != null) {
if (quote) {
Parser.quoteIdentifier(builder, tableAlias);
} else {
builder.append(tableAlias);
}
builder.append('.');
Parser.quoteIdentifier(builder, tableAlias).append('.');
}
if (column != null) {
if (derivedName != null) {
......@@ -82,10 +71,8 @@ public class ExpressionColumn extends Expression {
} else {
builder.append(column.getSQL());
}
} else if (quote) {
Parser.quoteIdentifier(builder, columnName);
} else {
builder.append(columnName);
Parser.quoteIdentifier(builder, columnName);
}
return builder;
}
......
......@@ -117,6 +117,13 @@ public class TestCompatibility extends TestDb {
assertEquals(1000000000000000000000e10, rs.getDouble(2));
assertEquals(0xfafbL, rs.getLong(3));
assertFalse(rs.next());
stat.execute("create table \"t 1\" (a int, b int)");
stat.execute("create view v as select * from \"t 1\"");
stat.executeQuery("select * from v").close();
stat.execute("drop view v");
stat.execute("drop table \"t 1\"");
c.close();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论