mirror of
https://github.com/sqlite/sqlite.git
synced 2024-12-01 17:23:42 +01:00
Move the asynchronous IO code from src/test_async.c to ext/async/. Refactor it to be a standalone module and to support windows. (CVS 6539)
FossilOrigin-Name: e71fb0fb8d83b4453c3c1e84606bf58d04926809
This commit is contained in:
parent
ceea33217b
commit
a3f065980e
1738
ext/async/sqlite3async.c
Normal file
1738
ext/async/sqlite3async.c
Normal file
File diff suppressed because it is too large
Load Diff
44
ext/async/sqlite3async.h
Normal file
44
ext/async/sqlite3async.h
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
#ifndef __SQLITEASYNC_H_
|
||||
#define __SQLITEASYNC_H_ 1
|
||||
|
||||
#define SQLITEASYNC_VFSNAME "sqlite3async"
|
||||
|
||||
/*
|
||||
** Install the asynchronous IO VFS.
|
||||
*/
|
||||
int sqlite3async_initialize(const char *zParent, int isDefault);
|
||||
|
||||
/*
|
||||
** Uninstall the asynchronous IO VFS.
|
||||
*/
|
||||
void sqlite3async_shutdown();
|
||||
|
||||
/*
|
||||
** Process events on the write-queue.
|
||||
*/
|
||||
void sqlite3async_run();
|
||||
|
||||
/*
|
||||
** Control/configure the asynchronous IO system.
|
||||
*/
|
||||
int sqlite3async_control(int op, ...);
|
||||
|
||||
/*
|
||||
** Values that can be used as the first argument to sqlite3async_control().
|
||||
*/
|
||||
#define SQLITEASYNC_HALT 1
|
||||
#define SQLITEASYNC_DELAY 2
|
||||
#define SQLITEASYNC_GET_HALT 3
|
||||
#define SQLITEASYNC_GET_DELAY 4
|
||||
|
||||
/*
|
||||
** If the first argument to sqlite3async_control() is SQLITEASYNC_HALT,
|
||||
** the second argument should be one of the following.
|
||||
*/
|
||||
#define SQLITEASYNC_HALT_NEVER 0 /* Never halt (default value) */
|
||||
#define SQLITEASYNC_HALT_NOW 1 /* Halt as soon as possible */
|
||||
#define SQLITEASYNC_HALT_IDLE 2 /* Halt when write-queue is empty */
|
||||
|
||||
#endif /* ifndef __SQLITEASYNC_H_ */
|
||||
|
4
main.mk
4
main.mk
@ -46,6 +46,7 @@
|
||||
#
|
||||
TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
|
||||
TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
|
||||
TCCX += -I$(TOP)/ext/async
|
||||
|
||||
# Object files for the SQLite library.
|
||||
#
|
||||
@ -255,7 +256,8 @@ TESTSRC2 = \
|
||||
$(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \
|
||||
$(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c \
|
||||
$(TOP)/ext/fts3/fts3.c $(TOP)/ext/fts3/fts3_expr.c \
|
||||
$(TOP)/ext/fts3/fts3_tokenizer.c
|
||||
$(TOP)/ext/fts3/fts3_tokenizer.c \
|
||||
$(TOP)/ext/async/sqlite3async.c
|
||||
|
||||
# Header files used by all library source files.
|
||||
#
|
||||
|
24
manifest
24
manifest
@ -1,5 +1,5 @@
|
||||
C Rework\sthe\scolumn-cache\smechanism\sto\sbe\smore\srobust\s(and\smore\scorrect).\nThe\scolumn-alias\scache\sis\scurrently\sdisabled,\s(CVS\s6538)
|
||||
D 2009-04-23T13:22:43
|
||||
C Move\sthe\sasynchronous\sIO\scode\sfrom\ssrc/test_async.c\sto\sext/async/.\sRefactor\sit\sto\sbe\sa\sstandalone\smodule\sand\sto\ssupport\swindows.\s(CVS\s6539)
|
||||
D 2009-04-23T14:58:40
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@ -24,6 +24,8 @@ F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
|
||||
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
|
||||
F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1
|
||||
F ext/async/sqlite3async.c d59701cc27f8a7a2bf6ffa997af12b32f05633e6
|
||||
F ext/async/sqlite3async.h 73d37b60bc37cbd86f836a172fb57a59a7dd2697
|
||||
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
|
||||
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
|
||||
F ext/fts1/ft_hash.h 1a35e654a235c2c662d3ca0dfc3138ad60b8b7d5
|
||||
@ -83,7 +85,7 @@ F ext/rtree/tkt3363.test 6662237ea75bb431cd5d262dfc9535e1023315fc
|
||||
F ext/rtree/viewrtree.tcl 09526398dae87a5a87c5aac2b3854dbaf8376869
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F main.mk bbb170882a34fe51dbd2d2e9c450c6cc0dad3325
|
||||
F main.mk 8388687358db061fa98f062f8b417b986d8ff3fe
|
||||
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
|
||||
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
|
||||
F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
|
||||
@ -173,7 +175,7 @@ F src/test6.c 1a0a7a1f179469044b065b4a88aab9faee114101
|
||||
F src/test7.c b94e68c2236de76889d82b8d7d8e00ad6a4d80b1
|
||||
F src/test8.c b1061548f7ce3aeedea3cc4d649ee1487c2b4eaf
|
||||
F src/test9.c 963d380922f25c1c323712d05db01b19197ee6f7
|
||||
F src/test_async.c 636451da68b7ff4a6d19b266441b2f28790967db
|
||||
F src/test_async.c 95c15d9085ea9a837a5c4332a9ae3a8df1afd2cd
|
||||
F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad
|
||||
F src/test_backup.c 1384a18985a5a2d275c2662e48473bf1542ebd08
|
||||
F src/test_btree.c d7b8716544611c323860370ee364e897c861f1b0
|
||||
@ -403,7 +405,7 @@ F test/index3.test 727d55dceb9a4ec36675057bb5becfc265e28ca6
|
||||
F test/indexedby.test 946ca2628a521f4ced0520421a0788345abaf3dc
|
||||
F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908
|
||||
F test/insert2.test 4f3a04d168c728ed5ec2c88842e772606c7ce435
|
||||
F test/insert3.test 7188f1da1126eb15f1b27cf34f4c2753c7d5fd27
|
||||
F test/insert3.test 1b7db95a03ad9c5013fdf7d6722b6cd66ee55e30
|
||||
F test/insert4.test 6e382eaf7295a4463e6f29ea20fcd8e63d097eeb
|
||||
F test/insert5.test 1f93cbe9742110119133d7e8e3ccfe6d7c249766
|
||||
F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
|
||||
@ -477,7 +479,7 @@ F test/misc5.test 6a5c1e3217a95b0db05ff9a0f1ecb5ce9043ffef
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test debcd7dbfd847ae97b16ceb7fec6f567902874a6
|
||||
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
|
||||
F test/mutex1.test ebd54720401fafe854799dc86b7bf60b75631935
|
||||
F test/mutex1.test 5b71777fc127509cd257910c8db799de557a02de
|
||||
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
||||
F test/nan.test c627d79b3d36ea892563fd67584b3e8a18f0618a
|
||||
F test/notify1.test 533cf60a81f59c1c88a99ce46b1c14f47d14c32c
|
||||
@ -517,7 +519,7 @@ F test/savepoint5.test 0735db177e0ebbaedc39812c8d065075d563c4fd
|
||||
F test/savepoint6.test e28f7d8ab8a389d4e5bd1dc08bf2c3312754cc67
|
||||
F test/schema.test deafe5472099ab5bc65748059dc5182fc8ebad74
|
||||
F test/schema2.test 906408621ea881fdb496d878b1822572a34e32c5
|
||||
F test/select1.test 7de2cabb417c142c40e5b8005855b8bd4eedc9e7
|
||||
F test/select1.test 041fe01f2a8b7d77ffe77872f7b18ef531b31dfa
|
||||
F test/select2.test 9735da20ccd41e42bf2b4c19fd939141b591adae
|
||||
F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
|
||||
F test/select4.test 44aa6e7110592e18110b0b9cf5c024d37d23be17
|
||||
@ -720,7 +722,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
P ecbef45011f1f98d940b2d3492941213d9f04172
|
||||
R 809b7ccefbb8e27249a22441796f79d9
|
||||
U drh
|
||||
Z 84c7a808c7a31870885d027c8c29d439
|
||||
P dd4d67a67454a3ff13c286a2a8360c5f0432c91d
|
||||
R 07be84b60f3cf1fb3263cdf9b0c910bb
|
||||
U danielk1977
|
||||
Z 9ac60e3337f4b3b00edc92808d492861
|
||||
|
@ -1 +1 @@
|
||||
dd4d67a67454a3ff13c286a2a8360c5f0432c91d
|
||||
e71fb0fb8d83b4453c3c1e84606bf58d04926809
|
1798
src/test_async.c
1798
src/test_async.c
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing corner cases of the INSERT statement.
|
||||
#
|
||||
# $Id: insert3.test,v 1.8 2008/12/23 10:37:47 danielk1977 Exp $
|
||||
# $Id: insert3.test,v 1.9 2009/04/23 14:58:40 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -166,9 +166,11 @@ ifcapable bloblit {
|
||||
}
|
||||
} {{} 4.3 hi}
|
||||
}
|
||||
db close
|
||||
|
||||
file delete -force test.db
|
||||
foreach tab [db eval {SELECT name FROM sqlite_master WHERE type = 'table'}] {
|
||||
db eval "DROP TABLE $tab"
|
||||
}
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# $Id: mutex1.test,v 1.19 2009/03/24 15:08:10 drh Exp $
|
||||
# $Id: mutex1.test,v 1.20 2009/04/23 14:58:40 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -97,8 +97,8 @@ do_test mutex1-1.9 {
|
||||
# * Multi-threaded mode,
|
||||
# * Single-threaded mode.
|
||||
#
|
||||
set enable_shared_cache [sqlite3_enable_shared_cache 1]
|
||||
ifcapable threadsafe {
|
||||
ifcapable threadsafe&&shared_cache {
|
||||
set enable_shared_cache [sqlite3_enable_shared_cache 1]
|
||||
foreach {mode mutexes} {
|
||||
singlethread {}
|
||||
multithread {fast static_lru static_master static_mem static_open static_prng }
|
||||
@ -133,12 +133,10 @@ ifcapable threadsafe {
|
||||
lsort $res
|
||||
} [lsort $mutexes]
|
||||
}
|
||||
}
|
||||
sqlite3_enable_shared_cache $enable_shared_cache
|
||||
sqlite3_enable_shared_cache $enable_shared_cache
|
||||
|
||||
# Open and use a connection in "nomutex" mode. Test that no recursive
|
||||
# mutexes are obtained.
|
||||
ifcapable threadsafe {
|
||||
# Open and use a connection in "nomutex" mode. Test that no recursive
|
||||
# mutexes are obtained.
|
||||
do_test mutex1.3.1 {
|
||||
catch {db close}
|
||||
clear_mutex_counters
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the SELECT statement.
|
||||
#
|
||||
# $Id: select1.test,v 1.67 2009/04/10 15:38:43 drh Exp $
|
||||
# $Id: select1.test,v 1.68 2009/04/23 14:58:40 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -1022,9 +1022,12 @@ ifcapable subquery {
|
||||
} {0}
|
||||
}
|
||||
|
||||
foreach tab [db eval {SELECT name FROM sqlite_master WHERE type = 'table'}] {
|
||||
db eval "DROP TABLE $tab"
|
||||
}
|
||||
db close
|
||||
file delete -force test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
do_test select1-14.1 {
|
||||
execsql {
|
||||
SELECT * FROM sqlite_master WHERE rowid>10;
|
||||
|
Loading…
Reference in New Issue
Block a user