Add experimental collation_list pragma. (CVS 2321)

FossilOrigin-Name: f73a8aa34afd39e0b7df8f22b5c5d2c8d8979a1b
This commit is contained in:
danielk1977 2005-02-09 03:20:37 +00:00
parent 24c8ab8030
commit 48af65aeae
4 changed files with 39 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C Document\sSQLITE_DEFAULT_CACHE_SIZE\sand\sSQLITE_DEFAULT_TEMP_CACHE_SIZE\smacros.\s(CVS\s2320)
D 2005-02-09T01:40:24
C Add\sexperimental\scollation_list\spragma.\s(CVS\s2321)
D 2005-02-09T03:20:37
F Makefile.in d928187101fa3d78426cf48ca30e39d0fb714e57
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@ -54,7 +54,7 @@ F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c d0c1f41b41d2b56a6fd0e1308a66518872f68ed5
F src/pager.h 70d496f372163abb6340f474288c4bb9ea962cf7
F src/parse.y ee046c1ea30425a817285e52fb1993c2f955e766
F src/pragma.c 809b95acd9af67297a5f923a1a57d82179e0ad3a
F src/pragma.c 7e65c5545d83909238adf231e2a6eee6eb43e0d5
F src/printf.c 3d20b21cfecadacecac3fb7274e746cb81d3d357
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c 37dd84fd228db14e9006e3eafb389f08d823502f
@ -163,7 +163,7 @@ F test/pager.test 1579e8f07291ae8e24db62ffade5c101c3e76597
F test/pager2.test 49c0f57c7da0b060f0486b85fdd074025caa694e
F test/pager3.test 647f696a9cf7409df00a1e0047c2eb55585a1b85
F test/pagesize.test 1b826d1608fd86d2303aa895b5586052ad07eba1
F test/pragma.test 4a7a06bfa87fdbf2b9e5d1ab89c8af39ddae09b3
F test/pragma.test 6e675a123a0ee290b7c72842301c60b9d0a2352c
F test/printf.test 92ba4c510b4fc61120ffa4a01820446ed917ae57
F test/progress.test 16496001da445e6534afb94562c286708316d82f x
F test/quick.test 91e5b8ae6663dc9e3e754b271f0384f0cae706e6
@ -270,7 +270,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
P c54ad2123693be8777d80343979e3261c4892105
R 1af2a5239838c226531c539e5c814775
P ddcea6f8891b02e64f96591af161feb55c00a72c
R e466854aaacba808643591e9960883c0
U danielk1977
Z 0212512ce81305fe90a01955b4ef61b6
Z 33af67b6340da3c6cb60fb210dbb411f

View File

@ -1 +1 @@
ddcea6f8891b02e64f96591af161feb55c00a72c
f73a8aa34afd39e0b7df8f22b5c5d2c8d8979a1b

View File

@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.88 2005/02/06 02:45:42 drh Exp $
** $Id: pragma.c,v 1.89 2005/02/09 03:20:37 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -539,6 +539,20 @@ void sqlite3Pragma(
sqlite3VdbeAddOp(v, OP_Callback, 3, 0);
}
}else
if( sqlite3StrICmp(zLeft, "collation_list")==0 ){
int i = 0;
HashElem *p;
sqlite3VdbeSetNumCols(v, 2);
sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC);
sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){
CollSeq *pColl = (CollSeq *)sqliteHashData(p);
sqlite3VdbeAddOp(v, OP_Integer, i++, 0);
sqlite3VdbeOp3(v, OP_String8, 0, 0, pColl->zName, 0);
sqlite3VdbeAddOp(v, OP_Callback, 2, 0);
}
}else
#endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */
#ifndef SQLITE_OMIT_FOREIGN_KEY

View File

@ -12,7 +12,7 @@
#
# This file implements tests for the PRAGMA command.
#
# $Id: pragma.test,v 1.32 2005/01/17 07:53:44 danielk1977 Exp $
# $Id: pragma.test,v 1.33 2005/02/09 03:20:37 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -30,6 +30,7 @@ source $testdir/tester.tcl
# pragma-8.*: Test user_version and schema_version pragmas.
# pragma-9.*: Test temp_store and temp_store_directory.
# pragma-10.*: Test the count_changes pragma in the presence of triggers.
# pragma-11.*: Test the collation_list pragma.
#
# Delete the preexisting database to avoid the special setup
@ -709,6 +710,20 @@ do_test pragma-10.3 {
} ;# ifcapable trigger
ifcapable schema_pragmas {
do_test pragma-11.1 {
execsql2 {
pragma collation_list;
}
} {seq 0 name NOCASE seq 1 name BINARY}
do_test pragma-11.2 {
db collate New_Collation blah...
execsql {
pragma collation_list;
}
} {0 New_Collation 1 NOCASE 2 BINARY}
}
# Reset the sqlite3_temp_directory variable for the next run of tests:
sqlite3 dbX :memory:
dbX eval {PRAGMA temp_store_directory = ""}