SQLiter icon indicating copy to clipboard operation
SQLiter copied to clipboard

Binding empty data blob in 1.0.0 and 1.0.1 crashes

Open benasher44 opened this issue 4 years ago • 0 comments

If you bind an empty data blob like ByteArray(0) to a statement, you'll get a crash:

kotlin.ArrayIndexOutOfBoundsException
	at kotlin.Throwable#<init>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Throwable.kt:27)
	at kotlin.Exception#<init>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:21)
	at kotlin.RuntimeException#<init>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:32)
	at kotlin.IndexOutOfBoundsException#<init>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:90)
	at kotlin.ArrayIndexOutOfBoundsException#<init>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/Exceptions.kt:97)
	at <global>.ThrowArrayIndexOutOfBoundsException(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt:23)
	at <global>.Kotlin_Arrays_getByteArrayAddressOfElement(Unknown Source)
	at kotlinx.cinterop#[email protected]<kotlin.ByteArray>(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt:47)
	at kotlinx.cinterop.<no(/Users/teamcity2/buildAgent/work/11ac87a349af04d5/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt:91)
	at co.touchlab.sqliter.interop.ActualSqliteStatement#bindBlob(/Users/runner/work/SQLiter/SQLiter/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/interop/ActualSqliteStatement.kt:126)
	at co.touchlab.sqliter.native.NativeStatement#bindBlob(/Users/runner/work/SQLiter/SQLiter/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeStatement.kt:92)
	at co.touchlab.sqliter.concurrency.ConcurrentDatabaseConnection.ConcurrentStatement#bindBlob(/Users/runner/work/SQLiter/SQLiter/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/concurrency/ConcurrentDatabaseConnection.kt)
	at co.touchlab.sqliter#[email protected](/Users/runner/work/SQLiter/SQLiter/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/Statement.kt:60)
	at com.squareup.sqldelight.drivers.native.SqliterStatement#bindBytes(/Users/runner/work/1/s/sqldelight-copy/drivers/native-driver/src/nativeMain/kotlin/com/squareup/sqldelight/drivers/native/SqliterPreparedStatement.kt:17)

benasher44 avatar Apr 26 '21 03:04 benasher44