提交 f85c131f authored 作者: Owner's avatar Owner

Standardized names, removed sysout comments from test

上级 d3e45541
......@@ -36,16 +36,22 @@ public class ColumnNamer {
* @return the new column name
*/
public static String getColumnName(Expression columnExp, int indexOfColumn, String columnNameOverride) {
// try a name form the column name override
String columnName = null;
if (columnNameOverride != null){
columnName = columnNameOverride;
}
// try a name form the column alias
if (columnName==null && columnExp.getAlias()!=null){
columnName = columnExp.getAlias();
if(!isAllowableColumnName(columnName)){
columnName = columnName.replace('\n', ' ').replace('\r', ' ');
}
if(!isAllowableColumnName(columnName)){
columnName = null;
}
}
// try a name derived form the column expression SQL
if (columnName==null && columnExp.getColumnName()!=null){
columnName = columnExp.getColumnName();
if(!isAllowableColumnName(columnName)){
......@@ -55,6 +61,7 @@ public class ColumnNamer {
columnName = null;
}
}
// go with a innocuous default name pattern
if (columnName==null){
columnName = "_unnamed_column_"+(indexOfColumn+1)+"_";
}
......
......@@ -541,8 +541,6 @@ public class TestGeneralCommonTableQueries extends TestBase {
}
conn.close();
//System.out.println("conn.close();");
deleteDb("commonTableExpressionQueries");
//System.out.println("deleteDb(commonTableExpressionQueries);");
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论