Conversation
- Finished the Prologue for importOpenCloseCSV.bat - Changed function call to createOpenCloseStagingTable.sql - Forced execution of all commands to single transaction
|
These look good - I will approve this request once I test these functions with the updated gradebookServer from #30. |
|
I have found one issue with |
|
Following the commit with a note about reverting previous commits, I assume this PR is presently in a suspended state. |
Fixed error where `getSections` would return all courses an Instructor taught
|
The previous reverts were due to an error on my end when I used a remote branch as the origin for the |
|
I have the following observations:
|
Qualified functions for 'gradebook' schema Changed 'Gradebook' to 'gradebook' for some qualified tables and functions
There was a problem hiding this comment.
Looks good. Thanks for your persistence @zbhujwala.
I recommend merging the changes after approvals from all designated reviewers.
Edit: I dismissed this approval following @afig's request for change and my subsequent comment with sample query to use.
There was a problem hiding this comment.
While working on the web client, I came across some issues with the data being produced by these functions.
After taking a look at the code in getInstructorInfo.sql, these issues seem to be the result of improper condition checking. Here is an example query that demonstrates what seems to be the cause of the issues below:
testdb=> SELECT true OR false AND false;
?column?
----------
t
(1 row)
testdb=> SELECT (true OR false) AND false;
?column?
----------
f
(1 row)
In Postgres, AND has a higher precedence than OR, which seems to follow the SQL standard.
Taking a look at the previous comments, it seems that @srrollo had already observed a similar issue in getSections.
getSeasons: seems to return all defined seasons regardless of year or wether an instructor has sections in that year, as long as a valid instructor is given:
For instance, the instructor with ID 480 only has 3 sections of CS110 in Spring 2017, and a section of CS170 in Fall 2099 (the latter for testing purposes) yet the following data is returned:
testdb=> SELECT gradebook.getSeasons(480, 2017);
getseasons
------------------
(0,Spring)
(1,Spring_Break)
(2,Summer)
(3,Fall)
(4,Intersession)
(5 rows)
testdb=> SELECT gradebook.getSeasons(480, 2099);
getseasons
------------------
(0,Spring)
(1,Spring_Break)
(2,Summer)
(3,Fall)
(4,Intersession)
(5 rows)
testdb=> SELECT gradebook.getSeasons(4800, 0);
getseasons
------------
(0 rows)
getCourses: similarly, all courses of a given instructor are returned, regardless of year or season
testdb=> SELECT gradebook.getCourses(480, 2017, 0);
getcourses
------------
CS110
CS170
(1 row)
testdb=> SELECT gradebook.getCourses(480, 2017, 9);
getcourses
------------
CS110
CS170
(1 row)
testdb=> SELECT gradebook.getCourses(480, 2070, 0);
getcourses
------------
CS110
CS170
(1 row)
testdb=> SELECT gradebook.getCourses(4800, 2070, 0);
getcourses
------------
(0 rows)
testdb=> SELECT gradebook.getCourses(4800, 2017, 0);
getcourses
------------
(0 rows)
getSections: all section numbers belonging to sections that an instructor teaches are returned, regardless of year, season, or course
testdb=> SELECT gradebook.getSections(480, 2017, 0, 'CS110');
getsections
-------------
(1106,05)
(1107,72)
(1108,74)
(1110,01)
(4 rows)
--similar results to the previous tests when given invalid parameters
Another small yet important issue
- The
getSeasonsfunction is missing aGradebook.schema qualification when it is being created.
|
Good description @afig. Yes, this issue is related to (but also different from) the issue @srrollo described earlier. In addition to the issue with operator precedence, in general, the queries are missing a join. Here is the query to use in SELECT DISTINCT S."Order", S.Name
FROM Gradebook.Season S JOIN Gradebook.Term T ON S."Order" = T.Season
JOIN Gradebook.Section N ON N.Term = T.ID
WHERE T.Year = year
AND (N.Instructor1 = instructorID
OR N.Instructor2 = instructorID
OR N.Instructor3 = instructorID
)
ORDER BY S."Order"; |
Following @afig's request for changes and my subsequent comment with sample query to use
|
I propose approving this PR with the knowledge of the issues documented in this thread. I believe it is OK to merge the changes because as it is this PR provides the correct DB interface to the web server. If the PR is approved, I will resolve conflicts, merge, and then fix the known issues in a new branch. |
|
I just resolved conflicts (had three easy-to-resolve conflicts). @srrollo Please review and indicate approval or not. If this PR gets your approval as well, I will merge and then create a new branch and fix issues. |
wildtayne
left a comment
There was a problem hiding this comment.
I agree with merging as-is
|
Created Issue #36 to fix known issues in this PR. |
No description provided.