Index: sql/modules/admin.sql
===================================================================
--- sql/modules/admin.sql       (revision 3194)
+++ sql/modules/admin.sql       (working copy)
@@ -358,8 +358,7 @@

             insert into user_preference (id) values (v_user_id);

-            select * from entity_employee where entity_id = in_entity_id;
-            IF NOT FOUND THEN
+            IF NOT exists(SELECT * FROM entity_employee WHERE entity_id = in_entity_id) THEN
                 INSERT into entity_employee (entity_id) values (in_entity_id);
             END IF;
             -- Finally, issue the create user statement
