From f946f8383bc3ca287f8711a486c057d5aee082e9 Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Thu, 4 Nov 2010 17:58:00 +0000 Subject: [PATCH] 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 --- .../java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java index 1321f8b90..3d9fb4f8a 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java @@ -32,6 +32,7 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; 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.JDBCStore; import org.apache.openjpa.jdbc.kernel.exps.FilterValue; @@ -459,7 +460,8 @@ public class MySQLDictionary */ @Override 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 return blobTypeName; // return old default of 64KB else if (col.getSize() <= 255)