After the fix I also noticed the following effect. If I do not specify
schema name everything works OK
sb.execute("CREATE LINKED TABLE
two('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://
localhost:1433','myuser','mypassword','testtable')");
but I do specify schema name
sb.execute("CREATE LINKED TABLE
two('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://
localhost:1433','myuser','mypassword','', 'testtable')");
I will get a different error.
=======
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Column LOWER
not found; SQL statement:
SELECT lower,upper,mixed from two [42122-100]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSQLException(Message.java:77)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:
130)
at org.h2.command.dml.Select.prepare(Select.java:710)
at org.h2.command.Parser.prepareCommand(Parser.java:233)
at org.h2.engine.Session.prepareLocal(Session.java:285)
at org.h2.engine.Session.prepareCommand(Session.java:246)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1035)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:70)
at org.h2.samples.Test.mixedCase(Test.java:120)
at org.h2.samples.Test.main(Test.java:15)
=====
The reason for the error is that columns are not converted to upper
case anymore. The fix would be in TableLink.java line 150 delete the
following lines
if (storesLowerCase &&
n.equals(StringUtils.toLowerEnglish(n))) {
n = StringUtils.toUpperEnglish(n);
}
and use
n=convertColumnName(n);
instead as you use it in other places