OpenWrt Forum Archive

Topic: sqlite malfunction ?

The content of this topic has been archived on 4 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I would like to use PHP/sqlite on Kamikaze

Platform is BRCM47xx kernel 2.6 fresh instalation from 8.09 repositories:

When I try use sqlite2 :

$db = sqlite_open("/usb/home/db.sqlite"); or $db = new PDO('sqlite2:/usb/home/db.sqlite');

I get this error:

php-cli: ./src/btree.c: 702: sqliteBtreeOpen: Assertion `sizeof(ptr)==sizeof(char*)' failed.
Aborted

When I try sqlite3:
$db = new PDO('sqlite:/usb/home/db.sqlite');

I get Segmentation fault

Is it bug or I am stupid?

Hi,

I've got the same problem with Kamikaze 8.09, on x86 openwrt.

Do I need to backport listed libs ??

thanks smile

Found the problem !

This happens when the source are cross-compiled, also on x86 platform :
For example, I've rebuild the sources on a AMD 64, for x86, but this did not work.
After some search via google, I've found that the problem was with the pointer size which is "hard coded" in sqlite's config.h file.
On mine machine, it was coded as size=8. I had to replace it to "4", and it works...

Maybe a patch should be included in the trunk when cross-compiling ??

Hi

link http://lamp2.fh-stpoelten.ac.at/~tm0410 … backports/ is broken and i tried to compile usin instructions by forum2006 and i get an "No rule to make target `all'.  Stop" error. ¿somebody nows how to solve this or where is an updated lib that works?

Thanks

The discussion might have continued from here.