From sthalik+perec at tehran.lain.pl Thu Jun 26 23:38:03 2008 From: sthalik+perec at tehran.lain.pl (Stanislaw Halik) Date: Fri, 27 Jun 2008 01:38:03 +0200 Subject: [Cl-perec-devel] [patch] check whether e-s-d type is serializable Message-ID: <20080626233803.GA6224@tehran.lain.pl> Heya, After evaluating the following code: (defpclass* test-foo () ((slot-1 :type fixnum))) the image becomes unusable. MAKE-INSTANCE on any class complains about the type even if the class gets purged through #'(setf find-class). Made a patch chat checks SLOT-DEFINITION-TYPE for PERSISTENT-DIRECT-SLOT-DEFINITION by calling UNIT-TYPE-P, thus avoiding botching the image. -- The great peril of our existence lies in the fact that our diet consists entirely of souls. -- Inuit saying -------------- next part -------------- A non-text attachment was scrubbed... Name: perec-serializable-type-test.diff Type: text/x-diff Size: 636 bytes Desc: not available URL: From levente.meszaros at gmail.com Fri Jun 27 08:16:11 2008 From: levente.meszaros at gmail.com (=?ISO-8859-1?Q?Levente_M=E9sz=E1ros?=) Date: Fri, 27 Jun 2008 10:16:11 +0200 Subject: [Cl-perec-devel] [patch] check whether e-s-d type is serializable In-Reply-To: <20080626233803.GA6224@tehran.lain.pl> References: <20080626233803.GA6224@tehran.lain.pl> Message-ID: 2008/6/27 Stanislaw Halik : > Heya, > > After evaluating the following code: > > (defpclass* test-foo () > ((slot-1 :type fixnum))) > > the image becomes unusable. MAKE-INSTANCE on any class complains about > the type even if the class gets purged through #'(setf find-class). > > Made a patch chat checks SLOT-DEFINITION-TYPE for > PERSISTENT-DIRECT-SLOT-DEFINITION by calling UNIT-TYPE-P, thus avoiding > botching the image. Thanks for reporting this bug but I'm not sure this is the correct way to fix it. I pushed a different one which patches unit-type-p and should allow using fixnum as a slot type. BTW we do not use fixnum (that's why it did not work) because that would create a database/application which is not portable accross 32-bit/64-bit servers. levy -- There's no perfectoin From sthalik+perec at tehran.lain.pl Fri Jun 27 13:05:55 2008 From: sthalik+perec at tehran.lain.pl (Stanislaw Halik) Date: Fri, 27 Jun 2008 15:05:55 +0200 Subject: [Cl-perec-devel] [patch] check whether e-s-d type is serializable In-Reply-To: References: <20080626233803.GA6224@tehran.lain.pl> Message-ID: <20080627130555.GA16467@tehran.lain.pl> On Fri, Jun 27, 2008, Levente M?sz?ros wrote: >> After evaluating the following code: >> (defpclass* test-foo () >> ((slot-1 :type fixnum))) >> the image becomes unusable. MAKE-INSTANCE on any class complains about >> the type even if the class gets purged through #'(setf find-class). >> Made a patch chat checks SLOT-DEFINITION-TYPE for >> PERSISTENT-DIRECT-SLOT-DEFINITION by calling UNIT-TYPE-P, thus avoiding >> botching the image. > Thanks for reporting this bug but I'm not sure this is the correct way > to fix it. > I pushed a different one which patches unit-type-p and should allow > using fixnum as a slot type. With the diff applied, using unsupported types (pathname, random-state etc) doesn't break the image anymore. Thanks! -- The great peril of our existence lies in the fact that our diet consists entirely of souls. -- Inuit saying From sthalik+perec at tehran.lain.pl Fri Jun 27 13:16:46 2008 From: sthalik+perec at tehran.lain.pl (Stanislaw Halik) Date: Fri, 27 Jun 2008 15:16:46 +0200 Subject: [Cl-perec-devel] [patch] (select (foo) (from foo)) / (select (foo) (from (foo foo))) inconsistency Message-ID: <20080627131646.GB16467@tehran.lain.pl> Heya, The query structure generated by the query: (select (foo) (from (foo foo))) asserts (typep foo 'foo). The query "(select (foo) (from foo))" doesn't. This has an effect of pulling objects from other classes into the result: PRC> (with-transaction (select (foo) (from foo))) WARNING: *COMPILED-QUERY-CACHE* is unbound, query compiler cache is disabled. See WITH-COMPILED-QUERY-CACHE and MAKE-COMPILED-QUERY-CACHE. (# # # #) With the patch in place, the two queries give identical results. -- The great peril of our existence lies in the fact that our diet consists entirely of souls. -- Inuit saying -------------- next part -------------- A non-text attachment was scrubbed... Name: perec-select-query-missing-assert.diff Type: text/x-diff Size: 1032 bytes Desc: not available URL: From levente.meszaros at gmail.com Fri Jun 27 15:18:38 2008 From: levente.meszaros at gmail.com (=?ISO-8859-1?Q?Levente_M=E9sz=E1ros?=) Date: Fri, 27 Jun 2008 17:18:38 +0200 Subject: [Cl-perec-devel] [patch] (select (foo) (from foo)) / (select (foo) (from (foo foo))) inconsistency In-Reply-To: <20080627131646.GB16467@tehran.lain.pl> References: <20080627131646.GB16467@tehran.lain.pl> Message-ID: 2008/6/27 Stanislaw Halik : > Heya, > > The query structure generated by the query: > > (select (foo) (from (foo foo))) > > asserts (typep foo 'foo). > > The query "(select (foo) (from foo))" doesn't. This has an effect of > pulling objects from other classes into the result: > > PRC> (with-transaction > (select (foo) (from foo))) That's not an accident. When the from clause contains only a symbol (as is in your second query) then it is the name of the query variable which can be used to refer to instances within the where clause, for example: (select (foo) (from foo) (where (and (typep foo 'bar) (baz? foo))) If you don't provide the name of persistent class in the from clause then the variable will scan through all persistent instances. Try: (select (alma) (from alma)) even if you don't have a class named alma you will get all persistent instances. When the from clause is a list of two symbols, then the first is the name and the second is the type. So Hope this helps, levy -- There's no perfectoin