summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2012-09-04 02:27:41 (EDT)
committerlzhu2012-09-04 02:27:41 (EDT)
commit43d99e5a175eb822a47893027f134ab0e1822f94 (patch)
tree6a0e24b98ce075fff066c91eb56a60a688ccec40
parent3a1ff5b4891417b4c892e2da1795cfe96a929b49 (diff)
downloadorg.eclipse.datatools.connectivity-43d99e5a175eb822a47893027f134ab0e1822f94.zip
org.eclipse.datatools.connectivity-43d99e5a175eb822a47893027f134ab0e1822f94.tar.gz
org.eclipse.datatools.connectivity-43d99e5a175eb822a47893027f134ab0e1822f94.tar.bz2
Fix 53106 Error occurs when new a data det based on flat file datav201209041427
source that using file URI
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/util/querytextutil/QueryTextUtil.java59
1 files changed, 46 insertions, 13 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/util/querytextutil/QueryTextUtil.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/util/querytextutil/QueryTextUtil.java
index acae495..1a1f0b6 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/util/querytextutil/QueryTextUtil.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/util/querytextutil/QueryTextUtil.java
@@ -74,28 +74,61 @@ public class QueryTextUtil
};
boolean inQuote = false;
boolean isEscaped = false;
+ boolean isFrom = false;
char[] chars = trimmedQueryText.toCharArray( );
for ( int i = 0; i < chars.length; i++ )
{
- if ( chars[i] == '"' )
+ if ( !isFrom )
{
- if ( !isEscaped )
- inQuote = !inQuote;
- else
+ if ( !inQuote
+ && chars[i] == 'f' && i + 3 < chars.length
+ && chars[i + 1] == 'r' && chars[i + 2] == 'o'
+ && chars[i + 3] == 'm' )
+ {
+ isFrom = !isFrom;
+ i = i + 3;
+ }
+ if ( chars[i] == '"' )
+ {
+ if ( !isEscaped )
+ inQuote = !inQuote;
+ else
+ isEscaped = !isEscaped;
+ }
+ else if ( chars[i] == '\\' )
+ {
isEscaped = !isEscaped;
+ }
+ else if ( ( !inQuote ) && chars[i] == QUERY_TEXT_DELIMITER )
+ delimiterIndex = i;
+ else if ( ( !inQuote )
+ && chars[i] == COLUMNSINFO_BEGIN_DELIMITER )
+ {
+ columnsInfoBeginIndex = i;
+ break;
+ }
+
}
- else if ( chars[i] == '\\' )
- {
- isEscaped = !isEscaped;
- }
- else if ( ( !inQuote ) && chars[i] == QUERY_TEXT_DELIMITER )
- delimiterIndex = i;
- else if ( ( !inQuote ) && chars[i] == COLUMNSINFO_BEGIN_DELIMITER )
+ else
{
- columnsInfoBeginIndex = i;
- break;
+ if ( chars[i] == '"' )
+ {
+ if ( !isEscaped )
+ inQuote = !inQuote;
+ else
+ isEscaped = !isEscaped;
+ }
+ else if ( ( !inQuote ) && chars[i] == QUERY_TEXT_DELIMITER )
+ delimiterIndex = i;
+ else if ( ( !inQuote )
+ && chars[i] == COLUMNSINFO_BEGIN_DELIMITER )
+ {
+ columnsInfoBeginIndex = i;
+ break;
+ }
}
+
}
if ( inQuote )