Re: [sqlite] Blob handling in command line tool sqlite3

2007-06-10 Thread Guido Ostkamp
On Sat, 9 Jun 2007, Joe Wilson wrote: CREATE TABLE t(b blob); INSERT INTO "t" VALUES(X'ABCD'); select quote(b) from t; X'ABCD' Thanks, Joe. I am just wondering why this 'quote' is not the default behavior on binary columns when the 'sqlite3' tool is used. Best regards Guido

[sqlite] sqlite 3.2.8 segmentation fault

2007-06-10 Thread Rachmel, Nir (Nir)
Hi All, I am running sqlite version 3.2.8, on a windriver linux, on a ppc platform. It is linked to PHP 5.1.4, where I have scripts that access the database (both sets and gets). Recently I have been experimenting with simultanious accesses to the sqlite database (meaning mutliple clients

[sqlite] Full Text Search

2007-06-10 Thread Mark Gilbert
Folks. I have just started learning about Full Text search in SQlite, and I have some questions 1) With the Amalgamated Sqlite, I guess to enable FTS I just #define SQLITE_ENABLE_FTS2 at the start of sqlite3.c Is there anything else I have to do to switch it on ? 2) If I want to do a full

[sqlite] error in round-function?

2007-06-10 Thread Olaf Schmidt
The integrated round-function works well so far, especially because it does "bankers rounding". Tough it seems to have a little bug, wich is probably simple to fix. Try... select round(0.94, 1) -> gives 0.9, wich is correct select round(0.96, 1) -> gives 1, wich is correct too but... select

Re: [sqlite] Ranking in fts.

2007-06-10 Thread Scott Hess
On 6/10/07, Ralf Junker <[EMAIL PROTECTED]> wrote: Hello Scott Hess, >I've lined up some time to work on fts, again, which means fts3. One >thing I'd like to include would be to order doclists by some baked-in >ranking. The idea is to sort to most important items to the front of >the list,

Re: [sqlite] sqlite 3.2.8 segmentation fault

2007-06-10 Thread Joe Wilson
You're crashing in free(), which means your heap is corrupted. The cause of the corruption could be from anywhere - and not necessarily sqlite. It might be the victim of a previously corrupted heap. Try running your program through a memory checker like valgrind to see what it turns up. Also

Re: [sqlite] Blob handling in command line tool sqlite3

2007-06-10 Thread Joe Wilson
--- Guido Ostkamp <[EMAIL PROTECTED]> wrote: > On Sat, 9 Jun 2007, Joe Wilson wrote: > > CREATE TABLE t(b blob); > > INSERT INTO "t" VALUES(X'ABCD'); > > select quote(b) from t; > > X'ABCD' > > Thanks, Joe. I am just wondering why this 'quote' is not the default > behavior on binary columns when

Re: [sqlite] error in round-function?

2007-06-10 Thread drh
Olaf Schmidt <[EMAIL PROTECTED]> wrote: > The integrated round-function works well so far, > especially because it does "bankers rounding". > Tough it seems to have a little bug, wich is probably simple to fix. > > Try... > select round(0.94, 1) -> gives 0.9, wich is correct > select round(0.96,

Re: [sqlite] error in round-function?

2007-06-10 Thread Alberto Simões
Olaf Schmidt <[EMAIL PROTECTED]> wrote: > The integrated round-function works well so far, > especially because it does "bankers rounding". > Tough it seems to have a little bug, wich is probably simple to fix. > > Try... > select round(0.94, 1) -> gives 0.9, wich is correct > select round(0.96,

Re: [sqlite] error in round-function?

2007-06-10 Thread Olaf Schmidt
Hi drh, > http://www.sqlite.org/faq.html#q18 Not so easy I think (I'm well aware of rounding-problems regarding the IEEE-Float-Formats, etc.). Bankers rounding aside at the moment. select round(0.95, 1) gives 0 - not 0.9 (in case rounding down) and also not 1.0 (in case rounding up) Funny

Re: [sqlite] error in round-function?

2007-06-10 Thread Alberto Simões
On 6/10/07, Olaf Schmidt <[EMAIL PROTECTED]> wrote: Hi drh, > http://www.sqlite.org/faq.html#q18 Not so easy I think (I'm well aware of rounding-problems regarding the IEEE-Float-Formats, etc.). Bankers rounding aside at the moment. select round(0.95, 1) 0.9 select round(9.95, 1) 9.9

[sqlite] sqlite3 through PDO/PHP issues.

2007-06-10 Thread Gregory Gulik
I recently upgraded my server from RHEL 4 to RHEL 5 and one of the changes is the PHP interface to sqlite changed to be exclusively through PHP's PDO functions. I converted my databases to sqlite3 successfully but I'm having no end of troubles getting my PHP scripts to be able to perform

Re: [sqlite] error in round-function?

2007-06-10 Thread Olaf Schmidt
> > select round(0.95, 1) > 0.9 > > select round(9.95, 1) > 9.9 > > select round(0.995, 2) > 0.99 > > select round(9.995, 2) > 9.99 > (3.3.17 here) As it should be, hmm. On what OS have you tested? If on windows, was it a GCC-compile or a MS-VC-compile? Olaf -- View this message in context:

Re: [sqlite] error in round-function?

2007-06-10 Thread Alberto Simões
On 6/10/07, Olaf Schmidt <[EMAIL PROTECTED]> wrote: > > select round(0.95, 1) > 0.9 > > select round(9.95, 1) > 9.9 > > select round(0.995, 2) > 0.99 > > select round(9.995, 2) > 9.99 > (3.3.17 here) As it should be, hmm. On what OS have you tested? If on windows, was it a GCC-compile or a

Re: [sqlite] error in round-function?

2007-06-10 Thread Olaf Schmidt
Thanks to RBS and Alberto for testing... So it seems the problem is somehow Windows-related (maybe the VC-Compiler). Think I'll override the Round-Function in my wrapper. Regards, Olaf -- View this message in context: http://www.nabble.com/error-in-round-function--tf3897765.html#a11052069

Re: [sqlite] error in round-function?

2007-06-10 Thread drh
Olaf Schmidt <[EMAIL PROTECTED]> wrote: > > select round(0.95, 1) > gives 0 - not 0.9 (in case rounding down) and > also not 1.0 (in case rounding up) > I can reproduce the problem by running sqlite3.exe on windows. But I cannot explain it. The problem occurs in printf.c on line 454:

Re: [sqlite] sqlite3 through PDO/PHP issues.

2007-06-10 Thread Joe Wilson
> $sql = "SELECT count(*) FROM feedback"; > $result = $handle->query($sql); > echo "rows = " . $result->rowCount() . "\n"; I've never used PHP, but just for kicks, to eliminate the database from the equation, try: $sql = "SELECT 123 AS abc;"; and see what happens.

Re: [sqlite] error in round-function?

2007-06-10 Thread Joe Wilson
--- Olaf Schmidt <[EMAIL PROTECTED]> wrote: > On what OS have you tested? > If on windows, was it a GCC-compile or a MS-VC-compile? Running the GCC cross-compiled sqlite3.exe from http://www.sqlite.org/sqlite-3_3_17.zip on Windows (well, wine on Linux): SQLite version 3.3.17 Enter ".help"

RE: [sqlite] error in round-function?

2007-06-10 Thread RB Smissaert
Just checked my code and luckily I don't round in SQLite. I suppose an easy work-around for now would be to do something like: Select round(field + 0.001, 1) as it will be unlikely you are dealing with 0.949 RBS -Original Message- From: Olaf Schmidt [mailto:[EMAIL

Re: [sqlite] error in round-function?

2007-06-10 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Going into this statement on both Linux and Windows, > the exact same values are in realvalue and in rounder: > >realvalue: 0xf000 0.94995559107901499373838 >rounder:0x3faa 0.0500030 >

RE: [sqlite] Amalgamation questions

2007-06-10 Thread Brett Keating
Well I basically did the following, but not sure it's optimal: 1) Took 3.3.17 amalgamation 2) Took shell.c from 3.3.17 full distribution, and made a target that just uses sqlite3.c and shell.c to get the command line tool 3) Took whatever I had in my old makefile for compile flags and added them

RE: [sqlite] Amalgamation questions

2007-06-10 Thread Dan Kennedy
On Sun, 2007-06-10 at 16:08 -0700, Brett Keating wrote: > Well I basically did the following, but not sure it's optimal: > > 1) Took 3.3.17 amalgamation > 2) Took shell.c from 3.3.17 full distribution, and made a target that > just uses sqlite3.c and shell.c to get the command line tool > 3) Took