Is there any chance you are storing a \0 char inside the xml ? 

Jacob A. Camp wrote:
> 
> Hello,
> 
> I've been looking into an issue that a few of our programmers have looked
> at as well and it left us all wondering. Basically, our database has a
> VARCHAR column that has an XML file written to it when the object is
> manipulated. I can use a tool to view the database file and I can ensure
> that the entire field is filled out correctly and the XML is correctly
> formed.
> 
> The field in the database contains 8955 characters and when I execute the
> sqlite3_column_text() on that specific column to access the data, the
> const unsigned char* that's returned only contains 2030 characters and the
> XML file that I'm trying to reconstruct from it then becomes unusable. I
> even attempted digging into the SQLite class and it seems that this value
> is obtained from the official function calls.
> 
> In sqlite3.c:
> 
> static Mem *columnMem(sqlite3_stmt *pStmt, int i){
>   Vdbe *pVm;
>   int vals;
>   Mem *pOut;
> 
>   pVm = (Vdbe *)pStmt;
>   if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
>     sqlite3_mutex_enter(pVm->db->mutex);
>     vals = sqlite3_data_count(pStmt);
>     pOut = &pVm->pResultSet[i];
> 
> After the last line has been executed pOut contains members z and zMalloc
> which both contain the same memory location that points to the char* that
> contains the first 2030 characters and none of the rest that are stored in
> the VARCHAR field.
> 
> Is there some limit to the amount of data that can be returned by this
> function? I read over most of the documentation and didn't see it
> mentioning any sort of restriction.
> 
> Thanks in advance,
> --Jake
> 
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> www.mastercam.com
> **********************************************************************
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/sqlite3_column_text%28%29-returning-partial-results-tp33016613p33016758.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to