title: MySqlException: Subquery returns more than 1 row, for a stored procedure with a cursor
body: <p>Hello I have the following stored procedure for MySQL but when it is executed in my ASP.NET Core application I get a Subquery returns more than 1 row error. What am I doing wrong here? The equivalent SQL Server version used to work without problems...</p>
  <pre><code>-- System Calculates Candidate’s Matching Score based on a Manager’s Answer Weights
  CREATE PROCEDURE spSysCalcCandScore
  (
      IN Candidate_ID INT,
      IN Manager_ID INT
  )
  Begin
      DECLARE ansID INT;
      DECLARE tempSum INT;
      DECLARE Sum INT;
      DECLARE Done INT DEFAULT FALSE;
      DECLARE MyCursor CURSOR FOR
      SELECT Answer_ID FROM Completed_Questionnaire
      WHERE Candidate_ID = Candidate_ID;
      DECLARE CONTINUE HANDLER FOR NOT FOUND SET Done = TRUE;
      START TRANSACTION;
          OPEN MyCursor;
          myloop: LOOP
              FETCH  MyCursor INTO ansID;
              IF Done THEN
                  LEAVE myloop;
              END IF;
              SET tempSum = (SELECT Weight_Value FROM Weight WHERE (Answer_ID = ansID AND Manager_ID = Manager_ID));
              SET Sum = Sum + tempSum;
          END LOOP;
          CLOSE MyCursor;
          
          IF (Sum IS NULL) THEN
              SET Sum = 0;
          END IF;
          
          UPDATE `Interest`
          SET Matching_Score = Sum
          WHERE (Candidate_ID = Candidate_ID AND Manager_ID = Manager_ID);
      COMMIT;
  End//
  </code></pre>