提交 46629ef6 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix ExpressionColumn.getSQL() for DATABASE_TO_UPPER=FALSE

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