title: Sqlite persistently executes sql even when conditions are not met
body: <p>Why does this code still add users to sqlite3 db even though <code>len(cursor.fetchall())</code> is greater than 0? </p>
  
  <pre><code>#just for refrence, the issue is in the next block of code
  def get_db():
      db = getattr(g, '_database', None)
      if db is None:
          db = g._database = sqlite3.connect(DATABASE)
      return db
  
  @app.route("/add_user", methods=['POST'])
  def add_user():
      data = request.get_json(force=True)
      cursor = get_db().cursor()
      response = cursor.execute("SELECT * FROM users WHERE email = ?", (data['email'],))
      print('res_length', len(response.fetchall()))
      res_length = len(response.fetchall())
  
      if res_length &gt; 0:
          return jsonify({"message": "User exists"})
      else: #This always executes!!! Why?????
          cursor.execute("INSERT INTO users (name, email, password) VALUES(?, ?, ?)", (data['name'], data['email'], data['password']))
          get_db().commit()
          get_db().close()
          return jsonify({
          "message": "New User added",
          "status": "ok",
          "status_code": 200
          })
  </code></pre>
  
  <p>Using Flask-1.0.3 and Python-3.7.3</p>