Skip to content

Commit

Permalink
inet 6 fix. contribution coming from sourceforge
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Robert committed Jul 13, 2012
1 parent 3b2d8b3 commit b60aa97
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,11 @@ public String sqlStringForValue(Object v, String kp) {
EOEntity kpEntity = entityForKeyPath(kp);
attribute = kpEntity.attributeNamed(kp.substring(lastDotIdx+1));
}
// AK: inet6 addresses get handed down as "xxx:xxx:...:xxx%y", not "xxx:xxx:...:xxx/y"
// note that this might break if you hand over a host name that contains percent chars (not sure if possible)
if(attribute != null && "inet".equals(attribute.externalType()) && v != null && v.toString().indexOf('%') > 0) {
v = v.toString().replace('%', '/');
}
if(attribute != null && v != null && v != NSKeyValueCoding.NullValue) {
String s = columnTypeStringForAttribute(attribute);
return super.sqlStringForValue(v, kp) + "::" + s;
Expand Down

0 comments on commit b60aa97

Please sign in to comment.