Jump to content

Sqlite Bug in 3.2.10.0 with NULL values


ChrisL
 Share

Recommended Posts

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

Try the below code in 3.2.8.1 and then with 3.2.10.0

#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
EndIf
_SQLite_Open (); Open a :memory: database
If @error > 0 Then
    MsgBox(16, "SQLite Error", "Can't Load Database!")
    Exit - 1
EndIf


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 ())
Next

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
    _arrayDisplay($aResult)

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

_SQLite_Close ()
_SQLite_Shutdown ()
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...