提交 9ca5bd10 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not return null as name of the catalog/schema/table from SimpleResultSet

上级 99c7bb02
......@@ -1984,14 +1984,14 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData,
}
/**
* Returns null.
* Returns empty string.
*
* @param columnIndex (1,2,...)
* @return null
* @return empty string
*/
@Override
public String getCatalogName(int columnIndex) {
return null;
return "";
}
/**
......@@ -2040,25 +2040,25 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData,
}
/**
* Returns null.
* Returns empty string.
*
* @param columnIndex (1,2,...)
* @return null
* @return empty string
*/
@Override
public String getSchemaName(int columnIndex) {
return null;
return "";
}
/**
* Returns null.
* Returns empty string.
*
* @param columnIndex (1,2,...)
* @return null
* @return empty string
*/
@Override
public String getTableName(int columnIndex) {
return null;
return "";
}
// ---- unsupported / result set -----------------------------------
......
......@@ -244,11 +244,11 @@ public class TestTools extends TestDb {
assertTrue(rs.getMetaData().isSearchable(1));
assertTrue(rs.getMetaData().isSigned(1));
assertFalse(rs.getMetaData().isWritable(1));
assertEquals(null, rs.getMetaData().getCatalogName(1));
assertEquals("", rs.getMetaData().getCatalogName(1));
assertEquals(null, rs.getMetaData().getColumnClassName(1));
assertEquals("NULL", rs.getMetaData().getColumnTypeName(1));
assertEquals(null, rs.getMetaData().getSchemaName(1));
assertEquals(null, rs.getMetaData().getTableName(1));
assertEquals("", rs.getMetaData().getSchemaName(1));
assertEquals("", rs.getMetaData().getTableName(1));
assertEquals(ResultSet.HOLD_CURSORS_OVER_COMMIT, rs.getHoldability());
assertEquals(1, rs.getColumnCount());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论