Rename the sqlite_compile_option_*() SQL functions to sqlite_compileoption_*()

for consistency with the C/C++ interface.

FossilOrigin-Name: dd4962aa34c4dd118d2cb15465384636eacc64d5
This commit is contained in:
drh 2010-02-26 16:37:47 +00:00
parent 71caabf0cc
commit 8bb76d39a0
4 changed files with 42 additions and 73 deletions

View File

@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Remove\sthe\scompile_option\spragma\s(retaining\scompile_options\s-\swith\san\s"s").\nUpdates\sto\sdocumentation.
D 2010-02-26T15:39:24
C Rename\sthe\ssqlite_compile_option_*()\sSQL\sfunctions\sto\ssqlite_compileoption_*()\nfor\sconsistency\swith\sthe\sC/C++\sinterface.
D 2010-02-26T16:37:48
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -124,7 +124,7 @@ F src/delete.c 610dc008e88a9599f905f5cbe9577ac9c36e0581
F src/expr.c d0a345e1d8995e142bc5d9f39a97b9981d7d8f23
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c e2116672a6bd610dc888e27df292ebc7999c9bb0
F src/func.c 374f45d2a5dcebc0aedc8755c2e9abe71b4e49b0
F src/func.c 5dca069d98eca0ff70c9a8fb8ab9e1d6467187b5
F src/global.c 5a9c1e3c93213ca574786ac1caa976ce8f709105
F src/hash.c 458488dcc159c301b8e7686280ab209f1fb915af
F src/hash.h 2894c932d84d9f892d4b4023a75e501f83050970
@ -321,7 +321,7 @@ F test/crash8.test 5b32966fcb58fd616d24ce94303420351d076eb9
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
F test/createtab.test 199cf68f44e5d9e87a0b8afc7130fdeb4def3272
F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
F test/ctime.test 50e1fd7bc76a89014e27c73381e7b5ec75bb17cb
F test/ctime.test f5040beef89c1b2bdb6a9edb7358a519213ff80c
F test/date.test 0b8473ed9ab6fd4283b4a01f035e1067762ba734
F test/default.test 6faf23ccb300114924353007795aa9a8ec0aa9dc
F test/delete.test f7629d9eb245dfca170169cc5c7a735dec34aeb4
@ -795,14 +795,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 7bdb1e05faceddbb0b8e3efee7d070ad8c4611a3
R 166632f05beccd6e33784984b6d9675d
P 733778df996a2dda7c31ff7b544cb6f9a6ed4c97
R 7f351a8380a57500bdc76d848dfdb822
U drh
Z ed08651f41dc2c7225f33203915e8063
Z 9c0ca58ad9d71dc0c1f9bebd48b21b4a
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFLh+svoxKgR168RlERArQvAJ95o9BxgjMp3G3ev6cCRTv/xZJZmgCdEowj
KQEVfyphDS5oiwkCBBNOI7Q=
=1Xz8
iD8DBQFLh/jeoxKgR168RlERAgx7AJ9t8rjVK1sKv6l87VjKqoxYlMqILwCeOAZq
XkZC4ILkhEvojBGezLNi0to=
=MB8W
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
733778df996a2dda7c31ff7b544cb6f9a6ed4c97
dd4962aa34c4dd118d2cb15465384636eacc64d5

View File

@ -1549,8 +1549,8 @@ void sqlite3RegisterGlobalFunctions(void){
FUNCTION(sqlite_version, 0, 0, 0, versionFunc ),
FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ),
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
FUNCTION(sqlite_compile_option_used,1, 0, 0, compileoptionusedFunc ),
FUNCTION(sqlite_compile_option_get, 1, 0, 0, compileoptiongetFunc ),
FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ),
FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ),
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
FUNCTION(quote, 1, 0, 0, quoteFunc ),
FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid),

View File

@ -61,79 +61,48 @@ do_test ctime-1.2.2 {
list [ lindex $ans 0 ] [ expr { [lsort [lindex $ans 1]]==[lindex $ans 1] } ]
} {0 1}
do_test ctime-1.3.1 {
catchsql {
PRAGMA compile_option();
}
} {1 {near ")": syntax error}}
do_test ctime-1.3.2 {
catchsql {
PRAGMA compile_option(NULL);
}
} {1 {near "NULL": syntax error}}
do_test ctime-1.3.3 {
catchsql {
PRAGMA compile_option foo;
}
} {1 {near "foo": syntax error}}
do_test ctime-1.3.4 {
catchsql {
PRAGMA compile_option 'foo';
}
} {1 {near "'foo'": syntax error}}
# SQLITE_THREADSAFE should pretty much always be defined
# one way or the other, and it must have a value of 0 or 1.
do_test ctime-1.4.1 {
catchsql {
PRAGMA compile_option('SQLITE_THREADSAFE');
SELECT sqlite_compileoption_used('SQLITE_THREADSAFE');
}
} {0 1}
do_test ctime-1.4.2 {
catchsql {
PRAGMA compile_option('THREADSAFE');
SELECT sqlite_compileoption_used('THREADSAFE');
}
} {0 1}
do_test ctime-1.4.3 {
catchsql {
PRAGMA compile_option("THREADSAFE");
}
} {0 1}
do_test ctime-1.4.4 {
catchsql {
PRAGMA compile_option='THREADSAFE';
}
} {0 1}
do_test ctime-1.4.5 {
catchsql {
PRAGMA compile_option="THREADSAFE";
SELECT sqlite_compileoption_used("THREADSAFE");
}
} {0 1}
do_test ctime-1.5 {
set ans1 [ catchsql {
PRAGMA compile_option('THREADSAFE=0');
SELECT sqlite_compileoption_used('THREADSAFE=0');
} ]
set ans2 [ catchsql {
PRAGMA compile_option('THREADSAFE=1');
SELECT sqlite_compileoption_used('THREADSAFE=1');
} ]
lsort [ list $ans1 $ans2 ]
} {{0 0} {0 1}}
do_test ctime-1.6 {
execsql {
PRAGMA compile_option('THREADSAFE=');
SELECT sqlite_compileoption_used('THREADSAFE=');
}
} {0}
do_test ctime-1.7.1 {
execsql {
PRAGMA compile_option('SQLITE_OMIT_COMPILEOPTION_DIAGS');
SELECT sqlite_compileoption_used('SQLITE_OMIT_COMPILEOPTION_DIAGS');
}
} {0}
do_test ctime-1.7.2 {
execsql {
PRAGMA compile_option('OMIT_COMPILEOPTION_DIAGS');
SELECT sqlite_compileoption_used('OMIT_COMPILEOPTION_DIAGS');
}
} {0}
@ -142,66 +111,66 @@ do_test ctime-1.7.2 {
do_test ctime-2.1.1 {
catchsql {
SELECT sqlite_compile_option_used();
SELECT sqlite_compileoption_used();
}
} {1 {wrong number of arguments to function sqlite_compile_option_used()}}
} {1 {wrong number of arguments to function sqlite_compileoption_used()}}
do_test ctime-2.1.2 {
catchsql {
SELECT sqlite_compile_option_used(NULL);
SELECT sqlite_compileoption_used(NULL);
}
} {0 {{}}}
do_test ctime-2.1.3 {
catchsql {
SELECT sqlite_compile_option_used("");
SELECT sqlite_compileoption_used("");
}
} {0 0}
do_test ctime-2.1.4 {
catchsql {
SELECT sqlite_compile_option_used('');
SELECT sqlite_compileoption_used('');
}
} {0 0}
do_test ctime-2.1.5 {
catchsql {
SELECT sqlite_compile_option_used(foo);
SELECT sqlite_compileoption_used(foo);
}
} {1 {no such column: foo}}
do_test ctime-2.1.6 {
catchsql {
SELECT sqlite_compile_option_used('THREADSAFE', 0);
SELECT sqlite_compileoption_used('THREADSAFE', 0);
}
} {1 {wrong number of arguments to function sqlite_compile_option_used()}}
} {1 {wrong number of arguments to function sqlite_compileoption_used()}}
do_test ctime-2.1.7 {
catchsql {
SELECT sqlite_compile_option_used(0);
SELECT sqlite_compileoption_used(0);
}
} {0 0}
do_test ctime-2.1.8 {
catchsql {
SELECT sqlite_compile_option_used('0');
SELECT sqlite_compileoption_used('0');
}
} {0 0}
do_test ctime-2.1.9 {
catchsql {
SELECT sqlite_compile_option_used(1.0);
SELECT sqlite_compileoption_used(1.0);
}
} {0 0}
do_test ctime-2.2.1 {
catchsql {
SELECT sqlite_compile_option_get();
SELECT sqlite_compileoption_get();
}
} {1 {wrong number of arguments to function sqlite_compile_option_get()}}
} {1 {wrong number of arguments to function sqlite_compileoption_get()}}
do_test ctime-2.2.2 {
catchsql {
SELECT sqlite_compile_option_get(0, 0);
SELECT sqlite_compileoption_get(0, 0);
}
} {1 {wrong number of arguments to function sqlite_compile_option_get()}}
} {1 {wrong number of arguments to function sqlite_compileoption_get()}}
# This assumes there is at least 1 compile time option
# (see SQLITE_THREADSAFE above).
do_test ctime-2.3 {
catchsql {
SELECT sqlite_compile_option_used(sqlite_compile_option_get(0));
SELECT sqlite_compileoption_used(sqlite_compileoption_get(0));
}
} {0 1}
@ -209,7 +178,7 @@ do_test ctime-2.3 {
# (see SQLITE_THREADSAFE above).
do_test ctime-2.4 {
set ans [ catchsql {
SELECT sqlite_compile_option_get(0);
SELECT sqlite_compileoption_get(0);
} ]
list [lindex $ans 0]
} {0}
@ -225,10 +194,10 @@ foreach opt $opts {
do_test ctime-2.5.$tc {
set N [ expr {$tc-1} ]
set ans1 [ catchsql {
SELECT sqlite_compile_option_get($N);
SELECT sqlite_compileoption_get($N);
} ]
set ans2 [ catchsql {
SELECT sqlite_compile_option_used($opt);
SELECT sqlite_compileoption_used($opt);
} ]
list [ lindex $ans1 0 ] [ expr { [lindex $ans1 1]==$opt } ] \
[ expr { $ans2 } ]
@ -239,7 +208,7 @@ foreach opt $opts {
do_test ctime-2.5.$tc {
set N [ expr {$tc-1} ]
set ans [ catchsql {
SELECT sqlite_compile_option_get($N);
SELECT sqlite_compileoption_get($N);
} ]
} {0 {{}}}
incr tc 1
@ -247,7 +216,7 @@ incr tc 1
do_test ctime-2.5.$tc {
set N -1
set ans [ catchsql {
SELECT sqlite_compile_option_get($N);
SELECT sqlite_compileoption_get($N);
} ]
} {0 {{}}}