sqlite3.lsp unsigned long int bug

Started by Dmi, May 11, 2007, 01:52:01 AM

Previous topic - Next topic

Dmi

sqlite3.lsp incorrectly handle the numbers greater than 2**32:



Newlisp:
QuoteIntegers are 64-bit numbers (including the sign bit, 32-bit before version 8.9.7). Valid integers are numbers between -9,223,372,036,854,775,808 and +9,223,372,036,854,775,807.


SQLite:
QuoteINTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.


sqlite.lsp
SQLITE_INTEGER
      (push (sqlite3_column_int pstm i) row -1))

From SQLite API:
* int* sqlite3_column_int(sqlite3_stmt*, int iCol)

The Fix:
(SQLITE_INTEGER
      (set 'pstr (sqlite3_column_text pstm i))
      (if (= pstr 0)
         (push nil row -1)
         (push (int (get-string pstr)) row -1)))
WBR, Dmi

Lutz

#1
Thanks for the fix Dmitry, the next sqlite3.lsp update will handle integers bigger 32-Bit.



Lutz

Dmi

#2
Thanks Lutz!
WBR, Dmi