提交 5818aa0b authored 作者: Thomas Mueller's avatar Thomas Mueller

Fix bug with ALLOW_LITERALS=NONE.

上级 f0dd328d
......@@ -82,7 +82,9 @@ Change Log
</li><li>Fix to org.h2.util.ScriptReader when handling unclosed block comments.
</li><li>Make org.h2.util.ScriptReader throw a better exception when handling broken scripts which generate
extremely large statements.
</li><li>Fix bug with ALLOW_LITERALS=NONE, where the periodic analyze table on insert would throw an exception.
</li><li>Fix bug with ALLOW_LITERALS=NONE,
where the periodic analyze table on insert would throw an exception.
A similar problem was fixed in the Console tool.
</li><li>Issue 510: Make org.h2.bnf public for consumption by external projects, patch by Nicolas Fortin
</li><li>Issue 509: Important fix on ValueGeometry, patch by Nicolas Fortin (with some tweaking)
Make ValueGeometry#getDimensionCount more reliable.
......
......@@ -7,9 +7,9 @@
package org.h2.bnf.context;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import org.h2.command.Parser;
......@@ -141,15 +141,17 @@ public class DbContents {
if (url != null) {
isH2 = url.startsWith("jdbc:h2:");
if (isH2) {
Statement stat = meta.getConnection().createStatement();
ResultSet rs = stat.executeQuery(
"SELECT UPPER(VALUE) FROM INFORMATION_SCHEMA.SETTINGS WHERE NAME='MODE'");
PreparedStatement prep = meta.getConnection().prepareStatement(
"SELECT UPPER(VALUE) FROM INFORMATION_SCHEMA.SETTINGS " +
"WHERE NAME=?");
prep.setString(1, "MODE");
ResultSet rs = prep.executeQuery();
rs.next();
if ("MYSQL".equals(rs.getString(1))) {
isH2ModeMySQL = true;
}
rs.close();
stat.close();
prep.close();
}
isOracle = url.startsWith("jdbc:oracle:");
isPostgreSQL = url.startsWith("jdbc:postgresql:");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论