[elephant-devel] strings as Class Indices ?
franks-muc at web.de
franks-muc at web.de
Sun Aug 6 21:13:12 UTC 2006
Thank you for the reply.
This is still on ACL7trial, where elephant works fine and already stores useful data,
except for class indexing, which I tried to introduce now. Up to now I'm iterating through
the main btree stored in root to search by slot value. I'm also using the latest CVS version.
I made no progress in clisp.
The result of the tests (in ACL) is pasted below.
CG-USER(135): (setf ele-tests::*default-spec* '(:clsql (:postgresql-socket "localhost" "clsql-tests" "postgres" "$postgres%")))
(:CLSQL (:POSTGRESQL-SOCKET "localhost" "clsql-tests" "postgres" "$postgres%"))
CG-USER(136): (ele-tests::do-backend-tests)
Doing 111 pending tests of 111 tests total.
ELEPHANT-TESTS::FIXNUMS ELEPHANT-TESTS::FIXNUM-TYPE-1 ELEPHANT-TESTS::BIGNUMS ELEPHANT-TESTS::FLOATS ELEPHANT-TESTS::RATIONALS
ELEPHANT-TESTS::BASE-STRINGS ELEPHANT-TESTS::STRINGS ELEPHANT-TESTS::SYMBOLS ELEPHANT-TESTS::CHARS ELEPHANT-TESTS::PATHNAMES
ELEPHANT-TESTS::CONSES ELEPHANT-TESTS::HASH-TABLES-1 ELEPHANT-TESTS::HASH-TABLES-2 ELEPHANT-TESTS::ARRAYS-1 ELEPHANT-TESTS::ARRAYS-2
ELEPHANT-TESTS::TEST-DEEP-EQUALP ELEPHANT-TESTS::OBJECTS ELEPHANT-TESTS::CIRCULAR ELEPHANT:PERSISTENT
ELEPHANT-TESTS::NON-TRANSIENT-CLASS-SLOT-1 ELEPHANT-TESTS::NON-TRANSIENT-CLASS-SLOT-2 ELEPHANT-TESTS::TRANSIENT-CLASS-SLOT
ELEPHANT-TESTS::CLASS-DEFINERS ELEPHANT-TESTS::BAD-INHERITENCE ELEPHANT-TESTS::MIXES ELEPHANT-TESTS::MIXES-RIGHT-SLOTS ELEPHANT-TESTS::INHERIT
ELEPHANT-TESTS::INHERIT-RIGHT-SLOTS ELEPHANT-TESTS::INITFORM-CLASSES ELEPHANT-TESTS::INITFORM-TEST ELEPHANT-TESTS::INITARG-TEST
ELEPHANT-TESTS::NO-EVAL-INITFORM ELEPHANT-TESTS::REDEFCLASS MAKUNBOUND ELEPHANT-TESTS::UPDATE-CLASS CHANGE-CLASS ELEPHANT-TESTS::CHANGE-CLASS3
ELEPHANT-TESTS::BASICPERSISTENCE ELEPHANT-TESTS::TESTOID ELEPHANT-TESTS::BTREE-MAKE ELEPHANT-TESTS::BTREE-PUT ELEPHANT-TESTS::BTREE-GET
ELEPHANT:REMOVE-KV ELEPHANT-TESTS::REMOVED ELEPHANT:MAP-BTREE ELEPHANT-TESTS::INDEXED-BTREE-MAKE ELEPHANT-TESTS::ADD-INDICES
ELEPHANT-TESTS::TEST-INDICES ELEPHANT-TESTS::INDEXED-PUT ELEPHANT-TESTS::INDEXED-GET ELEPHANT-TESTS::SIMPLE-SLOT-GET
ELEPHANT-TESTS::INDEXED-GET-FROM-SLOT1 ELEPHANT-TESTS::INDEXED-GET-FROM-SLOT2 ELEPHANT-TESTS::REMOVE-KV-INDEXED
ELEPHANT-TESTS::NO-KEY-NOR-INDICES ELEPHANT-TESTS::REMOVE-KV-FROM-SLOT1 ELEPHANT-TESTS::NO-KEY-NOR-INDICES-SLOT1
ELEPHANT-TESTS::REMOVE-KV-FROM-SLOT2 ELEPHANT-TESTS::NO-KEY-NOR-INDICES-SLOT2 ELEPHANT-TESTS::MAP-INDEXED ELEPHANT-TESTS::GET-FIRST
ELEPHANT-TESTS::GET-FIRST2 ELEPHANT-TESTS::GET-LAST ELEPHANT-TESTS::GET-LAST2 SET ELEPHANT-TESTS::SET2 ELEPHANT-TESTS::SET-RANGE
ELEPHANT-TESTS::SET-RANGE2 ELEPHANT-TESTS::REM-KV ELEPHANT-TESTS::REM-IDEXKV ELEPHANT-TESTS::MAKE-INDEXED2 ELEPHANT-TESTS::ADD-INDICES2
ELEPHANT-TESTS::PUT-INDEXED2 ELEPHANT-TESTS::GET-INDEXED2 ELEPHANT-TESTS::GET-FROM-INDEX3 ELEPHANT-TESTS::DUP-TEST ELEPHANT-TESTS::NODUP-TEST
ELEPHANT-TESTS::PREV-NODUP-TEST ELEPHANT-TESTS::PNODUP-TEST ELEPHANT-TESTS::PPREV-NODUP-TEST ELEPHANT-TESTS::CUR-DEL1
ELEPHANT-TESTS::INDEXED-DELETE ELEPHANT-TESTS::TEST-DELETED
Test ELEPHANT-TESTS::INDEXED-DELETE2 failed
Form: (ELEPHANT-TESTS::FINISHES
(ELEPHANT:WITH-TRANSACTION (:STORE-CONTROLLER ELEPHANT:*STORE-CONTROLLER*)
(ELEPHANT:WITH-BTREE-CURSOR (ELEPHANT-TESTS::CURS ELEPHANT-TESTS::INDEX3)
(ELEPHANT:CURSOR-FIRST ELEPHANT-TESTS::CURS)
(ELEPHANT:CURSOR-NEXT-DUP ELEPHANT-TESTS::CURS)
(ELEPHANT:CURSOR-DELETE ELEPHANT-TESTS::CURS))))
Expected value: T
Actual value: NIL.
Test ELEPHANT-TESTS::TEST-DELETED2 failed
Form: (VALUES (ELEPHANT:GET-VALUE 0 ELEPHANT-TESTS::INDEXED2) (ELEPHANT:GET-VALUE 0 ELEPHANT-TESTS::INDEX3)
(ELEPHANT:GET-VALUE 1 ELEPHANT-TESTS::INDEXED2)
(ELEPHANT:WITH-BTREE-CURSOR (ELEPHANT-TESTS::C ELEPHANT-TESTS::INDEX3)
(ELEPHANT:CURSOR-FIRST ELEPHANT-TESTS::C)
(MULTIPLE-VALUE-BIND (ELEPHANT-TESTS::M ELEPHANT-TESTS::K ELEPHANT-TESTS::V)
(ELEPHANT:CURSOR-NEXT ELEPHANT-TESTS::C)
ELEPHANT-TESTS::V)))
Expected values: 0
0
NIL
-2
Actual values: 0
0
-1
-1.
Test ELEPHANT-TESTS::CUR-DEL2 failed
Form: (ELEPHANT:WITH-TRANSACTION (:STORE-CONTROLLER ELEPHANT:*STORE-CONTROLLER*)
(LET* ((ELEPHANT-TESTS::IBT (ELEPHANT:MAKE-INDEXED-BTREE ELEPHANT:*STORE-CONTROLLER*))
(ELEPHANT-TESTS::ID1
(ELEPHANT:ADD-INDEX ELEPHANT-TESTS::IBT :INDEX-NAME 'ELEPHANT-TESTS::IDX1 :KEY-FORM 'ELEPHANT-TESTS::ODD)))
(LOOP ELEPHANT-TESTS::FOR ELEPHANT-TESTS::I ELEPHANT-TESTS::FROM 0 ELEPHANT-TESTS::TO 10 DO
(SETF (ELEPHANT:GET-VALUE ELEPHANT-TESTS::I ELEPHANT-TESTS::IBT) (* ELEPHANT-TESTS::I ELEPHANT-TESTS::I)))
(ELEPHANT:WITH-BTREE-CURSOR (ELEPHANT-TESTS::C ELEPHANT-TESTS::ID1)
(ELEPHANT:CURSOR-FIRST ELEPHANT-TESTS::C)
(ELEPHANT:CURSOR-NEXT-DUP ELEPHANT-TESTS::C)
(ELEPHANT:CURSOR-DELETE ELEPHANT-TESTS::C))
(EQUAL (LIST (ELEPHANT:GET-VALUE 1 ELEPHANT-TESTS::ID1) (ELEPHANT:GET-VALUE 0 ELEPHANT-TESTS::ID1)) '(1 0))))
Expected value: T
Actual value: #<SIMPLE-ERROR @ #x21a4627a>.
ELEPHANT-TESTS::GET-BOTH ELEPHANT-TESTS::PGET-BOTH ELEPHANT-TESTS::PGET-BOTH-RANGE
Test ELEPHANT-TESTS::PCURSOR failed
Form: (ELEPHANT:WITH-BTREE-CURSOR (ELEPHANT-TESTS::C ELEPHANT-TESTS::INDEX3)
(VALUES (ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PFIRST ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT-NODUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT-DUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PPREV ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PPREV-NODUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PLAST ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PSET ELEPHANT-TESTS::C 300))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PSET-RANGE ELEPHANT-TESTS::C 199.5))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PGET-BOTH ELEPHANT-TESTS::C 10 101))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PGET-BOTH-RANGE ELEPHANT-TESTS::C 11 111.4))))
Expected values: 0
2
10
11
10
9
9999
3000
2000
101
112
Actual values: 0
1
10
11
10
9
9999
3000
2000
101
112.
ELEPHANT-TESTS::NEWINDEX
Test ELEPHANT-TESTS::PCURSOR2 failed
Form: (ELEPHANT:WITH-BTREE-CURSOR (ELEPHANT-TESTS::C ELEPHANT-TESTS::INDEX4)
(VALUES (ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PFIRST ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT-NODUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PNEXT-DUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PPREV ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PPREV-NODUP ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PLAST ELEPHANT-TESTS::C))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PSET ELEPHANT-TESTS::C 300))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PSET-RANGE ELEPHANT-TESTS::C 199.5))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PGET-BOTH ELEPHANT-TESTS::C 10 101))
(ELEPHANT-TESTS::PCURSOR-PKEY (ELEPHANT:CURSOR-PGET-BOTH-RANGE ELEPHANT-TESTS::C 11 111.4))))
Expected values: 0
2
10
11
10
9
9999
3000
2000
101
112
Actual values: 0
1
10
11
10
9
9999
3000
2000
101
112.
ELEPHANT-TESTS::ADD-GET-REMOVE ELEPHANT-TESTS::ADD-GET-REMOVE-SYMBOL ELEPHANT-TESTS::EXISTSP
Warning: Manually finalizing class IDX-ONE
ELEPHANT-TESTS::DISABLE-CLASS-INDEXING-TEST ELEPHANT-TESTS::INDEXING-BASIC-TRIVIAL ELEPHANT-TESTS::INDEXING-BASIC
ELEPHANT-TESTS::INDEXING-INHERIT ELEPHANT-TESTS::INDEXING-RANGE ELEPHANT-TESTS::INDEXING-WIPE-INDEX ELEPHANT-TESTS::INDEXING-RECONNECT-DB
ELEPHANT-TESTS::INDEXING-CHANGE-CLASS ELEPHANT-TESTS::INDEXING-REDEF-CLASS
Ranged get of 40/500 objects = Linear: 25.937 sec Indexed: 14.0 sec
ELEPHANT-TESTS::INDEXING-TIMING
Single store mode: ignoring ELEPHANT-TESTS::REMOVE-ELEMENT
Single store mode: ignoring ELEPHANT-TESTS::MIGRATE-BASIC
Single store mode: ignoring ELEPHANT-TESTS::MIGRATE-BTREE
Single store mode: ignoring ELEPHANT-TESTS::MIGRATE-IDX-BTREE
Single store mode: ignoring ELEPHANT-TESTS::MIGRATE-PCLASS
Single store mode: ignoring ELEPHANT-TESTS::MIGRATE-IPCLASS
5 out of 111 total tests failed: ELEPHANT-TESTS::INDEXED-DELETE2, ELEPHANT-TESTS::TEST-DELETED2, ELEPHANT-TESTS::CUR-DEL2,
ELEPHANT-TESTS::PCURSOR, ELEPHANT-TESTS::PCURSOR2.
NIL
CG-USER(137):
> -----Ursprüngliche Nachricht-----
> Von: eslick at media.mit.edu, Elephant bugs and development <elephant-devel at common-lisp.net>
> Gesendet: 06.08.06 21:24:03
> An: Elephant bugs and development <elephant-devel at common-lisp.net>
> Betreff: Re: [elephant-devel] strings as Class Indices ?
> That's interesting, that code works fine on my system.
>
> Have you run the full Elephant regression tests on clisp? Did they all
> pass?
>
> Regards,
> Ian
>
> franks-muc at web.de wrote:
> > I wonder if it is possible to use strings in class indices. The example from the manual
> > using integers works well on my computer (windows,acl-trial,elephant,postgres).
> > I modified this example to use strings:
> >
> > (defclass idx-four ()
> > ((slot1 :initarg :slot1 :accessor slot1 :index t))
> > (:metaclass persistent-metaclass))
> >
> >
> > (defun make-idx-four (val)
> > (make-instance 'idx-four :slot1 val))
> >
> > (with-transaction ()
> > (mapc #'make-idx-four '("1" "1" "1" "2" "2" "4" "5" "5" "5" "6" "10")))
> >
> > (get-instances-by-value 'idx-four 'slot1 "1")
> > ==> NIL
> >
> > I suspect that nil is not the desired result since other examples provided
> > for elephant suggest that strings should work (see (get-instance-by-value 'user 'name name)
> > in http://common-lisp.net/pipermail/elephant-devel/2006-July/000477.html).
> >
> > Could someone please explain where I am wrong ?
> > Thank you in advance!
> > Frank Schorr
> >
> >
> > _____________________________________________________________________
> > Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > http://smartsurfer.web.de/?mc=100071&distributionid=000000000071
> >
> > _______________________________________________
> > elephant-devel site list
> > elephant-devel at common-lisp.net
> > http://common-lisp.net/mailman/listinfo/elephant-devel
> >
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
More information about the elephant-devel
mailing list