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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user