I found a reason of below failures.

This test is failed in case of "INSERT INTO abc VALUES(4, 5,
randstr(1000,1000))" query is executed in crash scripts.

When this query is executed, journal file is created because of record size
exceeds current page and crashed by test scripts.
However, if I change page size from 1KB to 4KB, journal file is not created
and not crashed. This means that new data is inserted and searched by
select query.

This failures are fixed by changing random string size from 1000 to 4072,
to make this test have same process with original.

Whatever, this test case is not for "atomic write", but it is only for
"crash-recovery" safety check when "atomic write" is enabled.

Best regards,
YongIl Jang.

2012/8/20 Yongil Jang <[email protected]>

> 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^LR<eaQDG
> YfC*feJ
> G9I^It?>tTdWVN5Ttoc<YbQyv4C2h6hK-Z47rqfUcmle*b7>962blIqn7uWx9d2xv/EiQ|61AZ-n|FOXjYrWc_^InVxJ:d/cEg7j32qdJf0GCSsnoUXN=GuER^_r4bc!R//GnRBmIgTj7aL18Bf/?4NPlF|-:YoveCRikCj2Aj:e1PgdwHytrZQc8G7c5_6=dsKkuui<KiB,C1bUWkE=aNS
> zb8TN+tE_,ec=M8/2pbtrdRwh53F>jk93guxHO:J<use>6aHDKbGyom7W3ZO-.vjrIe_wq4lQPjjqTurZ5OamMCl+n|jf680X*IsmGL,d<9>3btX22cb2wjDRGL>shIs0WQkWJeKXLVneKZ!Pna56+iK-Y
> *Qsrrh0:.d+R4MxiezaDVue2LsF
> E3u-KwVqKScNOaJO>,TriK_S,t_Qb*bjco0Mg.feUlD8eLjqtpWDd?kgx0
> *n<SOu7/lKbGaRkEP|Vd6/FfO,
> H.?_Y_a/I,K=5>P=d|.AakNc_/jq,e+9!06AGgrIYBzfhoemyj.r!MDZsg3T>y>R:1mc_|ysDpZwVs
> LHa9hNexhLc.9DLirYBHRR:rbMyJedJ_vN7/|vLQIJ8RBMqlj1<qqmkZKRiCpbolb9Zi,j2o!3q0qcVZO-|yZm8=o35Bjqu2f0n.YBR73|Eu5?-xzjG1K/Y2veXBfy^2VkI?l<v_i6e
> yum6Pe>G0c1X,_GG8Zx9j
> 9f|sQtfGhcbftpnP214GGWW1Fz8Z5k5AZ!-OC<Psg+nlYdp9Tsdq.WfVx?KUhjUg
> mki8<WN4K^s*!.Y_u,4s/CW3n,29d4zTN:=5Y3:8.25_10pwE<HIU7KuE/<e.ZGL+w=uwbxGhCg9ZpK3QJz!4v66tD-<Wy1G3mjJfoK?}]
>
> Am I wrong?
> Or, This test case is not for safety check of "atomic write"?
>
> Best regards,
> YongIl Jang.
>
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to