Update-slots-from-instance now throws an exception if it generates an update without...
authorRuss Tyndall <russ@acceleration.net>
Thu, 14 May 2009 17:27:38 +0000 (13:27 -0400)
committerNathan Bird <nathan@acceleration.net>
Mon, 20 Jun 2011 20:06:18 +0000 (16:06 -0400)
 prev: 106b55bc15b5118cd328e3ebb6f5f67db3b26206

sql/oodml.lisp

index bb6f447d5841444bc0400e1a7675579b5d3d1a07..466e86a55945fa280a6f3e0a8c7034e304087d00 100644 (file)
                                    (db-value-from-slot s val database))))
                        sds)))
     (cond ((and avps (view-database obj))
-           (update-records (sql-expression :table vct)
-                           :av-pairs avps
-                           :where (key-qualifier-for-instance
-                                   obj :database database)
-                           :database database))
+           (let ((where (key-qualifier-for-instance
+                         obj :database database)))
+             (unless where
+               (error "update-record-from-slots: could not generate a where clause for ~a" obj))
+             (update-records (sql-expression :table vct)
+                             :av-pairs avps
+                             :where where
+                             :database database)))
           ((and avps (not (view-database obj)))
            (insert-records :into (sql-expression :table vct)
                            :av-pairs avps