5
5
pgsql
6
6
--SKIPIF--
7
7
<?php
8
- require_once (__DIR__ .'/../../dba/tests/skipif.inc ' );
8
+ require_once dirname (__DIR__ , 2 ) . '/dba/tests/setup/setup_dba_tests.inc ' ;
9
+ check_skip_any ();
9
10
require_once ('skipif.inc ' );
10
11
?>
11
12
--FILE--
@@ -18,46 +19,65 @@ if (!$dbh) {
18
19
}
19
20
pg_close ($ dbh );
20
21
21
- require_once (__DIR__ . ' /../../ dba/tests/test .inc ') ;
22
- require_once ( __DIR__ . ' /../../dba/tests/dba_handler.inc ' ) ;
22
+ require_once dirname (__DIR__ , 2 ) . ' / dba/tests/setup/setup_dba_tests .inc ' ;
23
+ $ name = ' bug14383.db ' ;
23
24
25
+ $ handler = get_any_handler ($ name );
26
+ run_standard_tests ($ handler , $ name );
24
27
?>
25
28
--CLEAN--
26
29
<?php
27
- require_once (__DIR__ .'/../../dba/tests/clean.inc ' );
30
+ require_once dirname (__DIR__ , 2 ) . '/dba/tests/setup/setup_dba_tests.inc ' ;
31
+ $ name = 'bug14383.db ' ;
32
+ cleanup_standard_db ($ name );
28
33
?>
29
34
--EXPECTF--
30
- database handler: %s
31
- 3NYNYY
32
- Content String 2
33
- Content 2 replaced
34
- Read during write:%sallowed
35
- "key number 6" written
36
- Failed to write "key number 6" 2nd time
37
- Content 2 replaced 2nd time
38
- The 6th value
39
- array(3) {
40
- ["key number 6"]=>
41
- string(13) "The 6th value"
42
- ["key2"]=>
43
- string(27) "Content 2 replaced 2nd time"
44
- ["key5"]=>
45
- string(23) "The last content string"
46
- }
47
- --NO-LOCK--
48
- 3NYNYY
49
- Content String 2
35
+ Using handler: "%s"
36
+ === RUNNING WITH FILE LOCK ===
37
+ Remove key 1 and 3
38
+ bool(true)
39
+ bool(true)
40
+ Try to remove key 1 again
41
+ bool(false)
42
+ key2: Content String 2
43
+ key4: Another Content String
44
+ key5: The last content string
45
+ name9: Content String 9
46
+ [key10]name10: Content String 10
47
+ [key30]name30: Content String 30
48
+ Total keys: 6
49
+ Key 1 exists? N
50
+ Key 2 exists? Y
51
+ Key 3 exists? N
52
+ Key 4 exists? Y
53
+ Key 5 exists? Y
54
+ Replace second key data
55
+ bool(true)
50
56
Content 2 replaced
51
57
Read during write: not allowed
52
- "key number 6" written
53
- Failed to write "key number 6" 2nd time
54
- Content 2 replaced 2nd time
55
- The 6th value
56
- array(3) {
58
+ Expected: Added a new data entry
59
+ Expected: Failed to insert data for already used key
60
+ Replace second key data
61
+ bool(true)
62
+ Delete "key4"
63
+ bool(true)
64
+ Fetch "key2": Content 2 replaced 2nd time
65
+ Fetch "key number 6": The 6th value
66
+ array(6) {
67
+ ["[key10]name10"]=>
68
+ string(17) "Content String 10"
69
+ ["[key30]name30"]=>
70
+ string(17) "Content String 30"
57
71
["key number 6"]=>
58
72
string(13) "The 6th value"
59
73
["key2"]=>
60
74
string(27) "Content 2 replaced 2nd time"
61
75
["key5"]=>
62
76
string(23) "The last content string"
77
+ ["name9"]=>
78
+ string(16) "Content String 9"
63
79
}
80
+ === RUNNING WITH DB LOCK (default) ===
81
+ SAME OUTPUT AS PREVIOUS RUN
82
+ === RUNNING WITH NO LOCK ===
83
+ SAME OUTPUT AS PREVIOUS RUN (modulo read during write due to no lock)
0 commit comments