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 helped

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 > > Would it

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 comp

[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 [ )

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: [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

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

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

[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

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

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

[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).

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

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

2018-04-06 Thread Max Vlasov
tion (or inline using the 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: sqli

[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

[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

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 <max.vla...@gmail.com> 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, ver

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

[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 >

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

2016-11-29 Thread Max Vlasov
.de> wrote: > Max Vlasov wrote: > > trim(col, char(9)) > > works, while > > trim(col,'\t') > > does not. > > SELECT trim('ttthello\tt\\\', '\t'); > hello > > Works as designed. > > SQL does not use backslash escaping. > Use char(9) or an a

[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 <ddevie...@gmail.com> wrote: > On Thu, Nov 10, 2016 at 11:38 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> __imp_EnterCriticalSection > > > Is this post [1] related to your issue? > Maybe you're not us

[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

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)

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

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 <slav...@bigfraud.org> wrote: > > On 24 Oct 2016, at

[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

[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 wrote: > &g

[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

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

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

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 <d...@ziggurat29.com> 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 >

[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

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

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 <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to >> the current syntax diagrams? > > An upd

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"

[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

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 <andrew.m.g...@gmail.com> 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 >>

[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 >

Re: [sqlite] comma-separated string data

2014-04-07 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

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 <max.vla...@gmail.com> 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 sql

Re: [sqlite] comma-separated string data

2014-04-05 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

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

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

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..."

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

[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

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

Re: [sqlite] RPAD/LPAD

2014-03-08 Thread Max Vlasov
On Sat, Mar 8, 2014 at 10:52 AM, Max Vlasov <max.vla...@gmail.com> wrote: > On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne <ddevie...@gmail.com> > wrote: >> >> basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, >> x)') would register a 2-ar

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

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

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch <clem...@ladisch.de> 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

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

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.

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'); >

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)

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

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 <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> >> The only one a little similar I found is >> http://www.sqlite.org/docsrc/artifact/873cf35adf14cf3

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 <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to > > Not that I am aware of. > I just no

[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

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread Max Vlasov
On Mon, Feb 17, 2014 at 7:00 PM, RSmith <rsm...@rsweb.co.za> wrote: > > > On 2014/02/17 09:59, Max Vlasov wrote: >> >> . >> So >> >>Select nanosec() - nanosec() from ... >> >> returns non-zero values for most of the times, s

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 <slav...@bigfraud.org> wrote: > > On 17 Feb 2014, at 7:59am, Max Vlasov <max.vla...@gmail.com> wrote: > > > So the nanosec example modified > > > > Select v-v from > > ( > > Select nanos

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 <jklow...@schemamania.org>wrote: > On Fri, 14 Feb 2014 08:32:02 +0400 > Max Vlasov <max.vla...@gmail.com> wrote: > > > From: Max Vlasov <max.vla...@gmail.com> > > To: General Discussion of SQLite Datab

[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

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

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 <d...@sqlite.org> wrote: > On Thu, Feb 13, 2014 at 4:45 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > > Hi, > > > > probably was discussed and modified before, but I still can not > understand > >

[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

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 <ralfjun...@gmx.de> 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 >> >>

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

[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

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

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 <d...@sqlite.org> wrote: > On Sat, Aug 31, 2013 at 2:03 PM, Max Vlasov <max.vla...@gmail.com> wrote: > >> Hi, >> >> I noticed that opening places.sqlite of my installation of Firefox >> can't be made for exa

[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 <i...@tandetnik.org> 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 Ti

[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)

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

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*/ >

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 <petite.abei...@gmail.com>wrote: > > On Jul 23, 2013, at 9:52 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > > Basically it's several tables implementing Object-Propery-Value metaphor > > Hurray! The Entity–a

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 <danielk1...@gmail.com> 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

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

[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

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

2013-04-09 Thread Max Vlasov
on, Apr 8, 2013 at 8:20 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > > Richard, > > > > It makes sense, but I see here some possibility of future confusion. > > Correct me if I'm wrong. Currently if I have a vfs that requires special > > preparations (for exa

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

2013-04-08 Thread Max Vlasov
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 <d...@sqlite.org> wrote: > On Mon, Apr 8, 2013 at 6:12 AM, Max Vlasov <max.vla...@gmai

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

2013-04-08 Thread Max Vlasov
not expect this from client that uses vfs Max On Mon, Apr 8, 2013 at 1:56 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 04/08/2013 04:40 PM, Max Vlasov wrote: > >> On Mon, Apr 8, 2013 at 1:23 PM, Dan Kennedy <danielk1...@gmail.com> >> wrote: >> >> >

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()

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 <max.vla...@gmail.com> wrote: > > > > On Thu, Apr 4, 2013 at 4:02 PM, Richard Hipp <d...@sqlite.org> wrote: > >> We would like to encourage people to try out the new code and >> report both success and failure. &g

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

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

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 >

Re: [sqlite] integrity_check "out of memory"

2013-01-23 Thread Max Vlasov
On Tue, Jan 22, 2013 at 12:33 PM, Dominique Pellé <dominique.pe...@gmail.com > wrote: > Max Vlasov wrote: > > > Hi, > > > > I found with the web search that this error (out of memory for PRAGMA > > integrity_check) appeared in the wild and there were som

Re: [sqlite] integrity_check "out of memory"

2013-01-22 Thread Max Vlasov
Thanks, Dominique I will try asap, but looking at the arithmetics 25 (The length of "Page ? is never used") * 800 (maximum I could get) = 20,000 (limit mentioned in the ticket ) looks like this is a winner :) Max > Hi Max > > It looks perhaps like the bug that was fixed in this

  1   2   3   4   5   >