Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.ArrayList;

import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.types.TypeId;

/**
* This class is used at COMPILE TIME ONLY. It is responsible for generating
Expand Down Expand Up @@ -937,6 +938,10 @@ private String extractColName(String colDef) {
* if the received column in the received query has
* no known target type.
*/

// DERBY - 6928
// Use org.apache.derby.iapi.types.TypeId.SMALLINT_NAME instead of hardcoding "SMALLINT"

private String getCastInfoForCol(String queryName,
String colName)
{
Expand All @@ -950,7 +955,8 @@ private String getCastInfoForCol(String queryName,
colName.equals("SQL_DATA_TYPE") ||
colName.equals("SQL_DATETIME_SUB"))
{
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}
else if (queryName.equals("getColumns")) {
Expand All @@ -961,29 +967,34 @@ else if (queryName.equals("getColumns")) {
colName.equals("SQL_DATA_TYPE") ||
colName.equals("SQL_DATETIME_SUB"))
{
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}
else if (queryName.equals("getProcedureColumns")) {
if (colName.equals("DATA_TYPE")) {
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}
else if (queryName.equals("getVersionColumns")) {
if (colName.equals("DATA_TYPE")) {
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}
else if (queryName.startsWith("getBestRowIdentifier")) {
if (colName.equals("DATA_TYPE")) {
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}
else if (queryName.equals("getIndexInfo")) {
if (colName.equals("NON_UNIQUE") ||
colName.equals("TYPE"))
{
return "SMALLINT";
//return "SMALLINT";
return TypeId.SMALLINT_NAME;
}
}

Expand Down
4 changes: 3 additions & 1 deletion java/engine/org/apache/derby/iapi/store/raw/PageKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ public int hashCode() {
}

public String toString() {
return "Page(" + pageNumber + "," + container.toString() + ")";
//return "Page(" + pageNumber + "," + container.toString() + ")";
return "Could not read page " + pageNumber + " from segment "
+ container.getSegmentId() + "of container " + container.getContainerId();
}

}
2 changes: 2 additions & 0 deletions java/tools/org/apache/derby/tools/JDBCDisplayUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ static public void DisplayResults(PrintStream out, ResultSet rs, Connection conn
ShowWarnings(out, rs);
numberOfRowsSelected++;
}
// print number of rows in the result set
indentedPrintLine( out, indentLevel, numberOfRowsSelected + " rows in the result set");
} catch (SQLException e) {
// REVISIT: might want to check the exception
// and for some, not bother with the retry.
Expand Down