提交 6f06aa37 authored 作者: Thomas Mueller's avatar Thomas Mueller

CSVREAD: the function didn't close the file. Thanks to Vince Bonfanti for the patch!

上级 051eb419
......@@ -1884,7 +1884,12 @@ public class Function extends Expression implements FunctionCall {
char fieldSeparator = csv.getFieldSeparatorRead();
String[] columns = StringUtils.arraySplit(columnList, fieldSeparator, true);
ResultSet rs = csv.read(fileName, columns, charset);
ValueResultSet vr = ValueResultSet.getCopy(rs, 0);
ValueResultSet vr;
try {
vr = ValueResultSet.getCopy(rs, 0);
} finally {
rs.close();
}
return vr;
}
default:
......
......@@ -40,7 +40,7 @@ public class ValueResultSet extends Value {
/**
* Create a result set value for the given result set. The result set will
* be fully read in memory.
* be fully read in memory. The original result set is not closed.
*
* @param rs the result set
* @param maxrows the maximum number of rows to read (0 to just read the
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论