Skip to content

Commit 4cfa955

Browse files
fix: Enable "SELECT FOR UPDATE" for the several applicable dialects
1 parent c8a0d6a commit 4cfa955

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

exposed-core/api/exposed-core.api

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3902,6 +3902,7 @@ public class org/jetbrains/exposed/v1/core/vendors/H2Dialect : org/jetbrains/exp
39023902
public fun getSupportsSubqueryUnions ()Z
39033903
public fun getSupportsTernaryAffectedRowValues ()Z
39043904
public fun getSupportsWindowFrameGroupsMode ()Z
3905+
public fun getSupportsSelectForUpdate ()Z
39053906
public fun isAllowedAsColumnDefault (Lorg/jetbrains/exposed/v1/core/Expression;)Z
39063907
public final fun isSecondVersion ()Z
39073908
public fun listDatabases ()Ljava/lang/String;
@@ -3973,6 +3974,7 @@ public class org/jetbrains/exposed/v1/core/vendors/MysqlDialect : org/jetbrains/
39733974
public fun getSupportsSetDefaultReferenceOption ()Z
39743975
public fun getSupportsSubqueryUnions ()Z
39753976
public fun getSupportsTernaryAffectedRowValues ()Z
3977+
public fun getSupportsSelectForUpdate ()Z
39763978
public fun isAllowedAsColumnDefault (Lorg/jetbrains/exposed/v1/core/Expression;)Z
39773979
public fun isFractionDateTimeSupported ()Z
39783980
public fun isTimeZoneOffsetSupported ()Z
@@ -4001,6 +4003,7 @@ public class org/jetbrains/exposed/v1/core/vendors/OracleDialect : org/jetbrains
40014003
public fun getSupportsOrderByNullsFirstLast ()Z
40024004
public fun getSupportsRestrictReferenceOption ()Z
40034005
public fun getSupportsSetDefaultReferenceOption ()Z
4006+
public fun getSupportsSelectForUpdate ()Z
40044007
public fun isAllowedAsColumnDefault (Lorg/jetbrains/exposed/v1/core/Expression;)Z
40054008
public fun listDatabases ()Ljava/lang/String;
40064009
public fun modifyColumn (Lorg/jetbrains/exposed/v1/core/Column;Lorg/jetbrains/exposed/v1/core/ColumnDiff;)Ljava/util/List;

exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/vendors/H2.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ open class H2Dialect : VendorDialect(dialectName, H2DataTypeProvider, H2Function
303303
override val supportsDualTableConcept: Boolean by lazy { resolveDelegatedDialect()?.supportsDualTableConcept ?: super.supportsDualTableConcept }
304304
override val supportsOrderByNullsFirstLast: Boolean by lazy { resolveDelegatedDialect()?.supportsOrderByNullsFirstLast ?: super.supportsOrderByNullsFirstLast }
305305
override val supportsWindowFrameGroupsMode: Boolean by lazy { resolveDelegatedDialect()?.supportsWindowFrameGroupsMode ?: super.supportsWindowFrameGroupsMode }
306+
override val supportsSelectForUpdate: Boolean get() = isSecondVersion
306307
override val supportsColumnTypeChange: Boolean get() = isSecondVersion
307308

308309
override fun isAllowedAsColumnDefault(e: Expression<*>): Boolean = true

exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/vendors/MysqlDialect.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ open class MysqlDialect : VendorDialect(dialectName, MysqlDataTypeProvider.INSTA
357357

358358
override val supportsSetDefaultReferenceOption: Boolean = false
359359

360+
override val supportsSelectForUpdate: Boolean = true
361+
360362
/** Returns `true` if the MySQL database version is greater than or equal to 5.6. */
361363
@Suppress("MagicNumber")
362364
open fun isFractionDateTimeSupported(): Boolean {

exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/vendors/OracleDialect.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ open class OracleDialect : VendorDialect(dialectName, OracleDataTypeProvider, Or
445445
override val supportsOrderByNullsFirstLast: Boolean = true
446446
override val supportsOnUpdate: Boolean = false
447447
override val supportsSetDefaultReferenceOption: Boolean = false
448+
override val supportsSelectForUpdate: Boolean = true
448449

449450
// Preventing the deletion of a parent row if a child row references it is the default behaviour in Oracle.
450451
override val supportsRestrictReferenceOption: Boolean = false

0 commit comments

Comments
 (0)