Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase of PR 807: non-blocking behavior for next_result #962

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Apr 14, 2018

  1. change next_result to not block the interpreter

    when actually preforming a multi-statement select with any non-trivial
    components, the `next_result` call will block the ruby interpreter.
    We fix this in two ways:
    
    First, we wrap up the actual mysql_next_result call in a "no-gvl"
    call so that the interpreter can do other work while next_result is
    happening.  Second, we borrow a method from do_query and spin in a
    select() loop on the mysql socket until the query is ready.  A quick
    source dive into the underlying mysql source shows that next_result()
    falls into the same path as mysql_real_query (cli_read_query_result), so
    this should be a safe method.
    Ben Osheroff authored and sodabrew committed Apr 14, 2018
    Configuration menu
    Copy the full SHA
    747946e View commit details
    Browse the repository at this point in the history
  2. pick up violite.h to check for the state where mysql over-reads

    Ben Osheroff authored and sodabrew committed Apr 14, 2018
    Configuration menu
    Copy the full SHA
    a5b1daa View commit details
    Browse the repository at this point in the history
  3. Workaround to avoid including all of violite.h

    Rather than including violite.h to be able to look into the net.vio structure
    to call its has_data function pointer, we borrow the definitions of just two
    functions that understand this structure.
    
    The underlying client library may have pre-read the results from the next
    query, so wait_for_fd would not be triggered. Instead we will ask whether
    the net.vio structure has additional data that hasn't been parsed.
    
    Hack: use knowledge of whether the connecti is SSL or not to call the
    appropriate has_data function and pass net.vio as an opaque structure.
    
    Definitions are from vio_priv.h
    sodabrew committed Apr 14, 2018
    Configuration menu
    Copy the full SHA
    2b11c2f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    61d0900 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2018

  1. Configuration menu
    Copy the full SHA
    7a6dbdd View commit details
    Browse the repository at this point in the history