title: MySql FOUND_ROWS() returning 195 regardless
body: <p>I'm selecting data from a database by mean of a storedprocedure like this:</p>
  
  <pre><code>CREATE PROCEDURE select(...)
  
  BEGIN
  
  ...
  
  SELECT SQL_CALC_FOUND_ROWS x,y,z, FROM ....;
  
  END
  </code></pre>
  
  <p>and then retrieve the number of rows found by mean of this stored procedure:</p>
  
  <pre><code>CREATE PROCEDURE rows() 
  
  BEGIN
  
      SELECT FOUND_ROWS();
  
  END
  </code></pre>
  
  <p>This works perfectly well when I call both procedures from the command line:</p>
  
  <pre><code>CALL select("x", y, z);
  </code></pre>
  
  <p>yields the correct set of data,</p>
  
  <pre><code>CALL rows;
  </code></pre>
  
  <p>yields the correct number of rows found.</p>
  
  <p>However, when I have a Java application make the calls, rows() consistently returns 195. </p>
  
  <pre><code>if (c != null) {
      try {
          PreparedStatement ps = c.prepareStatement(statement);
          result = new Matrix(ps.executeQuery());
      } catch (SQLException e) {
          errorroutine
      }
  } else errorroutine;
  return result;
  </code></pre>
  
  <p>What's up? Is 195 an error code, if so, why and what for?</p>