Skip to content

Commit

Permalink
Fix MySQL support in ERXExistsQualifier
Browse files Browse the repository at this point in the history
The identifier quote character in MySLQ is the backtick (not double quote). Using double quote resulted in invalid expression. Also, by using expression.sqlStringForSchemaObjectName we respect com.webobjects.jdbcadaptor.MySQLExpression.enableIdentifierQuoting flag which is off by default in case of MySQL (resulting in no quoting at all).
  • Loading branch information
Denis Frolov committed Apr 14, 2014
1 parent 5e69b03 commit d3d496b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public String sqlStringForSQLExpression(EOQualifier qualifier, EOSQLExpression e
}

EOJoin parentChildJoin = ERXArrayUtilities.firstObject(relationship.joins());
String destEntityForeignKey = ".\"" + parentChildJoin.destinationAttribute().columnName() + "\"";
String destEntityForeignKey = "." + expression.sqlStringForSchemaObjectName(parentChildJoin.destinationAttribute().columnName());

EOQualifier qual = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(subqualifier, destEntity);
EOFetchSpecification fetchSpecification = new EOFetchSpecification(destEntity.name(), qual, null, false, true, null);
Expand Down

2 comments on commit d3d496b

@elemgee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Denis. I had a pull request coming for this, but I like your inclusion of respecting the adaptor flag much better. I hadn't thought of that. Thank you very much.

@dfrolov
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Larry, I'm glad I could help! Good to know, that I'm not the only one using this qualifier with MySQL:)

Please sign in to comment.