[#4724] Compare by PK only if the PK belongs to the same table
This commit is contained in:
parent
d3835638e2
commit
7b65c4fd29
@ -515,7 +515,7 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
|
||||
UniqueKey<R> thisPK = this.getPrimaryKey();
|
||||
UniqueKey<R> thatPK = that.getPrimaryKey();
|
||||
|
||||
if (thisPK != null && thatPK != null) {
|
||||
if (thisPK != null && thatPK != null && thisPK.getTable().equals(thatPK.getTable())) {
|
||||
return row(fields(thisPK.getFieldsArray())).eq(row(that.fields(thatPK.getFieldsArray())));
|
||||
}
|
||||
else {
|
||||
@ -533,7 +533,7 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
|
||||
UniqueKey<R> thisPK = this.getPrimaryKey();
|
||||
UniqueKey<R> thatPK = that.getPrimaryKey();
|
||||
|
||||
if (thisPK != null && thatPK != null) {
|
||||
if (thisPK != null && thatPK != null && thisPK.getTable().equals(thatPK.getTable())) {
|
||||
return row(fields(thisPK.getFieldsArray())).ne(row(that.fields(thatPK.getFieldsArray())));
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user