Re: [sqlite] Long long int constants in sources

2019-12-25 Thread Max Vlasov
On Wed, 25 Dec 2019 at 01:24, Clemens Ladisch wrote: > Max Vlasov wrote: > > bcc 5.5 compiler ... didn't like long long constants > >such as -2251799813685248LL > > If you want to make this particular compiler happy, use > -2251799813685248i64. > Thanks, this he

Re: [sqlite] Long long int constants in sources

2019-12-24 Thread Max Vlasov
On Tue, 24 Dec 2019 at 23:58, Warren Young wrote: > On Dec 24, 2019, at 12:32 PM, Max Vlasov wrote: > > > > I didn't mention it was for sqlite > > static compiling with Delphi 32 bit, that supports (also quite old) OMF > > static libraries format > > Woul

Re: [sqlite] Long long int constants in sources

2019-12-24 Thread Max Vlasov
On Tue, 24 Dec 2019 at 21:37, Warren Young wrote: > On Dec 24, 2019, at 3:19 AM, Max Vlasov wrote: > > > > an "ancient" bcc 5.5 compiler > > Yes, [almost 20 years old][1] now. Even in these times of slowing > technology, that’s still a very long time in comput

[sqlite] Long long int constants in sources

2019-12-24 Thread Max Vlasov
Hi, an "ancient" bcc 5.5 compiler perfectly compiled sqlite to win32 until 3.28.00, but starting 3.29.00 it appears it didn't like long long constants such as -2251799813685248LL , mentioned at least in sqlite3RealSameAsInt and sqlite3VdbeExec. The errors tells unrelated error messages, like [ ) e

Re: [sqlite] [EXTERNAL] "Optional" incoming parameters for virtual tables

2019-04-18 Thread Max Vlasov
On Thu, 18 Apr 2019 at 09:48, Hick Gunter wrote: > So the QP is attemopting to determine which cost product is less: > > My guess is it will probably choose the undesired, invalid plan. A linear > cost penalty for desired but optional inputs is probably not going to cut > it. In this case, the re

Re: [sqlite] [EXTERNAL] "Optional" incoming parameters for virtual tables

2019-04-17 Thread Max Vlasov
On Wed, 17 Apr 2019 at 15:08, Hick Gunter wrote: > > SLEECT contents from textfiles where search_path = 'mypath' and > name_pattern IN ('*.txt','*.csv'); > > It's interesting, I implemented the mask and decided to give such a query a try (having the same cost adjust I explained in the first post)

Re: [sqlite] [EXTERNAL] "Optional" incoming parameters for virtual tables

2019-04-17 Thread Max Vlasov
On Wed, 17 Apr 2019 at 15:08, Hick Gunter wrote: > ... > > SELECT contents from textfiles( 'mypath', NULL, 0); > SELECT contents from textfiles where search_path = 'mypath' and > is_recursive = 1; > SLEECT contents from textfiles where search_path = 'mypath' and > name_pattern IN ('*.txt','*.

Re: [sqlite] [EXTERNAL] "Optional" incoming parameters for virtual tables

2019-04-17 Thread Max Vlasov
On Wed, 17 Apr 2019 at 12:52, Hick Gunter wrote: > Your xBestIndex function should be returning a cost that is proportional > to the "effort required to fulfill the query". My own VT implementations > have been returning the total number of records for queries with no > constraints and assuming a

[sqlite] "Optional" incoming parameters for virtual tables

2019-04-17 Thread Max Vlasov
Hi, I'm trying to implement "optional incoming" parameters for my virtual tables. It's when there are columns required, but also there are some fine-tuning columns that should be noticed when provided in the query and assumed some default if not. The system that I tried seems to work, but I would

Re: [sqlite] Malformed schema (orphan index) on particular db with the version 3.27.2

2019-03-16 Thread Max Vlasov
ones. Max On Fri, 15 Mar 2019 at 18:00, Richard Hipp wrote: > On 3/15/19, Max Vlasov wrote: > > > > But 3.27.2 said > > malformed database schema ({sqlite_autoindex_mytablename}_1) - orphan > > index. > > This error message arises from enhanced early dete

[sqlite] Malformed schema (orphan index) on particular db with the version 3.27.2

2019-03-15 Thread Max Vlasov
Hi, I have a database that used in software since probably 2010, there are many variants of this database at my hd and everything was fine with it starting 3.6.10 through 3.26.00, I'm not sure about every version, but during the version history, at least several was used to open it. But 3.27.2 sa

Re: [sqlite] Exception handling during create table from a virtual one

2018-10-26 Thread Max Vlasov
On Fri, Oct 26, 2018 at 5:50 PM Clemens Ladisch wrote: > > Аfter the exception is thrown > > If I continue the execution > > You must return from the callback function normally, or abort the process. > Anything else will corrupt SQLite's internal state. > > Thanks, probably it's better

[sqlite] Exception handling during create table from a virtual one

2018-10-26 Thread Max Vlasov
Hi, I have a virtual table that raises an unhandled exception during a create table ... as select * from {myvirtualtable} command, inside xColumn callback. I already fixed the error inside my library to handle the situation reasonably, but there's something I noticed for the non-handled exception

Re: [sqlite] [EXTERNAL] Re: sqlite3_progress_handler(D,N,X,P)

2018-05-25 Thread Max Vlasov
On Fri, May 25, 2018 at 10:29 AM, x wrote: > You could have interrupt checks just before the return of a result row > yourself by creating a Step fct that called sqlite3_step and then checked > for an interrupt. It’s when the sqlite3.c code’s being run interrupt is > most needed. e.g. if a query

Re: [sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread Max Vlasov
On Sat, May 5, 2018 at 1:19 PM, J Decker wrote: > https://www.sqlite.org/c3ref/column_blob.html > > The sqlite3_column_type() routine returns the datatype code > Column api is not suitable for me since it relies on the actual data provided, but I'm the one who calls sqlite3_result_* to provide

[sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread Max Vlasov
Hi, What is the best way to map a field type as it is provided in create table statement to sqlite3_result_* function call? More specifically, I have a virtual table implementation where a raw table data provided and the corresponding field definition part ([FieldA] TEXT, [FieldB] FLOAT). Whe

Re: [sqlite] SQLite equivalent of SQL Over(Partition)

2018-04-15 Thread Max Vlasov
Simon, I think the Group by might work correctly, but sometimes (as in OP case) would require a lot of rewriting (copy-paste). The key point here is that the Window function doesn't change the set, but only allows wider access to other rows of the set at the current row "time". So we just have to m

Re: [sqlite] Access to sqlite3_api_routines outside of a loadable extension context

2018-04-06 Thread Max Vlasov
he SQLITE_CORE define) and use the > EXTRA_INIT hook to do initialization. > > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven says > a lot about anticipated traffic volume. > > >-Original Message- > >From: sqlite-users [m

[sqlite] Access to sqlite3_api_routines outside of a loadable extension context

2018-04-05 Thread Max Vlasov
Hi, I'm considering creating a virtual table or user function that might possible work either as a loadable extension or as a general, statically created one. In order to avoid repeating during developing, I thought that I might use sqlite3_api_routines structure as a universal access to sqlite cod

[sqlite] Unexpected optimization

2018-03-22 Thread Max Vlasov
Hi, I noticed an unexpected optimization at the sqlite side. Currently I can not reproduce this with some arbitrary test data (probably I will eventually). Anyway the logic behind this (pseudo-code query) Select , (Select count(*) from LookUpTable where LookUpTable.Value=TableValue) as StatC

Re: [sqlite] finding the number of records until a value is different

2017-12-29 Thread Max Vlasov
I think it's possible with CTE. Recently I wondered whether it would be possible to implement an operation that might be called "an accumulated group by". It's when you enumerate the rows and based on the values of the previous row and current row you apply some new "group" value that can be used

Re: [sqlite] All versions compatible "very big" estimatedCost (Virtual tables)

2017-04-04 Thread Max Vlasov
On Tue, Mar 28, 2017 at 11:26 AM, Max Vlasov wrote: > > > So, what is the maximum reasonable value of estimatedCost that will not > turn sqlite into possible overflow errors while telling at the same time > that I consider some variant very, very expensive? Or maybe changing chea

Re: [sqlite] All versions compatible "very big" estimatedCost (Virtual tables)

2017-03-28 Thread Max Vlasov
On Tue, Mar 28, 2017 at 12:51 PM, Dominique Devienne wrote: > On Tue, Mar 28, 2017 at 11:00 AM, Hick Gunter wrote: > > > > > The "estimated cost" is described as "how many disk IO operations are > > expected". Version higher than 3.8.2 allow setting an "estimatedRows" > > (default: 25) and versi

[sqlite] All versions compatible "very big" estimatedCost (Virtual tables)

2017-03-28 Thread Max Vlasov
Hi, I sometimes use virtual tables to implement some kind of one-to-many output. One of examples mentioned previously was the comma list virtual table when a field containing comma-separated values might be used to output rows of values from this list. Other example - performing regexp-like query

Re: [sqlite] trimming with tab and other special characters

2016-11-29 Thread Max Vlasov
On Tue, Nov 29, 2016 at 4:19 PM, Igor Tandetnik wrote: That's the exact opposite of your interpretation. For backslash escapes, > you need to rely on "facilities of your programming language". If you > cannot, and must use raw SQL queries, there are still ways to represent > arbitrary characters,

Re: [sqlite] trimming with tab and other special characters

2016-11-29 Thread Max Vlasov
Reasonable enough, I wonder why OP and other authors of the discussion https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg49355.html was so sure about backslash escaping support, even Igor Tandetnik :) On Tue, Nov 29, 2016 at 11:39 AM, Clemens Ladisch wrote: > Max Vla

[sqlite] trimming with tab and other special characters

2016-11-29 Thread Max Vlasov
Hi, the search in the mailing list about the trim function reveals possible escaping support for the second parameter of the function, but in my case (sqlite 3.15.1) trim(col, char(9)) works, while trim(col,'\t') does not. Can someone clarify on that? Thanks Max ___

Re: [sqlite] import-prefixed symbols in sqlite3.obj file

2016-11-10 Thread Max Vlasov
On Thu, Nov 10, 2016 at 1:51 PM, Dominique Devienne wrote: > On Thu, Nov 10, 2016 at 11:38 AM, Max Vlasov wrote: > >> __imp_EnterCriticalSection > > > Is this post [1] related to your issue? > Maybe you're not using the 64-bit SDK too? --DD thanks for mentioning.

[sqlite] import-prefixed symbols in sqlite3.obj file

2016-11-10 Thread Max Vlasov
Hi, Trying to link sqlite object file generated by visual c++ command-line compiler(cl.exe sqlite3.c /c) with the Delphi 64 bit executable, I encountered that some functions by windows api used by sqlite contains "___imp_" prefix (total: 7). This happened since recent delphi 64 bit compilers accep

Re: [sqlite] Best way to wipe out data of a closed database

2016-10-24 Thread Max Vlasov
On Mon, Oct 24, 2016 at 4:28 PM, Wade, William wrote: > It sounds like you've got a way forward on leaks via the malloc() system > within the process space. > > 1) The region of the C process stack that was reached by some deep call stack. > 2) Processor registers. > 3) Process pages that were co

Re: [sqlite] Best way to wipe out data of a closed database

2016-10-24 Thread Max Vlasov
On Mon, Oct 24, 2016 at 1:36 PM, Richard Hipp wrote: > > Memsys5 is also faster than your global system memory allocator > (before the extra overhead of zeroing, at least). But on the other > hand, you have to know the maximum amount of memory SQLite will want > at the very beginning, and that me

Re: [sqlite] Best way to wipe out data of a closed database

2016-10-24 Thread Max Vlasov
Simon, thanks never heard of secure_delete, interesting, but probably no use in case of VFS Layer that leaves only encrypted data on disk. As for zero-malloc option, it looks promising. On Mon, Oct 24, 2016 at 1:34 PM, Simon Slavin wrote: > > On 24 Oct 2016, at 9:58am, Max Vlasov wrote: &

[sqlite] Best way to wipe out data of a closed database

2016-10-24 Thread Max Vlasov
Hi, in an application that implements encryption/decryption with VFS, what is the best way to ensure that the memory of the application doesn't contain decrypted data after the database is closed. So no side application could retrieve sensitive information by reading this process memory. Not only

[sqlite] Changes to VFS starting 3.8.3

2016-03-11 Thread Max Vlasov
On Thu, Mar 10, 2016 at 5:26 PM, Richard Hipp wrote: > Perhaps your in-memory VFS was relying on some unspecified behavior > that changed? Some tests finally led to the source of my problems. When I implemented the handlers of vfs interface before, I made xFileControl return SQLITE_ERROR i

[sqlite] Changes to VFS starting 3.8.3

2016-03-10 Thread Max Vlasov
Thanks, I suspect there's indeed some special behavior not obvious at the moment. I'll try to gather some additional information if it's possible or detect this specific behavior On Thu, Mar 10, 2016 at 5:26 PM, Richard Hipp wrote: > On 3/10/16, Max Vlasov w

[sqlite] Changes to VFS starting 3.8.3

2016-03-10 Thread Max Vlasov
Hi, I have a compatibility problem with my vfs implementation of memory databases. I once implemented it successfully probably with a version 3.6.something. Today I tried to create a new database using the same code with the latest (3.11.1) version (the procedure is when no prior db data exists,

Re: [sqlite] Artificially slow VACUUM by injecting a sleep() somewhere?

2014-12-08 Thread Max Vlasov
On Mon, Dec 8, 2014 at 5:56 PM, Roger Binns wrote: > On 12/07/2014 04:43 PM, David Barrett wrote: >> so I'm curious if you can think of a way using the API (or any >> other way) to essentially "nice" the process by inserting a short >> "sleep" into whatever loop runs inside the VACUUM command. > >

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
>> I once implemented a virtual table "allvalues" that outputs all >> database values with (hope self-explaining) fields >> >> TableName, TableRowId, FieldName, Value > > Could you expand on how you coped with the underlying database > changing, and how you mapped virtual table rowids to the actual

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
On Thu, Dec 4, 2014 at 10:44 AM, Baruch Burstein wrote: > > Is it possible to somehow search for/replace a string in all columns of all > tables? > Not particularity the answer to your question, but rather a method you or others might use. I once implemented a virtual table "allvalues" that outpu

Re: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
On Wed, Oct 22, 2014 at 4:50 PM, dave wrote: > > > -Original Message- > > From: sqlite-users-boun...@sqlite.org > > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Max Vlasov > > Sent: Wednesday, October 22, 2014 5:25 AM > > To: General Discussi

[sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
Hi, my static linking with Delphi for 3.7.8 version now complains about _beginthreadex_/_endthreadex_. Quick search shows than everywhere there's a recommendation to use these functions instead of API CreateThread if one plans to use Visual c run-time (msvcrt). All my previous linking with sqlite

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-06-03 Thread Max Vlasov
On Tue, May 27, 2014 at 10:49 PM, Richard Hipp wrote: > On Tue, May 27, 2014 at 10:50 AM, Richard Hipp wrote: >> > > This time I build the 32-bit DLL using mingw instead of MSVC. (MSVC was > still used for the 64-bit DLL.) So perhaps it will work correctly on > WinXP. Please let me know one wa

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-05-10 Thread Max Vlasov
On Fri, Feb 21, 2014 at 5:24 PM, Richard Hipp wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to >> the current syntax diagrams? > > An updated version of all-bnf.html has now b

Re: [sqlite] WITHOUT ROWID option

2014-05-09 Thread Max Vlasov
On Wed, May 7, 2014 at 6:31 PM, Richard Hipp wrote: > On Wed, May 7, 2014 at 9:00 AM, Marco Bambini wrote: > >> What is the best way to know if a table has been created with the WITHOUT >> ROWID option? >> > > > (1) You could send "SELECT rowid FROM table" > > (2) Run both "PRAGMA index_list

[sqlite] CTE in views for older versions

2014-04-20 Thread Max Vlasov
Hi, noticed that attempt to open a database containing a view Create vew ... with recursive ... ... with older (non-cte) versions of sqlite failed. The call to open_v2 was ok, but any access for example to PRAGMA encoding led to "malformed database schema" error. Although it came as no big surpri

Re: [sqlite] Why sqlite has no sqlite_bind_auto or similary named function

2014-04-18 Thread Max Vlasov
On Fri, Apr 18, 2014 at 8:08 PM, Andy Goth wrote: > On 4/18/2014 12:29 AM, Max Vlasov wrote: >> >> So it seems like if general queries allow affinity automatical >> selection while bind api does not have the corresponent function. I >> know that I can analize inco

[sqlite] Why sqlite has no sqlite_bind_auto or similary named function

2014-04-17 Thread Max Vlasov
Hi, The problem was with my program that automatically converts xml data into an sqilte table. It looks for an attribute and appends a column if it does not exists, but stating no particular type. All values were appended with sqlite_bind_text. Everything was fine, but an index created after this

Re: [sqlite] about the apparently arriving soon "threads"

2014-04-08 Thread Max Vlasov
On Tue, Apr 8, 2014 at 11:00 PM, big stone wrote: > Hi, > > I did experiment splitting my workload in 4 threads on my cpu i3-350m to > see what are the scaling possibilities. > > Timing : > 1 cpu = 28 seconds > 2 cpu = 16 seconds > 3 cpu = 15 seconds > 4 cpu = 14 seconds > If the info at http://

Re: [sqlite] comma-separated string data

2014-04-07 Thread Max Vlasov
On Mon, Apr 7, 2014 at 5:28 PM, Dominique Devienne wrote: > So the only piece > that's missing is an official way to use vtables "on the fly", and > pass in to its xFilter method the value from the left-correlated value > for each joined left value, so the resulting cursor can "iterate" the > righ

Re: [sqlite] comma-separated string data

2014-04-06 Thread Max Vlasov
On Sun, Apr 6, 2014 at 10:23 PM, Dominique Devienne wrote: > > If the answer to either question above is true, then a specialized > vtable would be both more convenient and faster, no? > Hmm... If logical peculiarity of vtable approach (when where-constrained queries might be larger than full-sc

Re: [sqlite] Difference in virtual tables logic triggered between version 3.7.15.2 to 3.8.0

2014-04-05 Thread Max Vlasov
On Sat, Apr 5, 2014 at 11:48 PM, Max Vlasov wrote: > > This works for an old version of sqlite (3.6.10), but today Dominique > Devienne mentioned some doubt about this approach and I decided to > test it with some data with a recent version of sqlite. With 3.8.4.3 > the same join

[sqlite] Difference in virtual tables logic triggered between version 3.7.15.2 to 3.8.0

2014-04-05 Thread Max Vlasov
I mentioned several times a technique involving particular virtual table implementation that allows interpreting comma-list fields as tables. Basically this techique uses a virtual table that virtually contains all data possible, but useful only when it is constrained with WHERE clause working log

Re: [sqlite] comma-separated string data

2014-04-04 Thread Max Vlasov
On Fri, Apr 4, 2014 at 10:20 PM, peter korinis wrote: > A data column in a link table contains comma-separated string data, where > > How do you 'parse' a table entry like: "4,66,51,3009,2,678, ." to extract > these values and use them in an SQL statement, perhaps a WHERE id='66'? > > In similar

Re: [sqlite] Goodram C50 SSD slow in SQlite benchmark

2014-03-23 Thread Max Vlasov
On Mon, Mar 24, 2014 at 4:49 AM, piotr maliński wrote: > I know it's bad. I'm trying to determine the cause of the difference, and > if it's a "feature" of that SSD or a bug of some sort. There was a very intensive discussion for a post labeled "UPDATE/INSERTing 1-2k rows slower than expected". Y

Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Max Vlasov
On Fri, Mar 21, 2014 at 8:06 PM, Ben Peng wrote: > > I guess I will have to take the longer route, namely define a customized > comparison function and translate user input internally. > There's an also virtual table method, probably not so easy to wrap the head around, but this one allows using

Re: [sqlite] which of these is faster?

2014-03-14 Thread Max Vlasov
On Fri, Mar 14, 2014 at 4:51 PM, Richard Hipp wrote: >> > In the original problem, there was already an index on the term for which > the min() was requested. >. > Whit your CTE-generated random integers, there is not an index on the > values. So "SELECT min(x) FROM..." does a linear search

Re: [sqlite] which of these is faster?

2014-03-14 Thread Max Vlasov
On Thu, Mar 13, 2014 at 11:06 PM, Richard Hipp wrote: > > Once you do that, you'll see that the opcode sequence is only slightly > different between the two. They should both run at about the same speed. > I doubt you'll be able to measure the difference. > > Actually a comparatively long (10,0

[sqlite] Observations about CTE optimization

2014-03-10 Thread Max Vlasov
Many CTE queries are just some mini-algorithms with iteration and only last row is required. I just wondered whether it's easy to do this without "order by ... " of the outer query (also mentioned in my reply about CTE sqrt). There's a solution, but the good news is that probably one rarely needs s

Re: [sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-03-08 Thread Max Vlasov
On Sat, Mar 8, 2014 at 2:24 AM, big stone wrote: > Ooups ! > > Thanks to the awesome posts about "RPAD/LPAD", I understood that I could > already create a "sqrt()" function for SQLite3 in interpreted python. > Yes, that discussion was inspiring :) Looking at your task I also played with cte v

Re: [sqlite] RPAD/LPAD

2014-03-08 Thread Max Vlasov
On Sat, Mar 8, 2014 at 10:52 AM, Max Vlasov wrote: > On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne > wrote: >> >> basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, >> x)') would register

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne wrote: > > basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, > x)') would register a 2-arg function (register_function's argc-2) > named $argv[0], which executes the following statement > > with args($argv[1], $argv[2], ... $arg

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Sat, Mar 8, 2014 at 2:16 AM, Clemens Ladisch wrote: > Eduardo Morras wrote: >> So, if a webapp that uses SQLite doesn't check it's input, functions that >> renames SQLite internals can be injected >> >> SELECT register_simple_function('MAX', 1, 'DROP TABLE ?'); > > Such a statement would not r

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch wrote: > Max Vlasov wrote: >> >> Nice suggestion. This probably falls into case when a small new part >> needed on sqlite side > > Actually, no change to SQLite itself would be needed. It's possible > to create an

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne wrote: > I think what SQLite lacks is a syntax to define custom function like > it does for virtual tables. Something like: > > create function rpad(x, y) using scripty_module as "return > PRINTF('%-*s',y,x)"; > Nice suggestion. This probably f

Re: [sqlite] Virtual table API performance

2014-03-02 Thread Max Vlasov
On Sun, Mar 2, 2014 at 5:21 PM, Elefterios Stamatogiannakis wrote: > > Our main test case is TPCH, a standard DB benchmark. The "lineitem" table of > TPCH contains 16 columns, which for 10M rows would require 160M xColumn > callbacks, to pass it through the virtual table API. These callbacks are >

Re: [sqlite] Virtual table API performance

2014-03-01 Thread Max Vlasov
Hi, thanks for explaining your syntax in another post. Now about virtual tables if you don't mind. On Fri, Feb 28, 2014 at 8:24 PM, Eleytherios Stamatogiannakis wrote: > > If we load into SQLite, > > create table newtable as select * from READCOMPRESSEDFILE('ctable.rc'); > > it takes: 55 sec

Re: [sqlite] Virtual Table "Functions"

2014-03-01 Thread Max Vlasov
On Fri, Feb 28, 2014 at 10:14 PM, Dominique Devienne wrote: > Can someone tell me how the statement below works? > > > Thanks for any help on this. This is really puzzling to me. --DD Very puzzling for me too For any statement like this select * from blablabla(123) sqlite (3.8.3.1) prim

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-26 Thread Max Vlasov
On Wed, Feb 26, 2014 at 12:33 PM, Fabrice Triboix wrote: > > And even then, that would not explain why the journal file lingers after > re-opening the database. > I remember asking a similar question. As long as I remember, the main logical implication is that journal file presence is not a mark

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
On Fri, Feb 21, 2014 at 5:24 PM, Richard Hipp wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov wrote: > >> >> The only one a little similar I found is >> http://www.sqlite.org/docsrc/artifact/873cf35adf14cf34 >> ( mentioned as art/syntax/all-bnf.html ) &g

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
On Fri, Feb 21, 2014 at 4:47 PM, Richard Hipp wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to > > Not that I am aware of. > I just noticed the file ( bubble-generator-data.tcl ) www.sqli

[sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
Hi, Is there a machine-readable (BNF or other) grammar as equivalent to the current syntax diagrams? http://www.sqlite.org/syntaxdiagrams.html The only one a little similar I found is http://www.sqlite.org/docsrc/artifact/873cf35adf14cf34 ( mentioned as art/syntax/all-bnf.html ) but it's p

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread Max Vlasov
On Mon, Feb 17, 2014 at 7:00 PM, RSmith wrote: > > > On 2014/02/17 09:59, Max Vlasov wrote: >> >> . >> So >> >>Select nanosec() - nanosec() from ... >> >> returns non-zero values for most of the times, so there's no guarantee the

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread Max Vlasov
On Mon, Feb 17, 2014 at 2:27 PM, Simon Slavin wrote: > > On 17 Feb 2014, at 7:59am, Max Vlasov wrote: > > > So the nanosec example modified > > > > Select v-v from > > ( > > Select nanosec() as v from TestTable > > ) > > >

Re: [sqlite] Once again about random values appearance

2014-02-16 Thread Max Vlasov
On Mon, Feb 17, 2014 at 1:22 AM, James K. Lowden wrote: > On Fri, 14 Feb 2014 08:32:02 +0400 > Max Vlasov wrote: > > > From: Max Vlasov > > To: General Discussion of SQLite Database > > Reply-To: General Discussion of SQLite Database > > Date: Fri, 14 Feb 20

[sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-02-14 Thread Max Vlasov
Hi, Some time ago when there was no "instr" functions, I looked at Mysql help pages and implemented a user function "locate" as the one that allows searching starting a particular position in the string. With two parameters form it was just identical to "instr" only the order of parameters was rev

Re: [sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
On Fri, Feb 14, 2014 at 6:35 AM, James K. Lowden wrote: > > > select id, (select id from TestTable where id = abs(random() % 100)) > > > as rndid from TestTable where id=rndid > > On Thu, 13 Feb 2014 07:26:55 -0500 > Richard Hipp wrote: > > > It is undefined behavior, subject to change depending

Re: [sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
On Thu, Feb 13, 2014 at 4:26 PM, Richard Hipp wrote: > On Thu, Feb 13, 2014 at 4:45 AM, Max Vlasov wrote: > > > Hi, > > > > probably was discussed and modified before, but I still can not > understand > > some peculiarities with random column values. > > &

[sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
Hi, probably was discussed and modified before, but I still can not understand some peculiarities with random column values. The table Create table [TestTable] ([id] integer primary key) populated with 100 default values (thanks to CTE now made with a single query): with recursive autoinc(i

Re: [sqlite] latest sqlite 3 with Delphi 5 professional

2014-01-24 Thread Max Vlasov
On Fri, Jan 24, 2014 at 9:16 PM, Ralf Junker wrote: > On 24.01.2014 10:06, Max Vlasov wrote: > >> BCC 5.5 (freely downloadable) compiles any version of sqlite3 to >> object files linkable to Delphi 5 and later, the only drawback I >> >> Don't know about DISQLite

Re: [sqlite] latest sqlite 3 with Delphi 5 professional

2014-01-24 Thread Max Vlasov
On Thu, Jan 23, 2014 at 1:33 AM, dean gwilliam wrote: > I'm just wondering what my options are here? > Any advice much appreciated. > ___ My two cents... Historically I took Aducom TDataSet-compatible classes (http://www.aducom.com/cms/page.php?2 , aut

[sqlite] Sqlite as a platform performance comparison tool

2014-01-06 Thread Max Vlasov
Hi, A thought came to compare two computers of different platforms (ie i386 vs ARM) using uniform approach. We take two binaries of the same sqlite version compiled with the best c compilers for both platforms and compare the time spent for identical operations using memory based databases (to exc

Re: [sqlite] Virtual Table: misuse error on sqlite3_declare_vtab()

2013-10-04 Thread Max Vlasov
Simon, don't know what exactly wrong in your particular case, but I'd suggest setting debugger breakpoints everywhere in your x-handlers and notice the moment after which calls are ceased (or you get a error code). Max On Fri, Oct 4, 2013 at 6:07 PM, Simon wrote: > Hi there, > > I'm currently

Re: [sqlite] Why latest places.sqlite from firefox can't be opened by some older versions of sqlite

2013-08-31 Thread Max Vlasov
On Sat, Aug 31, 2013 at 10:14 PM, Richard Hipp wrote: > On Sat, Aug 31, 2013 at 2:03 PM, Max Vlasov wrote: > >> Hi, >> >> I noticed that opening places.sqlite of my installation of Firefox >> can't be made for example with sqlite 3.6.10, it says that

[sqlite] Why latest places.sqlite from firefox can't be opened by some older versions of sqlite

2013-08-31 Thread Max Vlasov
Hi, I noticed that opening places.sqlite of my installation of Firefox can't be made for example with sqlite 3.6.10, it says that file either encrypted or invalid (everything ok for example with 3.7.15.2 and sure firefox itself, it works :)). This might be a failure of my particular installation

Re: [sqlite] Group by in sqlite 3.8 works a little differently depending on the spaces at the end

2013-08-28 Thread Max Vlasov
On Wed, Aug 28, 2013 at 5:11 PM, Igor Tandetnik wrote: > On 8/28/2013 8:57 AM, Max Vlasov wrote: > See the recent discussion at > > http://comments.gmane.org/gmane.comp.db.sqlite.general/83005 > > It's not about trailing spaces, but about whether Title in GROUP BY resol

[sqlite] Group by in sqlite 3.8 works a little differently depending on the spaces at the end

2013-08-28 Thread Max Vlasov
Hi, the following query (notice the space at the end of the 3rd string) Create table [TestTable] ([Title] TEXT); INsert into TestTable (Title) VALUES ('simple text'); INsert into TestTable (Title) VALUES ('simple text'); INsert into TestTable (Title) VALUES ('simple text '); select Trim(Title) a

Re: [sqlite] How to create connection life-time object?

2013-07-26 Thread Max Vlasov
On Fri, Jul 26, 2013 at 9:56 PM, Dušan Paulovič wrote: > Thanks for suggestion, but: > 1.) one object is not linked to one connection > If you have your own memory management, it's not a problem since the scheme I described is basically just a storage of pointers. To free or not to free (if the

Re: [sqlite] How to create connection life-time object?

2013-07-26 Thread Max Vlasov
Hi, Dušan On Thu, Jul 25, 2013 at 2:39 PM, Dušan Paulovič wrote: > Hello, is there a way to somehow set a connection life-time object? > ... > > > It would be fine to have something like: > int sqlite3_set_lifetime_object( > sqlite3 *db, /*db connection*/ > const char *zObjectN

Re: [sqlite] Is REAL the best universal data type?

2013-07-23 Thread Max Vlasov
On Tue, Jul 23, 2013 at 10:09 PM, Petite Abeille wrote: > > On Jul 23, 2013, at 9:52 AM, Max Vlasov wrote: > > > Basically it's several tables implementing Object-Propery-Value metaphor > > Hurray! The Entity–attribute–value (EAV) anti-pattern! > > pattern,

Re: [sqlite] Is REAL the best universal data type?

2013-07-23 Thread Max Vlasov
On Tue, Jul 23, 2013 at 1:38 PM, Dan Kennedy wrote: > On 07/23/2013 02:52 PM, Max Vlasov wrote: > >> So >> par adoxically probably the best type for universal field container is >> REAL >> (or NUMERIC) since it will accept data of any type, but has advantage

Re: [sqlite] Is REAL the best universal data type?

2013-07-23 Thread Max Vlasov
On Tue, Jul 23, 2013 at 1:32 PM, Clemens Ladisch wrote: > > > But REAL will sort the strings '1', '10', '2' wrong. > What do you mean by "wrong"? The test CREATE TABLE testtable (id integer primary key, value real); insert into testtable (value) values ('1'); insert into testtable (value) valu

[sqlite] Is REAL the best universal data type?

2013-07-23 Thread Max Vlasov
I've created a kind of triple storage base with Sqlite db as the container. Basically it's several tables implementing Object-Propery-Value metaphor. There's only one field for data so thinking about generality I assumed that the type for the data field should be TEXT of nothing since most of other

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-09 Thread Max Vlasov
h/xUnfetch on the VFS level? > > > > Max > > > > > > > > > > > > On Mon, Apr 8, 2013 at 3:33 PM, Richard Hipp wrote: > > > > > On Mon, Apr 8, 2013 at 6:12 AM, Max Vlasov > wrote: > > > > > > > But I

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-08 Thread Max Vlasov
other expects pointer to the data, the complexity of understanding will grow. Or is there a simple way to disable xFetch/xUnfetch on the VFS level? Max On Mon, Apr 8, 2013 at 3:33 PM, Richard Hipp wrote: > On Mon, Apr 8, 2013 at 6:12 AM, Max Vlasov wrote: > > > But I also noticed

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-08 Thread Max Vlasov
n it should not expect this from client that uses vfs Max On Mon, Apr 8, 2013 at 1:56 PM, Dan Kennedy wrote: > On 04/08/2013 04:40 PM, Max Vlasov wrote: > >> On Mon, Apr 8, 2013 at 1:23 PM, Dan Kennedy >> wrote: >> >> >>> Right. But a VFS is not obliged to sup

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-08 Thread Max Vlasov
On Mon, Apr 8, 2013 at 1:23 PM, Dan Kennedy wrote: > > Right. But a VFS is not obliged to support the new xFetch() and > xUnfetch() methods (used to read data from a memory mapped file). > And if it doesn't, SQLite will use xRead() exclusively. > > It always uses xWrite() to write - whether mmap

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-08 Thread Max Vlasov
On Sun, Apr 7, 2013 at 2:12 PM, Max Vlasov wrote: > > > > On Thu, Apr 4, 2013 at 4:02 PM, Richard Hipp wrote: > >> We would like to encourage people to try out the new code and >> report both success and failure. >> > > > Not particulary about this d

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-07 Thread Max Vlasov
On Sun, Apr 7, 2013 at 3:55 PM, Chris Smith wrote: > Possibly related: > http://en.wikipedia.org/wiki/Thrashing_(computer_science) > > That's an interesting direction. Surprisingly if one query ... site:microsoft.com "Thrashing" "memory-mapped"... on google, he or she would find a forum topic "Me

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-07 Thread Max Vlasov
don't know what's wrong with the link, I'm clicking the one from gmail thread and it works. Other way is to google [Unresponsive system under some file-mapping related conditions] and the first result is the thread link Max On Sun, Apr 7, 2013 at 2:25 PM, Jean-Christophe Deschamps wrote: > Hi M

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-07 Thread Max Vlasov
On Thu, Apr 4, 2013 at 4:02 PM, Richard Hipp wrote: > By making use of memory-mapped I/O, the current trunk of SQLite (which will > eventually become version 3.7.17 after much more refinement and testing) > can be as much as twice as fast, on some platforms and under some > workloads. We would l

  1   2   3   4   5   >