diff options
Diffstat (limited to 'src/ext_depends/d2sqlite3/source')
-rw-r--r-- | src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d b/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d index 8cf6a38..3b262ab 100644 --- a/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d +++ b/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d @@ -88,14 +88,15 @@ package(d2sqlite3): this(Database db, string sql) { sqlite3_stmt* handle; + enforce(sql.length <= int.max, "Length of SQL statement exceeds `int.max`"); version (_UnlockNotify) { - auto result = sqlite3_blocking_prepare_v2(db, sql.toStringz, sql.length.to!int, + auto result = sqlite3_blocking_prepare_v2(db, sql.ptr, cast(int) sql.length, &handle, null); } else { - auto result = sqlite3_prepare_v2(db.handle(), sql.toStringz, sql.length.to!int, + auto result = sqlite3_prepare_v2(db.handle(), sql.ptr, cast(int) sql.length, &handle, null); } enforce(result == SQLITE_OK, new SqliteException(errmsg(db.handle()), result, sql)); |