From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating SQLite version 3.37 in CVI2019: Runtime error: Argument too small

Hello community,

 

we face some troubles integrating SQLLite (v3.37) in CVI2019. In CVI2013 our program is running without problems...

 

First we had to add some compiler settings to get the code compileable:

/DSQLITE_DOS=0 /DSQLITE_MEMORY_BARRIER="0" /DSQLITE_THREADSAFE=0

 

Not 100% sure what the flags are for, but I found them somewhere in the web.

 

Now I get the following runtime error when executing a SQL command:

FATAL RUN-TIME ERROR: "sqlite3.c", line 156053, col 10, thread id 17912: Argument too small.

 

Source Code:

memset(&pWInfo->nOBSat, 0,
offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat));

 

Where pWInfo is declared like that:

struct WhereInfo {
Parse *pParse; /* Parsing and code generating context */
SrcList *pTabList; /* List of tables in the join */
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
ExprList *pResultSet; /* Result set of the query */
Expr *pWhere; /* The complete WHERE clause */
int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
int iContinue; /* Jump here to continue with next record */
int iBreak; /* Jump here to break out of the loop */
int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
u8 nLevel; /* Number of nested loop */
i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
u8 eOnePass; /* ONEPASS_OFF, or _SINGLE, or _MULTI */
u8 eDistinct; /* One of the WHERE_DISTINCT_* values */
unsigned bDeferredSeek :1; /* Uses OP_DeferredSeek */
unsigned untestedTerms :1; /* Not all WHERE terms resolved by outer loop */
unsigned bOrderedInnerLoop:1;/* True if only the inner-most loop is ordered */
unsigned sorted :1; /* True if really sorted (not just grouped) */
LogEst nRowOut; /* Estimated number of output rows */
int iTop; /* The very beginning of the WHERE loop */
int iEndWhere; /* End of the WHERE clause itself */
WhereLoop *pLoops; /* List of all WhereLoop objects */
WhereExprMod *pExprMods; /* Expression modifications */
Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
WhereClause sWC; /* Decomposition of the WHERE clause */
WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
WhereLevel a[1]; /* Information about each nest loop in WHERE */
};

 

What is wrong with the usage of the memset()?

 

Or there are conflicts with the memset function in "string.h" => void * CVIANSI memset(void *, int, size_t);?

 

Your help would be appreciated...

 

Thanks,

Thomas

 

 

0 Kudos
Message 1 of 1
(681 Views)