Re: [sqlite] [FTS3] The Compress and Uncompress functions and extension

2011-07-22 Thread Alexey Pechnikov
2011/7/22 Abhinav Upadhyay :
> Thanks for pointing out that mail archive discussion. I wasn't using
> compress/uncompress because uncompress requires you to store the size
> of the compressed buffer which is returned by the compress function
> while compressing. But that email discussion suggests a nifty trick to
> overcome this.

And you can get the content size without decompression. It can be useful.

-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [FTS3] The Compress and Uncompress functions and extension

2011-07-22 Thread Abhinav Upadhyay
On Fri, Jul 22, 2011 at 1:32 PM, Abhinav Upadhyay
 wrote:
> On Fri, Jul 22, 2011 at 12:38 PM, Alexey Pechnikov
>  wrote:
>> But why you don't use compress/uncompress functions from DRH? See
>> http://www.mail-archive.com/sqlite-users%40sqlite.org/msg17018.html
>>
>> I did wrap these into extension and add SQLITE_COMPRESS_MIN_LENGTH
>> http://sqlite.mobigroup.ru/artifact/a5da96353bb851b34114052ba85041fdffb725cd
>> http://sqlite.mobigroup.ru/artifact/56df1be3c402d7d49c3a13be704a2ff22c3003d2
>>
>> http://sqlite.mobigroup.ru/dir?name=ext/compress
>>
>
> Thanks for pointing out that mail archive discussion. I wasn't using
> compress/uncompress because uncompress requires you to store the size
> of the compressed buffer which is returned by the compress function
> while compressing. But that email discussion suggests a nifty trick to
> overcome this.
>
> I implemented the compress/uncompress functions as suggested by
> RIchard in the email, however, it is still not working for me. The
> database is getting compressed fine, but  there is problem with
> decompression. I seem to be getting null values for the column values
> in the result set of my query.
>
> For example:
>
> $./my_program "print a document"
>
> (null)((null))
> (null)
>
> The above are three column values that I am trying select in my query.
> "pring a document" is a query that I tried to execute. Although this
> is definitely an improvement from before :)
>

Sorry, it was my mistake. I had done a small error in calling
uncompress. Now it seems to be working fine.

Thanks a ton for the help. You saved my day :-)

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


Re: [sqlite] [FTS3] The Compress and Uncompress functions and extension

2011-07-22 Thread Abhinav Upadhyay
On Fri, Jul 22, 2011 at 12:38 PM, Alexey Pechnikov
 wrote:
> But why you don't use compress/uncompress functions from DRH? See
> http://www.mail-archive.com/sqlite-users%40sqlite.org/msg17018.html
>
> I did wrap these into extension and add SQLITE_COMPRESS_MIN_LENGTH
> http://sqlite.mobigroup.ru/artifact/a5da96353bb851b34114052ba85041fdffb725cd
> http://sqlite.mobigroup.ru/artifact/56df1be3c402d7d49c3a13be704a2ff22c3003d2
>
> http://sqlite.mobigroup.ru/dir?name=ext/compress
>

Thanks for pointing out that mail archive discussion. I wasn't using
compress/uncompress because uncompress requires you to store the size
of the compressed buffer which is returned by the compress function
while compressing. But that email discussion suggests a nifty trick to
overcome this.

I implemented the compress/uncompress functions as suggested by
RIchard in the email, however, it is still not working for me. The
database is getting compressed fine, but  there is problem with
decompression. I seem to be getting null values for the column values
in the result set of my query.

For example:

$./my_program "print a document"

(null)((null))  
(null)

The above are three column values that I am trying select in my query.
"pring a document" is a query that I tried to execute. Although this
is definitely an improvement from before :)

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


Re: [sqlite] [FTS3] The Compress and Uncompress functions and extension

2011-07-22 Thread Alexey Pechnikov
But why you don't use compress/uncompress functions from DRH? See
http://www.mail-archive.com/sqlite-users%40sqlite.org/msg17018.html

I did wrap these into extension and add SQLITE_COMPRESS_MIN_LENGTH
http://sqlite.mobigroup.ru/artifact/a5da96353bb851b34114052ba85041fdffb725cd
http://sqlite.mobigroup.ru/artifact/56df1be3c402d7d49c3a13be704a2ff22c3003d2

http://sqlite.mobigroup.ru/dir?name=ext/compress

-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users