/ Check-in [c3fe1f4b]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test BEGIN CONCURRENT transactions that consist entirely of read-only statements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA3-256: c3fe1f4b7e8dcadcb516622719d000b808effe3ad497244ba44f57d52dc2cc08
User & Date: dan 2017-08-24 10:10:28
Wiki:begin-concurrent
Context
2017-08-28
17:19
Merge recent enhancements from trunk. check-in: d53108e7 user: drh tags: begin-concurrent
2017-08-24
10:10
Test BEGIN CONCURRENT transactions that consist entirely of read-only statements. check-in: c3fe1f4b user: dan tags: begin-concurrent
2017-08-12
14:06
Add a more rigorous test case for the bug fixed by the previous commit on this branch. check-in: 42560723 user: dan tags: begin-concurrent
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/concurrent4.test.

96
97
98
99
100
101
102
103

























































































104
105
} {wal}

do_execsql_test 3.2 {
  BEGIN CONCURRENT;
    REPLACE INTO t1 VALUES(25, randomblob(1117));
  COMMIT;
} {}


























































































finish_test









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
} {wal}

do_execsql_test 3.2 {
  BEGIN CONCURRENT;
    REPLACE INTO t1 VALUES(25, randomblob(1117));
  COMMIT;
} {}

#-------------------------------------------------------------------------
# Test the effect of BEGIN CONCURRENT transactions that consist entirely
# of read-only statements.
#
reset_db
do_execsql_test 4.0 {
  PRAGMA page_size = 1024;
  PRAGMA journal_mode = wal;
  
  CREATE TABLE t4(a, b);
  INSERT INTO t4 VALUES(1, 2);
  INSERT INTO t4 VALUES(3, 4);
} {wal}
 
sqlite3 db2 test.db
do_test 4.1.1 {
  db eval {
    BEGIN CONCURRENT;
      INSERT INTO t4 VALUES(5, 6);
  }

  db2 eval {
    BEGIN CONCURRENT;
      SELECT * FROM t4;
    ROLLBACK;
  }
} {1 2 3 4}

do_test 4.1.2 {
  db eval { COMMIT }
  db2 eval { SELECT * FROM t4 }
} {1 2 3 4 5 6}

do_test 4.2.1 {
  db eval {
    BEGIN CONCURRENT;
      INSERT INTO t4 VALUES(7, 8);
  }

  db2 eval {
    BEGIN CONCURRENT;
      SELECT * FROM t4;
    COMMIT;
  }
} {1 2 3 4 5 6}

do_test 4.2.2 {
  db eval { COMMIT }
  db2 eval { SELECT * FROM t4 }
} {1 2 3 4 5 6 7 8}

do_test 4.3 {
  db2 eval {
    BEGIN CONCURRENT;
      SELECT * FROM t4;
  }

  db eval {
    BEGIN CONCURRENT;
      INSERT INTO t4 VALUES(9, 10);
    COMMIT;
  }
  db2 eval {
    SELECT * FROM t4;
    COMMIT;
  }
} {1 2 3 4 5 6 7 8}

set sz [file size test.db-wal]
do_test 4.4.1 {
  db eval {
    BEGIN CONCURRENT;
      SELECT * FROM t4;
      SELECT * FROM sqlite_master;
  }

  db eval COMMIT
  file size test.db-wal
} $sz
do_test 4.4.2 {
  db eval {
    BEGIN CONCURRENT;
      SELECT * FROM t4;
      SELECT * FROM sqlite_master;
    ROLLBACK;
  }
  file size test.db-wal
} $sz

finish_test