diff --git a/gradle.properties b/gradle.properties index 6703a04a7f..b151d9cbab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ openssl.version.suffix=u openssl.sha256=e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6 openssl.pgp.sha256=7f564cada05f055c1534eae3fc7c19864eb2f6831cfcd91546e62476ba99e96e -sqlcipher.versionName=4.5.4 +sqlcipher.versionName=4.5.5 org.gradle.caching=true org.gradle.configuration-cache=true diff --git a/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLite.kt b/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLite.kt index cf3899aa12..0e07d848da 100644 --- a/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLite.kt +++ b/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLite.kt @@ -48,7 +48,6 @@ import com.bloomberg.selekt.SQL_MISUSE import com.bloomberg.selekt.SQL_NOMEM import com.bloomberg.selekt.SQL_NOT_A_DATABASE import com.bloomberg.selekt.SQL_NOT_FOUND -import com.bloomberg.selekt.SQL_OK import com.bloomberg.selekt.SQL_RANGE import com.bloomberg.selekt.SQL_READONLY import com.bloomberg.selekt.SQL_TOO_BIG @@ -91,7 +90,6 @@ internal object SQLite : com.bloomberg.selekt.SQLite(sqlite) { message: String, context: String? ): Nothing { - require(code != SQL_OK) { "Result code is not an error: $code" } val exceptionMessage = extendedErrorMessage(code, extendedCode, message, context) throw when (code) { SQL_BUSY -> SQLiteDatabaseLockedException(exceptionMessage) diff --git a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLiteTest.kt b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLiteTest.kt index 0c037a6f82..0fe8e9af4c 100644 --- a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLiteTest.kt +++ b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLiteTest.kt @@ -142,8 +142,10 @@ internal class SQLiteTest { } @Test - fun openThenRekeySuccessfully() { - assertEquals(SQL_OK, SQLite.rekey(db, otherKey)) + fun openThenRekeyWithoutKeyFails() { + assertFailsWith { + SQLite.rekey(db, otherKey) + } } @Test @@ -735,7 +737,7 @@ internal class SQLiteTest { @Test fun exceptionForErrorOk() { - assertFailsWith { + assertFailsWith { SQLite.throwSQLException(SQL_OK, SQL_OK, "") } } diff --git a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SelektTest.kt b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SelektTest.kt index 497bc717bd..ed4522ddda 100644 --- a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SelektTest.kt +++ b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SelektTest.kt @@ -35,12 +35,12 @@ internal class SelektTest { @Test fun libVersion() { - assertEquals("3.41.2", Selekt.sqliteLibVersion()) + assertEquals("3.42.0", Selekt.sqliteLibVersion()) } @Test fun libVersionNumber() { - assertEquals(3_041_002, Selekt.sqliteLibVersionNumber()) + assertEquals(3_042_000, Selekt.sqliteLibVersionNumber()) } @OptIn(Experimental::class) diff --git a/selekt-java/src/main/kotlin/com/bloomberg/selekt/SQLite.kt b/selekt-java/src/main/kotlin/com/bloomberg/selekt/SQLite.kt index 828906613d..fa952cc3c1 100644 --- a/selekt-java/src/main/kotlin/com/bloomberg/selekt/SQLite.kt +++ b/selekt-java/src/main/kotlin/com/bloomberg/selekt/SQLite.kt @@ -260,26 +260,26 @@ open class SQLite( throwSQLException(errorCode(db), extendedErrorCode(db), errorMessage(db), context) private fun checkSQLCode(code: SQLCode): SQLCode = when (code) { - SQL_OK -> code + SQL_OK -> SQL_OK else -> throwSQLException(code, -1, "Error information not accessible.") } private fun checkConnectionSQLCode(db: Long, code: SQLCode): SQLCode { if (SQL_OK == code) { - return code + return SQL_OK } throwSQLException(db) } private fun checkStatementSQLCode(statement: Long, code: SQLCode): SQLCode = if (SQL_OK == code) { - code + SQL_OK } else { throwSQLException(databaseHandle(statement)) } private fun checkBindSQLCode(statement: Long, code: SQLCode): SQLCode { if (SQL_OK == code) { - return code + return SQL_OK } throwSQLException(databaseHandle(statement)) } diff --git a/selekt-sqlite3/src/main/external/sqlcipher b/selekt-sqlite3/src/main/external/sqlcipher index c7f9a1c348..7c460791eb 160000 --- a/selekt-sqlite3/src/main/external/sqlcipher +++ b/selekt-sqlite3/src/main/external/sqlcipher @@ -1 +1 @@ -Subproject commit c7f9a1c348fde215ac18ce2b78a62ce8111a3743 +Subproject commit 7c460791eba939e6c6872825219a6644ca47283b