[sqlite] How to read data from mem?

2016-03-16 Thread Sairam Gaddam
I want to read the mem when the program is inside the sqlite3VdbeExec() function and in case OP_Insert. Here the mem consists of entire row to be inserted. When I read the mem *pData, I found from the member pData->flags that it contains a BLOB. But when I tried to print BLOB in pData->z, I

[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
Thank you very much!! It helped a lot. On Wed, Mar 9, 2016 at 9:26 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > The documentation says that the function sqlite3_update_hook() is called > > whenever a row is updated, deleted or inserted > > No. It says that th

[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
http://www.sqlite.org/c3ref/update_hook.html The documentation says that the function sqlite3_update_hook() is called whenever a row is updated, deleted or inserted for a rowid table. But I don't find this function to be invoked in my program. When will this function be invoked?? And I am

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> I have done some manual WAL decoding for my forensic software that can > identifiy a previous DB state - its fun :)... > > (From memory) > > To determine which pages belong to the last transaction, you need to : > > Read the WAL header to obtain the current salt, then read each wal > frame to

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > Sounds to me you want to implement logical decoding, that is to > extract an SQL form from the binary WAL format. > I don't believe SQLite provides such a feature, that is something > other databases use for bidirectional replication. I just want to know which tables and rows are changed

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > To achieve what goal? > > In any case, perhaps https://www.sqlite.org/rbu.html is of interest to > you. > I want to make note of those changes and replicate in another DB. And I found that WAL is the correct place where changes to the database are present. So my main aim is to get those

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > If you're really sure that the database files are identical, the easiest > way to do the replication would be to copy the WAL file. > > What processing do you want to do? > I want to take note of changes and depending on data, I might replicate in some other DB. The database files are not

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > This requires detailed knowledge of how SQLite works. If the file format > page I referred you to does not help you may have to study the SQLite > source code to find out what you need. > Yeah I read the source file wal.c and based on what I read, SQLite syncs the frames which have page data

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
My main aim is to find the fresh changes which are to be made to database through WAL module. How is data stored in WAL? If the data is stored in pages inside WAL then how to see the changes which are presently made to the database? Should I decrypt the information from WAL to know the changes

[sqlite] WAL checkpoint

2016-02-24 Thread Sairam Gaddam
Before checkpointing the data from WAL, if the DB is queried, will the result include updated data from WAL or not? Will this situation arise? because writing to WAL and checkpoint occur very fast but if a query comes in between, will the result be updated or not before checkpoint.

[sqlite] Closure.c extension

2015-09-09 Thread Sairam Gaddam
Is it necessary to have AVL tree in closure tables method and does it result in speed improvements? On Wed, Sep 9, 2015 at 4:59 PM, Richard Hipp wrote: > On 9/9/15, Sairam Gaddam wrote: > > I know that one of the method to compute transitive closure is closure > > tables metho

[sqlite] Closure.c extension

2015-09-09 Thread Sairam Gaddam
I know that one of the method to compute transitive closure is closure tables method. But I didn't understand why AVL tree implementation is present in the closure.c extension in order to compute transitive closure because the result can be directly queried from the Virtual table(closure table).

[sqlite] AVL tree implementation in closure module

2015-09-01 Thread Sairam Gaddam
Deep inside SQLite source files, there is a module called closure.c for computing transitive closure and it is provided as an extension. Inside, it uses an AVL tree implementation, so why to use that kind of implementation(or importance) for computing transitive closure in this case? And when is

[sqlite] Regarding root in transitive closure extension of SQLite

2015-08-11 Thread Sairam Gaddam
> Hello ! > > Look this comment on ext/misc/closure.c: > > -- > > ** When it is created, the new transitive_closure table may be supplied > ** with default values for the name of a table T and columns T.X and T.P. > ** *The T.X and T.P columns must contain integers*. The ideal case is > for >

[sqlite] Regarding root in transitive closure extension of SQLite

2015-08-11 Thread Sairam Gaddam
> > Given that SQLite supports CTE's now, why use that extension? > > AFAIK, it was to add hierarchical query capability to SQLite, which CTE > does builtin now. --DD But will that solve my problem of having the data type of groupId other than Integer primary key like Text???

[sqlite] Regarding root in transitive closure extension of SQLite

2015-08-06 Thread Sairam Gaddam
I have enabled the transitive closure extension and I followed the steps regarding querying the virtual table mentioned in closure.c file as follows CREATE VIRTUAL TABLE ct1 USING transitive_closure( tablename='group1', idcolumn='groupId', parentcolumn='parentId' );

[sqlite] How to use gdb for .test files in SQLite?

2015-07-28 Thread Sairam Gaddam
I was testing a custom SQLite with the test files and one of the file(tclsqlite.test) gave a segmentation fault, when I used Valgrind, it didn't give any stack trace but instead gave the following error. ==5697== ==5697== Process terminating with default action of signal 11 (SIGSEGV): dumping

[sqlite] Unable to find the file 'memleak.txt'

2015-07-17 Thread Sairam Gaddam
> Try "locate memleak" if the file is not present in the working directory > of the process running the test. > > I tried that but there is no file named memleak.txt in the whole system !!!

[sqlite] Unable to find the file 'memleak.txt'

2015-07-17 Thread Sairam Gaddam
I ran the test files which are present in SQLite for my custom build and I got some memory leaks. I got a message like, Writing unfreed memory log to "./memleak.txt" But I couldn't able to locate that file. Can anyone kindly tell where to find that file or where the unfreed memory log is written

[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Sairam Gaddam
I want to make some changes to the result set and I need to add an extra column. On Mon, Jul 13, 2015 at 12:33 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > I have tried a method to create a Mem and add a string to it, which is as > > below > > > > sqlite3Vdb

[sqlite] How to correctly a add string to a Mem?

2015-07-13 Thread Sairam Gaddam
I have tried a method to create a Mem and add a string to it, which is as below sqlite3VdbeMemInit(&(p->custom_aMem[0]), p->db, MEM_Null); memAboutToChange(p,&(p->custom_aMem[0])); sqlite3VdbeMemSetStr(&(p->custom_aMem[0]), zColumn ,

[sqlite] Regarding Result Set

2015-07-10 Thread Sairam Gaddam
Sir, I created a custom Result set in Resultrow case in sqlite3VdbeExec function as below custom_pResultSet = (Mem*) malloc(sizeof (Mem) * (custom_numElements)); and I initialized it using sqlite3VdbeMemInit function. for( i = 0 ; i < custom_numElements ; i++ )

[sqlite] Result set creation

2015-07-09 Thread Sairam Gaddam
I created a custom Result set in Resultrow case in sqlite3VdbeExec function as below custom_pResultSet = (Mem*) malloc(sizeof (Mem) * (custom_numElements)); and I initialized it using sqlite3VdbeMemInit function. for( i = 0 ; i < custom_numElements ; i++ ) {

[sqlite] Regarding TCL tests on SQLite

2015-07-01 Thread Sairam Gaddam
I was testing a custom build of SQLite by TCL test scripts which are present in test folder of SQLite, some of the test scripts like multiplex.test result in an error from the line number 536 which is below 536.faultsim_restore_and_reopen I included the file multiplex.test for

[sqlite] faultsim_restore_and_reopen

2015-06-26 Thread Sairam Gaddam
I was testing a custom build of SQLite by the test scripts which are present in test folder of SQLite, some of the test scripts like multiplex.test, wal4.test etc., have this line faultsim_restore_and_reopen which results in error. Can anyone kindly tell what is the function of

[sqlite] Will SQLite break a join query?

2015-06-26 Thread Sairam Gaddam
I know that SQLite will perform some internal select statements when executing a join query but will it break a join query and execute in parts ??? For example if I join 10 tables, will it perform join of 8 and 2 tables at once and in turn join the result of those two joins?

[sqlite] Error while copying the contents of VdbeOp object

2015-05-29 Thread Sairam Gaddam
How to correctly copy the contents of original VdbeOp aOp which is created by SQlite for some query into another custom VdbeOp object. I tried by normally copying the contents one by one but it resulted in errors. And how to correctly allocate memory to the custom VdbeOp object and how to free

[sqlite] Regarding SQLITE_PRIVATE

2015-05-15 Thread Sairam Gaddam
On Fri, May 15, 2015 at 4:46 PM, Hick Gunter wrote: > The keyword "static" before a function name limits its visibility to the > current source file. > > But many of the PRIVATE functions are not declared static like the > "sqlite3VdbePrintOp" function. If they do declare, can i know where they

[sqlite] Regarding SQLITE_PRIVATE

2015-05-15 Thread Sairam Gaddam
On Fri, May 15, 2015 at 4:42 PM, Simon Slavin wrote: > > > By not declaring them in the header file you're meant to be using ? > But I think they are declared in the header. > > ___ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org

[sqlite] Regarding SQLITE_PRIVATE

2015-05-15 Thread Sairam Gaddam
On Fri, May 15, 2015 at 3:53 PM, Hick Gunter wrote: > SQLITE_PRIVATE means that the function is PRIVATE. How they achieved PRIVATE functions in C? You are not allowed to call this function, it is not supported as part of > the SQLite API. Because you are not allowed to call the function

[sqlite] Tests regarding custom build of SQLite

2015-05-13 Thread Sairam Gaddam
In order to run .test files(sqlite test codes) in SQLite, I used ./testfixture NAMEOFFILE.test Can anyone kindly tell which build of sqlite will TESTFIXTURE access? Because even when I make modifications to sqlite3.c source code, the output of the test file under test has no effect. And one

[sqlite] TCL tests

2015-05-12 Thread Sairam Gaddam
On Tue, May 12, 2015 at 5:14 PM, Richard Hipp wrote: > > > ./testfixture NAMEOFFILE.test > testfixture.exe NAMEOFFILE.test > > Respectively for unix and windows. > > Thanks! That helped a lot.

[sqlite] TCL tests

2015-05-12 Thread Sairam Gaddam
On Tue, May 12, 2015 at 5:05 PM, Richard Hipp wrote: > > > Did you try the commands provided above? > > > yeah I tried those commands and installed both tcl and sqlite but i need help in executing the .test file which requires tcl like the one I attached in this mail. pfa.

[sqlite] TCL tests

2015-05-12 Thread Sairam Gaddam
On Tue, May 12, 2015 at 4:36 PM, Richard Hipp wrote: > > Unix: ./configure; make test > > Windows: nmake /f makefile.msc test > I installed both tcl and sqlite but i need help to run .test files which are present in test folder for sqlite!

[sqlite] TCL tests

2015-05-12 Thread Sairam Gaddam
---Original Message----- > > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > > bounces at mailinglists.sqlite.org] On Behalf Of Sairam Gaddam > > Sent: Tuesday, May 12, 2015 8:47 AM > > To: General Discussion of SQLite Database > > Subje

[sqlite] TCL tests

2015-05-12 Thread Sairam Gaddam
Can anyone kindly help me how to compile and run TCL test scripts ? All the test scripts are .test files and I need help in executing them.

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
I installed TCL and then unpacked the SQLite archive, then typed "./configure; make test" what to do next? On Fri, May 8, 2015 at 6:13 PM, Richard Hipp wrote: > On 5/8/15, Sairam Gaddam wrote: > > Is sqllogictest a program which can be downloaded and installed? > &g

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
Is sqllogictest a program which can be downloaded and installed? On Fri, May 8, 2015 at 5:21 PM, Richard Hipp wrote: > On 5/8/15, Sairam Gaddam wrote: > > I have custom SQLite and in order to test it I downl > > oaded sqlite-src-3081000.zip > > (7.29 MiB) as advised, whi

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
I have custom SQLite and in order to test it I downl oaded sqlite-src-3081000.zip (7.29 MiB) as advised, which contains some test files but most of them are .test files and how to execute them? should I use sqllogictest program? If it should be used where is it available? And regarding .c test

[sqlite] Regarding testing

2015-04-27 Thread Sairam Gaddam
Yeah I read that link previously but how do i get all those test cases? On Mon, Apr 27, 2015 at 5:27 PM, Simon Slavin wrote: > > On 27 Apr 2015, at 12:54pm, Sairam Gaddam wrote: > > > How SQLite is tested and can I get those test cases? > > < > http://lmgtfy.com/?q=H

[sqlite] Regarding testing

2015-04-27 Thread Sairam Gaddam
How SQLite is tested and can I get those test cases?

[sqlite] Comments in VDBE program

2015-04-16 Thread Sairam Gaddam
Thanks! Comments are enabled now. On Thu, Apr 16, 2015 at 4:41 PM, Richard Hipp wrote: > On 4/16/15, Sairam Gaddam wrote: > > I am using C SQLite interface. How to enable comments in the VDBE program > > here? > > because they are not enabled by default. > > gcc

[sqlite] Comments in VDBE program

2015-04-16 Thread Sairam Gaddam
I am using C SQLite interface. How to enable comments in the VDBE program here? because they are not enabled by default. gcc -DSQLITE -DEBUG filename.c ../sqlite3.c -ldl -lpthread I tried with the above line in the terminal but could not succeed in enabling the comments. Can any one help me with

[sqlite] Regarding SeekGe and Next opcodes in VDBE

2015-04-10 Thread Sairam Gaddam
Yes sir, I know about " .explain ". Next time I would try that @ Richard Hipp. And thanks Clemens. On Fri, Apr 10, 2015 at 3:57 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > On Thu, Apr 9, 2015 at 1:04 PM, Clemens Ladisch > wrote: > >> Sairam Gaddam wr

[sqlite] Regarding SeekGe and Next opcodes in VDBE

2015-04-10 Thread Sairam Gaddam
Then why there is a loop (Next opcode at 23rd instruction) over second table when it created an index ? On Thu, Apr 9, 2015 at 1:04 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > sql="create table em(name text primary key,age text,pts text);"\ > > "cr

[sqlite] Regarding SeekGe and Next opcodes in VDBE

2015-04-09 Thread Sairam Gaddam
//create table sql="create table em(name text primary key,age text,pts text);"\ "create table l(name text primary key,fame text);"; //insert values sql="insert into em values(44,20,1);"\ "insert into em values(11,20,2);"\ "insert into em values(5,21,3);"\ "insert into l values(11,11);"\

[sqlite] Clarification regarding Next opcode !

2015-03-20 Thread Sairam Gaddam
What Next opcode does is advance cursor P1 so that it points to the next key/data pair in its table or index. If there are no more key/value pairs then fall through to the following instruction. But i have a program where i need clarification regarding its operation (I inserted printf statement

[sqlite] regarding loops in vdbe code

2015-03-17 Thread Sairam Gaddam
01 NULL > 16Close 1 0 000 NULL > 17Close 0 0 000 NULL > 18Halt 0 0 000 NULL > 19Transaction1 0 0 00 NULL > 20

[sqlite] regarding loops in vdbe code

2015-03-17 Thread Sairam Gaddam
When joining a table in sqlite with some condition using where clause, sqlite sometimes generate less number of loops(Next opcodes) than the number of tables. Can anyone explain how sqlite iterates through all the tables when it has less number of loops.

[sqlite] regarding loops in joins(VDBE)

2015-03-09 Thread Sairam Gaddam
n. > > Since em.name and lo.name are matching primary keys, why the two tables? > Which other entity has a lo(cation)? And how are you going to keep that > other entity from assigning conflicting keys (i.e. those already used for > em entries)? > > Are you sure the

[sqlite] regarding loops in joins(VDBE)

2015-03-09 Thread Sairam Gaddam
sir, I have a join query with 3 tables and 2 conditions in the where clause.But the program executes by opening single loop.Can any one know how is executes? I have included the query and the vdbe program in the link below: http://pastebin.com/aA3QSJ7w

[sqlite] Regarding creating a mem object and copying contents to it in SQLite

2015-02-25 Thread Sairam Gaddam
chricht----- > Von: Sairam Gaddam [mailto:gaddamsairam at gmail.com] > Gesendet: Mittwoch, 25. Februar 2015 08:23 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] Regarding creating a mem object and copying contents > to it in SQLite > > I am trying to optimize

[sqlite] Regarding creating a mem object and copying contents to it in SQLite

2015-02-25 Thread Sairam Gaddam
ou think you need to manipulate > internal structures? > > -Urspr?ngliche Nachricht- > Von: Sairam Gaddam [mailto:gaddamsairam at gmail.com] > Gesendet: Mittwoch, 25. Februar 2015 07:41 > An: sqlite-users at sqlite.org > Betreff: [sqlite] Regarding creating

[sqlite] Regarding creating a mem object and copying contents to it in SQLite

2015-02-25 Thread Sairam Gaddam
hello, I created a mem object in SQLite and copied a string value to its member and i initialized some other members to default values manually, it worked well but some times it shows realloc() error. I also found a function sqlite3VdbeMemSetStr() which will copy the string value

[sqlite] regarding looping in vdbe for sqlite table joins!

2015-02-02 Thread Sairam Gaddam
Normally for executing joins in sqlite,the vdbe program opens 1 loop for each and every table but in my code(attached that file via pastebin) ,i am facing an issue because it is opening only 2 loops even if i use 4 tables in joining operation. can anyone explain why it happened like that and

[sqlite] regarding sqlite3_prepare_v2() func

2015-01-21 Thread Sairam Gaddam
I have one doubt regarding sqlite code. I have 2 programs-one with sqlite3_exec() included in the code and in other it is not included.I included those files which are zmain.c and zmain1.c respectively. First i created a database and added a table "em" and added some contents to it,then i executed

[sqlite] regarding sqlite3_prepare_v2() func

2015-01-21 Thread Sairam Gaddam
I have one doubt regarding sqlite code. I have 2 programs-one with sqlite3_exec() included in the code and in other it is not included.I included those files which are zmain.c and zmain1.c respectively. First i created a database and added a table "em" and added some contents to it,then i executed