[sqlite] How to check "atomic write" feature for 4KB page size on TCL test?

2012-08-19 Thread Yongil Jang
Dear all,
I'm trying to check whether can I use "atomic write" feature with 4KB page
size on my device.
To do that, I'd used crash3.test on TCL test by doing like as follows.

"./testfixture test/crash3.test"

To check it correctly, testfixture is compiled with
"-DSQLITE_ENABLE_ATOMIC_WRITE".
All of this was passed without any errors as I expected.

But, "crash3-1" test case only checks for 1KB page size of sqlite.
To clarify this issue, I'd changed some values from "page_size = 1024" to
"page_size = 4096" and added "-blocksize 4096".

foreach {sql res2} [list \

  {INSERT INTO abc VALUES(4, 5, 6)}{1 2 3 4 5 6} \

  {DELETE FROM abc}{}\

  {INSERT INTO abc SELECT * FROM abc}  {1 2 3 1 2 3} \

  {UPDATE abc SET a = 2}   {2 2 3}   \

  {INSERT INTO abc VALUES(4, 5, randstr(1000,1000))}   {n/a} \

  {CREATE TABLE def(d, e, f)}  {n/a} \

] {

  for {set ii 0} {$ii < 10} {incr ii} {



db close

forcedelete test.db test.db-journal

sqlite3 db test.db

do_test crash3-1.$tn.1 {

  execsql {

*PRAGMA page_size = 4096;*

BEGIN;

CREATE TABLE abc(a, b, c);

INSERT INTO abc VALUES(1, 2, 3);

COMMIT;

  }

} {}

db close



set crashfile test.db

if {($ii%2)==0} { append crashfile -journal }

set rand "SELECT randstr($tn,$tn);"

do_test crash3-1.$tn.2 [subst {

  crashsql -file $crashfile *-blocksize 4096* -char atomic {$rand $sql}

  sqlite3 db test.db

  execsql { PRAGMA integrity_check; }

}] {ok}



do_test2 crash3-1.$tn.3 {

  execsql { SELECT * FROM abc }

} {1 2 3} $res2



incr tn

  }

}

But, unfortunately, I got following failures.

crash3-1.41.3...
Expected: [{1 2 3} or {n/a}]
 Got: [1 2 3 4 5 {/pB9kEkQw
kEpYISEjN0q<:fT8comPoMZ9UdXVu_e86bCqrc8LPXIZ<8m!oln/4Z*4d9S3lIvAD6Ef>Q79Xs6n^LRtTdWVN5Ttoc962blIqn7uWx9d2xv/EiQ|61AZ-n|FOXjYrWc_^InVxJ:d/cEg7j32qdJf0GCSsnoUXN=GuER^_r4bc!R//GnRBmIgTj7aL18Bf/?4NPlF|-:YoveCRikCj2Aj:e1PgdwHytrZQc8G7c5_6=dsKkuuijk93guxHO:J6aHDKbGyom7W3ZO-.vjrIe_wq4lQPjjqTurZ5OamMCl+n|jf680X*IsmGL,d<9>3btX22cb2wjDRGL>shIs0WQkWJeKXLVneKZ!Pna56+iK-Y
*Qsrrh0:.d+R4MxiezaDVue2LsF
E3u-KwVqKScNOaJO>,TriK_S,t_Qb*bjco0Mg.feUlD8eLjqtpWDd?kgx0
*nP=d|.AakNc_/jq,e+9!06AGgrIYBzfhoemyj.r!MDZsg3T>y>R:1mc_|ysDpZwVs
LHa9hNexhLc.9DLirYBHRR:rbMyJedJ_vN7/|vLQIJ8RBMqlj1

Re: [sqlite] Transaction issues with WinRT build

2012-08-19 Thread Joe Mistachkin

Lukas Fellechner wrote:
> 
> I tried using the WinRT builds of sqlite. But I find there are problems 
> when using transactions. While my table creation and insert statements
work 
> fine, all transacted "update" statements are failing with result 
> "CannotOpen", error message is "unable to open database file". This even 
> happens when the connection is already open and I have already inserted 
> some lines into the DB. So the file is definately opened and write locked 
> for SQLite. 
> 

Setting the sqlite3_temp_directory to the value contained in the
"Windows.Storage.ApplicationData.Current.TemporaryFolder.Path" property
should clear the issue.  This can be done immediately after opening the
connection using PRAGMA temp_store_directory command on the newly opened
database connection.

--
Joe Mistachkin

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


Re: [sqlite] Transaction issues with WinRT build

2012-08-19 Thread Simon Slavin

On 19 Aug 2012, at 3:38pm, "Lukas Fellechner"  wrote:

> I tried using the WinRT builds of sqlite. But I find there are problems 
> when using transactions. While my table creation and insert statements work 
> fine, all transacted "update" statements are failing with result 
> "CannotOpen", error message is "unable to open database file". This even 
> happens when the connection is already open and I have already inserted 
> some lines into the DB. So the file is definately opened and write locked 
> for SQLite. 
> 
> If I replace the sqlite3.dll with the "regular" build, then I do not have 
> any issues. And if I remove the "begin transaction", then also everything 
> works fine.

Using both versions can you tell us the results of

SELECT sqlite_version(),sqlite_source_id()

Do you define transactions for your INSERT commands too ?  I can think of some 
reasons to get the error for all transactions.  This might be because although 
your application can access the database file without errors, it has trouble 
with the journal file in the same folder and the 'cannotopen' error is about 
the journal file.

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


[sqlite] Transaction issues with WinRT build

2012-08-19 Thread Lukas Fellechner
Hello,

I tried using the WinRT builds of sqlite. But I find there are problems 
when using transactions. While my table creation and insert statements work 
fine, all transacted "update" statements are failing with result 
"CannotOpen", error message is "unable to open database file". This even 
happens when the connection is already open and I have already inserted 
some lines into the DB. So the file is definately opened and write locked 
for SQLite. 

If I replace the sqlite3.dll with the "regular" build, then I do not have 
any issues. And if I remove the "begin transaction", then also everything 
works fine.

This happes with the standalone WinRT dll downloads, and also when using 
the Visual Studio Extension (VSIX WinRT package) as reference. I also tried 
to use sqliteadmin with the WinRT sqlite3.dll. It fails to open any 
database with something about "closed data set".

Has anyone tried to use the WinRT version on Windows 8 RC?

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


Re: [sqlite] SQLite file format and Open Data

2012-08-19 Thread Richard Hipp
On Sun, Aug 19, 2012 at 9:36 AM, Thejesh GN  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Hi Richard,
> I certainly know the software part of SQLite is in public domain. I want
> to know if SQLite file format (how the data is stored and organized
> inside SQLite file) is also in the public domain. I couldn't find any
> links related to this on http://www.sqlite.org .
>

http://www.sqlite.org/fileformat2.html


>
> I want to know this as I want to use SQLite release open data for public
> use.
>
> Can you please let me know.
>
> Thanks and Regards,
> Thejesh GN
> http://thejeshgn.com
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iQIcBAEBCgAGBQJQMOvlAAoJEL/8jdPAbdawkJoQALm03ungZ9mJWxHYA0XnvAQ7
> Qdu/qbdz4IYvwvgm7lZdznBC2QbQW8g6GsVHxlmAKFA4jxL3YWzSbGvvNF0R9dgm
> 9gFTsJvm98ZYLyFldauYzYUR9D5VxljwEkF3XisXikPzeov/uBYEEOA0LqEn2LTt
> cTqkkgViXrG0yVIVHk59GqpPP50Z2Oz1kweydW234lAj8fVIy0kIlNhXGvrmZ6QH
> Si9gkI+jVJQ8vTYiIRz3PdAwOgE6yEOMXnaWba0Xnt5YB7Xcw31mqSI4mc0+ngc2
> uMrHoge/bdgH9M9WzVak6aKKVYFWuGjmET6c3O5A8J4tjC9HZ81tMEtm0w56nYIz
> gmsQRL6gkz+DFn9xdXqFkC/t4KgUMx3IVqGDTRsslU4URgxqNDuN5tSCwy7LU/gE
> rVC7T6mjGieHRHddPswSQrQVnKELGQQgmK9xdZJI9dyczOsFpwnUJ7D2eA3xt+zD
> 8irPzf46z5Pl6byPSptXaWBaz6u06A8qO9NNNiRg8un/UDvbWOg61+4fnj4TB+08
> 1BxtwszBO5BDKglLugHxnPnYBjvaHKzsDdXR8wW8U7tgaWNfABOjIAWxszZVUomN
> 9q3pazKp5NEe9PmmsOR6F0MUQDnuAI+NqjEyxr3maPS3M1oe5RQTL9TJ1idZ7bac
> Cozr65aOztRl9d85gSN3
> =t0hn
> -END PGP SIGNATURE-
>



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