RE: [sqlite] PRAGMA cache_size = 0
I am yet to get answers for the following questions. > What happens if I set the cache_size to 0? Will I be able to do any of > update/delete/insert/select operations? > > When I set the cache_size to 0, is there any freeing up of memory by > sqlite? Regards, Phani
RE: [sqlite] Re: Re: Syntax help with UPDATE in SQLite Database Browser
Thanks to all those who assisted me with this issue. After manipulating the 'new parameters' table in another environment I was able to ensure that I had the columns required to allow select statements the did NOT include the table to be updated... I also took some hints from: http://www.mail-archive.com/sqlite-users@sqlite.org/msg21569.html With my resulting UPDATE statement reading: Update Parameter set ParameterValue = (select NewParams.NewParamVal from NewParams where Parameter.ModelID = NewParams.ModelID and Parameter.Parameter = NewParams.Parameter) WHERE (ModelID in (select Parameter.ModelID from Parameter, NewParams where NewParams.ModelID = Parameter.ModelID and NewParams.Parameter = Parameter.Parameter)) AND (Parameter in (select Parameter.Parameter from Parameter, NewParams where NewParams.ModelID = Parameter.ModelID and NewParams.Parameter = Parameter.Parameter)) Not perfect, but it'll do. Thanks again Rob -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Tuesday, 12 June 2007 12:19 PM To: SQLite Subject: [sqlite] Re: Re: Syntax help with UPDATE in SQLite Database Browser Ellis Robin (Bundaberg) <[EMAIL PROTECTED]> wrote: > Thanks Igor, the records in the Parameter table are required to ensure > that the values returned from NewParams are matched to the appropriate > records. They are matched to the record you are updating. SQLite walks all records in Parameter table, and for each record runs the subselect (the reference to Parameter table in the subselect represents the current row), then updates the field in the current row with the value thus calculated. Read about coordinated subqueries in your favorite SQL textbook. > By removing the referenecs to Parameter in the FROm statement I > achieve 0 updates. Since you don't have a WHERE clause, every single record in the Parameter table is necessarily being updated. It is possible that the value calculated by the subselect for each record is equal to the current value in this record, so it appears that no update takes place. If this is unexpected, check the logic of your subselect. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] - The information in this email together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this email message is prohibited, unless as a necessary part of Departmental business. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Database replication question
> - Original Message > From: Joe Wilson <[EMAIL PROTECTED]> > To: sqlite-users@sqlite.org > Sent: Monday, June 11, 2007 8:36:32 PM > Subject: Re: [sqlite] Database replication question > > > Large bulk inserts with more than one index (implicit or explicit) > is not SQLite's strong suit. > > If you search the mailing list archives you'll find a few suggestions: > > - "BEGIN EXCLUSIVE" (or is it "BEGIN IMMEDIATE"?) on the > database file and then copy the file over - fastest way What do you mean by "copy the file over"? A straight copy of the binary content of the file? If so, I can't really do that because the version of sqlite are potentially different on the two machines. > > or > > - increasing cache sizes > - pre-sorting the data in index order prior to bulk insert > - creating the other indexes after all the data is inserted > > If you do not require a live backup you could use the copy trick > and augment that with a daily archive via > > sqlite3 file.db .dump | gzip etc... > > in case the database file becomes corrupted. If the performance problem is with the seconday index, is there a way to "pause" indexing before a large bulk insert and then "resume" it later without rebuilding the entire index (to avoid doing: drop index + inserts + create index)? Maybe it's a stupid question, but I am guessing that there is some sort of version number for the rows in the db, so playing "catchup" on an index could work? Nicolas
Re: [sqlite] Database replication question
Large bulk inserts with more than one index (implicit or explicit) is not SQLite's strong suit. If you search the mailing list archives you'll find a few suggestions: - "BEGIN EXCLUSIVE" (or is it "BEGIN IMMEDIATE"?) on the database file and then copy the file over - fastest way or - increasing cache sizes - pre-sorting the data in index order prior to bulk insert - creating the other indexes after all the data is inserted If you do not require a live backup you could use the copy trick and augment that with a daily archive via sqlite3 file.db .dump | gzip etc... in case the database file becomes corrupted. --- [EMAIL PROTECTED] wrote: > I am trying to put in place a simple replication process to copy a database > from one machine to > an other. ... > My question is: > > is there a way to do a select or a .dump so that when inserting the data on > the other end, > things will be faster? Or maybe there are some pragmas I can use that would > improve performance? Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Database malformed with SQLite3.3.17 on WindowsXP
I've opened a new ticket 2409. http://www.sqlite.org/cvstrac/tktview?tn=2409,38 Also I found that it happenes from SQLite 3.3.9. -- tamagawa ryuji > Hi, Richard. Thank you for your very quick response. > >>> 1) Run a program SQLiteCrush.exe. >>>This program updates 'test.db' repeatedly. Insert data >>>to work table, copy them into items table, then delete >>>records from work. > >> Does SQLiteCrush.exe continue running in the background >> while you are doing steps 2 and 3? Or does SQLiteCrush.exe >> run to completion, then you do steps 2 and 3 separately? > > It continue running in the background. > > >> The code for SQLiteCrush.exe and a clean database would be helpful. >> Binaries for SQLiteCrush.exe and a corruption database, not so much. >> >> Perhaps you can open a new ticket and include the code and database >> as an attachment. > > I'm grad to do that. > -- > tamagawa ryuji > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Database replication question
Hi all I am trying to put in place a simple replication process to copy a database from one machine to an other. The table I have is something like CREATE TABLE sn2uid(sn VARCHAR(100) NOT NULL, uid INTEGER NOT NULL, PRIMARY KEY (sn)); CREATE INDEX uidindex on sn2uid ( uid ) Where the (sn,uid) pairs are pretty much random. On my test data, I have around 3 million entries, the size on disk being about 280 Mb If I do a 'select * from sn2uid' > db, I get around 100Mb worth of data. I was thinking to simply stream the result from that query over tcp (http really), and do the inserts on the other side... The problem I have is that, while doing this select takes about 10 seconds on my machine, I didn't find any quick way to insert quickly onto the other machine. After a while, the db file size grows very very slowly, even when using transactions My question is: is there a way to do a select or a .dump so that when inserting the data on the other end, things will be faster? Or maybe there are some pragmas I can use that would improve performance? To me, it seems that the reason things are slow is that even though I do the inserts in a transaction, the btrees are modified independently, and in that case randomly. If I was getting the data in the right order in terms of the btree, I think things could be significantly faster... What I tried was to simply something like: sqlite3 myorg.db '.dump sn2uid' > ~/sn2uid.txt sqlite3 mynew.db < ~/sn2uid.txt Would grouping inserts together by groups of 1 or so make things faster instead of one gigantic transaction? I am wondering in particular if the btree insert code is smart enough to build the tree and merge it into the main db file faster in that case? Thanks! Nicolas
[sqlite] Re: Re: Syntax help with UPDATE in SQLite Database Browser
Ellis Robin (Bundaberg) <[EMAIL PROTECTED]> wrote: Thanks Igor, the records in the Parameter table are required to ensure that the values returned from NewParams are matched to the appropriate records. They are matched to the record you are updating. SQLite walks all records in Parameter table, and for each record runs the subselect (the reference to Parameter table in the subselect represents the current row), then updates the field in the current row with the value thus calculated. Read about coordinated subqueries in your favorite SQL textbook. By removing the referenecs to Parameter in the FROm statement I achieve 0 updates. Since you don't have a WHERE clause, every single record in the Parameter table is necessarily being updated. It is possible that the value calculated by the subselect for each record is equal to the current value in this record, so it appears that no update takes place. If this is unexpected, check the logic of your subselect. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 through PDO/PHP issues.
After some more experimentation I have determined that the rowCount() method in the PDOStatement object just doesn't work. Using your ultra simple SQL test I get this: PDOStatement Object ( [queryString] => select 123 as abc; ) rows = 0 Joe Wilson wrote: $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. Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow - To unsubscribe, send email to [EMAIL PROTECTED] - -- Greg Gulik http://www.gulik.org/greg/ greg @ gulik.org
Re: [sqlite] Re: Why is there no sqlite3_exec16() method?
You can keep the prepared SQl and re-use it by using sqlite3_reset. Rob Richardson wrote: Igor, Thank you very much for your reply. My naïve impression was that sqlite3_prepare/step/finalize are used for SELECT statements, where there would be a result set one would want to step through, and that one would use sqlite3_exec() for statements where no result set is expected, such as UPDATE, DELETE or INSERT. So, let's say we want to delete a record using "DELETE FROM my_table WHERE my_key = my_unwanted_value". I would just pass that string into sqlite3_prepare16(), then call sqlite3_step() to actually do the deletion (and return SQLITE_DONE), and then clean up by calling sqlite_finalize? Rob Richardson - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] Re: Syntax help with UPDATE in SQLite Database Browser
Thanks Igor, the records in the Parameter table are required to ensure that the values returned from NewParams are matched to the appropriate records. By removing the referenecs to Parameter in the FROm statement I achieve 0 updates. Thanks to all, I'll dump to another DB and do the work there. Rob -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Friday, 8 June 2007 9:56 PM To: SQLite Subject: [sqlite] Re: Syntax help with UPDATE in SQLite Database Browser Ellis Robin (Bundaberg) <[EMAIL PROTECTED]> wrote: > Update Parameter set ParameterValue = (select NewParams.parametervalue > from Scenario, Link, Catchment, FunctionalUnit, > FunctionalUnitDefinition, StandardFU, Parameter, NewParams where > Scenario.ScenarioID = 1004 and Scenario.NetworkID = Link.NetworkID and > Link.LinkID = Catchment.LinkID and FunctionalUnit.CatchmentID = > Catchment.CatchmentID and FunctionalUnit.FunctionalUnitDefinitionID = > FunctionalUnitDefinition.FunctionalUnitDefinitionID and > FunctionalUnit.FunctionalUnitID = StandardFU.StandardFUID and > StandardFU.RainfallRunoffModelID = Parameter.ModelID and > Catchment.Name = NewParams.Subcatchments and > FunctionalUnitDefinition.Name = NewParams.FU_name and > Parameter.Parameter = NewParams.parameter) Remove Parameter from the FROM clause of the subselect. You want to tie the subselect to Parameter table you are updating, rather than giving it its own. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] - The information in this email together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this email message is prohibited, unless as a necessary part of Departmental business. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: sqlite_omit_xx build failure
"weiyang wang" <[EMAIL PROTECTED]> wrote: > hi, > > i am trying to get a smaller sqlite lib by adding sqlite_omit_xx defines. > but it failed at the compiler time. > > steps: > 1, in 'Makefile.in', omit macro is added: > > TCC += -DSQLITE_OMIT_ALTERTABLE=1 > > 2, run '(top)/configure' and 'make' in cygwin, > > 3, i got the fowllowing error: > Did you do this from a clean directory? Did you do "make clean" before doing "make"? -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] Slow View Performance
> TabA.ID1 > TabA.ID2 > TabA.field1 > > TabB.ID1 > TabB.ID2 > TabB.field2 > > TabC.ID1 > TabC.field3 > > ViewBC: > SELECT * FROM TabB INNER JOIN TabC On TabB.ID1 = TabC.ID1 > > This is slow: > SELECT field1, field2, field3 from TabA LEFT OUTER JOIN ViewBC ON TabA.ID1 = > ViewBC.ID1 AND TabA.ID2 = ViewBC.ID2 > > This is fast: > SELECT field1, field2, field3 from TabA LEFT OUTER JOIN TabB ON TabA.ID1 = > TabB.ID1 AND TabA.ID2 = TabB.ID2 INNER JOIN TabC ON TabB.ID1 = TabC.ID1 The second query may be faster, but the two queries are not equivalent. Outer joins are not associative. CREATE TABLE t1(a); INSERT INTO t1 VALUES(1); CREATE TABLE t2(b); INSERT INTO t2 VALUES(2); CREATE TABLE t3(c); INSERT INTO t3 VALUES(2); create view v1 as select b,c from t2 join t3 on b=c; sqlite> select a,b,c from t1 left join v1 on a=b; a b c -- -- -- 1 NULLNULL sqlite> select a,b,c from t1 left join (t2 join t3 on b=c) on a=b; a b c -- -- -- 1 NULLNULL sqlite> select a,b,c from t1 left join t2 on a=b join t3 on b=c; sqlite> select a,b,c from (t1 left join t2 on a=b) join t3 on b=c; Need Mail bonding? Go to the Yahoo! Mail Q for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list=396546091 - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] sqlite_omit_xx build failure
hi, i am trying to get a smaller sqlite lib by adding sqlite_omit_xx defines. but it failed at the compiler time. steps: 1, in 'Makefile.in', omit macro is added: TCC += -DSQLITE_OMIT_ALTERTABLE=1 2, run '(top)/configure' and 'make' in cygwin, 3, i got the fowllowing error: ./.libs/libsqlite3.a(parse.o): In function `sqlite3Parser': /home/ww1/sqlite-3.3.17/bld/parse.y:1066: undefined reference to `_sqlite3AlterB eginAddColumn' /home/ww1/sqlite-3.3.17/bld/parse.y:1063: undefined reference to `_sqlite3AlterF inishAddColumn' /home/ww1/sqlite-3.3.17/bld/parse.y:1060: undefined reference to `_sqlite3AlterR enameTable' it seems that parse.y is not stripped with the omit define (SQLITE_OMIT_ALTERTABLE) so that parse.c still contains the unwanted symbols. it is said that the omit defines must also be fed to lemon tool to gererate the correct parse.c, but i failed to find out where it is. appreciation will be given for any hint. wang
RE: [sqlite] Database malformed with SQLite3.3.17 on WindowsXP
Hi, Richard. Thank you for your very quick response. >> 1) Run a program SQLiteCrush.exe. >>This program updates 'test.db' repeatedly. Insert data >>to work table, copy them into items table, then delete >>records from work. >Does SQLiteCrush.exe continue running in the background >while you are doing steps 2 and 3? Or does SQLiteCrush.exe >run to completion, then you do steps 2 and 3 separately? It continue running in the background. >The code for SQLiteCrush.exe and a clean database would be helpful. >Binaries for SQLiteCrush.exe and a corruption database, not so much. > >Perhaps you can open a new ticket and include the code and database >as an attachment. I'm grad to do that. -- tamagawa ryuji - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Database malformed with SQLite3.3.17 on WindowsXP
=?iso-2022-jp?B?GyRCNkxAbhsoQiAbJEJONTtKIWMbKEJlLRskQiU9JWolZSE8JTcbKEI=?= =?iso-2022-jp?B?GyRCJWclczt2NkhJdDMrSC9JdDMrSC8yXSFkGyhC?= <[EMAIL PROTECTED]> wrote: > > I encountered a problem with SQLite3.3.17 on Windows XP. Under certain > situation, > database file got seriously corrupted. > > SQLite version: 3.3.17 Windows Binary > Platform:Windows XP SP2(Japanese) > Code wrtten in: Visual C++ 6.0 > > Here are the procedures to reproduce the problem: > > 1) Run a program SQLiteCrush.exe. >This program updates 'test.db' repeatedly. Insert data >to work table, copy them into items table, then delete >records from work. Does SQLiteCrush.exe continue running in the background while you are doing steps 2 and 3? Or does SQLiteCrush.exe run to completion, then you do steps 2 and 3 separately? > > 2) Open 'test.db' from sqlite3.exe. > > 3) Do '.read check.sql' repeatedly. >check.sql is made from many lines of 'pragma integrity_check;'. > > 4) Keep doing 1 -3 for several minuites, and 'pragma integrity_check' >starts to report something like >"rowid 91667 missing from index sqlite_autoindex_link_1". > [...] > > I'm ready to provide the code, the binary, the clean database and > the corrupted database file. > The code for SQLiteCrush.exe and a clean database would be helpful. Binaries for SQLiteCrush.exe and a corruption database, not so much. Perhaps you can open a new ticket and include the code and database as an attachment. -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Database malformed with SQLite3.3.17 on WindowsXP
Hello Lists, I encountered a problem with SQLite3.3.17 on Windows XP. Under certain situation, database file got seriously corrupted. SQLite version: 3.3.17 Windows Binary Platform:Windows XP SP2(Japanese) Code wrtten in: Visual C++ 6.0 Here are the procedures to reproduce the problem: 1) Run a program SQLiteCrush.exe. This program updates 'test.db' repeatedly. Insert data to work table, copy them into items table, then delete records from work. 2) Open 'test.db' from sqlite3.exe. 3) Do '.read check.sql' repeatedly. check.sql is made from many lines of 'pragma integrity_check;'. 4) Keep doing 1 -3 for several minuites, and 'pragma integrity_check' starts to report something like "rowid 91667 missing from index sqlite_autoindex_link_1". So far, I didn't see the database corrupted with SQLite 3.3.7. Also, without 3), the database was not corrupted. Instead of 'pragma integrity_check', issueing many select statements also make it currupted. I'm ready to provide the code, the binary, the clean database and the corrupted database file. Now, what can I do to fix this problem? Thanks in advance for any advice and suggestion. -- tamagawa ryuji - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] performances tool
Hello, Ghislain, Regarding: any tool or instrument which could help me to analyze the performances of SQLite You may want to write again and be a bit more specific. What operating system are you using? What wrapper, if any? Do you need to analyze your SQL and try to make it run more efficiently? If so, then note that using the EXPLAIN QUERY PLAN prefix will let you identify the indices used. If you want to know how long a particular SQL statement is taking to run on your database, then many tools such as sqlite3explorer http://www.sqlite.org/contrib can make timing under windows more convenient. Are you using explicit transactions? Do you define appropriate indices? [opinions are mine -- not my company's] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Why is there no sqlite3_exec16() method?
"Rob Richardson" <[EMAIL PROTECTED]> wrote: > > So, let's say we want to delete a record using "DELETE FROM my_table = > WHERE my_key = my_unwanted_value". I would just pass that string into = > sqlite3_prepare16(), then call sqlite3_step() to actually do the = > deletion (and return SQLITE_DONE), and then clean up by calling = > sqlite_finalize? > That's what sqlite3_exec16() would do, if such a function existed. Note, by the way, how sqlite3_prepare16_v2() works: It translates the input SQL into UTF-8 then calls sqlite3_prepare_v2() to do the parsing. The current implementation of SQLite does *not* implement a UTF-16 tokenizer or parser. All tokenizing and parsing is done in UTF-8. So if maximum performance is your goal, then you might consider using sqlite3_exec() and/or sqlite3_prepare_v2(). Note also that for new development you should be using sqlite3_prepare16_v2(), not sqlite3_prepare16(). -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite 3.2.8 segmentation fault
This is a question for your OS vendor. --- "Rachmel, Nir (Nir)" <[EMAIL PROTECTED]> wrote: > I have run into a problem - using the same environment variables as I > did in the old version ( I am upgrading from 3.2.8 to the newest version > of 3.3.17), I am unable to compile succesfully. > Here is the error I get: > > attempt to open > /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr > linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib/crtn.o succeeded > > /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr > linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib/crtn.o > ld.so.1 needed by > /home/lira/toolchain/wrlinux-1.2/target-libs/gpp/powerpc-wrs-linux-power > pc/lib/libpthread.so.0 > found ld.so.1 at > /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr > linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib//ld.so.1 > collect2: ld returned 1 exit status > make[1]: *** [sqlite3] Error 1 > make[1]: Leaving directory > `/home/rachmel/work/sqlite_new/avaya_build_target' > make: *** [build] Error 2 > > Any ideas as to what is the problem? Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] Re: Why is there no sqlite3_exec16() method?
Igor, Thank you very much for your reply. My naïve impression was that sqlite3_prepare/step/finalize are used for SELECT statements, where there would be a result set one would want to step through, and that one would use sqlite3_exec() for statements where no result set is expected, such as UPDATE, DELETE or INSERT. So, let's say we want to delete a record using "DELETE FROM my_table WHERE my_key = my_unwanted_value". I would just pass that string into sqlite3_prepare16(), then call sqlite3_step() to actually do the deletion (and return SQLITE_DONE), and then clean up by calling sqlite_finalize? Rob Richardson - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] performances tool
Hello, my name is Ghislain ,i find any tool or instrument which could help me to analyze the performances of SQLite.Please all the suggestions being able to help me would also to me. Thank you
Re: [sqlite] PRAGMA cache_size = 0
correct my former message, the smallest is 10, (10 pages in ram) On 6/11/07, B V, Phanisekhar <[EMAIL PROTECTED]> wrote: What happens if I set the cache_size to 0? Will I be able to do any of update/delete/insert/select operations? When I set the cache_size to 0, is there any freeing up of memory by sqlite? Regards, Phani
Re: [sqlite] PRAGMA cache_size = 0
the smallest cache_size is 512k, i guess. On 6/11/07, B V, Phanisekhar <[EMAIL PROTECTED]> wrote: What happens if I set the cache_size to 0? Will I be able to do any of update/delete/insert/select operations? When I set the cache_size to 0, is there any freeing up of memory by sqlite? Regards, Phani
[sqlite] PRAGMA cache_size = 0
What happens if I set the cache_size to 0? Will I be able to do any of update/delete/insert/select operations? When I set the cache_size to 0, is there any freeing up of memory by sqlite? Regards, Phani
Re: [sqlite] sqlite3_temp_directory in main.c
by checking the codes, i could see temp_store_directory is used to overide the platform-specific default temp directory in run time. That is, if temp_store_directory is 0 (the default value of temp_store_directory), then OS layer (os_win.x and os_unix.x) will provide the OS default temp directory. (for example, */var/tmp, /usr/tmp for unix*). if temp_store_directory is configured by pragma, then the configured temp_store_directory will be used instead of OS default one. the following code is from os_win.c :: sqlite3WinTempFileName() if( sqlite3_temp_directory ) { ... ... }else if( isNT() ) { ... ... } On 6/7/07, Tom Briggs <[EMAIL PROTECTED]> wrote: I can see your point, I guess, though I can't say that it seems like a major issue to me. Just out of curiosity, why aren't the defaults derived in os_win.x and os_unix.c sufficient? > -Original Message- > From: weiyang wang [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 06, 2007 11:17 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] sqlite3_temp_directory in main.c > > the concern here is to configure the default temp directory in library > compile time, on the OS porting layer. > in current version, the default value of > sqlite3_temp_directory is hardcoded > as 0 in main.c for all platforms. > would it be better to make it configrable for different > platforms and use > PRAGMA to overide the defult in runtime. > > i am looking forward to your opiniions. > > thanks again. > > wang > > On 6/6/07, Tom Briggs <[EMAIL PROTECTED]> wrote: > > > > > > Why not just use PRAGMA temp_store_directory, as the comments > > directly above that line suggest? > > > > > -Original Message- > > > From: weiyang wang [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, June 06, 2007 7:09 AM > > > To: sqlite-users > > > Subject: [sqlite] sqlite3_temp_directory in main.c > > > > > > hi, > > > > > > i found the following line in main.c > > > > > > char *sqlite3_temp_directory = 0; > > > > > > which seems to remove the possibilities that the customer > > > platform could > > > specify sqlite3_temp_directory. > > > > > > i suggest that this line is removed. > > > > > > any comments? > > > > > > thanks in advance. > > > > > > wang > > > > > > > > > > -- > --- > > To unsubscribe, send email to [EMAIL PROTECTED] > > > > > -- > --- > > > > > - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite 3.2.8 segmentation fault
Hi, Thanks for the response - your assumption seems reasonable - I am no able to use a different malloc library on my system, but I do want to try and upgrade my sqlite, since I have noticed I am using quite an old version, and who knows.. I have run into a problem - using the same environment variables as I did in the old version ( I am upgrading from 3.2.8 to the newest version of 3.3.17), I am unable to compile succesfully. Here is the error I get: attempt to open /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib/crtn.o succeeded /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib/crtn.o ld.so.1 needed by /home/lira/toolchain/wrlinux-1.2/target-libs/gpp/powerpc-wrs-linux-power pc/lib/libpthread.so.0 found ld.so.1 at /home/lira/toolchain/gnu/3.4.4-wrlinux-1.2/x86-linux2/bin/../../../../wr linux-1.2/target-libs/gpp/powerpc-wrs-linux-powerpc/lib//ld.so.1 collect2: ld returned 1 exit status make[1]: *** [sqlite3] Error 1 make[1]: Leaving directory `/home/rachmel/work/sqlite_new/avaya_build_target' make: *** [build] Error 2 Any ideas as to what is the problem? Thanks, Nir. -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, June 10, 2007 6:10 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite 3.2.8 segmentation fault 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 test against the latest version of sqlite, just in case. If you don't have the time to find the source of the memory corruption, perhaps this alternative malloc library may allow your program to run: DieHard, by Emery Berger (of Hoard fame). http://prisms.cs.umass.edu/emery/index.php?page=diehard --- "Rachmel, Nir (Nir)" <[EMAIL PROTECTED]> wrote: > 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 > requesting information from the database while another client is > commiting data to the database). > > After a while, php crashes with the following error printed to the > syslog: > *** glibc detected *** double free or corruption (fasttop): > 0x10796ca8 > *** > > Running the test again, with debug symbols produces the following > backtrace: > > 0x0fdde324 in raise () from /lib/libc.so.6 > (gdb) where > #0 0x0fdde324 in raise () from /lib/libc.so.6 > #1 0x0fddfd8c in abort () from /lib/libc.so.6 > #2 0x0fe14bac in __fsetlocking () from /lib/libc.so.6 > #3 0x0fe14bac in __fsetlocking () from /lib/libc.so.6 > #4 0x0fe14bac in __fsetlocking () from /lib/libc.so.6 > #5 0x0fe14bac in __fsetlocking () from /lib/libc.so.6 . > . > . > Previous frame inner to this frame (corrupt stack?) > > We have a special script that re-creates the backtrace, and it looks > like this: > > (gdb) bt_script > frame #: stack_frame_ptrbackchain_ptr LR_save_word > frame 0: 0x:0x $1 = 0xfdde324 >> frame 1: 0x337f5cf0:0x337f5d10 $2 = 0xfee2f7c > > frame 2: 0x337f5d10:0x337f5e40 $3 = 0xfddfdf8 > > frame 3: 0x337f5e40:0x337f5fe0 $4 = 0xfe14bac > <__libc_fatal> > frame 4: 0x337f5fe0:0x337f6040 $5 = 0xfe1c6b4 > > frame 5: 0x337f6040:0x337f6060 $6 = 0xfe1caac > > frame 6: 0x337f6060:0x337f6070 $7 = 0xf7f62dc > > frame 7: 0x337f6070:0x337f60c0 $8 = 0xf7de980 > > frame 8: 0x337f60c0:0x337f60e0 $9 = 0xf7e2478 Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. http://mobile.yahoo.com/go?refer=1GNXIC - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -