From 024097017ce093fb851632c8c95b08c8c2697558 Mon Sep 17 00:00:00 2001
From: PavelBegunkov <asml.Silence@gmail.com>
Date: Tue, 26 Aug 2014 14:05:08 +0400
Subject: [PATCH] fix #9.1

---
 db/StoredProcedures.sql | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/db/StoredProcedures.sql b/db/StoredProcedures.sql
index 4802fd275..b74c31c81 100644
--- a/db/StoredProcedures.sql
+++ b/db/StoredProcedures.sql
@@ -1183,8 +1183,7 @@ BEGIN
 			WHERE 	disciplines.SubjectID = SubjectID 	AND
 					disciplines.SemesterID = semID 		AND
 					(	disciplines_students.Type = 'attach'	OR
-						((disciplines_students.Type IS NULL OR disciplines_students.Type != 'detach') AND 
-						disciplines_groups.StudyGroupID = groupID )
+						((disciplines_students.Type IS NULL OR disciplines_students.Type != 'detach') AND disciplines_groups.StudyGroupID = groupID )
 					)
 			LIMIT 1;
 
@@ -1251,7 +1250,7 @@ BEGIN
 			WHERE 	disciplines.SubjectID = SubjectID 	AND
 					disciplines.SemesterID = semID 		AND
 					(	disciplines_students.Type = 'attach'	OR
-						(disciplines_students.Type != 'detach' AND disciplines_groups.StudyGroupID = groupID )
+						((disciplines_students.Type IS NULL OR disciplines_students.Type != 'detach') AND disciplines_groups.StudyGroupID = groupID )
 					)
 			LIMIT 1;
 
-- 
GitLab