summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2012-09-03 22:05:12 (EDT)
committer lzhu2012-09-03 22:05:12 (EDT)
commit3d994fbf7dd104f82392879dfca7180d7772f017 (patch)
tree6df0ed39995fb0b508abec1841f0e2cc2ec64734
parent1766fd251ad5ee901af05007adf80e038addecd4 (diff)
downloadorg.eclipse.datatools.enablement.oda-3d994fbf7dd104f82392879dfca7180d7772f017.zip
org.eclipse.datatools.enablement.oda-3d994fbf7dd104f82392879dfca7180d7772f017.tar.gz
org.eclipse.datatools.enablement.oda-3d994fbf7dd104f82392879dfca7180d7772f017.tar.bz2
Fix 53106 Error occurs when new a data det based on flat file datav201209041005
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 )