OPENJPA-1870: Check if columnDefinition was provided before overriding blob type.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1031109 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2010-11-04 17:58:00 +00:00
parent 829334021c
commit f946f8383b
1 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.jdbc.identifier.DBIdentifier; import org.apache.openjpa.jdbc.identifier.DBIdentifier;
import org.apache.openjpa.jdbc.identifier.DBIdentifier.DBIdentifierType;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore; import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.kernel.exps.FilterValue; import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
@ -459,7 +460,8 @@ public class MySQLDictionary
*/ */
@Override @Override
public String getTypeName(Column col) { public String getTypeName(Column col) {
if (col.getType() == Types.BLOB) { // handle blobs differently, if the DBItentifierType is NULL (e.g. no column definition is set).
if (col.getType() == Types.BLOB && col.getTypeIdentifier().getType() == DBIdentifierType.NULL) {
if (col.getSize() <= 0) // unknown size if (col.getSize() <= 0) // unknown size
return blobTypeName; // return old default of 64KB return blobTypeName; // return old default of 64KB
else if (col.getSize() <= 255) else if (col.getSize() <= 255)