equal
deleted
inserted
replaced
|
1 function test() { |
|
2 var db = openDatabaseSync("QmlTestDB-selection", "", "Test database from Qt autotests", 1000000); |
|
3 var r="transaction_not_finished"; |
|
4 |
|
5 db.transaction( |
|
6 function(tx) { |
|
7 tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)'); |
|
8 tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); |
|
9 tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); |
|
10 } |
|
11 ); |
|
12 |
|
13 db.transaction( |
|
14 function(tx) { |
|
15 tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); |
|
16 tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); |
|
17 var rs = tx.executeSql('SELECT * FROM Greeting'); |
|
18 if ( rs.rows.length != 4 ) |
|
19 r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows[0]+rs.rows[1] |
|
20 else |
|
21 r = "passed"; |
|
22 } |
|
23 ); |
|
24 |
|
25 return r; |
|
26 } |