HHH-16541 Don't report supportsSkipLocked() for Sybase

This commit is contained in:
Christian Beikov 2023-05-17 16:22:21 +02:00
parent b45edfc02d
commit 0980b78d5e
4 changed files with 7 additions and 11 deletions

View File

@ -592,13 +592,14 @@ public boolean supportsLobValueChangePropagation() {
@Override @Override
public boolean supportsSkipLocked() { public boolean supportsSkipLocked() {
return true; // It does support skipping locked rows only for READ locking
return false;
} }
@Override @Override
public String appendLockHint(LockOptions mode, String tableName) { public String appendLockHint(LockOptions mode, String tableName) {
final String lockHint = super.appendLockHint( mode, tableName ); final String lockHint = super.appendLockHint( mode, tableName );
return mode.getLockMode() == LockMode.UPGRADE_SKIPLOCKED || mode.getTimeOut() == LockOptions.SKIP_LOCKED return !mode.getLockMode().greaterThan( LockMode.READ ) && mode.getTimeOut() == LockOptions.SKIP_LOCKED
? lockHint + " readpast" ? lockHint + " readpast"
: lockHint; : lockHint;
} }

View File

@ -594,13 +594,14 @@ public boolean supportsLobValueChangePropagation() {
@Override @Override
public boolean supportsSkipLocked() { public boolean supportsSkipLocked() {
return true; // It does support skipping locked rows only for READ locking
return false;
} }
@Override @Override
public String appendLockHint(LockOptions mode, String tableName) { public String appendLockHint(LockOptions mode, String tableName) {
final String lockHint = super.appendLockHint( mode, tableName ); final String lockHint = super.appendLockHint( mode, tableName );
return mode.getLockMode() == LockMode.UPGRADE_SKIPLOCKED || mode.getTimeOut() == LockOptions.SKIP_LOCKED return !mode.getLockMode().greaterThan( LockMode.READ ) && mode.getTimeOut() == LockOptions.SKIP_LOCKED
? lockHint + " readpast" ? lockHint + " readpast"
: lockHint; : lockHint;
} }

View File

@ -282,7 +282,7 @@ public void testNamedQueryResultListPessimisticWriteLockTimeoutException() {
} }
@Test @Test
@RequiresDialectFeature( value = DialectChecks.SupportSkipLocked.class ) @RequiresDialectFeature( value = DialectChecks.SupportsSkipLocked.class )
@SkipForDialect(value = CockroachDialect.class, comment = "for update clause does not imply locking. See https://github.com/cockroachdb/cockroach/issues/88995") @SkipForDialect(value = CockroachDialect.class, comment = "for update clause does not imply locking. See https://github.com/cockroachdb/cockroach/issues/88995")
public void testUpdateWithPessimisticReadLockSkipLocked() { public void testUpdateWithPessimisticReadLockSkipLocked() {
Lock lock = new Lock(); Lock lock = new Lock();

View File

@ -198,12 +198,6 @@ public boolean isMatch(Dialect dialect) {
} }
} }
public static class SupportSkipLocked implements DialectCheck {
public boolean isMatch(Dialect dialect) {
return dialect.supportsSkipLocked();
}
}
public static class SupportNoWait implements DialectCheck { public static class SupportNoWait implements DialectCheck {
public boolean isMatch(Dialect dialect) { public boolean isMatch(Dialect dialect) {
return dialect.supportsNoWait(); return dialect.supportsNoWait();