Add value check before updating :default slots. auto-increment
authorHolger Schauer <Holger.Schauer@gmx.de>
Thu, 10 Mar 2011 12:34:15 +0000 (13:34 +0100)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 30 Mar 2011 00:27:13 +0000 (18:27 -0600)
sql/oodml.lisp

index d47bbba447ec98914db2b883377c9c941debfdd9..e575d4df66ae7e58bc921badebe500629eb55a85 100644 (file)
        (when (and (slot-exists-p slot 'db-constraints)
                   (listp (view-class-slot-db-constraints slot))
                   (member :default (view-class-slot-db-constraints slot)))
-         (update-slot-from-record obj (slot-definition-name slot))))
+          (unless (and (slot-boundp obj (slot-definition-name slot))
+                       (slot-value obj (slot-definition-name slot)))
+           (update-slot-from-record obj (slot-definition-name slot)))))
       ;;this may just be a NOP.
       (setf (slot-value obj 'view-database) database)))