Jump to content
Sign in to follow this  

Sqlite Bug in with NULL values

Recommended Posts


I have a table which has some NULL values in, with build of Autoit all is fine with as soon as sqlite accesses a cell with NULL data autoit hard crashes

Try the below code in and then with

#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <array.au3>

Local $aResult, $iRows, $iColumns, $iRval

_SQLite_Startup ()
If @error > 0 Then
    MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!")
    Exit - 1
_SQLite_Open (); Open a :memory: database
If @error > 0 Then
    MsgBox(16, "SQLite Error", "Can't Load Database!")
    Exit - 1

If Not _SQLite_Exec (-1, "CREATE TEMP TABLE persons (a,b,c,d,e,f,g,h,i,j);") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())

For $i = 1 to 10
If Not _SQLite_Exec (-1, "INSERT INTO persons VALUES (1,2,3,4,5,6,7,8,9,NULL);") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())

Msgbox(0,"","Got this far so all the data is inserted")

; Query
$iRval = _SQLite_GetTable2d (-1, "SELECT * FROM persons;", $aResult, $iRows, $iColumns)
If $iRval = $SQLITE_OK Then

    MsgBox(16, "SQLite Error: " & $iRval, _SQLite_ErrMsg ())

_SQLite_Close ()
_SQLite_Shutdown ()

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this