[sqlite] does there some fts3 document i can read

2009-11-19 Thread ouwind
i cant find documents about fts3 in sqlite documents

2009-11-20



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


Re: [sqlite] understanding the query optimizer

2009-11-19 Thread Jong-young Park
Have you read this document?

http://sqlite.org/optoverview.html

I think it's good start for you.

The main rule of optimizer is whether the query uses an index.


On Wed, Nov 18, 2009 at 12:03 AM, P Kishor  wrote:

> Recent travails of the user trying to figure out how the optimizer
> figures out how to optimize query with a LIKE clause set me
> thinking... I really don't know anything about this optimizer. When I
> work with a db, I spend a considerable amount of time thinking about
> the most appropriate db structure, and then, the most appropriate
> queries, but then, it seems that I hand it over to this optimizer
> that, as Richard said, evaluates "hundreds, thousands" or way of doing
> the query, and then chooses the best one. Once it chooses that way, it
> sticks with that way until something about the query changes.
>
> Except, I know nothing about this optimizer. Richard is a smart guy...
> he created SQLite, and the optimizer. But, is he so smart that he can
> figure out the best way to run every query that will ever be handed to
> SQLite? ;-)
>
> In this time and world of open source, am I submitting my precious
> query to a black box I know nothing about?
>
> Where can I learn more about this optimizer? Where can I sign up?
>
> Oh, if you tell me that I should read the SQLite source code, that
> will be the correct, open source specific answer. However, I am hoping
> someone can point me to a "optimizer for dummies" version.
>
>
> --
> Puneet Kishor
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how index stored by fts3

2009-11-19 Thread Dan Kennedy

On Nov 20, 2009, at 11:48 AM, ouwind wrote:

> if used A, what different does fts3 with sqlite

Right, structure A is just a regular SQLite table. It is
structure B, the full-text index, that makes fts3 different.


> --
> ouwind
> 2009-11-20
>
> -
> 发件人:  Dan Kennedy 
> 发送时间:  2009-11-20 12:32
> 主   题:  Re: [sqlite] how index stored by fts3
> 收件人:  General Discussion of SQLite Database  us...@sqlite.org>
>
>
>
> On Nov 20, 2009, at 10:24 AM, ouwind wrote:
>
>>
>> it used revert index or just index
>> for example:
>> i insert some records
>> 1:"i am a boy"
>> 2:"i am a girl"
>> 3:"you are a boy"
>>
>> what's the table stores like
>> option A: id,  content
>> 1,   i am a boy
>> 2,   i am a girl
>> 3,   you are a boy
>> option B: value, docid
>> i, 1,2
>> am   , 1,2
>> a, 1,2,3
>> boy  , 1,3
>> girl , 2
>> you  , 3
>> are  , 3
>>
>> it used struct A or B?
>
> Both, as it happens. Structure B is stored in a tricky way
> to minimize its size.
>
> Dan.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] how index stored by fts3

2009-11-19 Thread ouwind
if used A, what different does fts3 with sqlite


--
ouwind
2009-11-20

-
发件人:  Dan Kennedy 
发送时间:  2009-11-20 12:32
主   题:  Re: [sqlite] how index stored by fts3
收件人:  General Discussion of SQLite Database 



On Nov 20, 2009, at 10:24 AM, ouwind wrote:

>
> it used revert index or just index
> for example:
> i insert some records
> 1:"i am a boy"
> 2:"i am a girl"
> 3:"you are a boy"
>
> what's the table stores like
> option A: id,  content
>  1,   i am a boy
>  2,   i am a girl
>  3,   you are a boy
> option B: value, docid
>  i, 1,2
>  am   , 1,2
>  a, 1,2,3
>  boy  , 1,3
>  girl , 2
>  you  , 3
>  are  , 3
>
> it used struct A or B?

Both, as it happens. Structure B is stored in a tricky way
to minimize its size.

Dan.

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


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


Re: [sqlite] how index stored by fts3

2009-11-19 Thread Dan Kennedy

On Nov 20, 2009, at 10:24 AM, ouwind wrote:

>
> it used revert index or just index
> for example:
> i insert some records
> 1:"i am a boy"
> 2:"i am a girl"
> 3:"you are a boy"
>
> what's the table stores like
> option A: id,  content
>  1,   i am a boy
>  2,   i am a girl
>  3,   you are a boy
> option B: value, docid
>  i, 1,2
>  am   , 1,2
>  a, 1,2,3
>  boy  , 1,3
>  girl , 2
>  you  , 3
>  are  , 3
>
> it used struct A or B?

Both, as it happens. Structure B is stored in a tricky way
to minimize its size.

Dan.

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


[sqlite] how index stored by fts3

2009-11-19 Thread ouwind

it used revert index or just index
for example:
i insert some records 
1:"i am a boy"
2:"i am a girl"
3:"you are a boy"

what's the table stores like
option A: id,  content
  1,   i am a boy
  2,   i am a girl
  3,   you are a boy
option B: value, docid
  i, 1,2
  am   , 1,2
  a, 1,2,3
  boy  , 1,3
  girl , 2
  you  , 3
  are  , 3

it used struct A or B?
2009-11-20



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


Re: [sqlite] Watch Sqlite databases and delete folders based on it.

2009-11-19 Thread Simon Slavin

On 19 Nov 2009, at 7:45pm, Sadnem wrote:

> Well, I'm configuring my server to Download some folders to it and then 
> to upload them to another web and i was wondering how could i delete 
> that folders from the hdd once they were completely uploaded (thats when 
> the folder get marked with a 0 status) my problem is that i haven't made 
> all the code I'm using to do that and the infoabout the status of the 
> upload is stored in a sqlite database but my sqlite knowledge is null, I 
> hope you can understand it now.

The feature you're talking about cannot be done inside SQL at all.  It must be 
done using whatever programming language you're using.  You have called your 
code 'script' so you might be thinking of it as a script instead of a program, 
but either way you need to know how to use it to delete files and folders.

For more help learn how to program using that programming language or, at the 
minimum, figure out what programming language you're using and ask in a place 
about that programming language rather than a list about SQLite.

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


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim Romano wrote:
> I would hope that it could be included by default. 

[Note I do not speak on behalf of the SQLite team but have been an observer
for many years]

Your request is extremely unlikely to go into the SQLite core as the bar is
*very* high.  This is not because the SQLite team hates you, but because of
the principles and practise.  Firstly it has *Lite* in the name and they
really mean that.  Secondly anything that goes in has to stay in and be
supported and tested forever as they don't break backwards compatibility
except under extraordinary circumstances.

In context, you are already using SQLite from some programming language and
so have its full facilities available.  SQLite also has an API that makes it
very easy to extend functionality for functions, collations, virtual tables
and file/operating system access.

So for example you will note SQLite has no statistical functions although
arguably they could be useful to many (but not all) SQLite users. However
they can be added via host language or the SQLite API.  For example your
desired function plus many others are already provided by contributions -
see the bottom of:

  http://sqlite.org/contrib

Quite simply you refuse to use the existing extension mechanisms (your host
language, SQLite's API), can wait for a long time (hence not a priority),
have not had others clamouring for this functionality (see mailing list
archives), have ambiguous functionality requirements that may differ from
others and yet still somehow expect the SQLite team to do this, expect them
to make it default, expect the various packagers of SQLite libraries to also
make it default and expect other SQLite users to hack it out for size
reasons?  Really?  Really :-)

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksFveAACgkQmOOfHg372QSmSgCeNvBLIQJri7AUh9RKXdcl008n
yw8AoMjx5ZvsSFnF4r4fPXpuwrRyE/HQ
=nt/g
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Force cache flush?

2009-11-19 Thread Israel Brewster

 Nov 19, 2009, at 12:13 PM, Jay A. Kreibich wrote:

On Thu, Nov 19, 2009 at 11:58:59AM -0900, Israel Brewster scratched  
on the wall:



When issuing an INSERT command on a SQLite database, is that insert
cached before being written to the disk?


 Sometimes.  It may be partly cached until the transaction is
 committed.  If it is a stand-alone INSERT, that will be as soon as
 the statement is fully processed.


If so (as I suspect to be the
case), is there a way to force the cache to be flushed to disk?


 Commit any open transactions.


I have
an application that issues a number of INSERT statements, but these
don't appear to be written to the actual database file until the
application quits.


 If you're using the C API, make sure you call sqlite3_reset() and/or
 sqlite3_finalize() to close out the statement.


Thanks for the info. I'm not using transactions, so that shouldn't be  
the problem. I'm using the Qt SQL drivers, but they just use the C  
API's in a fairly standard way, to my understanding. I'll look more  
into that then. Thanks!




  -j

--
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
a protractor."   "I'll go home and see if I can scrounge up a ruler
and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


---
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
---




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


Re: [sqlite] Force cache flush?

2009-11-19 Thread Jay A. Kreibich
On Thu, Nov 19, 2009 at 11:58:59AM -0900, Israel Brewster scratched on the wall:

> When issuing an INSERT command on a SQLite database, is that insert  
> cached before being written to the disk? 

  Sometimes.  It may be partly cached until the transaction is
  committed.  If it is a stand-alone INSERT, that will be as soon as
  the statement is fully processed.

> If so (as I suspect to be the  
> case), is there a way to force the cache to be flushed to disk?

  Commit any open transactions.

> I have  
> an application that issues a number of INSERT statements, but these  
> don't appear to be written to the actual database file until the  
> application quits.

  If you're using the C API, make sure you call sqlite3_reset() and/or
  sqlite3_finalize() to close out the statement.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] is ticket 4037 not a bug?

2009-11-19 Thread John Elrick
Bogdan Ureche wrote:
> Allan,
>
> Thank you very much for the reply. You are correct when stating that,
> according to SQLite documentation this SQL syntax is not expected to work.
> Therefore, it is not a bug. Perhaps it should be added to the list of SQL92
> features unsupported  by SQLite.

IMHO it's a bug (or oversight):

C:\Users\John\Documents>sqlite3 test.db3
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table foo (id integer, value varchar);
sqlite> .q

C:\Users\John\Documents>sqlite3
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> attach database "test.db3" as myfoo;
sqlite> insert into myfoo.foo values (1, "hello");
sqlite> select r.* from myfoo.foo r;
1|hello
sqlite> select myfoo.foo.* from myfoo.foo r;
Error: near "*": syntax error
sqlite>


I cannot think of a good reason why:

select myfoo.foo.* from myfoo.foo;

would be expected to produce different results than:

select r.* from myfoo.foo r;

If the former is invalid, then the latter should be also and vis versa.

My own opinion, but there it is.

FWIW,


John Elrick










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


[sqlite] Force cache flush?

2009-11-19 Thread Israel Brewster
When issuing an INSERT command on a SQLite database, is that insert  
cached before being written to the disk? If so (as I suspect to be the  
case), is there a way to force the cache to be flushed to disk? I have  
an application that issues a number of INSERT statements, but these  
don't appear to be written to the actual database file until the  
application quits. Usually this isn't an issue (and, in fact, is  
probably a good thing), but it has caused problems a couple of times.  
This could also be caused by the program itself, of course, but I  
wanted to check the obvious places first. Thanks!
---
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
---



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


Re: [sqlite] is ticket 4037 not a bug?

2009-11-19 Thread Bogdan Ureche
Allan,

Thank you very much for the reply. You are correct when stating that,
according to SQLite documentation this SQL syntax is not expected to work.
Therefore, it is not a bug. Perhaps it should be added to the list of SQL92
features unsupported  by SQLite.

But I am asking myself: was that omission deliberate or just an oversight?
One possible answer would be that, when designing the attaching feature, the
developers started from the following requirement: "We want the queries in
attached databases to behave exactly like in the main database, with one
exception: no support for the syntax [database_name].[table_name].* because
it's too much work or for some other reason. We will support this later if
users ask for it."

If that was the case, then by all means ticket 4037 is a feature request.

But as you pointed out, it seems logical for this to work so I tend to
believe it was an oversight. In which case one might argue it's still a
feature request, however it would be closer to the grey area between bugs
and feature requests.

If this is a feature request, I would give it a higher priority than 'nice
to have'. I suppose it would be much easier to add this feature than it was
to add, say, foreign key support. I still can't explain why this syntax
error was not reported earlier, as I ran into this issue shortly after
adding support for attached databases in my project. Perhaps the usage of
attached databases in SQLite is not as widespread as one might expect?

Again, many thanks.

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


Re: [sqlite] Watch Sqlite databases and delete folders based on it.

2009-11-19 Thread P Kishor
On Thu, Nov 19, 2009 at 1:45 PM, Sadnem  wrote:
> P Kishor wrote:
>> On Thu, Nov 19, 2009 at 12:58 PM, Sadnem  wrote:
>>
>>> how could i make a script that would keep watching a sqlite table and
>>> cheking to delete folders marked with status 0? this is an example of
>>> the database i'm talking about -->
>>> http://www.wikifortio.com/834317/example.sqlite
>>> Note that the folder name is exactly the same as the one under "Release"
>>> and that these folders wont be located on the same directory of the
>>> database.
>>>
>>
>> Make a script in what? Not sure what you are asking but, from what I
>> understand, the following pseudocode should do it --
>>
>> WHILE: while true
>>    SELECT: select folder_name from table where status = 0
>>    LOOP: loop over SELECT
>>        unlink folder_name
>>    end LOOP
>> end WHILE
>>
>> the exact implementation will depend on the scripting language you are using.
>>
>>
>>> Thanks.
>>> Regards, Pedro.
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>
>>
>>
>>
> Well, I'm configuring my server to Download some folders to it and then
> to upload them to another web and i was wondering how could i delete
> that folders from the hdd once they were completely uploaded (thats when
> the folder get marked with a 0 status) my problem is that i haven't made
> all the code I'm using to do that and the infoabout the status of the
> upload is stored in a sqlite database but my sqlite knowledge is null, I
> hope you can understand it now.

I don't think you need much sqlite knowledge to accomplish... you just
need a SELECT statement. What you do need is a good knowledge of your
scripting environment so you don't willy nilly delete wrong folders.
Make your script, then test it out with fake entries and folders, and
then when you are sure, test it out again.


> Thanks.
> Regards, Pedro
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
Sent from Madison, Wisconsin, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Watch Sqlite databases and delete folders based on it.

2009-11-19 Thread Sadnem
P Kishor wrote:
> On Thu, Nov 19, 2009 at 12:58 PM, Sadnem  wrote:
>   
>> how could i make a script that would keep watching a sqlite table and
>> cheking to delete folders marked with status 0? this is an example of
>> the database i'm talking about -->
>> http://www.wikifortio.com/834317/example.sqlite
>> Note that the folder name is exactly the same as the one under "Release"
>> and that these folders wont be located on the same directory of the
>> database.
>> 
>
> Make a script in what? Not sure what you are asking but, from what I
> understand, the following pseudocode should do it --
>
> WHILE: while true
>SELECT: select folder_name from table where status = 0
>LOOP: loop over SELECT
>unlink folder_name
>end LOOP
> end WHILE
>
> the exact implementation will depend on the scripting language you are using.
>
>   
>> Thanks.
>> Regards, Pedro.
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> 
>
>
>
>   
Well, I'm configuring my server to Download some folders to it and then 
to upload them to another web and i was wondering how could i delete 
that folders from the hdd once they were completely uploaded (thats when 
the folder get marked with a 0 status) my problem is that i haven't made 
all the code I'm using to do that and the infoabout the status of the 
upload is stored in a sqlite database but my sqlite knowledge is null, I 
hope you can understand it now.
Thanks.
Regards, Pedro
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Suggested user-defined-function example

2009-11-19 Thread P Kishor
On Thu, Nov 19, 2009 at 12:32 PM, Tim Romano  wrote:
> Thank you, Jay and Pavel.
>
> So, there is much work going on "behind the scenes" in these two lines
> because of the tightly-knit connection between TCL and SQlite:
>
> proc sql_addnum { a b } { return [expr { $a + $b }] }
> db function addnum sql_addnum
>
>


well, I guess most well written interfaces will offer similar
functionality, not just Tcl. DBD::Perl also lets you do the same as
above with just two lines.


>
> Regards
> Tim Romano
>
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
Sent from Madison, Wisconsin, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Watch Sqlite databases and delete folders based on it.

2009-11-19 Thread P Kishor
On Thu, Nov 19, 2009 at 12:58 PM, Sadnem  wrote:
> how could i make a script that would keep watching a sqlite table and
> cheking to delete folders marked with status 0? this is an example of
> the database i'm talking about -->
> http://www.wikifortio.com/834317/example.sqlite
> Note that the folder name is exactly the same as the one under "Release"
> and that these folders wont be located on the same directory of the
> database.

Make a script in what? Not sure what you are asking but, from what I
understand, the following pseudocode should do it --

WHILE: while true
   SELECT: select folder_name from table where status = 0
   LOOP: loop over SELECT
   unlink folder_name
   end LOOP
end WHILE

the exact implementation will depend on the scripting language you are using.

> Thanks.
> Regards, Pedro.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
Sent from Madison, Wisconsin, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bad data in a database file or bug?

2009-11-19 Thread Vasu Nori
On Wed, Nov 18, 2009 at 8:39 AM, Vasu Nori  wrote:

>
>
> On Wed, Nov 18, 2009 at 4:06 AM, D. Richard Hipp  wrote:
>
>>
>> On Nov 17, 2009, at 9:49 PM, D. Richard Hipp wrote:
>>
>> >
>> > On Nov 17, 2009, at 9:45 PM, Vasu Nori wrote:
>> >>
>> >> sqlite> SELECT _id, typeof(_id) FROM feeds;
>> >> 1|integer
>> >> 2|integer
>> >> 3|integer
>> >> 4|integer
>> >> 5|integer
>> >> 6|integer
>> >> 7|integer
>> >> 8|integer
>> >> 9|integer
>> >> 10|integer
>> >> 11|integer
>> >> 0|integer
>> >> 13|integer
>> >> 14|integer
>> >
>> >
>> > Please email your database directly to me for analysis.  d...@hwaci.com
>>
>>
>> The database file is corrupt, but in a way that "PRAGMA
>> integrity_check" does not detect.  A single byte at an offset of 13568
>> into the file seems to have been changed from 0x0c into 0x00.
>>
>> wondering how difficult it is to detect this kind of corruption - the kind
where a single byte corruption can be pretty bad. in this case, it meant
that the entire row went un-retrievable with the query  "select * from feeds
where _id = 0;"

if it is such corruption can be detected and be included as part of "pragma
integrity-check" command, then
it could have proved quite useful in my case.

any opinions? and any sqlite-committers willing to do this? if not, how
about helping me with a few pointers to get me started on implementing this?

thanks

> How was this database created?  Can you recreate this problem from
>> scratch?
>>
>> database is created by an android application on a phone (running
> android). nothing extraordinary about this application's database creation.
>
> It is not reproducible that easily.
>
> any theories or hints on how one could debug this?
>
>
>>  D. Richard Hipp
>> d...@hwaci.com
>>
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Watch Sqlite databases and delete folders based on it.

2009-11-19 Thread Sadnem
how could i make a script that would keep watching a sqlite table and 
cheking to delete folders marked with status 0? this is an example of 
the database i'm talking about --> 
http://www.wikifortio.com/834317/example.sqlite
Note that the folder name is exactly the same as the one under "Release" 
and that these folders wont be located on the same directory of the 
database.
Thanks.
Regards, Pedro.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Suggested user-defined-function example

2009-11-19 Thread Tim Romano
Thank you, Jay and Pavel. 

So, there is much work going on "behind the scenes" in these two lines 
because of the tightly-knit connection between TCL and SQlite:

proc sql_addnum { a b } { return [expr { $a + $b }] }
db function addnum sql_addnum 



Regards
Tim Romano





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


Re: [sqlite] Suggested user-defined-function example

2009-11-19 Thread Pavel Ivanov
> can what Walter is doing  be done in other languages, namely Adobe Flex
> AIR/ActionScript?

I don't know Flex's API but I bet you have documentation for that and
can find there whether it has registration of user-defined functions
or not.

>  Is "return [expr { $a + $b }]" also written in TCL?

Yes.

> Where does a function registered with the SQLite engine live?  Is it
> stored inside the database?

No. It lives in your application and SQLite stores in the connection
only pointer to the function that it should call.

> Do the functions one registers in SQLite with the "function" method have
> at their disposal only simple scalar operators, or can there be loop
> control structures?

Whatever your language supports although I believe you cannot (or have
certain restrictions on) call SQLite API back from inside such
function.


Pavel

On Thu, Nov 19, 2009 at 10:58 AM, Tim Romano  wrote:
> Perhaps the list can help me to get beyond some fundamental igorance here.
>
> What is the name for what Walter is doing in the two lines below, and
> can what Walter is doing  be done in other languages, namely Adobe Flex
> AIR/ActionScript?
>
> proc sql_addnum { a b } { return [expr { $a + $b }] }
> db function addnum sql_addnum
>
>
> I see "function" documented here http://www.sqlite.org/tclsqlite.html
> and "proc" appears to create a TCL procedure.
>
>  Is "return [expr { $a + $b }]" also written in TCL?
>
> Where does a function registered with the SQLite engine live?  Is it
> stored inside the database?
> Do the functions one registers in SQLite with the "function" method have
> at their disposal only simple scalar operators, or can there be loop
> control structures?
>
> Thanks
> Tim Romano
>
> Walter Dnes wrote:
>>   Whilst trying to get a TCL script to create a function in SQLite I ran
>> into problems and did a lot of Googling.  I got very tired of seeing the
>> same old same old...
>>
>> proc sql_sqrt {x} {return [expr {sqrt($x)}]}
>> db function sqrt sql_sqrt
>>
>>   It didn't help me because it used only one parameter.  It didn't say
>> anything about you
>> - *MUST NOT* have commas between parameters in the function definition
>> - *MUST* have commas between parameters when actually calling it
>>
>>   I spent several hours figuring this out.  Here's a working example...
>>
>> package require sqlite3
>> sqlite3 db :memory:
>> db eval {create table dual(x varchar(1))}
>> db eval {insert into dual values(' ')}
>> proc sql_addnum { a b } { return [expr { $a + $b }] }
>> db function addnum sql_addnum
>> db eval {select 'Hello world' as x from dual} {puts stdout "$x"}
>> db eval {select  999  as y from dual} {puts stdout "$y"}
>> db eval {select addnum(1, 2)  as z from dual} {puts stdout "$z"}
>> db close
>>
>>   And the output is...
>>
>> Hello world
>> 999
>> 3
>>
>>   Use this code as an example, and it may save someone else some time
>> down the road.
>>
>>
>> 
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.425 / Virus Database: 270.14.73/2512 - Release Date: 11/18/09 
>> 19:41:00
>>
>>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Suggested user-defined-function example

2009-11-19 Thread Tim Romano
Perhaps the list can help me to get beyond some fundamental igorance here. 

What is the name for what Walter is doing in the two lines below, and 
can what Walter is doing  be done in other languages, namely Adobe Flex 
AIR/ActionScript?

proc sql_addnum { a b } { return [expr { $a + $b }] }
db function addnum sql_addnum 


I see "function" documented here http://www.sqlite.org/tclsqlite.html
and "proc" appears to create a TCL procedure.

 Is "return [expr { $a + $b }]" also written in TCL?

Where does a function registered with the SQLite engine live?  Is it 
stored inside the database?
Do the functions one registers in SQLite with the "function" method have 
at their disposal only simple scalar operators, or can there be loop 
control structures?

Thanks
Tim Romano

Walter Dnes wrote:
>   Whilst trying to get a TCL script to create a function in SQLite I ran
> into problems and did a lot of Googling.  I got very tired of seeing the
> same old same old...
>
> proc sql_sqrt {x} {return [expr {sqrt($x)}]}
> db function sqrt sql_sqrt
>
>   It didn't help me because it used only one parameter.  It didn't say
> anything about you
> - *MUST NOT* have commas between parameters in the function definition
> - *MUST* have commas between parameters when actually calling it
>
>   I spent several hours figuring this out.  Here's a working example...
>
> package require sqlite3
> sqlite3 db :memory:
> db eval {create table dual(x varchar(1))}
> db eval {insert into dual values(' ')} 
> proc sql_addnum { a b } { return [expr { $a + $b }] }
> db function addnum sql_addnum 
> db eval {select 'Hello world' as x from dual} {puts stdout "$x"}
> db eval {select  999  as y from dual} {puts stdout "$y"}
> db eval {select addnum(1, 2)  as z from dual} {puts stdout "$z"}
> db close
>
>   And the output is...
>
> Hello world
> 999
> 3
>
>   Use this code as an example, and it may save someone else some time
> down the road.
>
>   
> 
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.425 / Virus Database: 270.14.73/2512 - Release Date: 11/18/09 
> 19:41:00
>
>   

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


Re: [sqlite] is ticket 4037 not a bug?

2009-11-19 Thread Schrum, Allan
This was brought up before by me here:
http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2009-September/015484.html

The response was:
http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2009-September/015486.html

Which said:

According to http://www.sqlite.org/lang_select.html and
http://www.sqlite.org/lang_expr.html one can use in select statement
as a result column one of the following:
- *
- table_name.* (I assume that instead of table_name one can use table alias too)
- any expression

Expression can consist of the single column in the form
[[database_name.]table_name.]column_name

So nobody says that database_name.table_name.* should work and
behavior is as intended and documented. Though from the point of view
of outside user it seems logical for this to work of course.

---
So perhaps this is a feature request?

-Allan

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Bogdan Ureche
> Sent: Tuesday, November 17, 2009 2:51 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] is ticket 4037 not a bug?
> 
> >
> >
> >
> > I can imagine query generators tend to use more, possibly
> > redundant, qualifiers than a human programmer would.
> > --
> >  (  Kees Nuyt
> >  )
> > c[_]
> >
> 
> 
> That may be true but sometimes the qualifiers are needed to avoid
> ambiguity,
> in which case they are not redundant.
> 
> Bogdan
> 
> 
> 
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Asynchronous I/O and shared cache

2009-11-19 Thread presta

According to the documentation :

"database connection in read-uncommitted mode does not attempt to obtain
read-locks before reading from database tables as described above. This can
lead to inconsistent query results if another database connection modifies a
table while it is being read, but it also means that a read-transaction
opened by a connection in read-uncommitted mode can neither block nor be
blocked by any other connection."

Correct me if I'm wrong but if the "shared cache" access is locked for each
sqlite3_step, so it's not possible to have inconsistent query results.. and
no possible "real" parallel read/write.

Regards



> I don't know what Dan meant by his words but AFAIK there's no mutex
> making exclusive grab of shared cache by sqlite3_step() call. There is
> only mutex making sqlite3_step() execution exclusive for connection
> object.

I meant the mutex that is a member of the BtShared struct
(BtShared.mutex). Grabbed by the call to sqlite3VdbeMutexEnterArray()
at the top of sqlite3VdbeExec() and not released until that function
returns.

Pavel is right, technically it's not grabbed by sqlite3_step(). But
99% of the time spent in sqlite3_step() will be spent in a single call
to sqlite3VdbeExec(), so the effect is similar.

Dan.




> Pavel
>
> On Wed, Nov 18, 2009 at 8:40 AM, presta  wrote:
>>
>> I'm confused according to Dan Kennedy :
>>
>> "Each shared-cache has its own mutex. The mutex is held for the  
>> duration
>> of each sqlite3_step() call. So the way you're defining it here, you
>> can't have "real" concurrency when using shared-cache mode in any  
>> case. "
>>
>> So, it's a little bit "antagonist" to say "with shared cache they  
>> will be
>> parallelized pretty effectively in the same file too"
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Asynchronous-I-O-and-shared-cache-tp26402983p26407922.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
>>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
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/Asynchronous-I-O-and-shared-cache-tp26402983p26421364.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


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Tim Romano
Thanks for the heads-up, Jean-Denis.  

I was going to try to deploy the almost-finished Flex/AIR app on my 
wife's Mac notebook this weekend to see how it goes.  That it works 
quickly under Windows XP is all I know at this point.  I am very 
concerned about query performance and app responsiveness, but much less 
concerned about native look-and-feel.   I've done what I could to keep 
the app responsive by using  asynchronous data connections.

I didn't mention that I must operate under certain licensing 
constraints. The universities who own the rights to this data (and other 
similar sets of data) forbid third-parties to put the data on their own 
web-servers for any use beyond personal; so my app must use a local copy 
of the data that the end-users have licensed for their own personal use.

The question about the flip function() -- it is not that I am unable to 
do it on the front-end. But if the Unicode string, possibly containing 
decomposed characters, is flipped on the front-end and sent back to the 
database for insertion into a row, I will have no control over how the 
wrapper/provider/middleware  interprets the string of codepoints in 
"raw" (read "possibly malformed") representation for insertion into a 
Text field.  I want to sidestep that issue by having the flip() done by 
the database.

Regards
Tim Romano


Jean-Denis Muys wrote:
> On 11/19/09 14:55 , "Tim Romano"  wrote:
>
>
>   
>> The app was written in .NET against MS-Access; my Macintosh colleagues
>> couldn't use it. They outnumbered the Windows users. But I didn't own a
>> Mac and had never programmed on a Mac. But now Adobe Flex/AIR with
>> SQLite is available, and it offers cross-platform deployment. So I've
>> rewritten the app in Flex ActionScript using SQLite as the back-end.
>>
>> 
>
> Tim,
>
> I have absolutely no opinion on flip(), neither for nor against. However, I
> do have an opinion on using Adobe Flex or Microsoft Silverlight as
> "cross-platform" tools to bring software to the Mac.
>
> In one word: bad.
>
> These tools will not let you easily write an app that feels native on the
> Mac. Your colleagues might use it if forced to, exactly as they could use
> your previous .net app using a virtual machine, but they are likely to drag
> their feet.
>
> Additionally, there are very serious efficiency/resource consumption issues
> with the Mac version of Flash/Air on the Mac.
>
> I don't think there is a satisfactory answer to cross platform development
> of native GUI apps. The best you can do is possibly a web app. With such
> tools as client-side databases, HTML 5 and Capuccino, you might end-up not
> too far from a native look and feel.
>
> Also modern Javascript JIT compilers will let your write your own fast
> flip() function.
>
> All this IMHO of course.
>
> Jean-Denis
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.425 / Virus Database: 270.14.73/2512 - Release Date: 11/18/09 
> 19:41:00
>
>   

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


Re: [sqlite] temp directory?

2009-11-19 Thread Kris Groves
I believe you can specify the directory in which temporary files will be 
created.  This is done with pragma temp_store_directory.  I think you 
can also set this in compilation.

Artur Reilin wrote:
>
>>
>> On 19 Nov 2009, at 8:05am, Artur Reilin wrote:
>>
>>> My host have sqlite support vor sqlite 2.8.17 and i can use it. But i
>>> have
>>> to give chMod 0777 to the directory where i use sqlite. Not only on the
>>> directory, that contains the sqlite database. let me show it:
>>>
>>> /index.php (uses sqlite database)
>>> /data/data.sqlite (sqlite database)
>>>
>>> If i give chMod 0777 to /data/ and the files in this folder, it wouldn't
>>> work and get me an "malformed database - cannot create temp tables".
>>>
>>> I need to gibe chMod to the directory which contains the index.php file.
>>> That's a big security risk and i don't want to give chMod to the main
>>> directory.
>>>
>>> Is this normal and can i change this?
>>
>> You do not actually need 0777.  Your problem is that the user which is
>> creating and using the database is the user that runs Apache, not
>> yourself.  So find out which user Apache runs under.  This might be
>> perhaps www or _www or _apache.  Make sure that that user has the rights
>> over this directory.  Then Apache (running the .php script) which have
>> enough access to use the database file.
>>
>> Simon.
>
> The user which runs php (or has the highest rights) is called nobody. The
> support said me, that i need to set the directory to this user, but it
> also don't work. I get the same error as before. I can try it again, but
> the last time it didn't work.
>
> I also wondering why my oop version of my script didn't work, but the
> prozedural one does. They have pdo drivers like mine xampp server, but
> they don't have the sqlite3 drivers. Perhaps this also happens because of
> the malformed database error...
>
> With best wishes
>
> Artur Reilin
> sqlite.yuedream.de
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Jean-Denis Muys

On 11/19/09 14:55 , "Tim Romano"  wrote:


> The app was written in .NET against MS-Access; my Macintosh colleagues
> couldn't use it. They outnumbered the Windows users. But I didn't own a
> Mac and had never programmed on a Mac. But now Adobe Flex/AIR with
> SQLite is available, and it offers cross-platform deployment. So I've
> rewritten the app in Flex ActionScript using SQLite as the back-end.
> 

Tim,

I have absolutely no opinion on flip(), neither for nor against. However, I
do have an opinion on using Adobe Flex or Microsoft Silverlight as
"cross-platform" tools to bring software to the Mac.

In one word: bad.

These tools will not let you easily write an app that feels native on the
Mac. Your colleagues might use it if forced to, exactly as they could use
your previous .net app using a virtual machine, but they are likely to drag
their feet.

Additionally, there are very serious efficiency/resource consumption issues
with the Mac version of Flash/Air on the Mac.

I don't think there is a satisfactory answer to cross platform development
of native GUI apps. The best you can do is possibly a web app. With such
tools as client-side databases, HTML 5 and Capuccino, you might end-up not
too far from a native look and feel.

Also modern Javascript JIT compilers will let your write your own fast
flip() function.

All this IMHO of course.

Jean-Denis


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


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Tim Romano
Roger,
Also, you mentioned that it could take some time for a flip() function 
to make its way into the OSX version assuming it had been accepted and 
put on the docket.

I can wait a good long time for SQlite to add a flip() function.  About 
eight years ago now I wrote my app, a full-text search interface for 
ancient (early medieval) texts that were produced when spelling hadn't 
been regularized yet but reflected regional dialect pronunciations, and 
so there were multiple ways (sometimes dozens of ways) to spell the same 
word.. This was a labor of love, not of profit.

The app was written in .NET against MS-Access; my Macintosh colleagues 
couldn't use it. They outnumbered the Windows users. But I didn't own a 
Mac and had never programmed on a Mac. But now Adobe Flex/AIR with 
SQLite is available, and it offers cross-platform deployment. So I've 
rewritten the app in Flex ActionScript using SQLite as the back-end. 

After some initial problems with queries not working, which turned out 
to be Adobe Flex treating INT PRIMARY KEY as if it were an INTEGER 
PRIMARY KEY, I have the app working. But there's no hurry for the flip() 
function. I still have to find out why my starts-with searches are 
taking 40 seconds when they should be taking 100ms. The Adobe Flex 
libraries for SQLite are preventing an index from being used. Same 
problem is happening with Robert Simpson's provider for .NET and also 
with Mrinal Kant's SQLite Manager.  The index is used, however, when I 
execute the query in SQLite3.exe command-line.


Regards
Tim Romano

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


Re: [sqlite] Doubt in Trigger

2009-11-19 Thread Pavel Ivanov
> is it possible to have[insert or update] ?

No. http://www.sqlite.org/lang_createtrigger.html

Pavel

On Thu, Nov 19, 2009 at 8:53 AM, greensparker
 wrote:
>
> hi im using Before TRIGGER for validation PURPOSE (before inserting)
>
> i just want to know , is there any way to use the same trigger for UPDATE
> also.
>
> ex:
>    create trigger Testing before insert or update on testTable
>    begin
>    end;
>
>
> is it possible to have[insert or update] ?
>
> Bala
>
>
> --
> View this message in context: 
> http://old.nabble.com/Doubt-in-Trigger-tp26421342p26421342.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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Doubt in Trigger

2009-11-19 Thread greensparker

hi im using Before TRIGGER for validation PURPOSE (before inserting)

i just want to know , is there any way to use the same trigger for UPDATE
also.

ex:
create trigger Testing before insert or update on testTable
begin 
end;


is it possible to have[insert or update] ?

Bala


-- 
View this message in context: 
http://old.nabble.com/Doubt-in-Trigger-tp26421342p26421342.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


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Tim Romano
Roger wrote:

... You still  have the issue that the [flip()] code would likely be 
excluded by default just as
 soundex is, so it would still require re-compiling SQLite.  


I would hope that it could be included by default. Those who are 
concerned about the overall weight of the EXE (as a bicyclist is 
concerned about shaving grams from his bike)  are the very ones likely 
to have the skills and experience to recompile the code, and they could 
easily exclude this little flip() function at will during their 
recompilation.  Think of the pleasure you will give those folks when 
they have something else to exclude to bring the weight down!  :-)

Regards
Tim Romano


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


Re: [sqlite] Asynchronous I/O and shared cache

2009-11-19 Thread Pavel Ivanov
> I meant the mutex that is a member of the BtShared struct
> (BtShared.mutex). Grabbed by the call to sqlite3VdbeMutexEnterArray()
> at the top of sqlite3VdbeExec() and not released until that function
> returns.

Okay, now I see that and I don't like it at all. Of course it doesn't
eliminate ability to make 2 write transactions on different tables
simultaneously but this ability now narrows significantly to the cases
when transaction consists of more than one update and thus more than
one call to sqlite3_step(). Do you know the reasons why it was made
that way? What operations are made with shared cache that cannot be
parallelized and require such a wide exclusive lock (especially in
case of read-only transactions but cases of writing to different
tables are questionable too)?

Pavel

On Wed, Nov 18, 2009 at 11:55 PM, Dan Kennedy  wrote:
>
> On Nov 18, 2009, at 10:03 PM, Pavel Ivanov wrote:
>
>> I don't know what Dan meant by his words but AFAIK there's no mutex
>> making exclusive grab of shared cache by sqlite3_step() call. There is
>> only mutex making sqlite3_step() execution exclusive for connection
>> object.
>
> I meant the mutex that is a member of the BtShared struct
> (BtShared.mutex). Grabbed by the call to sqlite3VdbeMutexEnterArray()
> at the top of sqlite3VdbeExec() and not released until that function
> returns.
>
> Pavel is right, technically it's not grabbed by sqlite3_step(). But
> 99% of the time spent in sqlite3_step() will be spent in a single call
> to sqlite3VdbeExec(), so the effect is similar.
>
> Dan.
>
>
>
>
>> Pavel
>>
>> On Wed, Nov 18, 2009 at 8:40 AM, presta  wrote:
>>>
>>> I'm confused according to Dan Kennedy :
>>>
>>> "Each shared-cache has its own mutex. The mutex is held for the
>>> duration
>>> of each sqlite3_step() call. So the way you're defining it here, you
>>> can't have "real" concurrency when using shared-cache mode in any
>>> case. "
>>>
>>> So, it's a little bit "antagonist" to say "with shared cache they
>>> will be
>>> parallelized pretty effectively in the same file too"
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://old.nabble.com/Asynchronous-I-O-and-shared-cache-tp26402983p26407922.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
>>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] another Feature Request: char from codepoint?

2009-11-19 Thread Tim Romano
Yet I don't want to do this reversal "in my application".  I am not a C 
programmer and would have to rely upon data-providers to talk to the 
database.  Providers, as good as they may be, are not 100% transparent 
conduits between the client app and the database. Right now, three of 
them are returning different query plans from what SQLite3.exe returns, 
for example. In respect to the flip() function, what if a provider 
should add a bit of "intelligence" and throw a malformed Unicode 
character exception when it sees a composed Unicode character that makes 
no sense because its raw codepoints have been reversed?

I don't know if that hypothetical scenario is far-fetched; but it's not 
far-fetched to ask for a function like this because the mainstream 
databases all provide the ability to reverse the raw codepoints of a 
text string along with their other string-handling functions. Such a 
function is common, not unusual. Not that SQLite needs to do everything 
the other databases do. You do have demands to remain "Lite".  But I 
don't believe that a raw reverse-string function adds much "weight".  A  
UnicodeIntelligentReverse() that preserves combined Unicode forms during 
the reversal could be weighty but the raw-flip is a tiny bit of code.

Regards
Tim Romano

Igor Tandetnik wrote:
> Tim Romano  wrote:
>   
>> I respectfully disagree, Roger, about the simplicity.  Creating an
>> external DLL would complicate my distribution scenario significantly
>> because I'll  have just as many users of my little database
>> application working with Apple OSX as with Windows.
>> 
>
> You don't need external DLL. You can implement your custom function directly 
> in your application.
>
> Igor Tandetnik
>
> ___
>   

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


Re: [sqlite] temp directory?

2009-11-19 Thread Artur Reilin
> Okay.  That suggests something strange is happening.  Perhaps instead of
> making sure that the right 'user' has access to the database directory you
> can use the 'group' that 'nobody' is in, and give that group privilages.

I changed it to the group 'nobody', but no i have an empty result. I don't
get an error, but it doesn't show anything. I need to set chMod to 777 and
user and group 'nobody'. strange thing...

> Which set of PHP commands are you using to access the SQLite database ?

to access the database i use new SQLITEDATABASE and the query. I only read
the informations from the database.

> Can you create a new blank database which is not malformed ?

The database isn't malformed and it work right, but it seems not to work
if i use oop.

> Simon.

with besth wishes

Artur Reilin
sqlite.yuedream.de
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] temp directory?

2009-11-19 Thread Simon Slavin

On 19 Nov 2009, at 10:05am, Artur Reilin wrote:

> The user which runs php (or has the highest rights) is called nobody.

Okay.  That suggests something strange is happening.  Perhaps instead of making 
sure that the right 'user' has access to the database directory you can use the 
'group' that 'nobody' is in, and give that group privilages.

> The
> support said me, that i need to set the directory to this user, but it
> also don't work. I get the same error as before. I can try it again, but
> the last time it didn't work.

I do not know much more about this.  If you need someone else to help you could 
you list your operating system, and whether you really are doing this in a .php 
script run by a web server ?

> I also wondering why my oop version of my script didn't work, but the
> prozedural one does. They have pdo drivers like mine xampp server, but
> they don't have the sqlite3 drivers.

Which set of PHP commands are you using to access the SQLite database ?

> Perhaps this also happens because of
> the malformed database error...

Can you create a new blank database which is not malformed ?

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


Re: [sqlite] temp directory?

2009-11-19 Thread Artur Reilin

>
> On 19 Nov 2009, at 8:05am, Artur Reilin wrote:
>
>> My host have sqlite support vor sqlite 2.8.17 and i can use it. But i
>> have
>> to give chMod 0777 to the directory where i use sqlite. Not only on the
>> directory, that contains the sqlite database. let me show it:
>>
>> /index.php (uses sqlite database)
>> /data/data.sqlite (sqlite database)
>>
>> If i give chMod 0777 to /data/ and the files in this folder, it wouldn't
>> work and get me an "malformed database - cannot create temp tables".
>>
>> I need to gibe chMod to the directory which contains the index.php file.
>> That's a big security risk and i don't want to give chMod to the main
>> directory.
>>
>> Is this normal and can i change this?
>
> You do not actually need 0777.  Your problem is that the user which is
> creating and using the database is the user that runs Apache, not
> yourself.  So find out which user Apache runs under.  This might be
> perhaps www or _www or _apache.  Make sure that that user has the rights
> over this directory.  Then Apache (running the .php script) which have
> enough access to use the database file.
>
> Simon.

The user which runs php (or has the highest rights) is called nobody. The
support said me, that i need to set the directory to this user, but it
also don't work. I get the same error as before. I can try it again, but
the last time it didn't work.

I also wondering why my oop version of my script didn't work, but the
prozedural one does. They have pdo drivers like mine xampp server, but
they don't have the sqlite3 drivers. Perhaps this also happens because of
the malformed database error...

With best wishes

Artur Reilin
sqlite.yuedream.de
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] temp directory?

2009-11-19 Thread Simon Slavin

On 19 Nov 2009, at 8:05am, Artur Reilin wrote:

> My host have sqlite support vor sqlite 2.8.17 and i can use it. But i have
> to give chMod 0777 to the directory where i use sqlite. Not only on the
> directory, that contains the sqlite database. let me show it:
> 
> /index.php (uses sqlite database)
> /data/data.sqlite (sqlite database)
> 
> If i give chMod 0777 to /data/ and the files in this folder, it wouldn't
> work and get me an "malformed database - cannot create temp tables".
> 
> I need to gibe chMod to the directory which contains the index.php file.
> That's a big security risk and i don't want to give chMod to the main
> directory.
> 
> Is this normal and can i change this?

You do not actually need 0777.  Your problem is that the user which is creating 
and using the database is the user that runs Apache, not yourself.  So find out 
which user Apache runs under.  This might be perhaps www or _www or _apache.  
Make sure that that user has the rights over this directory.  Then Apache 
(running the .php script) which have enough access to use the database file.

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


[sqlite] temp directory?

2009-11-19 Thread Artur Reilin
Hello.

My host have sqlite support vor sqlite 2.8.17 and i can use it. But i have
to give chMod 0777 to the directory where i use sqlite. Not only on the
directory, that contains the sqlite database. let me show it:

/index.php (uses sqlite database)
/data/data.sqlite (sqlite database)

If i give chMod 0777 to /data/ and the files in this folder, it wouldn't
work and get me an "malformed database - cannot create temp tables".

I need to gibe chMod to the directory which contains the index.php file.
That's a big security risk and i don't want to give chMod to the main
directory.

Is this normal and can i change this?

with best wishes

Artur Reilin
sqlite.yuedream.de
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users