提交 83feff3e 编写于 作者: D Dave Cramer

patch for null table in getPrimaryKeys

上级 ff494e88
...@@ -2903,9 +2903,11 @@ public abstract class AbstractJdbc1DatabaseMetaData ...@@ -2903,9 +2903,11 @@ public abstract class AbstractJdbc1DatabaseMetaData
" ci.relname AS PK_NAME "+ " ci.relname AS PK_NAME "+
from+ from+
" WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid "+ " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid "+
" AND a.attrelid=ci.oid AND i.indisprimary "+ " AND a.attrelid=ci.oid AND i.indisprimary ";
" AND ct.relname = '"+escapeQuotes(table)+"' "+ if (table != null && !"".equals(table)) {
where+ sql += " AND ct.relname = '"+escapeQuotes(table)+"' ";
}
sql += where+
" ORDER BY table_name, pk_name, key_seq"; " ORDER BY table_name, pk_name, key_seq";
return connection.createStatement().executeQuery(sql); return connection.createStatement().executeQuery(sql);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册