Program: 125449
Project: 125449
Buggy source:
@Override public ResultSet getColumns(String catalog,String database,String tableNamePattern,String columnNamePattern) throws SQLException {
  String sql;
  if (!StringUtils.isEmpty(database)) {
    sql="String_Node_Str" + database + "String_Node_Str"+ tableNamePattern+ "String_Node_Str";
  }
 else {
    sql="String_Node_Str" + tableNamePattern + "String_Node_Str";
  }
  ResultSet rs=null;
  Statement stmt=null;
  List<String[]> list=new ArrayList<String[]>();
  try {
    stmt=connection.createStatement();
    rs=stmt.executeQuery(sql);
    while (rs.next()) {
      String tableName=tableNamePattern;
      String columnName=rs.getString("String_Node_Str").trim();
      String typeName=rs.getString("String_Node_Str");
      String columnSize=rs.getString("String_Node_Str");
      String decimalDigits=rs.getString("String_Node_Str");
      String isNullable;
      if ("String_Node_Str".equals(rs.getString("String_Node_Str"))) {
        isNullable="String_Node_Str";
      }
 else {
        isNullable=rs.getString("String_Node_Str");
      }
      if (decimalDigits == null) {
        decimalDigits="String_Node_Str";
      }
      String remarks="String_Node_Str";
      String columnDef="String_Node_Str";
      String[] r=new String[]{tableName,columnName,typeName,columnSize,decimalDigits,isNullable,remarks,columnDef};
      list.add(r);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
 finally {
    try {
      rs.close();
      stmt.close();
    }
 catch (    Exception e) {
    }
  }
  TeradataResultSet tableResultSet=new TeradataResultSet();
  tableResultSet.setMetadata(COLUMN_META);
  tableResultSet.setData(list);
  return tableResultSet;
}

Fixed version (ground truth):
@Override public ResultSet getColumns(String catalog,String database,String tableNamePattern,String columnNamePattern) throws SQLException {
  if (databaseName != null && !databaseName.trim().isEmpty()) {
    database=databaseName;
  }
  String sql=null;
  int dbMajorVersion=connection.getMetaData().getDatabaseMajorVersion();
  if (!StringUtils.isEmpty(database)) {
    sql="String_Node_Str" + database + "String_Node_Str"+ tableNamePattern+ "String_Node_Str";
    if (dbMajorVersion > 12) {
      sql="String_Node_Str" + database + "String_Node_Str"+ tableNamePattern+ "String_Node_Str"+ "String_Node_Str";
    }
  }
 else {
    sql="String_Node_Str" + tableNamePattern + "String_Node_Str";
    if (dbMajorVersion > 12) {
      sql="String_Node_Str" + tableNamePattern + "String_Node_Str"+ "String_Node_Str";
    }
  }
  ResultSet rs=null;
  Statement stmt=null;
  List<String[]> list=new ArrayList<String[]>();
  try {
    stmt=connection.createStatement();
    rs=stmt.executeQuery(sql);
    while (rs.next()) {
      String tableName=tableNamePattern;
      String columnName=null;
      String typeName=null;
      String columnSize=null;
      String decimalDigits=null;
      if (dbMajorVersion > 12) {
        columnName=rs.getString("String_Node_Str").trim();
        typeName=rs.getString("String_Node_Str");
        columnSize=rs.getString("String_Node_Str");
        decimalDigits=rs.getString("String_Node_Str");
      }
 else {
        columnName=rs.getString("String_Node_Str").trim();
        typeName=rs.getString("String_Node_Str");
        columnSize=rs.getString("String_Node_Str");
        decimalDigits=rs.getString("String_Node_Str");
      }
      String isNullable;
      if ("String_Node_Str".equals(rs.getString("String_Node_Str"))) {
        isNullable="String_Node_Str";
      }
 else {
        isNullable=rs.getString("String_Node_Str");
      }
      if (typeName == null) {
        typeName="String_Node_Str";
      }
      if (columnSize == null) {
        columnSize="String_Node_Str";
      }
      if (decimalDigits == null) {
        decimalDigits="String_Node_Str";
      }
      String remarks="String_Node_Str";
      String columnDef="String_Node_Str";
      String[] r=new String[]{tableName,columnName,typeName,columnSize,decimalDigits,isNullable,remarks,columnDef};
      list.add(r);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
 finally {
    try {
      rs.close();
      stmt.close();
    }
 catch (    Exception e) {
    }
  }
  TeradataResultSet tableResultSet=new TeradataResultSet();
  tableResultSet.setMetadata(COLUMN_META);
  tableResultSet.setData(list);
  return tableResultSet;
}