[ZBX-2143] compilation fails with sqlite Created: 2010 Mar 11  Updated: 2017 May 30  Resolved: 2010 Mar 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P)
Affects Version/s: None
Fix Version/s: 1.8.2, 1.9.0 (alpha)

Type: Incident report Priority: Blocker
Reporter: richlv Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

broken in rev 10667

make[3]: Entering directory `/home/zabbix/svn/1.8/src/libs/zbxdb'gcc -DHAVE_CONFIG_H -I. -I../../../include -g -O2 -L/usr/lib -I/usr/local/include -I/usr/lib/perl/5.8/CORE -I. -I/usr/include -MT db.o -MD -MP -MF .deps/db.Tpo -c -o db.o db.cdb.c: In function 'zbx_db_connect':db.c:291: error: 'SQLITE_OPEN_READWRITE' undeclared (first use in this function)db.c:291: error: (Each undeclared identifier is reported only oncedb.c:291: error: for each function it appears in.)make[3]: *** [db.o] Error 1



 Comments   
Comment by Aleksandrs Saveljevs [ 2010 Mar 11 ]

Fixed in r10718 in svn://svn.zabbix.com/branches/dev/zbx-2143-sqlite-compilation .

The reason sqlite3_open() was replaced by sqlite3_open_v2(..., SQLITE_OPEN_READWRITE, ...) was that sqlite3_open() creates an empty database file if it does not exist and there seems to be no way to override this behavior. Now that we reverted back to using sqlite3_open(), the server will not complain about the missing database file, but will then write lots of "query failed" messages to the log, like so:

19328:20100311:114424.186 [Z3005] Query failed: [0] no such table: escalations [select escalationid,actionid,triggerid,eventid,r_eventid,esc_step,status from escalations where status in (0,1) and nextcheck<=1268300664 and escalationid between 000000000000000 and 099999999999999]

Comment by Aleksandrs Saveljevs [ 2010 Mar 11 ]

For future reference, sqlite3_open_v2() and SQLITE_OPEN_READWRITE are absent from sqlite3.h version 3.4.2, but are present in sqlite3.h version 3.5.9.

Comment by richlv [ 2010 Mar 11 ]

could server check whether _v2 is available and use it if so ?

Comment by richlv [ 2010 Mar 11 ]

confirming the fix in dev branch, rev 10733

Comment by Aleksandrs Saveljevs [ 2010 Mar 15 ]

Will implement detection of sqlite_open_v2() in configure.

Comment by Aleksandrs Saveljevs [ 2010 Mar 17 ]

Available in pre-1.8.2 in r10868.

Generated at Fri Apr 19 03:57:59 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.