From 5e8f48ca53f04279db628b0636aab63945c91829 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Wed, 31 Jul 2013 03:12:39 +0000 Subject: [PATCH] remove extra object flags before checking query type git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-1.2.14@764 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/changes/changes.xml | 6 ++++++ src/java/com/healthmarketscience/jackcess/query/Query.java | 6 ++++-- .../com/healthmarketscience/jackcess/query/QueryFormat.java | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index e4887ca..5f6d758 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -4,6 +4,12 @@ Tim McCune + + + Remove extra object flags before checking query type. + + Implement handling of usagemaps for long value (MEMO/OLE) columns. diff --git a/src/java/com/healthmarketscience/jackcess/query/Query.java b/src/java/com/healthmarketscience/jackcess/query/Query.java index 15189b3..4b70e22 100644 --- a/src/java/com/healthmarketscience/jackcess/query/Query.java +++ b/src/java/com/healthmarketscience/jackcess/query/Query.java @@ -413,8 +413,10 @@ public abstract class Query public static Query create(int objectFlag, String name, List rows, int objectId) { + // remove other object flags before testing for query type + int typeFlag = objectFlag & OBJECT_FLAG_MASK; try { - switch(objectFlag) { + switch(typeFlag) { case SELECT_QUERY_OBJECT_FLAG: return new SelectQuery(name, rows, objectId); case MAKE_TABLE_QUERY_OBJECT_FLAG: @@ -436,7 +438,7 @@ public abstract class Query default: // unknown querytype throw new IllegalStateException( - "unknown query object flag " + objectFlag); + "unknown query object flag " + typeFlag); } } catch(IllegalStateException e) { LOG.warn("Failed parsing query", e); diff --git a/src/java/com/healthmarketscience/jackcess/query/QueryFormat.java b/src/java/com/healthmarketscience/jackcess/query/QueryFormat.java index 89d586e..e7381b7 100644 --- a/src/java/com/healthmarketscience/jackcess/query/QueryFormat.java +++ b/src/java/com/healthmarketscience/jackcess/query/QueryFormat.java @@ -58,6 +58,9 @@ public class QueryFormat // dbQProcedure = 224 // dbQAction = 240 + // mask which removes superfluous flags from object flags + static final int OBJECT_FLAG_MASK = 0XF0; + public static final String COL_ATTRIBUTE = "Attribute"; public static final String COL_EXPRESSION = "Expression"; public static final String COL_FLAG = "Flag"; -- 2.39.5