bug TDI-18269 fixed:fix a bug for sql builder

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@105626 f6f1c999-d317-4740-80b0-e6d1abc6f99e
This commit is contained in:
plv
2013-07-23 07:24:41 +00:00
parent b683484b58
commit 799fa2fbc8

View File

@@ -242,14 +242,12 @@ public class TalendTextUtils {
char c = fieldName.charAt(i);
b = b && c >= '0' && c <= '9';
}
// if fieldName include special symbol,need add quote
boolean check = Pattern.matches("^.[A-Za-z_]+$", fieldName);//$NON-NLS-1$
EDatabaseTypeName name = EDatabaseTypeName.getTypeFromDbType(dbType);
if (name.equals(EDatabaseTypeName.MYSQL) && fieldName.contains(JAVA_END_STRING)) {
String newFieldName = TalendQuoteUtils.addQuotes(fieldName);
return newFieldName;
}
boolean isCheck = !CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.SQL_ADD_QUOTE);
if (!b) {
if (isCheck && isPSQLSimilar(name)) {
if (isCheck && isPSQLSimilar(name) && check) {
return fieldName;
}
}