[#7942] Excess SELECT statement run on UpdatableRecord.store(), insert(), update() on MySQL

This commit is contained in:
lukaseder 2018-10-16 08:04:51 +02:00
parent 5a958a8df9
commit af49efa6d7

View File

@ -232,7 +232,9 @@ public class TableRecordImpl<R extends TableRecord<R>> extends AbstractRecord im
}
// [#1859] In some databases, not all fields can be fetched via getGeneratedKeys()
if (REFRESH_GENERATED_KEYS.contains(configuration().family()) && this instanceof UpdatableRecord)
if (TRUE.equals(configuration().settings().isReturnAllOnUpdatableRecord())
&& REFRESH_GENERATED_KEYS.contains(configuration().family())
&& this instanceof UpdatableRecord)
((UpdatableRecord<?>) this).refresh(key.toArray(EMPTY_FIELD));
}
}