/* Generated by Cython 0.15.1 on Tue Jun  5 11:44:41 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif

#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__oursql
#define __PYX_HAVE_API__oursql
#include "compat.h"
#include "string.h"
#include "mysql.h"
#include "mysqld_error.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "conversions.pyx",
  "oursql.pyx",
  "util.pyx",
  "connection.pyx",
  "statement.pyx",
  "query.pyx",
  "cursor.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_6oursql__Query;
struct __pyx_obj_6oursql__DictWhateverMixin;
struct __pyx_obj_6oursql_Cursor;
struct __pyx_obj_6oursql__DictQuery;
struct __pyx_obj_6oursql_Connection;
struct __pyx_obj_6oursql__AbstractIterWrapper;
struct __pyx_obj_6oursql_FileWrapper;
struct __pyx_obj_6oursql__ResultSet;
struct __pyx_obj_6oursql_DictCursor;
struct __pyx_obj_6oursql__DBAPITypeObject;
struct __pyx_obj_6oursql__Statement;
struct __pyx_obj_6oursql__ResultStringStream;
struct __pyx_obj_6oursql__BinaryWhateverMixin;
struct __pyx_obj_6oursql_IterWrapper;
union __pyx_t_6oursql_column_data;
union __pyx_t_6oursql_bitfield;
struct __pyx_t_6oursql_column_output;
struct __pyx_opt_args_6oursql_6Cursor__update_fields;

/* "oursql.pyx":15
 * cdef unsigned int UNSIGNED_NUM_FLAG = UNSIGNED_FLAG | NUM_FLAG
 * 
 * cdef union column_data:             # <<<<<<<<<<<<<<
 *     MYSQL_TIME t
 *     long long ll
 */
union __pyx_t_6oursql_column_data {
  MYSQL_TIME t;
  PY_LONG_LONG ll;
  unsigned PY_LONG_LONG ull;
  unsigned long ul;
  Py_ssize_t st;
  long l;
  float f;
  double d;
  char c;
  char dec[65];
  int8_t s8;
  int16_t s16;
  int32_t s32;
  int64_t s64;
  uint8_t u8;
  uint16_t u16;
  uint32_t u32;
  uint64_t u64;
};

/* "oursql.pyx":37
 *     uint64_t u64
 * 
 * cdef union bitfield:             # <<<<<<<<<<<<<<
 *     char c[8]
 *     uint64_t u64
 */
union __pyx_t_6oursql_bitfield {
  char c[8];
  uint64_t u64;
};

/* "oursql.pyx":41
 *     uint64_t u64
 * 
 * cdef struct column_output:             # <<<<<<<<<<<<<<
 *     enum_field_types type
 *     unsigned int flags
 */
struct __pyx_t_6oursql_column_output {
  enum enum_field_types type;
  unsigned int flags;
  int is_binary;
  unsigned long length;
  my_bool is_null;
  my_bool error;
  union __pyx_t_6oursql_column_data buf;
};

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":147
 *         self._update_fields(stmt, rowcount)
 * 
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:             # <<<<<<<<<<<<<<
 *         self.messages.extend(stmt.warnings)
 *         if rowcount is None:
 */
struct __pyx_opt_args_6oursql_6Cursor__update_fields {
  int __pyx_n;
  PyObject *rowcount;
};

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":116
 *         return PyCallIter_New(self.fetchone, None)
 * 
 * cdef class _Query:             # <<<<<<<<<<<<<<
 *     """_Query(...)
 * 
 */
struct __pyx_obj_6oursql__Query {
  PyObject_HEAD
  struct __pyx_vtabstruct_6oursql__Query *__pyx_vtab;
  struct __pyx_obj_6oursql_Connection *conn;
  PyObject *result;
  PyObject *res_a;
  PyObject *res_kw;
  PyObject *rowcount;
  PyObject *lastrowid;
  PyObject *description;
  PyObject *warnings;
  PyObject *has_result;
};


/* "/home/sthorne/src/oursql/oursqlx/util.pyx":45
 *     return ret
 * 
 * cdef class _DictWhateverMixin:             # <<<<<<<<<<<<<<
 *     def fetchone(self):
 *         row = super(_DictWhateverMixin, self).fetchone()
 */
struct __pyx_obj_6oursql__DictWhateverMixin {
  PyObject_HEAD
};


/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":3
 * import collections, itertools
 * 
 * cdef class Cursor:             # <<<<<<<<<<<<<<
 *     """Cursor(...)
 * 
 */
struct __pyx_obj_6oursql_Cursor {
  PyObject_HEAD
  struct __pyx_vtabstruct_6oursql_Cursor *__pyx_vtab;
  PyObject *_statements;
  PyObject *_stmt_kwargs;
  struct __pyx_obj_6oursql_Connection *conn;
  int closed;
  int try_plain_query;
  PyObject *rowcount;
  PyObject *lastrowid;
  PyObject *description;
  PyObject *messages;
  unsigned long arraysize;
};


/* "/home/sthorne/src/oursql/oursqlx/query.pyx":194
 *     {'__module__': __name__})
 * 
 * cdef class _DictQuery(_Query):             # <<<<<<<<<<<<<<
 *     _result_class = _DictResultSet
 */
struct __pyx_obj_6oursql__DictQuery {
  struct __pyx_obj_6oursql__Query __pyx_base;
};


/* "oursql.pyx":77
 * class UnknownError(Error): pass
 * 
 * cdef class Connection             # <<<<<<<<<<<<<<
 * 
 * include "util.pyx"
 */
struct __pyx_obj_6oursql_Connection {
  PyObject_HEAD
  struct __pyx_vtabstruct_6oursql_Connection *__pyx_vtab;
  PyObject *__weakref__;
  MYSQL *conn;
  PyObject *_charset;
  PyObject *_context_cursors;
  int use_unicode;
  int autoping;
  int raise_on_warnings;
  PyObject *default_cursor;
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":8
 * cdef my_ulonglong ull_negone = <my_ulonglong>-1
 * 
 * cdef class _AbstractIterWrapper:             # <<<<<<<<<<<<<<
 *     def __iter__(self):
 *         return self
 */
struct __pyx_obj_6oursql__AbstractIterWrapper {
  PyObject_HEAD
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":43
 *     """})
 * 
 * cdef class FileWrapper(_AbstractIterWrapper):             # <<<<<<<<<<<<<<
 *     """FileWrapper(fileobj, chunksize=8192, doclose=False)
 * 
 */
struct __pyx_obj_6oursql_FileWrapper {
  struct __pyx_obj_6oursql__AbstractIterWrapper __pyx_base;
  PyObject *fileobj;
  PyObject *chunksize;
  PyObject *readfunc;
  int doclose;
  int done;
};


/* "/home/sthorne/src/oursql/oursqlx/query.pyx":4
 * # MySQL, I really do.
 * 
 * cdef class _ResultSet:             # <<<<<<<<<<<<<<
 *     """_ResultSet(...)
 * 
 */
struct __pyx_obj_6oursql__ResultSet {
  PyObject_HEAD
  struct __pyx_vtabstruct_6oursql__ResultSet *__pyx_vtab;
  struct __pyx_obj_6oursql_Connection *conn;
  MYSQL_RES *res;
  unsigned int fields;
  PyObject *conversion_info;
  PyObject *rowcount;
  PyObject *lastrowid;
  PyObject *description;
  PyObject *column_names;
  PyObject *warnings;
  int show_table;
};


/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":265
 *         self.close()
 * 
 * cdef class DictCursor(Cursor):             # <<<<<<<<<<<<<<
 *     """DictCursor(...)
 * 
 */
struct __pyx_obj_6oursql_DictCursor {
  struct __pyx_obj_6oursql_Cursor __pyx_base;
};


/* "oursql.pyx":96
 * connect = Connection
 * 
 * cdef class _DBAPITypeObject:             # <<<<<<<<<<<<<<
 *     cdef readonly object values
 * 
 */
struct __pyx_obj_6oursql__DBAPITypeObject {
  PyObject_HEAD
  PyObject *values;
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":85
 *     """})
 * 
 * cdef class _Statement:             # <<<<<<<<<<<<<<
 *     """_Statement(...)
 * 
 */
struct __pyx_obj_6oursql__Statement {
  PyObject_HEAD
  struct __pyx_vtabstruct_6oursql__Statement *__pyx_vtab;
  PyObject *__weakref__;
  MYSQL_STMT *stmt;
  MYSQL_BIND *bind;
  struct __pyx_t_6oursql_column_output *result_data;
  unsigned int result_fields;
  unsigned int fetched;
  unsigned long cursor_type;
  unsigned long string_limit;
  unsigned long _prefetch_rows;
  int buffered;
  int data_waiting;
  int show_table;
  int exhausted;
  struct __pyx_obj_6oursql_Connection *conn;
  PyObject *warnings;
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":608
 *     {'__module__': __name__})
 * 
 * cdef class _ResultStringStream:             # <<<<<<<<<<<<<<
 *     """_ResultStringStream(...)
 * 
 */
struct __pyx_obj_6oursql__ResultStringStream {
  PyObject_HEAD
  MYSQL_BIND bind;
  struct __pyx_obj_6oursql__Statement *stmt;
  unsigned int index;
  unsigned int stmt_fetched;
  unsigned long offset;
  unsigned long length;
  int done;
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":12
 *         return self
 * 
 * cdef class _BinaryWhateverMixin:             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         ret = super(BinaryFileWrapper, self).next()
 */
struct __pyx_obj_6oursql__BinaryWhateverMixin {
  PyObject_HEAD
};


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":17
 *         return PyBuffer_FromObject(ret, 0, Py_END_OF_BUFFER)
 * 
 * cdef class IterWrapper(_AbstractIterWrapper):             # <<<<<<<<<<<<<<
 *     """IterWrapper(iterobj)
 * 
 */
struct __pyx_obj_6oursql_IterWrapper {
  struct __pyx_obj_6oursql__AbstractIterWrapper __pyx_base;
  PyObject *iterobj;
  PyObject *nextfunc;
};



/* "/home/sthorne/src/oursql/oursqlx/query.pyx":116
 *         return PyCallIter_New(self.fetchone, None)
 * 
 * cdef class _Query:             # <<<<<<<<<<<<<<
 *     """_Query(...)
 * 
 */

struct __pyx_vtabstruct_6oursql__Query {
  int (*_raise_error)(struct __pyx_obj_6oursql__Query *);
};
static struct __pyx_vtabstruct_6oursql__Query *__pyx_vtabptr_6oursql__Query;


/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":85
 *     """})
 * 
 * cdef class _Statement:             # <<<<<<<<<<<<<<
 *     """_Statement(...)
 * 
 */

struct __pyx_vtabstruct_6oursql__Statement {
  int (*_raise_error)(struct __pyx_obj_6oursql__Statement *);
  int (*_check_closed)(struct __pyx_obj_6oursql__Statement *);
  int (*_alloc_buffer)(struct __pyx_obj_6oursql__Statement *);
  int (*_bind_buffer)(struct __pyx_obj_6oursql__Statement *);
};
static struct __pyx_vtabstruct_6oursql__Statement *__pyx_vtabptr_6oursql__Statement;


/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":9
 * }
 * 
 * cdef class Connection:             # <<<<<<<<<<<<<<
 *     """Connection([host, user, passwd,] db=None, port=0, unix_socket=None,
 *         connect_timeout=None, read_timeout=None, write_timeout=None,
 */

struct __pyx_vtabstruct_6oursql_Connection {
  int (*_raise_error)(struct __pyx_obj_6oursql_Connection *);
  int (*_check_closed)(struct __pyx_obj_6oursql_Connection *);
};
static struct __pyx_vtabstruct_6oursql_Connection *__pyx_vtabptr_6oursql_Connection;


/* "/home/sthorne/src/oursql/oursqlx/query.pyx":4
 * # MySQL, I really do.
 * 
 * cdef class _ResultSet:             # <<<<<<<<<<<<<<
 *     """_ResultSet(...)
 * 
 */

struct __pyx_vtabstruct_6oursql__ResultSet {
  int (*_raise_error)(struct __pyx_obj_6oursql__ResultSet *);
  int (*_check_closed)(struct __pyx_obj_6oursql__ResultSet *);
};
static struct __pyx_vtabstruct_6oursql__ResultSet *__pyx_vtabptr_6oursql__ResultSet;


/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":3
 * import collections, itertools
 * 
 * cdef class Cursor:             # <<<<<<<<<<<<<<
 *     """Cursor(...)
 * 
 */

struct __pyx_vtabstruct_6oursql_Cursor {
  int (*_check_closed)(struct __pyx_obj_6oursql_Cursor *);
  int (*_update_fields)(struct __pyx_obj_6oursql_Cursor *, PyObject *, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args);
  int (*_check_statements)(struct __pyx_obj_6oursql_Cursor *);
};
static struct __pyx_vtabstruct_6oursql_Cursor *__pyx_vtabptr_6oursql_Cursor;


/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":265
 *         self.close()
 * 
 * cdef class DictCursor(Cursor):             # <<<<<<<<<<<<<<
 *     """DictCursor(...)
 * 
 */

struct __pyx_vtabstruct_6oursql_DictCursor {
  struct __pyx_vtabstruct_6oursql_Cursor __pyx_base;
};
static struct __pyx_vtabstruct_6oursql_DictCursor *__pyx_vtabptr_6oursql_DictCursor;


/* "/home/sthorne/src/oursql/oursqlx/query.pyx":194
 *     {'__module__': __name__})
 * 
 * cdef class _DictQuery(_Query):             # <<<<<<<<<<<<<<
 *     _result_class = _DictResultSet
 */

struct __pyx_vtabstruct_6oursql__DictQuery {
  struct __pyx_vtabstruct_6oursql__Query __pyx_base;
};
static struct __pyx_vtabstruct_6oursql__DictQuery *__pyx_vtabptr_6oursql__DictQuery;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { 
    return unlikely(b < 0) ? b : !b; 
}
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*); /*proto*/

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) {
#if PY_VERSION_HEX >= 0x02040000
    if (likely(PyList_CheckExact(L))
            /* Check that both the size is positive and no reallocation shrinking needs to be done. */
            && likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        Py_SIZE(L) -= 1;
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
#if PY_VERSION_HEX >= 0x02050000
    else if (Py_TYPE(L) == (&PySet_Type)) {
        return PySet_Pop(L);
    }
#endif
#endif
    return PyObject_CallMethod(L, (char*)"pop", NULL);
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/


static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

#define __pyx_binding_PyCFunctionType_USED 1

typedef struct {
    PyCFunctionObject func;
} __pyx_binding_PyCFunctionType_object;

static PyTypeObject __pyx_binding_PyCFunctionType_type;
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;

static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)

static int __pyx_binding_PyCFunctionType_init(void); /* proto */

#ifndef __PYX_FORCE_INIT_THREADS
  #if PY_VERSION_HEX < 0x02040200
    #define __PYX_FORCE_INIT_THREADS 1
  #else
    #define __PYX_FORCE_INIT_THREADS 0
  #endif
#endif

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_my_ulonglong(my_ulonglong);

#if PY_VERSION_HEX < 0x02050000
#ifndef PyAnySet_CheckExact

#define PyAnySet_CheckExact(ob) \
    ((ob)->ob_type == &PySet_Type || \
     (ob)->ob_type == &PyFrozenSet_Type)

#define PySet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)

#define Pyx_PyFrozenSet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)

#define PySet_Size(anyset) \
    PyObject_Size((anyset))

#define PySet_Contains(anyset, key) \
    PySequence_Contains((anyset), (key))

#define PySet_Pop(set) \
    PyObject_CallMethod(set, (char *)"pop", NULL)

static CYTHON_INLINE int PySet_Clear(PyObject *set) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}

static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}

static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}

#endif /* PyAnySet_CheckExact (<= Py2.4) */

#if PY_VERSION_HEX < 0x02040000
#ifndef Py_SETOBJECT_H
#define Py_SETOBJECT_H

static PyTypeObject *__Pyx_PySet_Type = NULL;
static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL;

#define PySet_Type (*__Pyx_PySet_Type)
#define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type)

#define PyAnySet_Check(ob) \
    (PyAnySet_CheckExact(ob) || \
     PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
     PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))

#define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)

static int __Pyx_Py23SetsImport(void) {
    PyObject *sets=0, *Set=0, *ImmutableSet=0;

    sets = PyImport_ImportModule((char *)"sets");
    if (!sets) goto bad;
    Set = PyObject_GetAttrString(sets, (char *)"Set");
    if (!Set) goto bad;
    ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet");
    if (!ImmutableSet) goto bad;
    Py_DECREF(sets);

    __Pyx_PySet_Type       = (PyTypeObject*) Set;
    __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet;

    return 0;

 bad:
    Py_XDECREF(sets);
    Py_XDECREF(Set);
    Py_XDECREF(ImmutableSet);
    return -1;
}

#else
static int __Pyx_Py23SetsImport(void) { return 0; }
#endif /* !Py_SETOBJECT_H */
#endif /* < Py2.4  */
#endif /* < Py2.5  */

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

/* Module declarations from 'oursql' */
static PyTypeObject *__pyx_ptype_6oursql_Connection = 0;
static PyTypeObject *__pyx_ptype_6oursql__DictWhateverMixin = 0;
static PyTypeObject *__pyx_ptype_6oursql__AbstractIterWrapper = 0;
static PyTypeObject *__pyx_ptype_6oursql__BinaryWhateverMixin = 0;
static PyTypeObject *__pyx_ptype_6oursql_IterWrapper = 0;
static PyTypeObject *__pyx_ptype_6oursql_FileWrapper = 0;
static PyTypeObject *__pyx_ptype_6oursql__Statement = 0;
static PyTypeObject *__pyx_ptype_6oursql__ResultStringStream = 0;
static PyTypeObject *__pyx_ptype_6oursql__ResultSet = 0;
static PyTypeObject *__pyx_ptype_6oursql__Query = 0;
static PyTypeObject *__pyx_ptype_6oursql__DictQuery = 0;
static PyTypeObject *__pyx_ptype_6oursql_Cursor = 0;
static PyTypeObject *__pyx_ptype_6oursql_DictCursor = 0;
static PyTypeObject *__pyx_ptype_6oursql__DBAPITypeObject = 0;
static unsigned int __pyx_v_6oursql_UNSIGNED_NUM_FLAG;
static my_ulonglong __pyx_v_6oursql_ull_negone;
static CYTHON_INLINE MYSQL *__pyx_f_6oursql_mysql_real_connect(MYSQL *, char *, char *, char *, char *, unsigned int, char *, unsigned long); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_ping(MYSQL *); /*proto*/
static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_commit(MYSQL *); /*proto*/
static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_rollback(MYSQL *); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_prepare(MYSQL_STMT *, char *, unsigned long); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch(MYSQL_STMT *); /*proto*/
static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_stmt_send_long_data(MYSQL_STMT *, unsigned int, char *, unsigned long); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch_column(MYSQL_STMT *, MYSQL_BIND *, unsigned int, unsigned long); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_real_query(MYSQL *, char *, unsigned long); /*proto*/
static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_use_result(MYSQL *); /*proto*/
static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_store_result(MYSQL *); /*proto*/
static CYTHON_INLINE int __pyx_f_6oursql_mysql_next_result(MYSQL *); /*proto*/
static CYTHON_INLINE MYSQL_ROW __pyx_f_6oursql_mysql_fetch_row(MYSQL_RES *); /*proto*/
static unsigned long __pyx_f_6oursql_bitval_from_char_p(unsigned char *, Py_ssize_t); /*proto*/
static PyObject *__pyx_f_6oursql_conversion_info_from_res(MYSQL_RES *, int); /*proto*/
static PyObject *__pyx_f_6oursql_description_from_res(MYSQL_RES *, int, int); /*proto*/
#define __Pyx_MODULE_NAME "oursql"
int __pyx_module_is_main_oursql = 0;

/* Implementation of 'oursql' */
static PyObject *__pyx_builtin_buffer;
static PyObject *__pyx_builtin_StandardError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_id;
static char __pyx_k_1[] = "%s.%s";
static char __pyx_k_2[] = "column \"%s\" appears more than once in output";
static char __pyx_k_3[] = "SHOW WARNINGS";
static char __pyx_k_4[] = "_exception_from_errno";
static char __pyx_k_5[] = "unknown kind of warning: %r";
static char __pyx_k_6[] = "CollatedWarningsError";
static char __pyx_k_7[] = "query caused warnings";
static char __pyx_k_9[] = "%Y-%m-%d %H:%M:%S";
static char __pyx_k_10[] = "%Y-%m-%d";
static char __pyx_k_11[] = "%H:%M:%S";
static char __pyx_k_12[] = "shared_memory_base_name";
static char __pyx_k_13[] = "alloc of conn object failed";
static char __pyx_k_15[] = "unknown protocol %r";
static char __pyx_k_16[] = "connection closed";
static char __pyx_k_18[] = "alloc of statement failed";
static char __pyx_k_21[] = "statement closed";
static char __pyx_k_23[] = "string limit must be >= 0";
static char __pyx_k_25[] = "binding this query would cause rows to become unfetchable";
static char __pyx_k_27[] = "alloc of result bind structure failed";
static char __pyx_k_29[] = "alloc of result buffers failed";
static char __pyx_k_31[] = "executing this query would cause rows to become unfetchable";
static char __pyx_k_33[] = "%d parameters expected, %d given";
static char __pyx_k_34[] = "alloc of bind parameters failed";
static char __pyx_k_36[] = "cannot bind %r object";
static char __pyx_k_37[] = "unknown column returned as string";
static char __pyx_k_38[] = "truncated column %d, type %d";
static char __pyx_k_39[] = "must prefetch at least 1 row";
static char __pyx_k_41[] = "";
static char __pyx_k_42[] = "row no longer available from database";
static char __pyx_k_44[] = "can't read negative bytes";
static char __pyx_k_46[] = "size remaining should be >= 0";
static char __pyx_k_48[] = "query closed";
static char __pyx_k_51[] = "cursor closed";
static char __pyx_k_53[] = "use the CALL statement with the execute method to call stored procedures";
static char __pyx_k_56[] = "can't call execute with both parameters and a plain query";
static char __pyx_k_58[] = "no results available";
static char __pyx_k_60[] = "unorderable types: %r and %r";
static char __pyx_k_61[] = "<_DBAPITypeObject representing %r at %#x>";
static char __pyx_k_62[] = "charset -> str\n        \n        Get or set the connection's current encoding. If use_unicode is \n        enabled, this is the encoding that will be used to decode incoming\n        strings.\n        ";
static char __pyx_k_63[] = "oursql python bindings for MySQL.\n\nThis module is a new, better set of MySQL bindings for python, supporting novel\nfeatures like parameterization!\n";
static char __pyx_k_64[] = "Aaron Gallagher <habnabit@gmail.com>";
static char __pyx_k_65[] = "0.9.3.1";
static char __pyx_k_66[] = "_datetime_from_string";
static char __pyx_k_67[] = "BinaryIterWrapper(iterobj)\n    \n    BinaryIterWrapper behaves like IterWrapper, except the strings yielded from\n    the iterable are treated as bytes instead of text strings.\n    ";
static char __pyx_k_68[] = "BinaryFileWrapper(fileobj, chunksize=8192, doclose=False)\n    \n    BinaryFileWrapper behaves exactly like FileWrapper, except the strings \n    yielded from the file object are treated as bytes instead of text strings.\n    ";
static char __pyx_k_69[] = "could not initialize mysql";
static char __pyx_k_71[] = "2.0";
static char __pyx_k__ca[] = "ca";
static char __pyx_k__db[] = "db";
static char __pyx_k__id[] = "id";
static char __pyx_k__tb[] = "tb";
static char __pyx_k__day[] = "day";
static char __pyx_k__exc[] = "exc";
static char __pyx_k__get[] = "get";
static char __pyx_k__key[] = "key";
static char __pyx_k__ssl[] = "ssl";
static char __pyx_k__tcp[] = "tcp";
static char __pyx_k__zip[] = "zip";
static char __pyx_k__DATE[] = "DATE";
static char __pyx_k__Date[] = "Date";
static char __pyx_k__Note[] = "Note";
static char __pyx_k__TIME[] = "TIME";
static char __pyx_k__Time[] = "Time";
static char __pyx_k__cert[] = "cert";
static char __pyx_k__conn[] = "conn";
static char __pyx_k__date[] = "date";
static char __pyx_k__host[] = "host";
static char __pyx_k__hour[] = "hour";
static char __pyx_k__next[] = "next";
static char __pyx_k__ping[] = "ping";
static char __pyx_k__pipe[] = "pipe";
static char __pyx_k__port[] = "port";
static char __pyx_k__read[] = "read";
static char __pyx_k__self[] = "self";
static char __pyx_k__size[] = "size";
static char __pyx_k__stmt[] = "stmt";
static char __pyx_k__time[] = "time";
static char __pyx_k__user[] = "user";
static char __pyx_k__utf8[] = "utf8";
static char __pyx_k__year[] = "year";
static char __pyx_k__Error[] = "Error";
static char __pyx_k__ROWID[] = "ROWID";
static char __pyx_k__clear[] = "clear";
static char __pyx_k__close[] = "close";
static char __pyx_k__deque[] = "deque";
static char __pyx_k__errno[] = "errno";
static char __pyx_k__extra[] = "extra";
static char __pyx_k__index[] = "index";
static char __pyx_k__month[] = "month";
static char __pyx_k__qmark[] = "qmark";
static char __pyx_k__query[] = "query";
static char __pyx_k__super[] = "super";
static char __pyx_k__value[] = "value";
static char __pyx_k__BINARY[] = "BINARY";
static char __pyx_k__Binary[] = "Binary";
static char __pyx_k__NUMBER[] = "NUMBER";
static char __pyx_k__STRING[] = "STRING";
static char __pyx_k__buffer[] = "buffer";
static char __pyx_k__capath[] = "capath";
static char __pyx_k__cipher[] = "cipher";
static char __pyx_k__codecs[] = "codecs";
static char __pyx_k__column[] = "column";
static char __pyx_k__commit[] = "commit";
static char __pyx_k__cursor[] = "cursor";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__errnos[] = "errnos";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__length[] = "length";
static char __pyx_k__memory[] = "memory";
static char __pyx_k__minute[] = "minute";
static char __pyx_k__oursql[] = "oursql";
static char __pyx_k__params[] = "params";
static char __pyx_k__passwd[] = "passwd";
static char __pyx_k__second[] = "second";
static char __pyx_k__socket[] = "socket";
static char __pyx_k__values[] = "values";
static char __pyx_k__Decimal[] = "Decimal";
static char __pyx_k__Warning[] = "Warning";
static char __pyx_k____doc__[] = "__doc__";
static char __pyx_k__charset[] = "charset";
static char __pyx_k__connect[] = "connect";
static char __pyx_k__decimal[] = "decimal";
static char __pyx_k__doclose[] = "doclose";
static char __pyx_k__execute[] = "execute";
static char __pyx_k__fileobj[] = "fileobj";
static char __pyx_k__iterobj[] = "iterobj";
static char __pyx_k__message[] = "message";
static char __pyx_k__nextset[] = "nextset";
static char __pyx_k__popleft[] = "popleft";
static char __pyx_k__prepare[] = "prepare";
static char __pyx_k__DATETIME[] = "DATETIME";
static char __pyx_k__StringIO[] = "StringIO";
static char __pyx_k____exit__[] = "__exit__";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__apilevel[] = "apilevel";
static char __pyx_k__autoping[] = "autoping";
static char __pyx_k__compress[] = "compress";
static char __pyx_k__datetime[] = "datetime";
static char __pyx_k__fetchall[] = "fetchall";
static char __pyx_k__fetchone[] = "fetchone";
static char __pyx_k__procname[] = "procname";
static char __pyx_k__protocol[] = "protocol";
static char __pyx_k__rollback[] = "rollback";
static char __pyx_k__rowcount[] = "rowcount";
static char __pyx_k__strptime[] = "strptime";
static char __pyx_k__warnings[] = "warnings";
static char __pyx_k__DataError[] = "DataError";
static char __pyx_k__TIMESTAMP[] = "TIMESTAMP";
static char __pyx_k__Timestamp[] = "Timestamp";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k____enter__[] = "__enter__";
static char __pyx_k__cStringIO[] = "cStringIO";
static char __pyx_k__chunksize[] = "chunksize";
static char __pyx_k__getreader[] = "getreader";
static char __pyx_k__itertools[] = "itertools";
static char __pyx_k__lastrowid[] = "lastrowid";
static char __pyx_k__localtime[] = "localtime";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____author__[] = "__author__";
static char __pyx_k____module__[] = "__module__";
static char __pyx_k___new_query[] = "_new_query";
static char __pyx_k__connection[] = "connection";
static char __pyx_k__exceptions[] = "exceptions";
static char __pyx_k__found_rows[] = "found_rows";
static char __pyx_k__has_result[] = "has_result";
static char __pyx_k__new_result[] = "new_result";
static char __pyx_k__parambatch[] = "parambatch";
static char __pyx_k__paramstyle[] = "paramstyle";
static char __pyx_k__show_table[] = "show_table";
static char __pyx_k__MemoryError[] = "MemoryError";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__charset_dir[] = "charset_dir";
static char __pyx_k__client_info[] = "client_info";
static char __pyx_k__collections[] = "collections";
static char __pyx_k__description[] = "description";
static char __pyx_k__microsecond[] = "microsecond";
static char __pyx_k__plain_query[] = "plain_query";
static char __pyx_k__unix_socket[] = "unix_socket";
static char __pyx_k__use_unicode[] = "use_unicode";
static char __pyx_k__UnknownError[] = "UnknownError";
static char __pyx_k___conversions[] = "_conversions";
static char __pyx_k___do_autoping[] = "_do_autoping";
static char __pyx_k___query_class[] = "_query_class";
static char __pyx_k__column_names[] = "column_names";
static char __pyx_k__cursor_class[] = "cursor_class";
static char __pyx_k__init_command[] = "init_command";
static char __pyx_k__local_infile[] = "local_infile";
static char __pyx_k__read_timeout[] = "read_timeout";
static char __pyx_k__string_limit[] = "string_limit";
static char __pyx_k__threadsafety[] = "threadsafety";
static char __pyx_k__DatabaseError[] = "DatabaseError";
static char __pyx_k__DateFromTicks[] = "DateFromTicks";
static char __pyx_k__InternalError[] = "InternalError";
static char __pyx_k__StandardError[] = "StandardError";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__TimeFromTicks[] = "TimeFromTicks";
static char __pyx_k___result_class[] = "_result_class";
static char __pyx_k__autoreconnect[] = "autoreconnect";
static char __pyx_k__multi_results[] = "multi_results";
static char __pyx_k__prefetch_rows[] = "prefetch_rows";
static char __pyx_k__warning_count[] = "warning_count";
static char __pyx_k__write_timeout[] = "write_timeout";
static char __pyx_k__IntegrityError[] = "IntegrityError";
static char __pyx_k__InterfaceError[] = "InterfaceError";
static char __pyx_k___DictResultSet[] = "_DictResultSet";
static char __pyx_k___DictStatement[] = "_DictStatement";
static char __pyx_k___escape_string[] = "_escape_string";
static char __pyx_k___new_statement[] = "_new_statement";
static char __pyx_k__buffer_results[] = "buffer_results";
static char __pyx_k__default_cursor[] = "default_cursor";
static char __pyx_k__connect_timeout[] = "connect_timeout";
static char __pyx_k__try_plain_query[] = "try_plain_query";
static char __pyx_k__OperationalError[] = "OperationalError";
static char __pyx_k__PermissionsError[] = "PermissionsError";
static char __pyx_k__ProgrammingError[] = "ProgrammingError";
static char __pyx_k___statement_class[] = "_statement_class";
static char __pyx_k__conversions_dict[] = "conversions_dict";
static char __pyx_k__multi_statements[] = "multi_statements";
static char __pyx_k__BinaryFileWrapper[] = "BinaryFileWrapper";
static char __pyx_k__BinaryIterWrapper[] = "BinaryIterWrapper";
static char __pyx_k__NotSupportedError[] = "NotSupportedError";
static char __pyx_k___date_from_string[] = "_date_from_string";
static char __pyx_k___time_from_string[] = "_time_from_string";
static char __pyx_k__raise_on_warnings[] = "raise_on_warnings";
static char __pyx_k__read_default_file[] = "read_default_file";
static char __pyx_k__report_truncation[] = "report_truncation";
static char __pyx_k__TimestampFromTicks[] = "TimestampFromTicks";
static char __pyx_k___do_warnings_query[] = "_do_warnings_query";
static char __pyx_k___protocol_enum_map[] = "_protocol_enum_map";
static char __pyx_k___setup_ssl_options[] = "_setup_ssl_options";
static char __pyx_k__read_default_group[] = "read_default_group";
static char __pyx_k___bitval_from_string[] = "_bitval_from_string";
static char __pyx_k___exception_enum_map[] = "_exception_enum_map";
static char __pyx_k__require_secure_auth[] = "require_secure_auth";
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_n_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_n_s_4;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_n_s_6;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_61;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_kp_s_65;
static PyObject *__pyx_n_s_66;
static PyObject *__pyx_kp_s_67;
static PyObject *__pyx_kp_s_68;
static PyObject *__pyx_kp_s_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_n_s__BINARY;
static PyObject *__pyx_n_s__Binary;
static PyObject *__pyx_n_s__BinaryFileWrapper;
static PyObject *__pyx_n_s__BinaryIterWrapper;
static PyObject *__pyx_n_s__DATE;
static PyObject *__pyx_n_s__DATETIME;
static PyObject *__pyx_n_s__DataError;
static PyObject *__pyx_n_s__DatabaseError;
static PyObject *__pyx_n_s__Date;
static PyObject *__pyx_n_s__DateFromTicks;
static PyObject *__pyx_n_s__Decimal;
static PyObject *__pyx_n_s__Error;
static PyObject *__pyx_n_s__IntegrityError;
static PyObject *__pyx_n_s__InterfaceError;
static PyObject *__pyx_n_s__InternalError;
static PyObject *__pyx_n_s__MemoryError;
static PyObject *__pyx_n_s__NUMBER;
static PyObject *__pyx_n_s__NotSupportedError;
static PyObject *__pyx_n_s__Note;
static PyObject *__pyx_n_s__OperationalError;
static PyObject *__pyx_n_s__PermissionsError;
static PyObject *__pyx_n_s__ProgrammingError;
static PyObject *__pyx_n_s__ROWID;
static PyObject *__pyx_n_s__STRING;
static PyObject *__pyx_n_s__StandardError;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__StringIO;
static PyObject *__pyx_n_s__TIME;
static PyObject *__pyx_n_s__TIMESTAMP;
static PyObject *__pyx_n_s__Time;
static PyObject *__pyx_n_s__TimeFromTicks;
static PyObject *__pyx_n_s__Timestamp;
static PyObject *__pyx_n_s__TimestampFromTicks;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UnknownError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s__Warning;
static PyObject *__pyx_n_s___DictResultSet;
static PyObject *__pyx_n_s___DictStatement;
static PyObject *__pyx_n_s____author__;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____doc__;
static PyObject *__pyx_n_s____enter__;
static PyObject *__pyx_n_s____exit__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____module__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s___bitval_from_string;
static PyObject *__pyx_n_s___conversions;
static PyObject *__pyx_n_s___date_from_string;
static PyObject *__pyx_n_s___do_autoping;
static PyObject *__pyx_n_s___do_warnings_query;
static PyObject *__pyx_n_s___escape_string;
static PyObject *__pyx_n_s___exception_enum_map;
static PyObject *__pyx_n_s___new_query;
static PyObject *__pyx_n_s___new_statement;
static PyObject *__pyx_n_s___protocol_enum_map;
static PyObject *__pyx_n_s___query_class;
static PyObject *__pyx_n_s___result_class;
static PyObject *__pyx_n_s___setup_ssl_options;
static PyObject *__pyx_n_s___statement_class;
static PyObject *__pyx_n_s___time_from_string;
static PyObject *__pyx_n_s__apilevel;
static PyObject *__pyx_n_s__autoping;
static PyObject *__pyx_n_s__autoreconnect;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__buffer_results;
static PyObject *__pyx_n_s__cStringIO;
static PyObject *__pyx_n_s__ca;
static PyObject *__pyx_n_s__capath;
static PyObject *__pyx_n_s__cert;
static PyObject *__pyx_n_s__charset;
static PyObject *__pyx_n_s__charset_dir;
static PyObject *__pyx_n_s__chunksize;
static PyObject *__pyx_n_s__cipher;
static PyObject *__pyx_n_s__clear;
static PyObject *__pyx_n_s__client_info;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__codecs;
static PyObject *__pyx_n_s__collections;
static PyObject *__pyx_n_s__column;
static PyObject *__pyx_n_s__column_names;
static PyObject *__pyx_n_s__commit;
static PyObject *__pyx_n_s__compress;
static PyObject *__pyx_n_s__conn;
static PyObject *__pyx_n_s__connect;
static PyObject *__pyx_n_s__connect_timeout;
static PyObject *__pyx_n_s__connection;
static PyObject *__pyx_n_s__conversions_dict;
static PyObject *__pyx_n_s__cursor;
static PyObject *__pyx_n_s__cursor_class;
static PyObject *__pyx_n_s__date;
static PyObject *__pyx_n_s__datetime;
static PyObject *__pyx_n_s__day;
static PyObject *__pyx_n_s__db;
static PyObject *__pyx_n_s__decimal;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__default_cursor;
static PyObject *__pyx_n_s__deque;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__doclose;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__errno;
static PyObject *__pyx_n_s__errnos;
static PyObject *__pyx_n_s__exc;
static PyObject *__pyx_n_s__exceptions;
static PyObject *__pyx_n_s__execute;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__extra;
static PyObject *__pyx_n_s__fetchall;
static PyObject *__pyx_n_s__fetchone;
static PyObject *__pyx_n_s__fileobj;
static PyObject *__pyx_n_s__found_rows;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__getreader;
static PyObject *__pyx_n_s__has_result;
static PyObject *__pyx_n_s__host;
static PyObject *__pyx_n_s__hour;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__init_command;
static PyObject *__pyx_n_s__iterobj;
static PyObject *__pyx_n_s__itertools;
static PyObject *__pyx_n_s__key;
static PyObject *__pyx_n_s__lastrowid;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__local_infile;
static PyObject *__pyx_n_s__localtime;
static PyObject *__pyx_n_s__memory;
static PyObject *__pyx_n_s__message;
static PyObject *__pyx_n_s__microsecond;
static PyObject *__pyx_n_s__minute;
static PyObject *__pyx_n_s__month;
static PyObject *__pyx_n_s__multi_results;
static PyObject *__pyx_n_s__multi_statements;
static PyObject *__pyx_n_s__new_result;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__nextset;
static PyObject *__pyx_n_s__oursql;
static PyObject *__pyx_n_s__parambatch;
static PyObject *__pyx_n_s__params;
static PyObject *__pyx_n_s__paramstyle;
static PyObject *__pyx_n_s__passwd;
static PyObject *__pyx_n_s__ping;
static PyObject *__pyx_n_s__pipe;
static PyObject *__pyx_n_s__plain_query;
static PyObject *__pyx_n_s__popleft;
static PyObject *__pyx_n_s__port;
static PyObject *__pyx_n_s__prefetch_rows;
static PyObject *__pyx_n_s__prepare;
static PyObject *__pyx_n_s__procname;
static PyObject *__pyx_n_s__protocol;
static PyObject *__pyx_n_s__qmark;
static PyObject *__pyx_n_s__query;
static PyObject *__pyx_n_s__raise_on_warnings;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__read_default_file;
static PyObject *__pyx_n_s__read_default_group;
static PyObject *__pyx_n_s__read_timeout;
static PyObject *__pyx_n_s__report_truncation;
static PyObject *__pyx_n_s__require_secure_auth;
static PyObject *__pyx_n_s__rollback;
static PyObject *__pyx_n_s__rowcount;
static PyObject *__pyx_n_s__second;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__show_table;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__socket;
static PyObject *__pyx_n_s__ssl;
static PyObject *__pyx_n_s__stmt;
static PyObject *__pyx_n_s__string_limit;
static PyObject *__pyx_n_s__strptime;
static PyObject *__pyx_n_s__super;
static PyObject *__pyx_n_s__tb;
static PyObject *__pyx_n_s__tcp;
static PyObject *__pyx_n_s__threadsafety;
static PyObject *__pyx_n_s__time;
static PyObject *__pyx_n_s__try_plain_query;
static PyObject *__pyx_n_s__unix_socket;
static PyObject *__pyx_n_s__use_unicode;
static PyObject *__pyx_n_s__user;
static PyObject *__pyx_n_s__utf8;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__values;
static PyObject *__pyx_n_s__warning_count;
static PyObject *__pyx_n_s__warnings;
static PyObject *__pyx_n_s__write_timeout;
static PyObject *__pyx_n_s__year;
static PyObject *__pyx_n_s__zip;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_63;
static PyObject *__pyx_int_8192;
static PyObject *__pyx_k_55;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_70;

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":5
 * # duplication of functions.
 * 
 * cdef inline MYSQL *mysql_real_connect(             # <<<<<<<<<<<<<<
 *         MYSQL *conn, char *host, char *user, char *passwd, char *db,
 *         unsigned int port, char *unix_socket, unsigned long client_flag):
 */

static CYTHON_INLINE MYSQL *__pyx_f_6oursql_mysql_real_connect(MYSQL *__pyx_v_conn, char *__pyx_v_host, char *__pyx_v_user, char *__pyx_v_passwd, char *__pyx_v_db, unsigned int __pyx_v_port, char *__pyx_v_unix_socket, unsigned long __pyx_v_client_flag) {
  MYSQL *__pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_real_connect");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":8
 *         MYSQL *conn, char *host, char *user, char *passwd, char *db,
 *         unsigned int port, char *unix_socket, unsigned long client_flag):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_real_connect(conn, host, user, passwd, db, port,
 *             unix_socket, client_flag)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":10
 *     with nogil:
 *         return _mysql_real_connect(conn, host, user, passwd, db, port,
 *             unix_socket, client_flag)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_ping(MYSQL *conn):
 */
        __pyx_r = mysql_real_connect(__pyx_v_conn, __pyx_v_host, __pyx_v_user, __pyx_v_passwd, __pyx_v_db, __pyx_v_port, __pyx_v_unix_socket, __pyx_v_client_flag);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":8
 *         MYSQL *conn, char *host, char *user, char *passwd, char *db,
 *         unsigned int port, char *unix_socket, unsigned long client_flag):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_real_connect(conn, host, user, passwd, db, port,
 *             unix_socket, client_flag)
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":12
 *             unix_socket, client_flag)
 * 
 * cdef inline int mysql_ping(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_ping(conn)
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_ping(MYSQL *__pyx_v_conn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_ping");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":13
 * 
 * cdef inline int mysql_ping(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_ping(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":14
 * cdef inline int mysql_ping(MYSQL *conn):
 *     with nogil:
 *         return _mysql_ping(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 */
        __pyx_r = mysql_ping(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":13
 * 
 * cdef inline int mysql_ping(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_ping(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":16
 *         return _mysql_ping(conn)
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_commit(conn)
 */

static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_commit(MYSQL *__pyx_v_conn) {
  my_bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_commit");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":17
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_commit(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":18
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 *     with nogil:
 *         return _mysql_commit(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 */
        __pyx_r = mysql_commit(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":17
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_commit(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":20
 *         return _mysql_commit(conn)
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_rollback(conn)
 */

static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_rollback(MYSQL *__pyx_v_conn) {
  my_bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_rollback");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":21
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_rollback(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":22
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 *     with nogil:
 *         return _mysql_rollback(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt,
 */
        __pyx_r = mysql_rollback(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":21
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_rollback(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":24
 *         return _mysql_rollback(conn)
 * 
 * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt,             # <<<<<<<<<<<<<<
 *         char *stmt_str, unsigned long length):
 *     with nogil:
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_prepare(MYSQL_STMT *__pyx_v_stmt, char *__pyx_v_stmt_str, unsigned long __pyx_v_length) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_prepare");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":26
 * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt,
 *         char *stmt_str, unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_prepare(stmt, stmt_str, length)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":27
 *         char *stmt_str, unsigned long length):
 *     with nogil:
 *         return _mysql_stmt_prepare(stmt, stmt_str, length)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 */
        __pyx_r = mysql_stmt_prepare(__pyx_v_stmt, __pyx_v_stmt_str, __pyx_v_length);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":26
 * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt,
 *         char *stmt_str, unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_prepare(stmt, stmt_str, length)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":29
 *         return _mysql_stmt_prepare(stmt, stmt_str, length)
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_stmt_execute(stmt)
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *__pyx_v_stmt) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_execute");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":30
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_execute(stmt)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":31
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:
 *         return _mysql_stmt_execute(stmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt):
 */
        __pyx_r = mysql_stmt_execute(__pyx_v_stmt);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":30
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_execute(stmt)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":33
 *         return _mysql_stmt_execute(stmt)
 * 
 * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_stmt_fetch(stmt)
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch(MYSQL_STMT *__pyx_v_stmt) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_fetch");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":34
 * 
 * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_fetch(stmt)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":35
 * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt):
 *     with nogil:
 *         return _mysql_stmt_fetch(stmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,
 */
        __pyx_r = mysql_stmt_fetch(__pyx_v_stmt);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":34
 * 
 * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_fetch(stmt)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":37
 *         return _mysql_stmt_fetch(stmt)
 * 
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,             # <<<<<<<<<<<<<<
 *         unsigned int index, char *data, unsigned long length):
 *     with nogil:
 */

static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_stmt_send_long_data(MYSQL_STMT *__pyx_v_stmt, unsigned int __pyx_v_index, char *__pyx_v_data, unsigned long __pyx_v_length) {
  my_bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_send_long_data");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":39
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,
 *         unsigned int index, char *data, unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_send_long_data(stmt, index, data, length)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":40
 *         unsigned int index, char *data, unsigned long length):
 *     with nogil:
 *         return _mysql_stmt_send_long_data(stmt, index, data, length)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt,
 */
        __pyx_r = mysql_stmt_send_long_data(__pyx_v_stmt, __pyx_v_index, __pyx_v_data, __pyx_v_length);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":39
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,
 *         unsigned int index, char *data, unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_send_long_data(stmt, index, data, length)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":42
 *         return _mysql_stmt_send_long_data(stmt, index, data, length)
 * 
 * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt,             # <<<<<<<<<<<<<<
 *         MYSQL_BIND *bind, unsigned int column, unsigned long offset):
 *     with nogil:
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch_column(MYSQL_STMT *__pyx_v_stmt, MYSQL_BIND *__pyx_v_bind, unsigned int __pyx_v_column, unsigned long __pyx_v_offset) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_fetch_column");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":44
 * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt,
 *         MYSQL_BIND *bind, unsigned int column, unsigned long offset):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_fetch_column(stmt, bind, column, offset)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":45
 *         MYSQL_BIND *bind, unsigned int column, unsigned long offset):
 *     with nogil:
 *         return _mysql_stmt_fetch_column(stmt, bind, column, offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 */
        __pyx_r = mysql_stmt_fetch_column(__pyx_v_stmt, __pyx_v_bind, __pyx_v_column, __pyx_v_offset);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":44
 * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt,
 *         MYSQL_BIND *bind, unsigned int column, unsigned long offset):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_fetch_column(stmt, bind, column, offset)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":47
 *         return _mysql_stmt_fetch_column(stmt, bind, column, offset)
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_stmt_store_result(stmt)
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *__pyx_v_stmt) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_stmt_store_result");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":48
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_store_result(stmt)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":49
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:
 *         return _mysql_stmt_store_result(stmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str,
 */
        __pyx_r = mysql_stmt_store_result(__pyx_v_stmt);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":48
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_store_result(stmt)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":51
 *         return _mysql_stmt_store_result(stmt)
 * 
 * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str,             # <<<<<<<<<<<<<<
 *         unsigned long length):
 *     with nogil:
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_real_query(MYSQL *__pyx_v_conn, char *__pyx_v_stmt_str, unsigned long __pyx_v_length) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_real_query");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":53
 * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str,
 *         unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_real_query(conn, stmt_str, length)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":54
 *         unsigned long length):
 *     with nogil:
 *         return _mysql_real_query(conn, stmt_str, length)             # <<<<<<<<<<<<<<
 * 
 * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn):
 */
        __pyx_r = mysql_real_query(__pyx_v_conn, __pyx_v_stmt_str, __pyx_v_length);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":53
 * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str,
 *         unsigned long length):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_real_query(conn, stmt_str, length)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":56
 *         return _mysql_real_query(conn, stmt_str, length)
 * 
 * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_use_result(conn)
 */

static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_use_result(MYSQL *__pyx_v_conn) {
  MYSQL_RES *__pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_use_result");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":57
 * 
 * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_use_result(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":58
 * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn):
 *     with nogil:
 *         return _mysql_use_result(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn):
 */
        __pyx_r = mysql_use_result(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":57
 * 
 * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_use_result(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":60
 *         return _mysql_use_result(conn)
 * 
 * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_store_result(conn)
 */

static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_store_result(MYSQL *__pyx_v_conn) {
  MYSQL_RES *__pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_store_result");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":61
 * 
 * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_store_result(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":62
 * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn):
 *     with nogil:
 *         return _mysql_store_result(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int mysql_next_result(MYSQL *conn):
 */
        __pyx_r = mysql_store_result(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":61
 * 
 * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_store_result(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":64
 *         return _mysql_store_result(conn)
 * 
 * cdef inline int mysql_next_result(MYSQL *conn):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_next_result(conn)
 */

static CYTHON_INLINE int __pyx_f_6oursql_mysql_next_result(MYSQL *__pyx_v_conn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_next_result");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":65
 * 
 * cdef inline int mysql_next_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_next_result(conn)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":66
 * cdef inline int mysql_next_result(MYSQL *conn):
 *     with nogil:
 *         return _mysql_next_result(conn)             # <<<<<<<<<<<<<<
 * 
 * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result):
 */
        __pyx_r = mysql_next_result(__pyx_v_conn);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":65
 * 
 * cdef inline int mysql_next_result(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_next_result(conn)
 * 
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":68
 *         return _mysql_next_result(conn)
 * 
 * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         return _mysql_fetch_row(result)
 */

static CYTHON_INLINE MYSQL_ROW __pyx_f_6oursql_mysql_fetch_row(MYSQL_RES *__pyx_v_result) {
  MYSQL_ROW __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mysql_fetch_row");

  /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":69
 * 
 * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_fetch_row(result)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save = NULL;
      #endif
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":70
 * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result):
 *     with nogil:
 *         return _mysql_fetch_row(result)             # <<<<<<<<<<<<<<
 */
        __pyx_r = mysql_fetch_row(__pyx_v_result);
        goto __pyx_L3;
      }

      /* "/home/sthorne/src/oursql/oursqlx/nogil.pyx":69
 * 
 * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_fetch_row(result)
 */
      /*finally:*/ {
        int __pyx_why;
        __pyx_why = 0; goto __pyx_L5;
        __pyx_L3: __pyx_why = 3; goto __pyx_L5;
        __pyx_L5:;
        Py_BLOCK_THREADS
        switch (__pyx_why) {
          case 3: goto __pyx_L0;
        }
      }
  }

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oursql.pyx":56
 * 
 * class Error(exceptions.StandardError):
 *     def __init__(self, message, errno=None, extra=None):             # <<<<<<<<<<<<<<
 *         StandardError.__init__(self, errno, message, extra)
 *         self.errno = errno
 */

static PyObject *__pyx_pf_6oursql_5Error___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_5Error___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_6oursql_5Error___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_5Error___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_errno = 0;
  PyObject *__pyx_v_extra = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__message,&__pyx_n_s__errno,&__pyx_n_s__extra,0};
  __Pyx_RefNannySetupContext("__init__");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__message);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errno);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__extra);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_errno = values[2];
    __pyx_v_extra = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "oursql.pyx":57
 * class Error(exceptions.StandardError):
 *     def __init__(self, message, errno=None, extra=None):
 *         StandardError.__init__(self, errno, message, extra)             # <<<<<<<<<<<<<<
 *         self.errno = errno
 *         self.extra = extra
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_builtin_StandardError, __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_errno);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_errno);
  __Pyx_GIVEREF(__pyx_v_errno);
  __Pyx_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_message);
  __Pyx_GIVEREF(__pyx_v_message);
  __Pyx_INCREF(__pyx_v_extra);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_extra);
  __Pyx_GIVEREF(__pyx_v_extra);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "oursql.pyx":58
 *     def __init__(self, message, errno=None, extra=None):
 *         StandardError.__init__(self, errno, message, extra)
 *         self.errno = errno             # <<<<<<<<<<<<<<
 *         self.extra = extra
 * 
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__errno, __pyx_v_errno) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":59
 *         StandardError.__init__(self, errno, message, extra)
 *         self.errno = errno
 *         self.extra = extra             # <<<<<<<<<<<<<<
 * 
 * class InterfaceError(Error): pass
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__extra, __pyx_v_extra) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":1
 * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     cdef unsigned long ret = 0
 */

static unsigned long __pyx_f_6oursql_bitval_from_char_p(unsigned char *__pyx_v_s, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  unsigned long __pyx_v_ret;
  unsigned long __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __Pyx_RefNannySetupContext("bitval_from_char_p");

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":3
 * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length):
 *     cdef Py_ssize_t i
 *     cdef unsigned long ret = 0             # <<<<<<<<<<<<<<
 *     for 0 <= i < length:
 *         ret = (ret << 8) | s[i]
 */
  __pyx_v_ret = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":4
 *     cdef Py_ssize_t i
 *     cdef unsigned long ret = 0
 *     for 0 <= i < length:             # <<<<<<<<<<<<<<
 *         ret = (ret << 8) | s[i]
 *     return ret
 */
  __pyx_t_1 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":5
 *     cdef unsigned long ret = 0
 *     for 0 <= i < length:
 *         ret = (ret << 8) | s[i]             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
    __pyx_v_ret = ((__pyx_v_ret << 8) | (__pyx_v_s[__pyx_v_i]));
  }

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":6
 *     for 0 <= i < length:
 *         ret = (ret << 8) | s[i]
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * cdef object conversion_info_from_res(MYSQL_RES *res, int fields):
 */
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":8
 *     return ret
 * 
 * cdef object conversion_info_from_res(MYSQL_RES *res, int fields):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef MYSQL_FIELD *field
 */

static PyObject *__pyx_f_6oursql_conversion_info_from_res(MYSQL_RES *__pyx_v_res, int __pyx_v_fields) {
  int __pyx_v_i;
  MYSQL_FIELD *__pyx_v_field;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("conversion_info_from_res");

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":11
 *     cdef int i
 *     cdef MYSQL_FIELD *field
 *     ret = PyList_New(fields)             # <<<<<<<<<<<<<<
 *     for 0 <= i < fields:
 *         field = mysql_fetch_field_direct(res, i)
 */
  __pyx_t_1 = PyList_New(__pyx_v_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":12
 *     cdef MYSQL_FIELD *field
 *     ret = PyList_New(fields)
 *     for 0 <= i < fields:             # <<<<<<<<<<<<<<
 *         field = mysql_fetch_field_direct(res, i)
 *         data = (
 */
  __pyx_t_2 = __pyx_v_fields;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":13
 *     ret = PyList_New(fields)
 *     for 0 <= i < fields:
 *         field = mysql_fetch_field_direct(res, i)             # <<<<<<<<<<<<<<
 *         data = (
 *             field.type,
 */
    __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":15
 *         field = mysql_fetch_field_direct(res, i)
 *         data = (
 *             field.type,             # <<<<<<<<<<<<<<
 *             field.flags,
 *             field.charsetnr)
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_field->type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":16
 *         data = (
 *             field.type,
 *             field.flags,             # <<<<<<<<<<<<<<
 *             field.charsetnr)
 *         Py_INCREF(data)
 */
    __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_field->flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":17
 *             field.type,
 *             field.flags,
 *             field.charsetnr)             # <<<<<<<<<<<<<<
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)
 */
    __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_field->charsetnr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_data));
    __pyx_v_data = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":18
 *             field.flags,
 *             field.charsetnr)
 *         Py_INCREF(data)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(ret, i, data)
 *     return ret
 */
    Py_INCREF(((PyObject *)__pyx_v_data));

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":19
 *             field.charsetnr)
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
    PyList_SET_ITEM(__pyx_v_ret, __pyx_v_i, ((PyObject *)__pyx_v_data));
  }

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":20
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * cdef object description_from_res(MYSQL_RES *res, int fields, bint show_table):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql.conversion_info_from_res", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":22
 *     return ret
 * 
 * cdef object description_from_res(MYSQL_RES *res, int fields, bint show_table):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef MYSQL_FIELD *field
 */

static PyObject *__pyx_f_6oursql_description_from_res(MYSQL_RES *__pyx_v_res, int __pyx_v_fields, int __pyx_v_show_table) {
  int __pyx_v_i;
  MYSQL_FIELD *__pyx_v_field;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("description_from_res");

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":25
 *     cdef int i
 *     cdef MYSQL_FIELD *field
 *     ret = PyList_New(fields)             # <<<<<<<<<<<<<<
 *     for 0 <= i < fields:
 *         field = mysql_fetch_field_direct(res, i)
 */
  __pyx_t_1 = PyList_New(__pyx_v_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":26
 *     cdef MYSQL_FIELD *field
 *     ret = PyList_New(fields)
 *     for 0 <= i < fields:             # <<<<<<<<<<<<<<
 *         field = mysql_fetch_field_direct(res, i)
 *         if show_table and field.table[0] != 0:
 */
  __pyx_t_2 = __pyx_v_fields;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":27
 *     ret = PyList_New(fields)
 *     for 0 <= i < fields:
 *         field = mysql_fetch_field_direct(res, i)             # <<<<<<<<<<<<<<
 *         if show_table and field.table[0] != 0:
 *             name = PyString_FromFormat("%s.%s",
 */
    __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":28
 *     for 0 <= i < fields:
 *         field = mysql_fetch_field_direct(res, i)
 *         if show_table and field.table[0] != 0:             # <<<<<<<<<<<<<<
 *             name = PyString_FromFormat("%s.%s",
 *                 field.table, field.name)
 */
    if (__pyx_v_show_table) {
      __pyx_t_3 = ((__pyx_v_field->table[0]) != 0);
      __pyx_t_4 = __pyx_t_3;
    } else {
      __pyx_t_4 = __pyx_v_show_table;
    }
    if (__pyx_t_4) {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":30
 *         if show_table and field.table[0] != 0:
 *             name = PyString_FromFormat("%s.%s",
 *                 field.table, field.name)             # <<<<<<<<<<<<<<
 *         else:
 *             name = field.name
 */
      __pyx_t_1 = PyString_FromFormat(__pyx_k_1, __pyx_v_field->table, __pyx_v_field->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":32
 *                 field.table, field.name)
 *         else:
 *             name = field.name             # <<<<<<<<<<<<<<
 *         data = (
 *             name,
 */
      __pyx_t_1 = PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_XDECREF(__pyx_v_name);
      __pyx_v_name = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":35
 *         data = (
 *             name,
 *             field.type,             # <<<<<<<<<<<<<<
 *             field.max_length,
 *             field.length,
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_field->type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":36
 *             name,
 *             field.type,
 *             field.max_length,             # <<<<<<<<<<<<<<
 *             field.length,
 *             field.length,
 */
    __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_field->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":37
 *             field.type,
 *             field.max_length,
 *             field.length,             # <<<<<<<<<<<<<<
 *             field.length,
 *             field.decimals,
 */
    __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_field->length); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":38
 *             field.max_length,
 *             field.length,
 *             field.length,             # <<<<<<<<<<<<<<
 *             field.decimals,
 *             field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG)
 */
    __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_field->length); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":39
 *             field.length,
 *             field.length,
 *             field.decimals,             # <<<<<<<<<<<<<<
 *             field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG)
 *         Py_INCREF(data)
 */
    __pyx_t_8 = PyLong_FromUnsignedLong(__pyx_v_field->decimals); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":40
 *             field.length,
 *             field.decimals,
 *             field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG)             # <<<<<<<<<<<<<<
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)
 */
    __pyx_t_9 = __Pyx_PyBool_FromLong(((__pyx_v_field->flags & NOT_NULL_FLAG) != NOT_NULL_FLAG)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    __Pyx_INCREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_data));
    __pyx_v_data = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":41
 *             field.decimals,
 *             field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG)
 *         Py_INCREF(data)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(ret, i, data)
 *     return ret
 */
    Py_INCREF(((PyObject *)__pyx_v_data));

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":42
 *             field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG)
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
    PyList_SET_ITEM(__pyx_v_ret, __pyx_v_i, ((PyObject *)__pyx_v_data));
  }

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":43
 *         Py_INCREF(data)
 *         PyList_SET_ITEM(ret, i, data)
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * cdef class _DictWhateverMixin:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("oursql.description_from_res", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":46
 * 
 * cdef class _DictWhateverMixin:
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         row = super(_DictWhateverMixin, self).fetchone()
 *         if row is None:
 */

static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone");

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":47
 * cdef class _DictWhateverMixin:
 *     def fetchone(self):
 *         row = super(_DictWhateverMixin, self).fetchone()             # <<<<<<<<<<<<<<
 *         if row is None:
 *             return None
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_row = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":48
 *     def fetchone(self):
 *         row = super(_DictWhateverMixin, self).fetchone()
 *         if row is None:             # <<<<<<<<<<<<<<
 *             return None
 *         ret = {}
 */
  __pyx_t_3 = (__pyx_v_row == Py_None);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":49
 *         row = super(_DictWhateverMixin, self).fetchone()
 *         if row is None:
 *             return None             # <<<<<<<<<<<<<<
 *         ret = {}
 *         for name, value in zip(self.column_names, row):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":50
 *         if row is None:
 *             return None
 *         ret = {}             # <<<<<<<<<<<<<<
 *         for name, value in zip(self.column_names, row):
 *             if name in ret:
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_ret = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":51
 *             return None
 *         ret = {}
 *         for name, value in zip(self.column_names, row):             # <<<<<<<<<<<<<<
 *             if name in ret:
 *                 if ret[name] != value:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__column_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L9_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_name);
    __pyx_v_name = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":52
 *         ret = {}
 *         for name, value in zip(self.column_names, row):
 *             if name in ret:             # <<<<<<<<<<<<<<
 *                 if ret[name] != value:
 *                     raise ProgrammingError('column "%s" appears more than once'
 */
    if (unlikely(((PyObject *)__pyx_v_ret) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = ((PyDict_Contains(((PyObject *)__pyx_v_ret), __pyx_v_name))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":53
 *         for name, value in zip(self.column_names, row):
 *             if name in ret:
 *                 if ret[name] != value:             # <<<<<<<<<<<<<<
 *                     raise ProgrammingError('column "%s" appears more than once'
 *                         ' in output' % name)
 */
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_ret), __pyx_v_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_value, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_3) {

        /* "/home/sthorne/src/oursql/oursqlx/util.pyx":54
 *             if name in ret:
 *                 if ret[name] != value:
 *                     raise ProgrammingError('column "%s" appears more than once'             # <<<<<<<<<<<<<<
 *                         ' in output' % name)
 *             else:
 */
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);

        /* "/home/sthorne/src/oursql/oursqlx/util.pyx":55
 *                 if ret[name] != value:
 *                     raise ProgrammingError('column "%s" appears more than once'
 *                         ' in output' % name)             # <<<<<<<<<<<<<<
 *             else:
 *                 ret[name] = value
 */
        __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L11;
      }
      __pyx_L11:;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":57
 *                         ' in output' % name)
 *             else:
 *                 ret[name] = value             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_ret), __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":58
 *             else:
 *                 ret[name] = value
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * _exception_enum_map = {
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("oursql._DictWhateverMixin.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":71
 *     _oursqlx_UnknownError: UnknownError,
 * }
 * def _exception_from_errno(int err):             # <<<<<<<<<<<<<<
 *     return _exception_enum_map[_oursqlx_exc_from_errno(err)]
 * 
 */

static PyObject *__pyx_pf_6oursql__exception_from_errno(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/
static PyMethodDef __pyx_mdef_6oursql__exception_from_errno = {__Pyx_NAMESTR("_exception_from_errno"), (PyCFunction)__pyx_pf_6oursql__exception_from_errno, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql__exception_from_errno(PyObject *__pyx_self, PyObject *__pyx_arg_err) {
  int __pyx_v_err;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_exception_from_errno");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_err); {
    __pyx_v_err = __Pyx_PyInt_AsInt(__pyx_arg_err); if (unlikely((__pyx_v_err == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._exception_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":72
 * }
 * def _exception_from_errno(int err):
 *     return _exception_enum_map[_oursqlx_exc_from_errno(err)]             # <<<<<<<<<<<<<<
 * 
 * def _do_warnings_query(Connection conn not None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___exception_enum_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(_oursqlx_exc_from_errno(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._exception_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/util.pyx":74
 *     return _exception_enum_map[_oursqlx_exc_from_errno(err)]
 * 
 * def _do_warnings_query(Connection conn not None):             # <<<<<<<<<<<<<<
 *     cdef int should_raise = False
 *     q = _Query(conn, 'SHOW WARNINGS')
 */

static PyObject *__pyx_pf_6oursql_1_do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_1_do_warnings_query = {__Pyx_NAMESTR("_do_warnings_query"), (PyCFunction)__pyx_pf_6oursql_1_do_warnings_query, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_1_do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn) {
  int __pyx_v_should_raise;
  struct __pyx_obj_6oursql__Query *__pyx_v_q = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_kind = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_message = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_warnings_query");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":75
 * 
 * def _do_warnings_query(Connection conn not None):
 *     cdef int should_raise = False             # <<<<<<<<<<<<<<
 *     q = _Query(conn, 'SHOW WARNINGS')
 *     ret = []
 */
  __pyx_v_should_raise = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":76
 * def _do_warnings_query(Connection conn not None):
 *     cdef int should_raise = False
 *     q = _Query(conn, 'SHOW WARNINGS')             # <<<<<<<<<<<<<<
 *     ret = []
 *     for kind, err, message in q:
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_conn);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_conn);
  __Pyx_GIVEREF(__pyx_v_conn);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__Query)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_q = ((struct __pyx_obj_6oursql__Query *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":77
 *     cdef int should_raise = False
 *     q = _Query(conn, 'SHOW WARNINGS')
 *     ret = []             # <<<<<<<<<<<<<<
 *     for kind, err, message in q:
 *         if kind == 'Note':
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_ret = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":78
 *     q = _Query(conn, 'SHOW WARNINGS')
 *     ret = []
 *     for kind, err, message in q:             # <<<<<<<<<<<<<<
 *         if kind == 'Note':
 *             kind = Note
 */
  if (PyList_CheckExact(((PyObject *)__pyx_v_q)) || PyTuple_CheckExact(((PyObject *)__pyx_v_q))) {
    __pyx_t_2 = ((PyObject *)__pyx_v_q); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_q)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) {
          if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 3)) {
          if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_kind);
    __pyx_v_kind = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_err);
    __pyx_v_err = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_message);
    __pyx_v_message = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":79
 *     ret = []
 *     for kind, err, message in q:
 *         if kind == 'Note':             # <<<<<<<<<<<<<<
 *             kind = Note
 *         elif kind == 'Warning':
 */
    __pyx_t_10 = __Pyx_PyString_Equals(__pyx_v_kind, ((PyObject *)__pyx_n_s__Note), Py_EQ); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":80
 *     for kind, err, message in q:
 *         if kind == 'Note':
 *             kind = Note             # <<<<<<<<<<<<<<
 *         elif kind == 'Warning':
 *             kind = Warning
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Note); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L9;
    }

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":81
 *         if kind == 'Note':
 *             kind = Note
 *         elif kind == 'Warning':             # <<<<<<<<<<<<<<
 *             kind = Warning
 *             should_raise = True
 */
    __pyx_t_10 = __Pyx_PyString_Equals(__pyx_v_kind, ((PyObject *)__pyx_n_s__Warning), Py_EQ); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":82
 *             kind = Note
 *         elif kind == 'Warning':
 *             kind = Warning             # <<<<<<<<<<<<<<
 *             should_raise = True
 *         elif kind == 'Error':
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":83
 *         elif kind == 'Warning':
 *             kind = Warning
 *             should_raise = True             # <<<<<<<<<<<<<<
 *         elif kind == 'Error':
 *             kind = _exception_from_errno(err)
 */
      __pyx_v_should_raise = 1;
      goto __pyx_L9;
    }

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":84
 *             kind = Warning
 *             should_raise = True
 *         elif kind == 'Error':             # <<<<<<<<<<<<<<
 *             kind = _exception_from_errno(err)
 *             should_raise = True
 */
    __pyx_t_10 = __Pyx_PyString_Equals(__pyx_v_kind, ((PyObject *)__pyx_n_s__Error), Py_EQ); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":85
 *             should_raise = True
 *         elif kind == 'Error':
 *             kind = _exception_from_errno(err)             # <<<<<<<<<<<<<<
 *             should_raise = True
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(__pyx_v_err);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_err);
      __Pyx_GIVEREF(__pyx_v_err);
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":86
 *         elif kind == 'Error':
 *             kind = _exception_from_errno(err)
 *             should_raise = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise InterfaceError('unknown kind of warning: %r' % kind)
 */
      __pyx_v_should_raise = 1;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/sthorne/src/oursql/oursqlx/util.pyx":88
 *             should_raise = True
 *         else:
 *             raise InterfaceError('unknown kind of warning: %r' % kind)             # <<<<<<<<<<<<<<
 *         ret.append((kind, (message, err)))
 *     if should_raise and conn.raise_on_warnings:
 */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_v_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":89
 *         else:
 *             raise InterfaceError('unknown kind of warning: %r' % kind)
 *         ret.append((kind, (message, err)))             # <<<<<<<<<<<<<<
 *     if should_raise and conn.raise_on_warnings:
 *         raise CollatedWarningsError('query caused warnings', extra=ret)
 */
    if (unlikely(((PyObject *)__pyx_v_ret) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    __Pyx_INCREF(__pyx_v_err);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_err);
    __Pyx_GIVEREF(__pyx_v_err);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_kind);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_kind);
    __Pyx_GIVEREF(__pyx_v_kind);
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_11 = PyList_Append(__pyx_v_ret, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":90
 *             raise InterfaceError('unknown kind of warning: %r' % kind)
 *         ret.append((kind, (message, err)))
 *     if should_raise and conn.raise_on_warnings:             # <<<<<<<<<<<<<<
 *         raise CollatedWarningsError('query caused warnings', extra=ret)
 *     return ret
 */
  if (__pyx_v_should_raise) {
    __pyx_t_10 = ((struct __pyx_obj_6oursql_Connection *)__pyx_v_conn)->raise_on_warnings;
  } else {
    __pyx_t_10 = __pyx_v_should_raise;
  }
  if (__pyx_t_10) {

    /* "/home/sthorne/src/oursql/oursqlx/util.pyx":91
 *         ret.append((kind, (message, err)))
 *     if should_raise and conn.raise_on_warnings:
 *         raise CollatedWarningsError('query caused warnings', extra=ret)             # <<<<<<<<<<<<<<
 *     return ret
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__extra), ((PyObject *)__pyx_v_ret)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":92
 *     if should_raise and conn.raise_on_warnings:
 *         raise CollatedWarningsError('query caused warnings', extra=ret)
 *     return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("oursql._do_warnings_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_q);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":3
 * import decimal, datetime, time
 * 
 * def _bitval_from_string(s):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef unsigned char *ss
 */

static PyObject *__pyx_pf_6oursql_2_bitval_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_2_bitval_from_string = {__Pyx_NAMESTR("_bitval_from_string"), (PyCFunction)__pyx_pf_6oursql_2_bitval_from_string, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_2_bitval_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  Py_ssize_t __pyx_v_length;
  unsigned char *__pyx_v_ss;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bitval_from_string");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":6
 *     cdef Py_ssize_t length
 *     cdef unsigned char *ss
 *     PyString_AsStringAndSize(s, <char **>&ss, &length)             # <<<<<<<<<<<<<<
 *     return bitval_from_char_p(ss, length)
 * 
 */
  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_s, ((char **)(&__pyx_v_ss)), (&__pyx_v_length)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":7
 *     cdef unsigned char *ss
 *     PyString_AsStringAndSize(s, <char **>&ss, &length)
 *     return bitval_from_char_p(ss, length)             # <<<<<<<<<<<<<<
 * 
 * def _datetime_from_string(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_f_6oursql_bitval_from_char_p(__pyx_v_ss, __pyx_v_length)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._bitval_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":9
 *     return bitval_from_char_p(ss, length)
 * 
 * def _datetime_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%Y-%m-%d %H:%M:%S')
 *     return datetime.datetime(*tt[:6])
 */

static PyObject *__pyx_pf_6oursql_3_datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_3_datetime_from_string = {__Pyx_NAMESTR("_datetime_from_string"), (PyCFunction)__pyx_pf_6oursql_3_datetime_from_string, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_3_datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_datetime_from_string");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":10
 * 
 * def _datetime_from_string(s):
 *     tt = time.strptime(s, '%Y-%m-%d %H:%M:%S')             # <<<<<<<<<<<<<<
 *     return datetime.datetime(*tt[:6])
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__strptime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":11
 * def _datetime_from_string(s):
 *     tt = time.strptime(s, '%Y-%m-%d %H:%M:%S')
 *     return datetime.datetime(*tt[:6])             # <<<<<<<<<<<<<<
 * 
 * def _date_from_string(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_tt, 0, 6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._datetime_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":13
 *     return datetime.datetime(*tt[:6])
 * 
 * def _date_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%Y-%m-%d')
 *     return datetime.date(*tt[:3])
 */

static PyObject *__pyx_pf_6oursql_4_date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_4_date_from_string = {__Pyx_NAMESTR("_date_from_string"), (PyCFunction)__pyx_pf_6oursql_4_date_from_string, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_4_date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_date_from_string");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":14
 * 
 * def _date_from_string(s):
 *     tt = time.strptime(s, '%Y-%m-%d')             # <<<<<<<<<<<<<<
 *     return datetime.date(*tt[:3])
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__strptime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":15
 * def _date_from_string(s):
 *     tt = time.strptime(s, '%Y-%m-%d')
 *     return datetime.date(*tt[:3])             # <<<<<<<<<<<<<<
 * 
 * def _time_from_string(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_tt, 0, 3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._date_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":17
 *     return datetime.date(*tt[:3])
 * 
 * def _time_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%H:%M:%S')
 *     return datetime.time(*tt[3:6])
 */

static PyObject *__pyx_pf_6oursql_5_time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6oursql_5_time_from_string = {__Pyx_NAMESTR("_time_from_string"), (PyCFunction)__pyx_pf_6oursql_5_time_from_string, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6oursql_5_time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_time_from_string");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":18
 * 
 * def _time_from_string(s):
 *     tt = time.strptime(s, '%H:%M:%S')             # <<<<<<<<<<<<<<
 *     return datetime.time(*tt[3:6])
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__strptime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":19
 * def _time_from_string(s):
 *     tt = time.strptime(s, '%H:%M:%S')
 *     return datetime.time(*tt[3:6])             # <<<<<<<<<<<<<<
 * 
 * _conversions = {
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_tt, 3, 6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._time_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":55
 * Binary = buffer
 * 
 * def TimestampFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """TimestampFromTicks(ticks) -> Timestamp.
 * 
 */

static PyObject *__pyx_pf_6oursql_6TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_6TimestampFromTicks[] = "TimestampFromTicks(ticks) -> Timestamp.\n    \n    Convert a time in seconds since the epoch into a Timestamp.\n    ";
static PyMethodDef __pyx_mdef_6oursql_6TimestampFromTicks = {__Pyx_NAMESTR("TimestampFromTicks"), (PyCFunction)__pyx_pf_6oursql_6TimestampFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_6TimestampFromTicks)};
static PyObject *__pyx_pf_6oursql_6TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("TimestampFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":60
 *     Convert a time in seconds since the epoch into a Timestamp.
 *     """
 *     return Timestamp(*time.localtime(ticks)[:6])             # <<<<<<<<<<<<<<
 * 
 * def DateFromTicks(ticks):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__localtime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_ticks);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ticks);
  __Pyx_GIVEREF(__pyx_v_ticks);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_4, 0, 6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.TimestampFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":62
 *     return Timestamp(*time.localtime(ticks)[:6])
 * 
 * def DateFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """DateFromTicks(ticks) -> Date.
 * 
 */

static PyObject *__pyx_pf_6oursql_7DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_7DateFromTicks[] = "DateFromTicks(ticks) -> Date.\n    \n    Convert a time in seconds since the epoch into a Date.\n    ";
static PyMethodDef __pyx_mdef_6oursql_7DateFromTicks = {__Pyx_NAMESTR("DateFromTicks"), (PyCFunction)__pyx_pf_6oursql_7DateFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_7DateFromTicks)};
static PyObject *__pyx_pf_6oursql_7DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DateFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":67
 *     Convert a time in seconds since the epoch into a Date.
 *     """
 *     return Date(*time.localtime(ticks)[:3])             # <<<<<<<<<<<<<<
 * 
 * def TimeFromTicks(ticks):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__localtime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_ticks);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ticks);
  __Pyx_GIVEREF(__pyx_v_ticks);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_4, 0, 3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.DateFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":69
 *     return Date(*time.localtime(ticks)[:3])
 * 
 * def TimeFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """TimeFromTicks(ticks) -> Time.
 * 
 */

static PyObject *__pyx_pf_6oursql_8TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_8TimeFromTicks[] = "TimeFromTicks(ticks) -> Time.\n    \n    Convert a time in seconds since the epoch into a Time.\n    ";
static PyMethodDef __pyx_mdef_6oursql_8TimeFromTicks = {__Pyx_NAMESTR("TimeFromTicks"), (PyCFunction)__pyx_pf_6oursql_8TimeFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_8TimeFromTicks)};
static PyObject *__pyx_pf_6oursql_8TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("TimeFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":74
 *     Convert a time in seconds since the epoch into a Time.
 *     """
 *     return Time(*time.localtime(ticks)[3:6])             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__localtime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_ticks);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ticks);
  __Pyx_GIVEREF(__pyx_v_ticks);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_4, 3, 6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.TimeFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":76
 *     cdef public object default_cursor
 * 
 *     def __cinit__(self, char *host=NULL, char *user=NULL, char *passwd=NULL, *,             # <<<<<<<<<<<<<<
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 */

static int __pyx_pf_6oursql_10Connection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_10Connection___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_host;
  char *__pyx_v_user;
  char *__pyx_v_passwd;
  char *__pyx_v_db;
  unsigned int __pyx_v_port;
  char *__pyx_v_unix_socket;
  PyObject *__pyx_v_connect_timeout = 0;
  PyObject *__pyx_v_read_timeout = 0;
  PyObject *__pyx_v_write_timeout = 0;
  PyObject *__pyx_v_protocol = 0;
  PyObject *__pyx_v_ssl = 0;
  char *__pyx_v_read_default_file;
  char *__pyx_v_read_default_group;
  char *__pyx_v_init_command;
  char *__pyx_v_charset_dir;
  char *__pyx_v_shared_memory_base_name;
  int __pyx_v_local_infile;
  int __pyx_v_require_secure_auth;
  int __pyx_v_compress;
  int __pyx_v_report_truncation;
  int __pyx_v_found_rows;
  int __pyx_v_use_unicode;
  PyObject *__pyx_v_charset = 0;
  int __pyx_v_autoping;
  PyObject *__pyx_v_default_cursor = 0;
  int __pyx_v_raise_on_warnings;
  int __pyx_v_multi_results;
  int __pyx_v_multi_statements;
  int __pyx_v_autoreconnect;
  unsigned long __pyx_v_flags;
  unsigned int __pyx_v_uint_tmp;
  my_bool __pyx_v_bool_tmp;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__host,&__pyx_n_s__user,&__pyx_n_s__passwd,&__pyx_n_s__db,&__pyx_n_s__port,&__pyx_n_s__unix_socket,&__pyx_n_s__connect_timeout,&__pyx_n_s__read_timeout,&__pyx_n_s__write_timeout,&__pyx_n_s__protocol,&__pyx_n_s__ssl,&__pyx_n_s__read_default_file,&__pyx_n_s__read_default_group,&__pyx_n_s__init_command,&__pyx_n_s__charset_dir,&__pyx_n_s_12,&__pyx_n_s__local_infile,&__pyx_n_s__require_secure_auth,&__pyx_n_s__compress,&__pyx_n_s__report_truncation,&__pyx_n_s__found_rows,&__pyx_n_s__use_unicode,&__pyx_n_s__charset,&__pyx_n_s__autoping,&__pyx_n_s__default_cursor,&__pyx_n_s__raise_on_warnings,&__pyx_n_s__multi_results,&__pyx_n_s__multi_statements,&__pyx_n_s__autoreconnect,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[29] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":78
 *     def __cinit__(self, char *host=NULL, char *user=NULL, char *passwd=NULL, *,
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,
 *             connect_timeout=None, read_timeout=None, write_timeout=None,             # <<<<<<<<<<<<<<
 *             protocol=None, ssl=None, char *read_default_file=NULL,
 *             char *read_default_group=NULL, char *init_command=NULL,
 */
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)Py_None);
    values[8] = ((PyObject *)Py_None);

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":79
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 *             protocol=None, ssl=None, char *read_default_file=NULL,             # <<<<<<<<<<<<<<
 *             char *read_default_group=NULL, char *init_command=NULL,
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,
 */
    values[9] = ((PyObject *)Py_None);
    values[10] = ((PyObject *)Py_None);
    values[22] = ((PyObject*)__pyx_n_s__utf8);

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":85
 *             bint compress=False, bint report_truncation=True,
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',
 *             bint autoping=False, default_cursor=None,             # <<<<<<<<<<<<<<
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True, bint autoreconnect=False):
 */
    values[24] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__host);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__user);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__passwd);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      while (kw_args > 0) {
        PyObject* value;
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__db);
        if (value) { values[3] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port);
        if (value) { values[4] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unix_socket);
        if (value) { values[5] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__connect_timeout);
        if (value) { values[6] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__read_timeout);
        if (value) { values[7] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__write_timeout);
        if (value) { values[8] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__protocol);
        if (value) { values[9] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ssl);
        if (value) { values[10] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__read_default_file);
        if (value) { values[11] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__read_default_group);
        if (value) { values[12] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__init_command);
        if (value) { values[13] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__charset_dir);
        if (value) { values[14] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_12);
        if (value) { values[15] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__local_infile);
        if (value) { values[16] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__require_secure_auth);
        if (value) { values[17] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__compress);
        if (value) { values[18] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__report_truncation);
        if (value) { values[19] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__found_rows);
        if (value) { values[20] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_unicode);
        if (value) { values[21] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__charset);
        if (value) { values[22] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__autoping);
        if (value) { values[23] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__default_cursor);
        if (value) { values[24] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__raise_on_warnings);
        if (value) { values[25] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__multi_results);
        if (value) { values[26] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__multi_statements);
        if (value) { values[27] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__autoreconnect);
        if (value) { values[28] = value; if (!(--kw_args)) break; }
        break;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_host = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_host) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":76
 *     cdef public object default_cursor
 * 
 *     def __cinit__(self, char *host=NULL, char *user=NULL, char *passwd=NULL, *,             # <<<<<<<<<<<<<<
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 */
      __pyx_v_host = ((char *)NULL);
    }
    if (values[1]) {
      __pyx_v_user = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_user = ((char *)NULL);
    }
    if (values[2]) {
      __pyx_v_passwd = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_passwd = ((char *)NULL);
    }
    if (values[3]) {
      __pyx_v_db = PyBytes_AsString(values[3]); if (unlikely((!__pyx_v_db) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":77
 * 
 *     def __cinit__(self, char *host=NULL, char *user=NULL, char *passwd=NULL, *,
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,             # <<<<<<<<<<<<<<
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 *             protocol=None, ssl=None, char *read_default_file=NULL,
 */
      __pyx_v_db = ((char *)NULL);
    }
    if (values[4]) {
      __pyx_v_port = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_port == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_port = ((unsigned int)0);
    }
    if (values[5]) {
      __pyx_v_unix_socket = PyBytes_AsString(values[5]); if (unlikely((!__pyx_v_unix_socket) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_unix_socket = ((char *)NULL);
    }
    __pyx_v_connect_timeout = values[6];
    __pyx_v_read_timeout = values[7];
    __pyx_v_write_timeout = values[8];
    __pyx_v_protocol = values[9];
    __pyx_v_ssl = values[10];
    if (values[11]) {
      __pyx_v_read_default_file = PyBytes_AsString(values[11]); if (unlikely((!__pyx_v_read_default_file) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":79
 *             char *db=NULL, unsigned int port=0, char *unix_socket=NULL,
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 *             protocol=None, ssl=None, char *read_default_file=NULL,             # <<<<<<<<<<<<<<
 *             char *read_default_group=NULL, char *init_command=NULL,
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,
 */
      __pyx_v_read_default_file = ((char *)NULL);
    }
    if (values[12]) {
      __pyx_v_read_default_group = PyBytes_AsString(values[12]); if (unlikely((!__pyx_v_read_default_group) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":80
 *             connect_timeout=None, read_timeout=None, write_timeout=None,
 *             protocol=None, ssl=None, char *read_default_file=NULL,
 *             char *read_default_group=NULL, char *init_command=NULL,             # <<<<<<<<<<<<<<
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,
 *             bint local_infile=False, bint require_secure_auth=False,
 */
      __pyx_v_read_default_group = ((char *)NULL);
    }
    if (values[13]) {
      __pyx_v_init_command = PyBytes_AsString(values[13]); if (unlikely((!__pyx_v_init_command) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_init_command = ((char *)NULL);
    }
    if (values[14]) {
      __pyx_v_charset_dir = PyBytes_AsString(values[14]); if (unlikely((!__pyx_v_charset_dir) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":81
 *             protocol=None, ssl=None, char *read_default_file=NULL,
 *             char *read_default_group=NULL, char *init_command=NULL,
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,             # <<<<<<<<<<<<<<
 *             bint local_infile=False, bint require_secure_auth=False,
 *             bint compress=False, bint report_truncation=True,
 */
      __pyx_v_charset_dir = ((char *)NULL);
    }
    if (values[15]) {
      __pyx_v_shared_memory_base_name = PyBytes_AsString(values[15]); if (unlikely((!__pyx_v_shared_memory_base_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_shared_memory_base_name = ((char *)NULL);
    }
    if (values[16]) {
      __pyx_v_local_infile = __Pyx_PyObject_IsTrue(values[16]); if (unlikely((__pyx_v_local_infile == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":82
 *             char *read_default_group=NULL, char *init_command=NULL,
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,
 *             bint local_infile=False, bint require_secure_auth=False,             # <<<<<<<<<<<<<<
 *             bint compress=False, bint report_truncation=True,
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',
 */
      __pyx_v_local_infile = ((int)0);
    }
    if (values[17]) {
      __pyx_v_require_secure_auth = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_require_secure_auth == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_require_secure_auth = ((int)0);
    }
    if (values[18]) {
      __pyx_v_compress = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_compress == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":83
 *             char *charset_dir=NULL, char *shared_memory_base_name=NULL,
 *             bint local_infile=False, bint require_secure_auth=False,
 *             bint compress=False, bint report_truncation=True,             # <<<<<<<<<<<<<<
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',
 *             bint autoping=False, default_cursor=None,
 */
      __pyx_v_compress = ((int)0);
    }
    if (values[19]) {
      __pyx_v_report_truncation = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_report_truncation == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_report_truncation = ((int)1);
    }
    if (values[20]) {
      __pyx_v_found_rows = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_found_rows == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":84
 *             bint local_infile=False, bint require_secure_auth=False,
 *             bint compress=False, bint report_truncation=True,
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',             # <<<<<<<<<<<<<<
 *             bint autoping=False, default_cursor=None,
 *             bint raise_on_warnings=True, bint multi_results=True,
 */
      __pyx_v_found_rows = ((int)1);
    }
    if (values[21]) {
      __pyx_v_use_unicode = __Pyx_PyObject_IsTrue(values[21]); if (unlikely((__pyx_v_use_unicode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_use_unicode = ((int)1);
    }
    __pyx_v_charset = ((PyObject*)values[22]);
    if (values[23]) {
      __pyx_v_autoping = __Pyx_PyObject_IsTrue(values[23]); if (unlikely((__pyx_v_autoping == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":85
 *             bint compress=False, bint report_truncation=True,
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',
 *             bint autoping=False, default_cursor=None,             # <<<<<<<<<<<<<<
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True, bint autoreconnect=False):
 */
      __pyx_v_autoping = ((int)0);
    }
    __pyx_v_default_cursor = values[24];
    if (values[25]) {
      __pyx_v_raise_on_warnings = __Pyx_PyObject_IsTrue(values[25]); if (unlikely((__pyx_v_raise_on_warnings == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":86
 *             bint found_rows=True, bint use_unicode=True, str charset='utf8',
 *             bint autoping=False, default_cursor=None,
 *             bint raise_on_warnings=True, bint multi_results=True,             # <<<<<<<<<<<<<<
 *             bint multi_statements=True, bint autoreconnect=False):
 *         cdef unsigned long flags = 0
 */
      __pyx_v_raise_on_warnings = ((int)1);
    }
    if (values[26]) {
      __pyx_v_multi_results = __Pyx_PyObject_IsTrue(values[26]); if (unlikely((__pyx_v_multi_results == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_multi_results = ((int)1);
    }
    if (values[27]) {
      __pyx_v_multi_statements = __Pyx_PyObject_IsTrue(values[27]); if (unlikely((__pyx_v_multi_statements == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":87
 *             bint autoping=False, default_cursor=None,
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True, bint autoreconnect=False):             # <<<<<<<<<<<<<<
 *         cdef unsigned long flags = 0
 *         cdef unsigned int uint_tmp
 */
      __pyx_v_multi_statements = ((int)1);
    }
    if (values[28]) {
      __pyx_v_autoreconnect = __Pyx_PyObject_IsTrue(values[28]); if (unlikely((__pyx_v_autoreconnect == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_autoreconnect = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Connection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_default_cursor);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_charset), (&PyString_Type), 1, "charset", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":88
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True, bint autoreconnect=False):
 *         cdef unsigned long flags = 0             # <<<<<<<<<<<<<<
 *         cdef unsigned int uint_tmp
 *         cdef my_bool bool_tmp
 */
  __pyx_v_flags = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":91
 *         cdef unsigned int uint_tmp
 *         cdef my_bool bool_tmp
 *         if compress:             # <<<<<<<<<<<<<<
 *             flags |= CLIENT_COMPRESS
 *         if found_rows:
 */
  if (__pyx_v_compress) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":92
 *         cdef my_bool bool_tmp
 *         if compress:
 *             flags |= CLIENT_COMPRESS             # <<<<<<<<<<<<<<
 *         if found_rows:
 *             flags |= CLIENT_FOUND_ROWS
 */
    __pyx_v_flags = (__pyx_v_flags | CLIENT_COMPRESS);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":93
 *         if compress:
 *             flags |= CLIENT_COMPRESS
 *         if found_rows:             # <<<<<<<<<<<<<<
 *             flags |= CLIENT_FOUND_ROWS
 *         # I'll come back to this later. Dealing with multiple result sets is
 */
  if (__pyx_v_found_rows) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":94
 *             flags |= CLIENT_COMPRESS
 *         if found_rows:
 *             flags |= CLIENT_FOUND_ROWS             # <<<<<<<<<<<<<<
 *         # I'll come back to this later. Dealing with multiple result sets is
 *         # such a pain.
 */
    __pyx_v_flags = (__pyx_v_flags | CLIENT_FOUND_ROWS);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":101
 *         #if multi_statements:
 *         #    flags |= CLIENT_MULTI_STATEMENTS
 *         self.conn = mysql_init(NULL)             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             raise MemoryError('alloc of conn object failed')
 */
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn = mysql_init(NULL);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":102
 *         #    flags |= CLIENT_MULTI_STATEMENTS
 *         self.conn = mysql_init(NULL)
 *         if not self.conn:             # <<<<<<<<<<<<<<
 *             raise MemoryError('alloc of conn object failed')
 *         if protocol not in _protocol_enum_map:
 */
  __pyx_t_1 = (!(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":103
 *         self.conn = mysql_init(NULL)
 *         if not self.conn:
 *             raise MemoryError('alloc of conn object failed')             # <<<<<<<<<<<<<<
 *         if protocol not in _protocol_enum_map:
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":104
 *         if not self.conn:
 *             raise MemoryError('alloc of conn object failed')
 *         if protocol not in _protocol_enum_map:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))
 *         uint_tmp = _protocol_enum_map[protocol]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___protocol_enum_map); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_2, __pyx_v_protocol))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":105
 *             raise MemoryError('alloc of conn object failed')
 *         if protocol not in _protocol_enum_map:
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))             # <<<<<<<<<<<<<<
 *         uint_tmp = _protocol_enum_map[protocol]
 *         mysql_options(self.conn, MYSQL_OPT_PROTOCOL, <char *>&uint_tmp)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_protocol);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_protocol);
    __Pyx_GIVEREF(__pyx_v_protocol);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":106
 *         if protocol not in _protocol_enum_map:
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))
 *         uint_tmp = _protocol_enum_map[protocol]             # <<<<<<<<<<<<<<
 *         mysql_options(self.conn, MYSQL_OPT_PROTOCOL, <char *>&uint_tmp)
 *         bool_tmp = report_truncation
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___protocol_enum_map); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_v_protocol); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_uint_tmp = __pyx_t_5;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":107
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))
 *         uint_tmp = _protocol_enum_map[protocol]
 *         mysql_options(self.conn, MYSQL_OPT_PROTOCOL, <char *>&uint_tmp)             # <<<<<<<<<<<<<<
 *         bool_tmp = report_truncation
 *         mysql_options(self.conn,
 */
  mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_PROTOCOL, ((char *)(&__pyx_v_uint_tmp)));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":108
 *         uint_tmp = _protocol_enum_map[protocol]
 *         mysql_options(self.conn, MYSQL_OPT_PROTOCOL, <char *>&uint_tmp)
 *         bool_tmp = report_truncation             # <<<<<<<<<<<<<<
 *         mysql_options(self.conn,
 *             MYSQL_REPORT_DATA_TRUNCATION, <char *>&bool_tmp)
 */
  __pyx_v_bool_tmp = __pyx_v_report_truncation;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":110
 *         bool_tmp = report_truncation
 *         mysql_options(self.conn,
 *             MYSQL_REPORT_DATA_TRUNCATION, <char *>&bool_tmp)             # <<<<<<<<<<<<<<
 *         bool_tmp = require_secure_auth
 *         mysql_options(self.conn, MYSQL_SECURE_AUTH, <char *>&bool_tmp)
 */
  mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_REPORT_DATA_TRUNCATION, ((char *)(&__pyx_v_bool_tmp)));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":111
 *         mysql_options(self.conn,
 *             MYSQL_REPORT_DATA_TRUNCATION, <char *>&bool_tmp)
 *         bool_tmp = require_secure_auth             # <<<<<<<<<<<<<<
 *         mysql_options(self.conn, MYSQL_SECURE_AUTH, <char *>&bool_tmp)
 *         if connect_timeout is not None:
 */
  __pyx_v_bool_tmp = __pyx_v_require_secure_auth;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":112
 *             MYSQL_REPORT_DATA_TRUNCATION, <char *>&bool_tmp)
 *         bool_tmp = require_secure_auth
 *         mysql_options(self.conn, MYSQL_SECURE_AUTH, <char *>&bool_tmp)             # <<<<<<<<<<<<<<
 *         if connect_timeout is not None:
 *             uint_tmp = connect_timeout
 */
  mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_SECURE_AUTH, ((char *)(&__pyx_v_bool_tmp)));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":113
 *         bool_tmp = require_secure_auth
 *         mysql_options(self.conn, MYSQL_SECURE_AUTH, <char *>&bool_tmp)
 *         if connect_timeout is not None:             # <<<<<<<<<<<<<<
 *             uint_tmp = connect_timeout
 *             mysql_options(self.conn,
 */
  __pyx_t_1 = (__pyx_v_connect_timeout != Py_None);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":114
 *         mysql_options(self.conn, MYSQL_SECURE_AUTH, <char *>&bool_tmp)
 *         if connect_timeout is not None:
 *             uint_tmp = connect_timeout             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_CONNECT_TIMEOUT, <char *>&uint_tmp)
 */
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_connect_timeout); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_uint_tmp = __pyx_t_5;

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":116
 *             uint_tmp = connect_timeout
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_CONNECT_TIMEOUT, <char *>&uint_tmp)             # <<<<<<<<<<<<<<
 *         if read_timeout is not None:
 *             uint_tmp = read_timeout
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_CONNECT_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)));
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":117
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_CONNECT_TIMEOUT, <char *>&uint_tmp)
 *         if read_timeout is not None:             # <<<<<<<<<<<<<<
 *             uint_tmp = read_timeout
 *             mysql_options(self.conn,
 */
  __pyx_t_1 = (__pyx_v_read_timeout != Py_None);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":118
 *                 MYSQL_OPT_CONNECT_TIMEOUT, <char *>&uint_tmp)
 *         if read_timeout is not None:
 *             uint_tmp = read_timeout             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_READ_TIMEOUT, <char *>&uint_tmp)
 */
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_read_timeout); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_uint_tmp = __pyx_t_5;

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":120
 *             uint_tmp = read_timeout
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_READ_TIMEOUT, <char *>&uint_tmp)             # <<<<<<<<<<<<<<
 *         if write_timeout is not None:
 *             uint_tmp = write_timeout
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_READ_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)));
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":121
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_READ_TIMEOUT, <char *>&uint_tmp)
 *         if write_timeout is not None:             # <<<<<<<<<<<<<<
 *             uint_tmp = write_timeout
 *             mysql_options(self.conn,
 */
  __pyx_t_1 = (__pyx_v_write_timeout != Py_None);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":122
 *                 MYSQL_OPT_READ_TIMEOUT, <char *>&uint_tmp)
 *         if write_timeout is not None:
 *             uint_tmp = write_timeout             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_WRITE_TIMEOUT, <char *>&uint_tmp)
 */
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_write_timeout); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_uint_tmp = __pyx_t_5;

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":124
 *             uint_tmp = write_timeout
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_WRITE_TIMEOUT, <char *>&uint_tmp)             # <<<<<<<<<<<<<<
 *         if read_default_file:
 *             mysql_options(self.conn,
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_WRITE_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)));
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":125
 *             mysql_options(self.conn,
 *                 MYSQL_OPT_WRITE_TIMEOUT, <char *>&uint_tmp)
 *         if read_default_file:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_FILE, read_default_file)
 */
  __pyx_t_1 = (__pyx_v_read_default_file != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":127
 *         if read_default_file:
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_FILE, read_default_file)             # <<<<<<<<<<<<<<
 *         if read_default_group:
 *             mysql_options(self.conn,
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_READ_DEFAULT_FILE, __pyx_v_read_default_file);
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":128
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_FILE, read_default_file)
 *         if read_default_group:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_GROUP, read_default_group)
 */
  __pyx_t_1 = (__pyx_v_read_default_group != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":130
 *         if read_default_group:
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_GROUP, read_default_group)             # <<<<<<<<<<<<<<
 *         if init_command:
 *             mysql_options(self.conn, MYSQL_INIT_COMMAND, init_command)
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_READ_DEFAULT_GROUP, __pyx_v_read_default_group);
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":131
 *             mysql_options(self.conn,
 *                 MYSQL_READ_DEFAULT_GROUP, read_default_group)
 *         if init_command:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn, MYSQL_INIT_COMMAND, init_command)
 *         if charset_dir:
 */
  __pyx_t_1 = (__pyx_v_init_command != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":132
 *                 MYSQL_READ_DEFAULT_GROUP, read_default_group)
 *         if init_command:
 *             mysql_options(self.conn, MYSQL_INIT_COMMAND, init_command)             # <<<<<<<<<<<<<<
 *         if charset_dir:
 *             mysql_options(self.conn, MYSQL_SET_CHARSET_DIR, charset_dir)
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_INIT_COMMAND, __pyx_v_init_command);
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":133
 *         if init_command:
 *             mysql_options(self.conn, MYSQL_INIT_COMMAND, init_command)
 *         if charset_dir:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn, MYSQL_SET_CHARSET_DIR, charset_dir)
 *         if shared_memory_base_name:
 */
  __pyx_t_1 = (__pyx_v_charset_dir != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":134
 *             mysql_options(self.conn, MYSQL_INIT_COMMAND, init_command)
 *         if charset_dir:
 *             mysql_options(self.conn, MYSQL_SET_CHARSET_DIR, charset_dir)             # <<<<<<<<<<<<<<
 *         if shared_memory_base_name:
 *             mysql_options(self.conn,
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_SET_CHARSET_DIR, __pyx_v_charset_dir);
    goto __pyx_L16;
  }
  __pyx_L16:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":135
 *         if charset_dir:
 *             mysql_options(self.conn, MYSQL_SET_CHARSET_DIR, charset_dir)
 *         if shared_memory_base_name:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name)
 */
  __pyx_t_1 = (__pyx_v_shared_memory_base_name != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":137
 *         if shared_memory_base_name:
 *             mysql_options(self.conn,
 *                 MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name)             # <<<<<<<<<<<<<<
 *         if local_infile:
 *             mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL)
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_SHARED_MEMORY_BASE_NAME, __pyx_v_shared_memory_base_name);
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":138
 *             mysql_options(self.conn,
 *                 MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name)
 *         if local_infile:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL)
 *         if charset is not None:
 */
  if (__pyx_v_local_infile) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":139
 *                 MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name)
 *         if local_infile:
 *             mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL)             # <<<<<<<<<<<<<<
 *         if charset is not None:
 *             mysql_options(self.conn,
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_LOCAL_INFILE, NULL);
    goto __pyx_L18;
  }
  __pyx_L18:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":140
 *         if local_infile:
 *             mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL)
 *         if charset is not None:             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn,
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))
 */
  __pyx_t_1 = (__pyx_v_charset != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":142
 *         if charset is not None:
 *             mysql_options(self.conn,
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))             # <<<<<<<<<<<<<<
 *         if autoreconnect:
 *             bool_tmp = True
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(((PyObject *)__pyx_v_charset)));
    goto __pyx_L19;
  }
  __pyx_L19:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":143
 *             mysql_options(self.conn,
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))
 *         if autoreconnect:             # <<<<<<<<<<<<<<
 *             bool_tmp = True
 *             mysql_options(self.conn, MYSQL_OPT_RECONNECT, <char *>&bool_tmp)
 */
  if (__pyx_v_autoreconnect) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":144
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))
 *         if autoreconnect:
 *             bool_tmp = True             # <<<<<<<<<<<<<<
 *             mysql_options(self.conn, MYSQL_OPT_RECONNECT, <char *>&bool_tmp)
 *         if ssl is not None:
 */
    __pyx_v_bool_tmp = 1;

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":145
 *         if autoreconnect:
 *             bool_tmp = True
 *             mysql_options(self.conn, MYSQL_OPT_RECONNECT, <char *>&bool_tmp)             # <<<<<<<<<<<<<<
 *         if ssl is not None:
 *             self._setup_ssl_options(**ssl)
 */
    mysql_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, MYSQL_OPT_RECONNECT, ((char *)(&__pyx_v_bool_tmp)));
    goto __pyx_L20;
  }
  __pyx_L20:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":146
 *             bool_tmp = True
 *             mysql_options(self.conn, MYSQL_OPT_RECONNECT, <char *>&bool_tmp)
 *         if ssl is not None:             # <<<<<<<<<<<<<<
 *             self._setup_ssl_options(**ssl)
 *         if not mysql_real_connect(self.conn, host, user, passwd, db, port,
 */
  __pyx_t_1 = (__pyx_v_ssl != Py_None);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":147
 *             mysql_options(self.conn, MYSQL_OPT_RECONNECT, <char *>&bool_tmp)
 *         if ssl is not None:
 *             self._setup_ssl_options(**ssl)             # <<<<<<<<<<<<<<
 *         if not mysql_real_connect(self.conn, host, user, passwd, db, port,
 *                 unix_socket, flags):
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___setup_ssl_options); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), __pyx_v_ssl); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L21;
  }
  __pyx_L21:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":149
 *             self._setup_ssl_options(**ssl)
 *         if not mysql_real_connect(self.conn, host, user, passwd, db, port,
 *                 unix_socket, flags):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         self.use_unicode = use_unicode
 */
  __pyx_t_1 = (!(__pyx_f_6oursql_mysql_real_connect(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, __pyx_v_host, __pyx_v_user, __pyx_v_passwd, __pyx_v_db, __pyx_v_port, __pyx_v_unix_socket, __pyx_v_flags) != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":150
 *         if not mysql_real_connect(self.conn, host, user, passwd, db, port,
 *                 unix_socket, flags):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         self.use_unicode = use_unicode
 *         self.autoping = autoping
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L22;
  }
  __pyx_L22:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":151
 *                 unix_socket, flags):
 *             self._raise_error()
 *         self.use_unicode = use_unicode             # <<<<<<<<<<<<<<
 *         self.autoping = autoping
 *         if default_cursor is None:
 */
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->use_unicode = __pyx_v_use_unicode;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":152
 *             self._raise_error()
 *         self.use_unicode = use_unicode
 *         self.autoping = autoping             # <<<<<<<<<<<<<<
 *         if default_cursor is None:
 *             default_cursor = Cursor
 */
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->autoping = __pyx_v_autoping;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":153
 *         self.use_unicode = use_unicode
 *         self.autoping = autoping
 *         if default_cursor is None:             # <<<<<<<<<<<<<<
 *             default_cursor = Cursor
 *         self.default_cursor = default_cursor
 */
  __pyx_t_1 = (__pyx_v_default_cursor == Py_None);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":154
 *         self.autoping = autoping
 *         if default_cursor is None:
 *             default_cursor = Cursor             # <<<<<<<<<<<<<<
 *         self.default_cursor = default_cursor
 *         self.raise_on_warnings = raise_on_warnings
 */
    __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql_Cursor)));
    __Pyx_DECREF(__pyx_v_default_cursor);
    __pyx_v_default_cursor = ((PyObject *)((PyObject*)__pyx_ptype_6oursql_Cursor));
    goto __pyx_L23;
  }
  __pyx_L23:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":155
 *         if default_cursor is None:
 *             default_cursor = Cursor
 *         self.default_cursor = default_cursor             # <<<<<<<<<<<<<<
 *         self.raise_on_warnings = raise_on_warnings
 *         self._context_cursors = []
 */
  __Pyx_INCREF(__pyx_v_default_cursor);
  __Pyx_GIVEREF(__pyx_v_default_cursor);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor = __pyx_v_default_cursor;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":156
 *             default_cursor = Cursor
 *         self.default_cursor = default_cursor
 *         self.raise_on_warnings = raise_on_warnings             # <<<<<<<<<<<<<<
 *         self._context_cursors = []
 * 
 */
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->raise_on_warnings = __pyx_v_raise_on_warnings;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":157
 *         self.default_cursor = default_cursor
 *         self.raise_on_warnings = raise_on_warnings
 *         self._context_cursors = []             # <<<<<<<<<<<<<<
 * 
 *     def _setup_ssl_options(self, *, char *key=NULL, char *cert=NULL,
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_context_cursors);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_context_cursors);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_context_cursors = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_default_cursor);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":159
 *         self._context_cursors = []
 * 
 *     def _setup_ssl_options(self, *, char *key=NULL, char *cert=NULL,             # <<<<<<<<<<<<<<
 *             char *ca=NULL, char *capath=NULL, char *cipher=NULL):
 *         mysql_ssl_set(self.conn, key, cert, ca, capath, cipher)
 */

static PyObject *__pyx_pf_6oursql_10Connection_1_setup_ssl_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_1_setup_ssl_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_key;
  char *__pyx_v_cert;
  char *__pyx_v_ca;
  char *__pyx_v_capath;
  char *__pyx_v_cipher;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__cert,&__pyx_n_s__ca,&__pyx_n_s__capath,&__pyx_n_s__cipher,0};
  __Pyx_RefNannySetupContext("_setup_ssl_options");
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      while (kw_args > 0) {
        PyObject* value;
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (value) { values[0] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cert);
        if (value) { values[1] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ca);
        if (value) { values[2] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__capath);
        if (value) { values[3] = value; if (!(--kw_args)) break; }
        value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cipher);
        if (value) { values[4] = value; if (!(--kw_args)) break; }
        break;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "_setup_ssl_options") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    if (values[0]) {
      __pyx_v_key = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_key = ((char *)NULL);
    }
    if (values[1]) {
      __pyx_v_cert = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_cert) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cert = ((char *)NULL);
    }
    if (values[2]) {
      __pyx_v_ca = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_ca) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":160
 * 
 *     def _setup_ssl_options(self, *, char *key=NULL, char *cert=NULL,
 *             char *ca=NULL, char *capath=NULL, char *cipher=NULL):             # <<<<<<<<<<<<<<
 *         mysql_ssl_set(self.conn, key, cert, ca, capath, cipher)
 * 
 */
      __pyx_v_ca = ((char *)NULL);
    }
    if (values[3]) {
      __pyx_v_capath = PyBytes_AsString(values[3]); if (unlikely((!__pyx_v_capath) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_capath = ((char *)NULL);
    }
    if (values[4]) {
      __pyx_v_cipher = PyBytes_AsString(values[4]); if (unlikely((!__pyx_v_cipher) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cipher = ((char *)NULL);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_setup_ssl_options", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Connection._setup_ssl_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":161
 *     def _setup_ssl_options(self, *, char *key=NULL, char *cert=NULL,
 *             char *ca=NULL, char *capath=NULL, char *cipher=NULL):
 *         mysql_ssl_set(self.conn, key, cert, ca, capath, cipher)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  mysql_ssl_set(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, __pyx_v_key, __pyx_v_cert, __pyx_v_ca, __pyx_v_capath, __pyx_v_cipher);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":163
 *         mysql_ssl_set(self.conn, key, cert, ca, capath, cipher)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """close()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_2close[] = "close()\n        \n        Close the connection. The connection object and all associated cursors\n        will become unusable.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":169
 *         will become unusable.
 *         """
 *         if self.conn:             # <<<<<<<<<<<<<<
 *             self.rollback()
 *             mysql_close(self.conn)
 */
  __pyx_t_1 = (((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":170
 *         """
 *         if self.conn:
 *             self.rollback()             # <<<<<<<<<<<<<<
 *             mysql_close(self.conn)
 *             self.conn = NULL
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rollback); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":171
 *         if self.conn:
 *             self.rollback()
 *             mysql_close(self.conn)             # <<<<<<<<<<<<<<
 *             self.conn = NULL
 * 
 */
    mysql_close(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":172
 *             self.rollback()
 *             mysql_close(self.conn)
 *             self.conn = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Connection.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":174
 *             self.conn = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             mysql_close(self.conn)
 */

static void __pyx_pf_6oursql_10Connection_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6oursql_10Connection_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":175
 * 
 *     def __dealloc__(self):
 *         if self.conn:             # <<<<<<<<<<<<<<
 *             mysql_close(self.conn)
 *             self.conn = NULL
 */
  __pyx_t_1 = (((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":176
 *     def __dealloc__(self):
 *         if self.conn:
 *             mysql_close(self.conn)             # <<<<<<<<<<<<<<
 *             self.conn = NULL
 * 
 */
    mysql_close(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":177
 *         if self.conn:
 *             mysql_close(self.conn)
 *             self.conn = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef int _raise_error(self) except -1:
 */
    ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_RefNannyFinishContext();
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":179
 *             self.conn = NULL
 * 
 *     cdef int _raise_error(self) except -1:             # <<<<<<<<<<<<<<
 *         # _raise_error can only be called internally, so we shouldn't need to
 *         # check for if the connection is closed.
 */

static int __pyx_f_6oursql_10Connection__raise_error(struct __pyx_obj_6oursql_Connection *__pyx_v_self) {
  int __pyx_v_err;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":182
 *         # _raise_error can only be called internally, so we shouldn't need to
 *         # check for if the connection is closed.
 *         cdef int err = mysql_errno(self.conn)             # <<<<<<<<<<<<<<
 *         raise _exception_from_errno(err)(mysql_error(self.conn), err)
 * 
 */
  __pyx_v_err = mysql_errno(__pyx_v_self->conn);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":183
 *         # check for if the connection is closed.
 *         cdef int err = mysql_errno(self.conn)
 *         raise _exception_from_errno(err)(mysql_error(self.conn), err)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _check_closed(self) except -1:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyBytes_FromString(mysql_error(__pyx_v_self->conn)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":185
 *         raise _exception_from_errno(err)(mysql_error(self.conn), err)
 * 
 *     cdef int _check_closed(self) except -1:             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             raise ProgrammingError('connection closed')
 */

static int __pyx_f_6oursql_10Connection__check_closed(struct __pyx_obj_6oursql_Connection *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_closed");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":186
 * 
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('connection closed')
 * 
 */
  __pyx_t_1 = (!(__pyx_v_self->conn != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":187
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn:
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 * 
 *     def ping(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Connection._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":189
 *             raise ProgrammingError('connection closed')
 * 
 *     def ping(self):             # <<<<<<<<<<<<<<
 *         """ping()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_4ping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_4ping[] = "ping()\n        \n        Make sure that the database connection is still open. If not, silently\n        reconnect.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_4ping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ping");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":195
 *         reconnect.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if mysql_ping(self.conn):
 *             self._raise_error()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":196
 *         """
 *         self._check_closed()
 *         if mysql_ping(self.conn):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 * 
 */
  __pyx_t_1 = __pyx_f_6oursql_mysql_ping(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":197
 *         self._check_closed()
 *         if mysql_ping(self.conn):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     def commit(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql.Connection.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":199
 *             self._raise_error()
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         """commit()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_5commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_5commit[] = "commit()\n        \n        Commit the current transaction.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_5commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  my_bool __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("commit");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":204
 *         Commit the current transaction.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if mysql_commit(self.conn):
 *             self._raise_error()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":205
 *         """
 *         self._check_closed()
 *         if mysql_commit(self.conn):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 * 
 */
  __pyx_t_2 = __pyx_f_6oursql_mysql_commit(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":206
 *         self._check_closed()
 *         if mysql_commit(self.conn):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     def rollback(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql.Connection.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":208
 *             self._raise_error()
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         """rollback()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_6rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_6rollback[] = "rollback()\n        \n        Roll back the current transaction.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_6rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  my_bool __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rollback");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":213
 *         Roll back the current transaction.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if mysql_rollback(self.conn):
 *             self._raise_error()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":214
 *         """
 *         self._check_closed()
 *         if mysql_rollback(self.conn):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 * 
 */
  __pyx_t_2 = __pyx_f_6oursql_mysql_rollback(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":215
 *         self._check_closed()
 *         if mysql_rollback(self.conn):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     property charset:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql.Connection.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":224
 *         strings.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             self._charset = PyString_FromString(
 *                 mysql_character_set_name(self.conn))
 */

static PyObject *__pyx_pf_6oursql_10Connection_7charset___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_7charset___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":226
 *         def __get__(self):
 *             self._charset = PyString_FromString(
 *                 mysql_character_set_name(self.conn))             # <<<<<<<<<<<<<<
 *             return self._charset
 *         def __set__(self, value):
 */
  __pyx_t_1 = PyString_FromString(mysql_character_set_name(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":225
 *         """
 *         def __get__(self):
 *             self._charset = PyString_FromString(             # <<<<<<<<<<<<<<
 *                 mysql_character_set_name(self.conn))
 *             return self._charset
 */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":227
 *             self._charset = PyString_FromString(
 *                 mysql_character_set_name(self.conn))
 *             return self._charset             # <<<<<<<<<<<<<<
 *         def __set__(self, value):
 *             cdef char *svalue
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset);
  __pyx_r = ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection.charset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":228
 *                 mysql_character_set_name(self.conn))
 *             return self._charset
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef char *svalue
 *             self._check_closed()
 */

static int __pyx_pf_6oursql_10Connection_7charset_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_10Connection_7charset_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  char *__pyx_v_svalue;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":230
 *         def __set__(self, value):
 *             cdef char *svalue
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             svalue = PyString_AsString(value)
 *             if mysql_set_character_set(self.conn, svalue):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":231
 *             cdef char *svalue
 *             self._check_closed()
 *             svalue = PyString_AsString(value)             # <<<<<<<<<<<<<<
 *             if mysql_set_character_set(self.conn, svalue):
 *                 self._raise_error()
 */
  __pyx_t_2 = PyString_AsString(__pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_svalue = __pyx_t_2;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":232
 *             self._check_closed()
 *             svalue = PyString_AsString(value)
 *             if mysql_set_character_set(self.conn, svalue):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             self._charset = value
 */
  __pyx_t_1 = mysql_set_character_set(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, __pyx_v_svalue);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":233
 *             svalue = PyString_AsString(value)
 *             if mysql_set_character_set(self.conn, svalue):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             self._charset = value
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":234
 *             if mysql_set_character_set(self.conn, svalue):
 *                 self._raise_error()
 *             self._charset = value             # <<<<<<<<<<<<<<
 * 
 *     def warning_count(self):
 */
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_charset = __pyx_v_value;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql.Connection.charset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":236
 *             self._charset = value
 * 
 *     def warning_count(self):             # <<<<<<<<<<<<<<
 *         """warning_count() -> int
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_7warning_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_7warning_count[] = "warning_count() -> int\n        \n        Return the number of warnings caused by the most-previously-executed\n        query or statement.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_7warning_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("warning_count");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":242
 *         query or statement.
 *         """
 *         return mysql_warning_count(self.conn)             # <<<<<<<<<<<<<<
 * 
 *     def cursor(self, cursor_class=None, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(mysql_warning_count(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection.warning_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":244
 *         return mysql_warning_count(self.conn)
 * 
 *     def cursor(self, cursor_class=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """cursor([cursor_class,] **cursor_options) -> Cursor.
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_8cursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_10Connection_8cursor[] = "cursor([cursor_class,] **cursor_options) -> Cursor.\n        \n        Create a new cursor associated with this connection of the specified \n        type. If no cursor class is specified, the 'default_cursor' attribute\n        is used as the cursor class. The cursor_options will be forwarded to \n        the cursor's initializer; see the documentation for the cursor classes \n        for details.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_8cursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cursor_class = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cursor_class,0};
  __Pyx_RefNannySetupContext("cursor");
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cursor_class);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "cursor") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cursor_class = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cursor", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("oursql.Connection.cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_cursor_class);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":253
 *         for details.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if cursor_class is None:
 *             cursor_class = self.default_cursor
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":254
 *         """
 *         self._check_closed()
 *         if cursor_class is None:             # <<<<<<<<<<<<<<
 *             cursor_class = self.default_cursor
 *         return cursor_class(self, **kwargs)
 */
  __pyx_t_2 = (__pyx_v_cursor_class == Py_None);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":255
 *         self._check_closed()
 *         if cursor_class is None:
 *             cursor_class = self.default_cursor             # <<<<<<<<<<<<<<
 *         return cursor_class(self, **kwargs)
 * 
 */
    __Pyx_INCREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
    __Pyx_DECREF(__pyx_v_cursor_class);
    __pyx_v_cursor_class = ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":256
 *         if cursor_class is None:
 *             cursor_class = self.default_cursor
 *         return cursor_class(self, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     property server_info:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_v_cursor_class, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection.cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_cursor_class);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":259
 * 
 *     property server_info:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             self._check_closed()
 *             return mysql_get_server_info(self.conn)
 */

static PyObject *__pyx_pf_6oursql_10Connection_11server_info___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_11server_info___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":260
 *     property server_info:
 *         def __get__(self):
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             return mysql_get_server_info(self.conn)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":261
 *         def __get__(self):
 *             self._check_closed()
 *             return mysql_get_server_info(self.conn)             # <<<<<<<<<<<<<<
 * 
 *     property ssl_cipher:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyBytes_FromString(mysql_get_server_info(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Connection.server_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":264
 * 
 *     property ssl_cipher:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef const_char *res
 *             self._check_closed()
 */

static PyObject *__pyx_pf_6oursql_10Connection_10ssl_cipher___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_10ssl_cipher___get__(PyObject *__pyx_v_self) {
  const char *__pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":266
 *         def __get__(self):
 *             cdef const_char *res
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             res = mysql_get_ssl_cipher(self.conn)
 *             if not res:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":267
 *             cdef const_char *res
 *             self._check_closed()
 *             res = mysql_get_ssl_cipher(self.conn)             # <<<<<<<<<<<<<<
 *             if not res:
 *                 return None
 */
  __pyx_v_res = mysql_get_ssl_cipher(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":268
 *             self._check_closed()
 *             res = mysql_get_ssl_cipher(self.conn)
 *             if not res:             # <<<<<<<<<<<<<<
 *                 return None
 *             return PyString_FromString(res)
 */
  __pyx_t_2 = (!(__pyx_v_res != 0));
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":269
 *             res = mysql_get_ssl_cipher(self.conn)
 *             if not res:
 *                 return None             # <<<<<<<<<<<<<<
 *             return PyString_FromString(res)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":270
 *             if not res:
 *                 return None
 *             return PyString_FromString(res)             # <<<<<<<<<<<<<<
 * 
 *     # Unless someone is monkeying around with calling __enter__ and __exit__
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyString_FromString(__pyx_v_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Connection.ssl_cipher.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":274
 *     # Unless someone is monkeying around with calling __enter__ and __exit__
 *     # manually, this approach is the simplest. Yaaay mostly-reentrant code.
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         curs = self.cursor()
 *         self._context_cursors.append(curs)
 */

static PyObject *__pyx_pf_6oursql_10Connection_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_curs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":275
 *     # manually, this approach is the simplest. Yaaay mostly-reentrant code.
 *     def __enter__(self):
 *         curs = self.cursor()             # <<<<<<<<<<<<<<
 *         self._context_cursors.append(curs)
 *         return curs.__enter__()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cursor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_curs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":276
 *     def __enter__(self):
 *         curs = self.cursor()
 *         self._context_cursors.append(curs)             # <<<<<<<<<<<<<<
 *         return curs.__enter__()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Append(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_context_cursors, __pyx_v_curs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":277
 *         curs = self.cursor()
 *         self._context_cursors.append(curs)
 *         return curs.__enter__()             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc, value, tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_curs, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Connection.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_curs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":279
 *         return curs.__enter__()
 * 
 *     def __exit__(self, exc, value, tb):             # <<<<<<<<<<<<<<
 *         curs = self._context_cursors.pop()
 *         curs.__exit__(exc, value, tb)
 */

static PyObject *__pyx_pf_6oursql_10Connection_10__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_10__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_tb = 0;
  PyObject *__pyx_v_curs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__exc,&__pyx_n_s__value,&__pyx_n_s__tb,0};
  __Pyx_RefNannySetupContext("__exit__");
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__exc);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tb);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__exit__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc = values[0];
    __pyx_v_value = values[1];
    __pyx_v_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Connection.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":280
 * 
 *     def __exit__(self, exc, value, tb):
 *         curs = self._context_cursors.pop()             # <<<<<<<<<<<<<<
 *         curs.__exit__(exc, value, tb)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Pop(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->_context_cursors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_curs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":281
 *     def __exit__(self, exc, value, tb):
 *         curs = self._context_cursors.pop()
 *         curs.__exit__(exc, value, tb)             # <<<<<<<<<<<<<<
 * 
 *     # FML.
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_curs, __pyx_n_s____exit__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_exc);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exc);
  __Pyx_GIVEREF(__pyx_v_exc);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_INCREF(__pyx_v_tb);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_tb);
  __Pyx_GIVEREF(__pyx_v_tb);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Connection.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_curs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":284
 * 
 *     # FML.
 *     def _escape_string(self, value):             # <<<<<<<<<<<<<<
 *         """_escape_string(value) -> str.
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_11_escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6oursql_10Connection_11_escape_string[] = "_escape_string(value) -> str.\n        \n        A wrapper around mysql_real_escape_string. Takes a bytestring in and \n        produces a bytestring out. Please do not every use this unless mysql\n        refuses to parameterize a query; oursql has good support for \n        parameterization which also works consistently with unicode.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_11_escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_escape_string");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":292
 *         parameterization which also works consistently with unicode.
 *         """
 *         return _oursqlx_escape_string(self.conn, value)             # <<<<<<<<<<<<<<
 * 
 *     def _escape_unicode_string(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = _oursqlx_escape_string(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection._escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":294
 *         return _oursqlx_escape_string(self.conn, value)
 * 
 *     def _escape_unicode_string(self, value):             # <<<<<<<<<<<<<<
 *         """_escape_unicode_stirng(value) -> unicode.
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_12_escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6oursql_10Connection_12_escape_unicode_string[] = "_escape_unicode_stirng(value) -> unicode.\n        \n        _escape_string that takes unicode in and produces unicode out, using\n        the connection's charset. As with _escape_string, please do not use \n        this function.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_12_escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_escape_unicode_string");

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":301
 *         this function.
 *         """
 *         return self._escape_string(             # <<<<<<<<<<<<<<
 *             value.encode(self.charset)).decode(self.charset)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":302
 *         """
 *         return self._escape_string(
 *             value.encode(self.charset)).decode(self.charset)             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___escape_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":301
 *         this function.
 *         """
 *         return self._escape_string(             # <<<<<<<<<<<<<<
 *             value.encode(self.charset)).decode(self.charset)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_value, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":302
 *         """
 *         return self._escape_string(
 *             value.encode(self.charset)).decode(self.charset)             # <<<<<<<<<<<<<<
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__charset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__charset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection._escape_unicode_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":73
 *     cdef MYSQL *conn
 *     cdef object _charset, _context_cursors
 *     cdef readonly int use_unicode, autoping, raise_on_warnings             # <<<<<<<<<<<<<<
 *     cdef public object default_cursor
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_11use_unicode___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_11use_unicode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->use_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection.use_unicode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_10Connection_8autoping___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_8autoping___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->autoping); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection.autoping.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->raise_on_warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Connection.raise_on_warnings.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/connection.pyx":74
 *     cdef object _charset, _context_cursors
 *     cdef readonly int use_unicode, autoping, raise_on_warnings
 *     cdef public object default_cursor             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, char *host=NULL, char *user=NULL, char *passwd=NULL, *,
 */

static PyObject *__pyx_pf_6oursql_10Connection_14default_cursor___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection_14default_cursor___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  __pyx_r = ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10Connection_14default_cursor_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_10Connection_14default_cursor_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10Connection_14default_cursor_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6oursql_10Connection_14default_cursor_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor);
  ((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->default_cursor = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":9
 * 
 * cdef class _AbstractIterWrapper:
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":10
 * cdef class _AbstractIterWrapper:
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * cdef class _BinaryWhateverMixin:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":13
 * 
 * cdef class _BinaryWhateverMixin:
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         ret = super(BinaryFileWrapper, self).next()
 *         return PyBuffer_FromObject(ret, 0, Py_END_OF_BUFFER)
 */

static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin___next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":14
 * cdef class _BinaryWhateverMixin:
 *     def __next__(self):
 *         ret = super(BinaryFileWrapper, self).next()             # <<<<<<<<<<<<<<
 *         return PyBuffer_FromObject(ret, 0, Py_END_OF_BUFFER)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__BinaryFileWrapper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":15
 *     def __next__(self):
 *         ret = super(BinaryFileWrapper, self).next()
 *         return PyBuffer_FromObject(ret, 0, Py_END_OF_BUFFER)             # <<<<<<<<<<<<<<
 * 
 * cdef class IterWrapper(_AbstractIterWrapper):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBuffer_FromObject(__pyx_v_ret, 0, Py_END_OF_BUFFER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._BinaryWhateverMixin.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":28
 *     cdef object iterobj, nextfunc
 * 
 *     def __cinit__(self, iterobj):             # <<<<<<<<<<<<<<
 *         self.iterobj = iter(iterobj)
 *         self.nextfunc = self.iterobj.next
 */

static int __pyx_pf_6oursql_11IterWrapper___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_11IterWrapper___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_iterobj = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterobj,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterobj);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_iterobj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.IterWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":29
 * 
 *     def __cinit__(self, iterobj):
 *         self.iterobj = iter(iterobj)             # <<<<<<<<<<<<<<
 *         self.nextfunc = self.iterobj.next
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_iterobj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->iterobj);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->iterobj);
  ((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->iterobj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":30
 *     def __cinit__(self, iterobj):
 *         self.iterobj = iter(iterobj)
 *         self.nextfunc = self.iterobj.next             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->iterobj, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->nextfunc);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->nextfunc);
  ((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->nextfunc = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.IterWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":32
 *         self.nextfunc = self.iterobj.next
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return self.nextfunc()
 * 
 */

static PyObject *__pyx_pf_6oursql_11IterWrapper_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_11IterWrapper_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":33
 * 
 *     def __next__(self):
 *         return self.nextfunc()             # <<<<<<<<<<<<<<
 * 
 * BinaryIterWrapper = type('BinaryIterWrapper',
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Call(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)->nextfunc, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.IterWrapper.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":59
 *     cdef int doclose, done
 * 
 *     def __cinit__(self, fileobj, chunksize=8192, bint doclose=False):             # <<<<<<<<<<<<<<
 *         self.fileobj = fileobj
 *         self.readfunc = fileobj.read
 */

static int __pyx_pf_6oursql_11FileWrapper___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_11FileWrapper___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fileobj = 0;
  PyObject *__pyx_v_chunksize = 0;
  int __pyx_v_doclose;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fileobj,&__pyx_n_s__chunksize,&__pyx_n_s__doclose,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_8192);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileobj);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chunksize);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__doclose);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fileobj = values[0];
    __pyx_v_chunksize = values[1];
    if (values[2]) {
      __pyx_v_doclose = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_doclose == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_doclose = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.FileWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":60
 * 
 *     def __cinit__(self, fileobj, chunksize=8192, bint doclose=False):
 *         self.fileobj = fileobj             # <<<<<<<<<<<<<<
 *         self.readfunc = fileobj.read
 *         self.chunksize = chunksize
 */
  __Pyx_INCREF(__pyx_v_fileobj);
  __Pyx_GIVEREF(__pyx_v_fileobj);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->fileobj);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->fileobj);
  ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->fileobj = __pyx_v_fileobj;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":61
 *     def __cinit__(self, fileobj, chunksize=8192, bint doclose=False):
 *         self.fileobj = fileobj
 *         self.readfunc = fileobj.read             # <<<<<<<<<<<<<<
 *         self.chunksize = chunksize
 *         self.doclose = doclose
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_fileobj, __pyx_n_s__read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->readfunc);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->readfunc);
  ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->readfunc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":62
 *         self.fileobj = fileobj
 *         self.readfunc = fileobj.read
 *         self.chunksize = chunksize             # <<<<<<<<<<<<<<
 *         self.doclose = doclose
 *         self.done = False
 */
  __Pyx_INCREF(__pyx_v_chunksize);
  __Pyx_GIVEREF(__pyx_v_chunksize);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize = __pyx_v_chunksize;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":63
 *         self.readfunc = fileobj.read
 *         self.chunksize = chunksize
 *         self.doclose = doclose             # <<<<<<<<<<<<<<
 *         self.done = False
 * 
 */
  ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->doclose = __pyx_v_doclose;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":64
 *         self.chunksize = chunksize
 *         self.doclose = doclose
 *         self.done = False             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->done = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.FileWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":66
 *         self.done = False
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.done:
 *             raise StopIteration
 */

static PyObject *__pyx_pf_6oursql_11FileWrapper_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_11FileWrapper_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":67
 * 
 *     def __next__(self):
 *         if self.done:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         ret = self.readfunc(self.chunksize)
 */
  if (((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->done) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":68
 *     def __next__(self):
 *         if self.done:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         ret = self.readfunc(self.chunksize)
 *         if not ret:
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":69
 *         if self.done:
 *             raise StopIteration
 *         ret = self.readfunc(self.chunksize)             # <<<<<<<<<<<<<<
 *         if not ret:
 *             if self.doclose:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  __Pyx_GIVEREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  __pyx_t_2 = PyObject_Call(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->readfunc, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_ret = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":70
 *             raise StopIteration
 *         ret = self.readfunc(self.chunksize)
 *         if not ret:             # <<<<<<<<<<<<<<
 *             if self.doclose:
 *                 self.fileobj.close()
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":71
 *         ret = self.readfunc(self.chunksize)
 *         if not ret:
 *             if self.doclose:             # <<<<<<<<<<<<<<
 *                 self.fileobj.close()
 *             self.done = True
 */
    if (((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->doclose) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":72
 *         if not ret:
 *             if self.doclose:
 *                 self.fileobj.close()             # <<<<<<<<<<<<<<
 *             self.done = True
 *             raise StopIteration
 */
      __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->fileobj, __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":73
 *             if self.doclose:
 *                 self.fileobj.close()
 *             self.done = True             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return ret
 */
    ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->done = 1;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":74
 *                 self.fileobj.close()
 *             self.done = True
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":75
 *             self.done = True
 *             raise StopIteration
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * BinaryFileWrapper = type('BinaryFileWrapper',
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.FileWrapper.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":101
 *     cdef public object warnings
 * 
 *     def __cinit__(self, Connection connection not None,             # <<<<<<<<<<<<<<
 *             unsigned long string_limit=0, bint show_table=False, **kwargs):
 *         self.conn = connection
 */

static int __pyx_pf_6oursql_10_Statement___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_10_Statement___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6oursql_Connection *__pyx_v_connection = 0;
  unsigned long __pyx_v_string_limit;
  int __pyx_v_show_table;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  my_bool __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__connection,&__pyx_n_s__string_limit,&__pyx_n_s__show_table,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__connection);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string_limit);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__show_table);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_connection = ((struct __pyx_obj_6oursql_Connection *)values[0]);
    if (values[1]) {
      __pyx_v_string_limit = __Pyx_PyInt_AsUnsignedLong(values[1]); if (unlikely((__pyx_v_string_limit == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_string_limit = ((unsigned long)0);
    }
    if (values[2]) {
      __pyx_v_show_table = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_show_table == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":102
 * 
 *     def __cinit__(self, Connection connection not None,
 *             unsigned long string_limit=0, bint show_table=False, **kwargs):             # <<<<<<<<<<<<<<
 *         self.conn = connection
 *         self.stmt = mysql_stmt_init(self.conn.conn)
 */
      __pyx_v_show_table = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("oursql._Statement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_connection), __pyx_ptype_6oursql_Connection, 0, "connection", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":103
 *     def __cinit__(self, Connection connection not None,
 *             unsigned long string_limit=0, bint show_table=False, **kwargs):
 *         self.conn = connection             # <<<<<<<<<<<<<<
 *         self.stmt = mysql_stmt_init(self.conn.conn)
 *         if not self.stmt:
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_connection));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_connection));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn));
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn = __pyx_v_connection;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":104
 *             unsigned long string_limit=0, bint show_table=False, **kwargs):
 *         self.conn = connection
 *         self.stmt = mysql_stmt_init(self.conn.conn)             # <<<<<<<<<<<<<<
 *         if not self.stmt:
 *             raise MemoryError('alloc of statement failed')
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt = mysql_stmt_init(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->conn);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":105
 *         self.conn = connection
 *         self.stmt = mysql_stmt_init(self.conn.conn)
 *         if not self.stmt:             # <<<<<<<<<<<<<<
 *             raise MemoryError('alloc of statement failed')
 *         self.string_limit = string_limit
 */
  __pyx_t_1 = (!(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":106
 *         self.stmt = mysql_stmt_init(self.conn.conn)
 *         if not self.stmt:
 *             raise MemoryError('alloc of statement failed')             # <<<<<<<<<<<<<<
 *         self.string_limit = string_limit
 *         self.show_table = show_table
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":107
 *         if not self.stmt:
 *             raise MemoryError('alloc of statement failed')
 *         self.string_limit = string_limit             # <<<<<<<<<<<<<<
 *         self.show_table = show_table
 *         self.result_data = NULL
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit = __pyx_v_string_limit;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":108
 *             raise MemoryError('alloc of statement failed')
 *         self.string_limit = string_limit
 *         self.show_table = show_table             # <<<<<<<<<<<<<<
 *         self.result_data = NULL
 *         self.warnings = []
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->show_table = __pyx_v_show_table;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":109
 *         self.string_limit = string_limit
 *         self.show_table = show_table
 *         self.result_data = NULL             # <<<<<<<<<<<<<<
 *         self.warnings = []
 *         self.buffered = self.data_waiting = self.exhausted = False
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":110
 *         self.show_table = show_table
 *         self.result_data = NULL
 *         self.warnings = []             # <<<<<<<<<<<<<<
 *         self.buffered = self.data_waiting = self.exhausted = False
 *         if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type):
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":111
 *         self.result_data = NULL
 *         self.warnings = []
 *         self.buffered = self.data_waiting = self.exhausted = False             # <<<<<<<<<<<<<<
 *         if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type):
 *             self._raise_error()
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered = 0;
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting = 0;
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->exhausted = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":112
 *         self.warnings = []
 *         self.buffered = self.data_waiting = self.exhausted = False
 *         if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 * 
 */
  __pyx_t_3 = _oursqlx_init_stmt_cursor(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, (&((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->cursor_type));
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":113
 *         self.buffered = self.data_waiting = self.exhausted = False
 *         if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":115
 *             self._raise_error()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 *         PyMem_Free(self.result_data)
 */

static void __pyx_pf_6oursql_10_Statement_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6oursql_10_Statement_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":116
 * 
 *     def __dealloc__(self):
 *         self.close()             # <<<<<<<<<<<<<<
 *         PyMem_Free(self.result_data)
 *         PyMem_Free(self.bind)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":117
 *     def __dealloc__(self):
 *         self.close()
 *         PyMem_Free(self.result_data)             # <<<<<<<<<<<<<<
 *         PyMem_Free(self.bind)
 * 
 */
  PyMem_Free(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":118
 *         self.close()
 *         PyMem_Free(self.result_data)
 *         PyMem_Free(self.bind)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  PyMem_Free(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->bind);

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":120
 *         PyMem_Free(self.bind)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.stmt:
 *             mysql_stmt_close(self.stmt)
 */

static PyObject *__pyx_pf_6oursql_10_Statement_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":121
 * 
 *     def close(self):
 *         if self.stmt:             # <<<<<<<<<<<<<<
 *             mysql_stmt_close(self.stmt)
 *             self.stmt = NULL
 */
  __pyx_t_1 = (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":122
 *     def close(self):
 *         if self.stmt:
 *             mysql_stmt_close(self.stmt)             # <<<<<<<<<<<<<<
 *             self.stmt = NULL
 * 
 */
    mysql_stmt_close(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":123
 *         if self.stmt:
 *             mysql_stmt_close(self.stmt)
 *             self.stmt = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef int _raise_error(self) except -1:
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":125
 *             self.stmt = NULL
 * 
 *     cdef int _raise_error(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int err = mysql_stmt_errno(self.stmt)
 *         raise _exception_from_errno(err)(mysql_stmt_error(self.stmt), err)
 */

static int __pyx_f_6oursql_10_Statement__raise_error(struct __pyx_obj_6oursql__Statement *__pyx_v_self) {
  int __pyx_v_err;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":126
 * 
 *     cdef int _raise_error(self) except -1:
 *         cdef int err = mysql_stmt_errno(self.stmt)             # <<<<<<<<<<<<<<
 *         raise _exception_from_errno(err)(mysql_stmt_error(self.stmt), err)
 * 
 */
  __pyx_v_err = mysql_stmt_errno(__pyx_v_self->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":127
 *     cdef int _raise_error(self) except -1:
 *         cdef int err = mysql_stmt_errno(self.stmt)
 *         raise _exception_from_errno(err)(mysql_stmt_error(self.stmt), err)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _check_closed(self) except -1:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyBytes_FromString(mysql_stmt_error(__pyx_v_self->stmt)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._Statement._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":129
 *         raise _exception_from_errno(err)(mysql_stmt_error(self.stmt), err)
 * 
 *     cdef int _check_closed(self) except -1:             # <<<<<<<<<<<<<<
 *         if not self.conn.conn:
 *             if self.stmt:
 */

static int __pyx_f_6oursql_10_Statement__check_closed(struct __pyx_obj_6oursql__Statement *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_closed");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":130
 * 
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:             # <<<<<<<<<<<<<<
 *             if self.stmt:
 *                 self.close()
 */
  __pyx_t_1 = (!(__pyx_v_self->conn->conn != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":131
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:
 *             if self.stmt:             # <<<<<<<<<<<<<<
 *                 self.close()
 *             raise ProgrammingError('connection closed')
 */
    __pyx_t_1 = (__pyx_v_self->stmt != 0);
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":132
 *         if not self.conn.conn:
 *             if self.stmt:
 *                 self.close()             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('connection closed')
 *         if not self.stmt:
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":133
 *             if self.stmt:
 *                 self.close()
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if not self.stmt:
 *             raise ProgrammingError('statement closed')
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":134
 *                 self.close()
 *             raise ProgrammingError('connection closed')
 *         if not self.stmt:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('statement closed')
 * 
 */
  __pyx_t_1 = (!(__pyx_v_self->stmt != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":135
 *             raise ProgrammingError('connection closed')
 *         if not self.stmt:
 *             raise ProgrammingError('statement closed')             # <<<<<<<<<<<<<<
 * 
 *     property string_limit:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":138
 * 
 *     property string_limit:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.string_limit
 * 
 */

static PyObject *__pyx_pf_6oursql_10_Statement_12string_limit___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_12string_limit___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":139
 *     property string_limit:
 *         def __get__(self):
 *             return self.string_limit             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, unsigned long value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._Statement.string_limit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":141
 *             return self.string_limit
 * 
 *         def __set__(self, unsigned long value):             # <<<<<<<<<<<<<<
 *             if value < 0:
 *                 raise ValueError('string limit must be >= 0')
 */

static int __pyx_pf_6oursql_10_Statement_12string_limit_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pf_6oursql_10_Statement_12string_limit_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  unsigned long __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_AsUnsignedLong(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._Statement.string_limit.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":142
 * 
 *         def __set__(self, unsigned long value):
 *             if value < 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('string limit must be >= 0')
 *             self.string_limit = value
 */
  __pyx_t_1 = (__pyx_v_value < 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":143
 *         def __set__(self, unsigned long value):
 *             if value < 0:
 *                 raise ValueError('string limit must be >= 0')             # <<<<<<<<<<<<<<
 *             self.string_limit = value
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":144
 *             if value < 0:
 *                 raise ValueError('string limit must be >= 0')
 *             self.string_limit = value             # <<<<<<<<<<<<<<
 * 
 *     def prepare(self, statement):
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit = __pyx_v_value;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.string_limit.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":146
 *             self.string_limit = value
 * 
 *     def prepare(self, statement):             # <<<<<<<<<<<<<<
 *         cdef char *buf
 *         cdef Py_ssize_t bufsize
 */

static PyObject *__pyx_pf_6oursql_10_Statement_3prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_3prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement) {
  char *__pyx_v_buf;
  Py_ssize_t __pyx_v_bufsize;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare");
  __Pyx_INCREF(__pyx_v_statement);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":149
 *         cdef char *buf
 *         cdef Py_ssize_t bufsize
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if self.data_waiting:
 *             raise ProgrammingError('binding this query would cause rows to '
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":150
 *         cdef Py_ssize_t bufsize
 *         self._check_closed()
 *         if self.data_waiting:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('binding this query would cause rows to '
 *                 'become unfetchable')
 */
  if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":151
 *         self._check_closed()
 *         if self.data_waiting:
 *             raise ProgrammingError('binding this query would cause rows to '             # <<<<<<<<<<<<<<
 *                 'become unfetchable')
 *         if PyUnicode_Check(statement):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":153
 *             raise ProgrammingError('binding this query would cause rows to '
 *                 'become unfetchable')
 *         if PyUnicode_Check(statement):             # <<<<<<<<<<<<<<
 *             statement = statement.encode(self.conn.charset)
 *         PyString_AsStringAndSize(statement, &buf, &bufsize)
 */
  __pyx_t_4 = PyUnicode_Check(__pyx_v_statement);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":154
 *                 'become unfetchable')
 *         if PyUnicode_Check(statement):
 *             statement = statement.encode(self.conn.charset)             # <<<<<<<<<<<<<<
 *         PyString_AsStringAndSize(statement, &buf, &bufsize)
 *         if mysql_stmt_prepare(self.stmt, buf, bufsize):
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_statement, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_statement);
    __pyx_v_statement = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":155
 *         if PyUnicode_Check(statement):
 *             statement = statement.encode(self.conn.charset)
 *         PyString_AsStringAndSize(statement, &buf, &bufsize)             # <<<<<<<<<<<<<<
 *         if mysql_stmt_prepare(self.stmt, buf, bufsize):
 *             self._raise_error()
 */
  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_statement, (&__pyx_v_buf), (&__pyx_v_bufsize)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":156
 *             statement = statement.encode(self.conn.charset)
 *         PyString_AsStringAndSize(statement, &buf, &bufsize)
 *         if mysql_stmt_prepare(self.stmt, buf, bufsize):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         self._alloc_buffer()
 */
  __pyx_t_1 = __pyx_f_6oursql_mysql_stmt_prepare(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, __pyx_v_buf, __pyx_v_bufsize);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":157
 *         PyString_AsStringAndSize(statement, &buf, &bufsize)
 *         if mysql_stmt_prepare(self.stmt, buf, bufsize):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         self._alloc_buffer()
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":158
 *         if mysql_stmt_prepare(self.stmt, buf, bufsize):
 *             self._raise_error()
 *         self._alloc_buffer()             # <<<<<<<<<<<<<<
 * 
 *     cdef int _alloc_buffer(self) except -1:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_alloc_buffer(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql._Statement.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_statement);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":160
 *         self._alloc_buffer()
 * 
 *     cdef int _alloc_buffer(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef MYSQL_RES *res
 *         cdef MYSQL_BIND *bind = NULL
 */

static int __pyx_f_6oursql_10_Statement__alloc_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self) {
  MYSQL_RES *__pyx_v_res;
  MYSQL_BIND *__pyx_v_bind;
  struct __pyx_t_6oursql_column_output *__pyx_v_result_data;
  PyObject *__pyx_v_fields = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  unsigned int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_alloc_buffer");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":162
 *     cdef int _alloc_buffer(self) except -1:
 *         cdef MYSQL_RES *res
 *         cdef MYSQL_BIND *bind = NULL             # <<<<<<<<<<<<<<
 *         cdef column_output *result_data = NULL
 *         res = mysql_stmt_result_metadata(self.stmt)
 */
  __pyx_v_bind = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":163
 *         cdef MYSQL_RES *res
 *         cdef MYSQL_BIND *bind = NULL
 *         cdef column_output *result_data = NULL             # <<<<<<<<<<<<<<
 *         res = mysql_stmt_result_metadata(self.stmt)
 * 
 */
  __pyx_v_result_data = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":164
 *         cdef MYSQL_BIND *bind = NULL
 *         cdef column_output *result_data = NULL
 *         res = mysql_stmt_result_metadata(self.stmt)             # <<<<<<<<<<<<<<
 * 
 *         # Okay so. MySQL doesn't require that we keep around the MYSQL_BIND
 */
  __pyx_v_res = mysql_stmt_result_metadata(__pyx_v_self->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":175
 *         # So! Since we have no reason not to, we free any previously bound
 *         # buffers.
 *         PyMem_Free(self.result_data)             # <<<<<<<<<<<<<<
 *         self.result_data = NULL
 *         # But if we don't need any buffers, we're done anyway.
 */
  PyMem_Free(__pyx_v_self->result_data);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":176
 *         # buffers.
 *         PyMem_Free(self.result_data)
 *         self.result_data = NULL             # <<<<<<<<<<<<<<
 *         # But if we don't need any buffers, we're done anyway.
 *         if not res:
 */
  __pyx_v_self->result_data = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":178
 *         self.result_data = NULL
 *         # But if we don't need any buffers, we're done anyway.
 *         if not res:             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  __pyx_t_1 = (!(__pyx_v_res != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":179
 *         # But if we don't need any buffers, we're done anyway.
 *         if not res:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":181
 *             return 0
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Otherwise, we (try to) allocate the result buffers.
 *             fields = mysql_num_fields(res)
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":183
 *         try:
 *             # Otherwise, we (try to) allocate the result buffers.
 *             fields = mysql_num_fields(res)             # <<<<<<<<<<<<<<
 *             bind = <MYSQL_BIND *>PyMem_Malloc(sizeof(MYSQL_BIND) * fields)
 *             if not bind:
 */
        __pyx_t_5 = PyLong_FromUnsignedLong(mysql_num_fields(__pyx_v_res)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_v_fields = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":184
 *             # Otherwise, we (try to) allocate the result buffers.
 *             fields = mysql_num_fields(res)
 *             bind = <MYSQL_BIND *>PyMem_Malloc(sizeof(MYSQL_BIND) * fields)             # <<<<<<<<<<<<<<
 *             if not bind:
 *                 raise MemoryError('alloc of result bind structure failed')
 */
        __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fields); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_bind = ((MYSQL_BIND *)PyMem_Malloc(__pyx_t_7));

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":185
 *             fields = mysql_num_fields(res)
 *             bind = <MYSQL_BIND *>PyMem_Malloc(sizeof(MYSQL_BIND) * fields)
 *             if not bind:             # <<<<<<<<<<<<<<
 *                 raise MemoryError('alloc of result bind structure failed')
 *             memset(bind, 0, sizeof(MYSQL_BIND) * fields)
 */
        __pyx_t_1 = (!(__pyx_v_bind != 0));
        if (__pyx_t_1) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":186
 *             bind = <MYSQL_BIND *>PyMem_Malloc(sizeof(MYSQL_BIND) * fields)
 *             if not bind:
 *                 raise MemoryError('alloc of result bind structure failed')             # <<<<<<<<<<<<<<
 *             memset(bind, 0, sizeof(MYSQL_BIND) * fields)
 *             result_data = <column_output *>PyMem_Malloc(
 */
          __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":187
 *             if not bind:
 *                 raise MemoryError('alloc of result bind structure failed')
 *             memset(bind, 0, sizeof(MYSQL_BIND) * fields)             # <<<<<<<<<<<<<<
 *             result_data = <column_output *>PyMem_Malloc(
 *                 sizeof(column_output) * fields)
 */
        __pyx_t_6 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        memset(__pyx_v_bind, 0, __pyx_t_7);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":189
 *             memset(bind, 0, sizeof(MYSQL_BIND) * fields)
 *             result_data = <column_output *>PyMem_Malloc(
 *                 sizeof(column_output) * fields)             # <<<<<<<<<<<<<<
 *             if not result_data:
 *                 raise MemoryError('alloc of result buffers failed')
 */
        __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fields); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_result_data = ((struct __pyx_t_6oursql_column_output *)PyMem_Malloc(__pyx_t_7));

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":190
 *             result_data = <column_output *>PyMem_Malloc(
 *                 sizeof(column_output) * fields)
 *             if not result_data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError('alloc of result buffers failed')
 *             memset(result_data, 0, sizeof(column_output) * fields)
 */
        __pyx_t_1 = (!(__pyx_v_result_data != 0));
        if (__pyx_t_1) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":191
 *                 sizeof(column_output) * fields)
 *             if not result_data:
 *                 raise MemoryError('alloc of result buffers failed')             # <<<<<<<<<<<<<<
 *             memset(result_data, 0, sizeof(column_output) * fields)
 *         except:
 */
          __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":192
 *             if not result_data:
 *                 raise MemoryError('alloc of result buffers failed')
 *             memset(result_data, 0, sizeof(column_output) * fields)             # <<<<<<<<<<<<<<
 *         except:
 *             # We only want to free the buffers if there was a failure and we
 */
        __pyx_t_6 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        memset(__pyx_v_result_data, 0, __pyx_t_7);
      }
      /*else:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":201
 *         else:
 *             # And we only want to save the buffers if there was no failure.
 *             self.bind = bind             # <<<<<<<<<<<<<<
 *             self.result_data = result_data
 *             self.result_fields = fields
 */
        __pyx_v_self->bind = __pyx_v_bind;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":202
 *             # And we only want to save the buffers if there was no failure.
 *             self.bind = bind
 *             self.result_data = result_data             # <<<<<<<<<<<<<<
 *             self.result_fields = fields
 *         finally:
 */
        __pyx_v_self->result_data = __pyx_v_result_data;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":203
 *             self.bind = bind
 *             self.result_data = result_data
 *             self.result_fields = fields             # <<<<<<<<<<<<<<
 *         finally:
 *             # But in any case, we don't need the result.
 */
        __pyx_t_8 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_fields); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __pyx_v_self->result_fields = __pyx_t_8;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":193
 *                 raise MemoryError('alloc of result buffers failed')
 *             memset(result_data, 0, sizeof(column_output) * fields)
 *         except:             # <<<<<<<<<<<<<<
 *             # We only want to free the buffers if there was a failure and we
 *             # can't use 'em.
 */
      /*except:*/ {
        __Pyx_AddTraceback("oursql._Statement._alloc_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_9);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":196
 *             # We only want to free the buffers if there was a failure and we
 *             # can't use 'em.
 *             PyMem_Free(result_data)             # <<<<<<<<<<<<<<
 *             PyMem_Free(bind)
 *             raise
 */
        PyMem_Free(__pyx_v_result_data);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":197
 *             # can't use 'em.
 *             PyMem_Free(result_data)
 *             PyMem_Free(bind)             # <<<<<<<<<<<<<<
 *             raise
 *         else:
 */
        PyMem_Free(__pyx_v_bind);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":198
 *             PyMem_Free(result_data)
 *             PyMem_Free(bind)
 *             raise             # <<<<<<<<<<<<<<
 *         else:
 *             # And we only want to save the buffers if there was no failure.
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_9);
        __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_9);
        __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; 
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L8_exception_handled;
      }
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L5;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L14_try_end:;
    }
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":206
 *         finally:
 *             # But in any case, we don't need the result.
 *             mysql_free_result(res)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _bind_buffer(self) except -1:
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L6;
    __pyx_L5: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L6;
    }
    __pyx_L6:;
    mysql_free_result(__pyx_v_res);
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("oursql._Statement._alloc_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":208
 *             mysql_free_result(res)
 * 
 *     cdef int _bind_buffer(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef MYSQL_RES *res
 *         cdef MYSQL_FIELD *field
 */

static int __pyx_f_6oursql_10_Statement__bind_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self) {
  MYSQL_RES *__pyx_v_res;
  MYSQL_FIELD *__pyx_v_field;
  MYSQL_BIND *__pyx_v_b;
  struct __pyx_t_6oursql_column_output *__pyx_v_c;
  unsigned int __pyx_v_fields;
  unsigned int __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  MYSQL_BIND *__pyx_t_2;
  struct __pyx_t_6oursql_column_output *__pyx_t_3;
  int __pyx_t_4;
  my_bool __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind_buffer");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":214
 *         cdef column_output *c
 *         cdef unsigned int fields, i
 *         res = mysql_stmt_result_metadata(self.stmt)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_v_res = mysql_stmt_result_metadata(__pyx_v_self->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":216
 *         res = mysql_stmt_result_metadata(self.stmt)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # And now we (try to) set up the result buffers.
 *             fields = mysql_num_fields(res)
 */
  /*try:*/ {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":218
 *         try:
 *             # And now we (try to) set up the result buffers.
 *             fields = mysql_num_fields(res)             # <<<<<<<<<<<<<<
 *             for 0 <= i < fields:
 *                 b, c = &self.bind[i], &self.result_data[i]
 */
    __pyx_v_fields = mysql_num_fields(__pyx_v_res);

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":219
 *             # And now we (try to) set up the result buffers.
 *             fields = mysql_num_fields(res)
 *             for 0 <= i < fields:             # <<<<<<<<<<<<<<
 *                 b, c = &self.bind[i], &self.result_data[i]
 *                 field = mysql_fetch_field_direct(res, i)
 */
    __pyx_t_1 = __pyx_v_fields;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":220
 *             fields = mysql_num_fields(res)
 *             for 0 <= i < fields:
 *                 b, c = &self.bind[i], &self.result_data[i]             # <<<<<<<<<<<<<<
 *                 field = mysql_fetch_field_direct(res, i)
 *                 if field.type == MYSQL_TYPE_GEOMETRY:
 */
      __pyx_t_2 = (&(__pyx_v_self->bind[__pyx_v_i]));
      __pyx_t_3 = (&(__pyx_v_self->result_data[__pyx_v_i]));
      __pyx_v_b = __pyx_t_2;
      __pyx_v_c = __pyx_t_3;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":221
 *             for 0 <= i < fields:
 *                 b, c = &self.bind[i], &self.result_data[i]
 *                 field = mysql_fetch_field_direct(res, i)             # <<<<<<<<<<<<<<
 *                 if field.type == MYSQL_TYPE_GEOMETRY:
 *                     c.type = b.buffer_type = MYSQL_TYPE_STRING
 */
      __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":222
 *                 b, c = &self.bind[i], &self.result_data[i]
 *                 field = mysql_fetch_field_direct(res, i)
 *                 if field.type == MYSQL_TYPE_GEOMETRY:             # <<<<<<<<<<<<<<
 *                     c.type = b.buffer_type = MYSQL_TYPE_STRING
 *                 else:
 */
      __pyx_t_4 = (__pyx_v_field->type == MYSQL_TYPE_GEOMETRY);
      if (__pyx_t_4) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":223
 *                 field = mysql_fetch_field_direct(res, i)
 *                 if field.type == MYSQL_TYPE_GEOMETRY:
 *                     c.type = b.buffer_type = MYSQL_TYPE_STRING             # <<<<<<<<<<<<<<
 *                 else:
 *                     c.type = b.buffer_type = field.type
 */
        __pyx_v_c->type = MYSQL_TYPE_STRING;
        __pyx_v_b->buffer_type = MYSQL_TYPE_STRING;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":225
 *                     c.type = b.buffer_type = MYSQL_TYPE_STRING
 *                 else:
 *                     c.type = b.buffer_type = field.type             # <<<<<<<<<<<<<<
 *                 c.flags = field.flags
 *                 c.is_binary = (field.charsetnr == CS_BINARY)
 */
        __pyx_v_c->type = __pyx_v_field->type;
        __pyx_v_b->buffer_type = __pyx_v_field->type;
      }
      __pyx_L8:;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":226
 *                 else:
 *                     c.type = b.buffer_type = field.type
 *                 c.flags = field.flags             # <<<<<<<<<<<<<<
 *                 c.is_binary = (field.charsetnr == CS_BINARY)
 *                 b.buffer_length = sizeof(column_data)
 */
      __pyx_v_c->flags = __pyx_v_field->flags;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":227
 *                     c.type = b.buffer_type = field.type
 *                 c.flags = field.flags
 *                 c.is_binary = (field.charsetnr == CS_BINARY)             # <<<<<<<<<<<<<<
 *                 b.buffer_length = sizeof(column_data)
 *                 b.buffer = &c.buf
 */
      __pyx_v_c->is_binary = (__pyx_v_field->charsetnr == 63);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":228
 *                 c.flags = field.flags
 *                 c.is_binary = (field.charsetnr == CS_BINARY)
 *                 b.buffer_length = sizeof(column_data)             # <<<<<<<<<<<<<<
 *                 b.buffer = &c.buf
 *                 b.length = &c.length
 */
      __pyx_v_b->buffer_length = (sizeof(union __pyx_t_6oursql_column_data));

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":229
 *                 c.is_binary = (field.charsetnr == CS_BINARY)
 *                 b.buffer_length = sizeof(column_data)
 *                 b.buffer = &c.buf             # <<<<<<<<<<<<<<
 *                 b.length = &c.length
 *                 b.is_null = &c.is_null
 */
      __pyx_v_b->buffer = (&__pyx_v_c->buf);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":230
 *                 b.buffer_length = sizeof(column_data)
 *                 b.buffer = &c.buf
 *                 b.length = &c.length             # <<<<<<<<<<<<<<
 *                 b.is_null = &c.is_null
 *                 b.error = &c.error
 */
      __pyx_v_b->length = (&__pyx_v_c->length);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":231
 *                 b.buffer = &c.buf
 *                 b.length = &c.length
 *                 b.is_null = &c.is_null             # <<<<<<<<<<<<<<
 *                 b.error = &c.error
 *                 if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG:
 */
      __pyx_v_b->is_null = (&__pyx_v_c->is_null);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":232
 *                 b.length = &c.length
 *                 b.is_null = &c.is_null
 *                 b.error = &c.error             # <<<<<<<<<<<<<<
 *                 if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG:
 *                     b.is_unsigned = True
 */
      __pyx_v_b->error = (&__pyx_v_c->error);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":233
 *                 b.is_null = &c.is_null
 *                 b.error = &c.error
 *                 if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG:             # <<<<<<<<<<<<<<
 *                     b.is_unsigned = True
 *             if mysql_stmt_bind_result(self.stmt, self.bind):
 */
      __pyx_t_4 = ((__pyx_v_field->flags & __pyx_v_6oursql_UNSIGNED_NUM_FLAG) == __pyx_v_6oursql_UNSIGNED_NUM_FLAG);
      if (__pyx_t_4) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":234
 *                 b.error = &c.error
 *                 if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG:
 *                     b.is_unsigned = True             # <<<<<<<<<<<<<<
 *             if mysql_stmt_bind_result(self.stmt, self.bind):
 *                 self._raise_error()
 */
        __pyx_v_b->is_unsigned = 1;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":235
 *                 if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG:
 *                     b.is_unsigned = True
 *             if mysql_stmt_bind_result(self.stmt, self.bind):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *         finally:
 */
    __pyx_t_5 = mysql_stmt_bind_result(__pyx_v_self->stmt, __pyx_v_self->bind);
    if (__pyx_t_5) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":236
 *                     b.is_unsigned = True
 *             if mysql_stmt_bind_result(self.stmt, self.bind):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             # And clean up the result data.
 */
      __pyx_t_6 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L4;}
      goto __pyx_L10;
    }
    __pyx_L10:;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":239
 *         finally:
 *             # And clean up the result data.
 *             mysql_free_result(res)             # <<<<<<<<<<<<<<
 * 
 *     property has_result:
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L5;
    __pyx_L4: {
      __pyx_why = 4;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L5;
    }
    __pyx_L5:;
    mysql_free_result(__pyx_v_res);
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql._Statement._bind_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":242
 * 
 *     property has_result:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             self._check_closed()
 *             return self.result_data != NULL
 */

static PyObject *__pyx_pf_6oursql_10_Statement_10has_result___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_10has_result___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":243
 *     property has_result:
 *         def __get__(self):
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             return self.result_data != NULL
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":244
 *         def __get__(self):
 *             self._check_closed()
 *             return self.result_data != NULL             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data != NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.has_result.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":247
 * 
 *     property description:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef MYSQL_RES *res
 *             self._check_closed()
 */

static PyObject *__pyx_pf_6oursql_10_Statement_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_11description___get__(PyObject *__pyx_v_self) {
  MYSQL_RES *__pyx_v_res;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":249
 *         def __get__(self):
 *             cdef MYSQL_RES *res
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             if not self.result_data:
 *                 return None
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":250
 *             cdef MYSQL_RES *res
 *             self._check_closed()
 *             if not self.result_data:             # <<<<<<<<<<<<<<
 *                 return None
 *             res = mysql_stmt_result_metadata(self.stmt)
 */
  __pyx_t_2 = (!(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data != 0));
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":251
 *             self._check_closed()
 *             if not self.result_data:
 *                 return None             # <<<<<<<<<<<<<<
 *             res = mysql_stmt_result_metadata(self.stmt)
 *             if not res:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":252
 *             if not self.result_data:
 *                 return None
 *             res = mysql_stmt_result_metadata(self.stmt)             # <<<<<<<<<<<<<<
 *             if not res:
 *                 self.result_data = NULL
 */
  __pyx_v_res = mysql_stmt_result_metadata(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":253
 *                 return None
 *             res = mysql_stmt_result_metadata(self.stmt)
 *             if not res:             # <<<<<<<<<<<<<<
 *                 self.result_data = NULL
 *                 return
 */
  __pyx_t_2 = (!(__pyx_v_res != 0));
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":254
 *             res = mysql_stmt_result_metadata(self.stmt)
 *             if not res:
 *                 self.result_data = NULL             # <<<<<<<<<<<<<<
 *                 return
 *             try:
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data = NULL;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":255
 *             if not res:
 *                 self.result_data = NULL
 *                 return             # <<<<<<<<<<<<<<
 *             try:
 *                 ret = description_from_res(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":256
 *                 self.result_data = NULL
 *                 return
 *             try:             # <<<<<<<<<<<<<<
 *                 ret = description_from_res(
 *                     res, self.result_fields, self.show_table)
 */
  /*try:*/ {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":258
 *             try:
 *                 ret = description_from_res(
 *                     res, self.result_fields, self.show_table)             # <<<<<<<<<<<<<<
 *             finally:
 *                 mysql_free_result(res)
 */
    __pyx_t_3 = __pyx_f_6oursql_description_from_res(__pyx_v_res, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_fields, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->show_table); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ret = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":260
 *                     res, self.result_fields, self.show_table)
 *             finally:
 *                 mysql_free_result(res)             # <<<<<<<<<<<<<<
 *             return ret
 * 
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L9;
    __pyx_L8: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L9;
    }
    __pyx_L9:;
    mysql_free_result(__pyx_v_res);
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":261
 *             finally:
 *                 mysql_free_result(res)
 *             return ret             # <<<<<<<<<<<<<<
 * 
 *     property column_names:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":264
 * 
 *     property column_names:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             desc = self.description
 *             if desc is None:
 */

static PyObject *__pyx_pf_6oursql_10_Statement_12column_names___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_12column_names___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":265
 *     property column_names:
 *         def __get__(self):
 *             desc = self.description             # <<<<<<<<<<<<<<
 *             if desc is None:
 *                 return None
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_desc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":266
 *         def __get__(self):
 *             desc = self.description
 *             if desc is None:             # <<<<<<<<<<<<<<
 *                 return None
 *             return [x[0] for x in desc]
 */
  __pyx_t_2 = (__pyx_v_desc == Py_None);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":267
 *             desc = self.description
 *             if desc is None:
 *                 return None             # <<<<<<<<<<<<<<
 *             return [x[0] for x in desc]
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":268
 *             if desc is None:
 *                 return None
 *             return [x[0] for x in desc]             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, *parameters):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyList_CheckExact(__pyx_v_desc) || PyTuple_CheckExact(__pyx_v_desc)) {
    __pyx_t_3 = __pyx_v_desc; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_desc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  for (;;) {
    if (PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
    } else if (PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("oursql._Statement.column_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":270
 *             return [x[0] for x in desc]
 * 
 *     def execute(self, *parameters):             # <<<<<<<<<<<<<<
 *         cdef char *buf = NULL
 *         cdef void *long_buffer
 */

static PyObject *__pyx_pf_6oursql_10_Statement_4execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_4execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameters = 0;
  char *__pyx_v_buf;
  void *__pyx_v_long_buffer;
  MYSQL_BIND *__pyx_v_bind;
  MYSQL_BIND *__pyx_v_b;
  union __pyx_t_6oursql_column_data *__pyx_v_column;
  union __pyx_t_6oursql_column_data *__pyx_v_c;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n_params;
  Py_ssize_t __pyx_v_stmt_params;
  Py_ssize_t __pyx_v_long_buffer_size;
  PyObject *__pyx_v_long_strings = NULL;
  PyObject *__pyx_v_temp_strings = NULL;
  PyObject *__pyx_v_o = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  MYSQL_BIND *__pyx_t_8;
  union __pyx_t_6oursql_column_data *__pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  unsigned PY_LONG_LONG __pyx_t_12;
  PY_LONG_LONG __pyx_t_13;
  unsigned int __pyx_t_14;
  unsigned long __pyx_t_15;
  my_bool __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  Py_ssize_t __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("execute");
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "execute", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_parameters = __pyx_args;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":271
 * 
 *     def execute(self, *parameters):
 *         cdef char *buf = NULL             # <<<<<<<<<<<<<<
 *         cdef void *long_buffer
 *         cdef MYSQL_BIND *bind = NULL, *b
 */
  __pyx_v_buf = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":273
 *         cdef char *buf = NULL
 *         cdef void *long_buffer
 *         cdef MYSQL_BIND *bind = NULL, *b             # <<<<<<<<<<<<<<
 *         cdef column_data *column, *c
 *         cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size
 */
  __pyx_v_bind = NULL;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":276
 *         cdef column_data *column, *c
 *         cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if self.data_waiting:
 *             raise ProgrammingError('executing this query would cause rows to '
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":277
 *         cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size
 *         self._check_closed()
 *         if self.data_waiting:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('executing this query would cause rows to '
 *                 'become unfetchable')
 */
  if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":278
 *         self._check_closed()
 *         if self.data_waiting:
 *             raise ProgrammingError('executing this query would cause rows to '             # <<<<<<<<<<<<<<
 *                 'become unfetchable')
 *         n_params = PyTuple_GET_SIZE(parameters)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":280
 *             raise ProgrammingError('executing this query would cause rows to '
 *                 'become unfetchable')
 *         n_params = PyTuple_GET_SIZE(parameters)             # <<<<<<<<<<<<<<
 *         stmt_params = mysql_stmt_param_count(self.stmt)
 *         if stmt_params != n_params:
 */
  __pyx_v_n_params = PyTuple_GET_SIZE(((PyObject *)__pyx_v_parameters));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":281
 *                 'become unfetchable')
 *         n_params = PyTuple_GET_SIZE(parameters)
 *         stmt_params = mysql_stmt_param_count(self.stmt)             # <<<<<<<<<<<<<<
 *         if stmt_params != n_params:
 *             raise ProgrammingError('%d parameters expected, %d given' % (
 */
  __pyx_v_stmt_params = mysql_stmt_param_count(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":282
 *         n_params = PyTuple_GET_SIZE(parameters)
 *         stmt_params = mysql_stmt_param_count(self.stmt)
 *         if stmt_params != n_params:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('%d parameters expected, %d given' % (
 *                 stmt_params, n_params))
 */
  __pyx_t_4 = (__pyx_v_stmt_params != __pyx_v_n_params);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":283
 *         stmt_params = mysql_stmt_param_count(self.stmt)
 *         if stmt_params != n_params:
 *             raise ProgrammingError('%d parameters expected, %d given' % (             # <<<<<<<<<<<<<<
 *                 stmt_params, n_params))
 *         long_strings = []
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":284
 *         if stmt_params != n_params:
 *             raise ProgrammingError('%d parameters expected, %d given' % (
 *                 stmt_params, n_params))             # <<<<<<<<<<<<<<
 *         long_strings = []
 *         # So we don't have temporary values cleaned up before they're used.
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_stmt_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":285
 *             raise ProgrammingError('%d parameters expected, %d given' % (
 *                 stmt_params, n_params))
 *         long_strings = []             # <<<<<<<<<<<<<<
 *         # So we don't have temporary values cleaned up before they're used.
 *         temp_strings = []
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_long_strings = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":287
 *         long_strings = []
 *         # So we don't have temporary values cleaned up before they're used.
 *         temp_strings = []             # <<<<<<<<<<<<<<
 *         try:
 *             if n_params > 0:
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_temp_strings = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":288
 *         # So we don't have temporary values cleaned up before they're used.
 *         temp_strings = []
 *         try:             # <<<<<<<<<<<<<<
 *             if n_params > 0:
 *                 buf = <char *>PyMem_Malloc(
 */
  /*try:*/ {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":289
 *         temp_strings = []
 *         try:
 *             if n_params > 0:             # <<<<<<<<<<<<<<
 *                 buf = <char *>PyMem_Malloc(
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)
 */
    __pyx_t_4 = (__pyx_v_n_params > 0);
    if (__pyx_t_4) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":291
 *             if n_params > 0:
 *                 buf = <char *>PyMem_Malloc(
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)             # <<<<<<<<<<<<<<
 *                 if not buf:
 *                     raise MemoryError('alloc of bind parameters failed')
 */
      __pyx_v_buf = ((char *)PyMem_Malloc((((sizeof(MYSQL_BIND)) + (sizeof(union __pyx_t_6oursql_column_data))) * __pyx_v_n_params)));

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":292
 *                 buf = <char *>PyMem_Malloc(
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     raise MemoryError('alloc of bind parameters failed')
 *                 bind = <MYSQL_BIND *>buf
 */
      __pyx_t_4 = (!(__pyx_v_buf != 0));
      if (__pyx_t_4) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":293
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)
 *                 if not buf:
 *                     raise MemoryError('alloc of bind parameters failed')             # <<<<<<<<<<<<<<
 *                 bind = <MYSQL_BIND *>buf
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)
 */
        __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L8;}
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":294
 *                 if not buf:
 *                     raise MemoryError('alloc of bind parameters failed')
 *                 bind = <MYSQL_BIND *>buf             # <<<<<<<<<<<<<<
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)
 *                 column = <column_data *>(buf + (sizeof(MYSQL_BIND) * n_params))
 */
      __pyx_v_bind = ((MYSQL_BIND *)__pyx_v_buf);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":295
 *                     raise MemoryError('alloc of bind parameters failed')
 *                 bind = <MYSQL_BIND *>buf
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)             # <<<<<<<<<<<<<<
 *                 column = <column_data *>(buf + (sizeof(MYSQL_BIND) * n_params))
 *                 memset(column, 0, sizeof(column_data) * n_params)
 */
      memset(__pyx_v_bind, 0, ((sizeof(MYSQL_BIND)) * __pyx_v_n_params));

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":296
 *                 bind = <MYSQL_BIND *>buf
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)
 *                 column = <column_data *>(buf + (sizeof(MYSQL_BIND) * n_params))             # <<<<<<<<<<<<<<
 *                 memset(column, 0, sizeof(column_data) * n_params)
 *                 # Cache the connection charset.
 */
      __pyx_v_column = ((union __pyx_t_6oursql_column_data *)(__pyx_v_buf + ((sizeof(MYSQL_BIND)) * __pyx_v_n_params)));

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":297
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)
 *                 column = <column_data *>(buf + (sizeof(MYSQL_BIND) * n_params))
 *                 memset(column, 0, sizeof(column_data) * n_params)             # <<<<<<<<<<<<<<
 *                 # Cache the connection charset.
 *                 self.conn.charset
 */
      memset(__pyx_v_column, 0, ((sizeof(union __pyx_t_6oursql_column_data)) * __pyx_v_n_params));

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":299
 *                 memset(column, 0, sizeof(column_data) * n_params)
 *                 # Cache the connection charset.
 *                 self.conn.charset             # <<<<<<<<<<<<<<
 *                 for 0 <= i < n_params:
 *                     o = PyTuple_GET_ITEM(parameters, i)
 */
      __pyx_t_5 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":300
 *                 # Cache the connection charset.
 *                 self.conn.charset
 *                 for 0 <= i < n_params:             # <<<<<<<<<<<<<<
 *                     o = PyTuple_GET_ITEM(parameters, i)
 *                     Py_INCREF(o)
 */
      __pyx_t_7 = __pyx_v_n_params;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":301
 *                 self.conn.charset
 *                 for 0 <= i < n_params:
 *                     o = PyTuple_GET_ITEM(parameters, i)             # <<<<<<<<<<<<<<
 *                     Py_INCREF(o)
 *                     b, c = &bind[i], &column[i]
 */
        __pyx_t_5 = PyTuple_GET_ITEM(((PyObject *)__pyx_v_parameters), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF(__pyx_v_o);
        __pyx_v_o = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":302
 *                 for 0 <= i < n_params:
 *                     o = PyTuple_GET_ITEM(parameters, i)
 *                     Py_INCREF(o)             # <<<<<<<<<<<<<<
 *                     b, c = &bind[i], &column[i]
 *                     # This monolith should be refactored into something better
 */
        Py_INCREF(__pyx_v_o);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":303
 *                     o = PyTuple_GET_ITEM(parameters, i)
 *                     Py_INCREF(o)
 *                     b, c = &bind[i], &column[i]             # <<<<<<<<<<<<<<
 *                     # This monolith should be refactored into something better
 *                     # someday. It can't really work the same way as MySQLdb has
 */
        __pyx_t_8 = (&(__pyx_v_bind[__pyx_v_i]));
        __pyx_t_9 = (&(__pyx_v_column[__pyx_v_i]));
        __pyx_v_b = __pyx_t_8;
        __pyx_v_c = __pyx_t_9;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":308
 *                     # a conversion dict, since this involves some C-level union
 *                     # and buffer munging.
 *                     if o is None:             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_NULL
 *                         b.buffer = NULL
 */
        __pyx_t_4 = (__pyx_v_o == Py_None);
        if (__pyx_t_4) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":309
 *                     # and buffer munging.
 *                     if o is None:
 *                         b.buffer_type = MYSQL_TYPE_NULL             # <<<<<<<<<<<<<<
 *                         b.buffer = NULL
 *                     # I wish there was a better way to do this. The split
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_NULL;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":310
 *                     if o is None:
 *                         b.buffer_type = MYSQL_TYPE_NULL
 *                         b.buffer = NULL             # <<<<<<<<<<<<<<
 *                     # I wish there was a better way to do this. The split
 *                     # between str/unicode/buffer is to make sure that people
 */
          __pyx_v_b->buffer = NULL;
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":315
 *                     # are really really sure that they're inserting raw binary
 *                     # data into a database instead of strings.
 *                     elif PyString_Check(o) or PyUnicode_Check(o):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         if self.conn.use_unicode:
 */
        if (!PyString_Check(__pyx_v_o)) {
          __pyx_t_4 = PyUnicode_Check(__pyx_v_o);
          __pyx_t_10 = __pyx_t_4;
        } else {
          __pyx_t_10 = PyString_Check(__pyx_v_o);
        }
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":316
 *                     # data into a database instead of strings.
 *                     elif PyString_Check(o) or PyUnicode_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_STRING             # <<<<<<<<<<<<<<
 *                         if self.conn.use_unicode:
 *                             o = o.encode(self.conn._charset)
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_STRING;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":317
 *                     elif PyString_Check(o) or PyUnicode_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         if self.conn.use_unicode:             # <<<<<<<<<<<<<<
 *                             o = o.encode(self.conn._charset)
 *                             temp_strings.append(o)
 */
          if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode) {

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":318
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         if self.conn.use_unicode:
 *                             o = o.encode(self.conn._charset)             # <<<<<<<<<<<<<<
 *                             temp_strings.append(o)
 *                         PyString_AsStringAndSize(o,
 */
            __pyx_t_5 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_6));
            __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            __Pyx_GIVEREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_v_o);
            __pyx_v_o = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":319
 *                         if self.conn.use_unicode:
 *                             o = o.encode(self.conn._charset)
 *                             temp_strings.append(o)             # <<<<<<<<<<<<<<
 *                         PyString_AsStringAndSize(o,
 *                             <char **>&b.buffer, &c.st)
 */
            if (unlikely(((PyObject *)__pyx_v_temp_strings) == Py_None)) {
              PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L8;} 
            }
            __pyx_t_11 = PyList_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L8;}
            goto __pyx_L15;
          }
          __pyx_L15:;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":321
 *                             temp_strings.append(o)
 *                         PyString_AsStringAndSize(o,
 *                             <char **>&b.buffer, &c.st)             # <<<<<<<<<<<<<<
 *                         c.ul = c.st
 *                         b.length = &c.ul
 */
          __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_o, ((char **)(&__pyx_v_b->buffer)), (&__pyx_v_c->st)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L8;}

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":322
 *                         PyString_AsStringAndSize(o,
 *                             <char **>&b.buffer, &c.st)
 *                         c.ul = c.st             # <<<<<<<<<<<<<<
 *                         b.length = &c.ul
 *                     elif PyBuffer_Check(o):
 */
          __pyx_v_c->ul = __pyx_v_c->st;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":323
 *                             <char **>&b.buffer, &c.st)
 *                         c.ul = c.st
 *                         b.length = &c.ul             # <<<<<<<<<<<<<<
 *                     elif PyBuffer_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_STRING
 */
          __pyx_v_b->length = (&__pyx_v_c->ul);
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":324
 *                         c.ul = c.st
 *                         b.length = &c.ul
 *                     elif PyBuffer_Check(o):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         _oursqlx_PyObject_AsReadBuffer(o, &b.buffer, &c.st)
 */
        __pyx_t_10 = PyBuffer_Check(__pyx_v_o);
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":325
 *                         b.length = &c.ul
 *                     elif PyBuffer_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_STRING             # <<<<<<<<<<<<<<
 *                         _oursqlx_PyObject_AsReadBuffer(o, &b.buffer, &c.st)
 *                         c.ul = c.st
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_STRING;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":326
 *                     elif PyBuffer_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         _oursqlx_PyObject_AsReadBuffer(o, &b.buffer, &c.st)             # <<<<<<<<<<<<<<
 *                         c.ul = c.st
 *                         b.length = &c.ul
 */
          __pyx_t_1 = _oursqlx_PyObject_AsReadBuffer(__pyx_v_o, (&__pyx_v_b->buffer), (&__pyx_v_c->st)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L8;}

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":327
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         _oursqlx_PyObject_AsReadBuffer(o, &b.buffer, &c.st)
 *                         c.ul = c.st             # <<<<<<<<<<<<<<
 *                         b.length = &c.ul
 *                     elif PyInt_Check(o):
 */
          __pyx_v_c->ul = __pyx_v_c->st;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":328
 *                         _oursqlx_PyObject_AsReadBuffer(o, &b.buffer, &c.st)
 *                         c.ul = c.st
 *                         b.length = &c.ul             # <<<<<<<<<<<<<<
 *                     elif PyInt_Check(o):
 *                         # MYSQL_TYPE_LONG really takes a C int, not a C long.
 */
          __pyx_v_b->length = (&__pyx_v_c->ul);
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":329
 *                         c.ul = c.st
 *                         b.length = &c.ul
 *                     elif PyInt_Check(o):             # <<<<<<<<<<<<<<
 *                         # MYSQL_TYPE_LONG really takes a C int, not a C long.
 *                         # This is necessary for platforms where sizeof(long) >
 */
        __pyx_t_10 = PyInt_Check(__pyx_v_o);
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":333
 *                         # This is necessary for platforms where sizeof(long) >
 *                         # sizeof(int).
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG             # <<<<<<<<<<<<<<
 *                         c.ll = PyInt_AS_LONG(o)
 *                         b.buffer = <void *>&c.ll
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_LONGLONG;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":334
 *                         # sizeof(int).
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 *                         c.ll = PyInt_AS_LONG(o)             # <<<<<<<<<<<<<<
 *                         b.buffer = <void *>&c.ll
 *                     elif PyLong_Check(o):
 */
          __pyx_v_c->ll = PyInt_AS_LONG(__pyx_v_o);

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":335
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 *                         c.ll = PyInt_AS_LONG(o)
 *                         b.buffer = <void *>&c.ll             # <<<<<<<<<<<<<<
 *                     elif PyLong_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 */
          __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ll));
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":336
 *                         c.ll = PyInt_AS_LONG(o)
 *                         b.buffer = <void *>&c.ll
 *                     elif PyLong_Check(o):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 *                         if o >= 0:
 */
        __pyx_t_10 = PyLong_Check(__pyx_v_o);
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":337
 *                         b.buffer = <void *>&c.ll
 *                     elif PyLong_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG             # <<<<<<<<<<<<<<
 *                         if o >= 0:
 *                             c.ull = PyLong_AsUnsignedLongLong(o)
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_LONGLONG;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":338
 *                     elif PyLong_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 *                         if o >= 0:             # <<<<<<<<<<<<<<
 *                             c.ull = PyLong_AsUnsignedLongLong(o)
 *                             b.buffer = <void *>&c.ull
 */
          __pyx_t_3 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (__pyx_t_10) {

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":339
 *                         b.buffer_type = MYSQL_TYPE_LONGLONG
 *                         if o >= 0:
 *                             c.ull = PyLong_AsUnsignedLongLong(o)             # <<<<<<<<<<<<<<
 *                             b.buffer = <void *>&c.ull
 *                             b.is_unsigned = True
 */
            __pyx_t_12 = PyLong_AsUnsignedLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __pyx_v_c->ull = __pyx_t_12;

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":340
 *                         if o >= 0:
 *                             c.ull = PyLong_AsUnsignedLongLong(o)
 *                             b.buffer = <void *>&c.ull             # <<<<<<<<<<<<<<
 *                             b.is_unsigned = True
 *                         else:
 */
            __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ull));

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":341
 *                             c.ull = PyLong_AsUnsignedLongLong(o)
 *                             b.buffer = <void *>&c.ull
 *                             b.is_unsigned = True             # <<<<<<<<<<<<<<
 *                         else:
 *                             c.ll = PyLong_AsLongLong(o)
 */
            __pyx_v_b->is_unsigned = 1;
            goto __pyx_L16;
          }
          /*else*/ {

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":343
 *                             b.is_unsigned = True
 *                         else:
 *                             c.ll = PyLong_AsLongLong(o)             # <<<<<<<<<<<<<<
 *                             b.buffer = <void *>&c.ll
 *                     elif PyFloat_Check(o):
 */
            __pyx_t_13 = PyLong_AsLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __pyx_v_c->ll = __pyx_t_13;

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":344
 *                         else:
 *                             c.ll = PyLong_AsLongLong(o)
 *                             b.buffer = <void *>&c.ll             # <<<<<<<<<<<<<<
 *                     elif PyFloat_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_DOUBLE
 */
            __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ll));
          }
          __pyx_L16:;
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":345
 *                             c.ll = PyLong_AsLongLong(o)
 *                             b.buffer = <void *>&c.ll
 *                     elif PyFloat_Check(o):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_DOUBLE
 *                         c.d = PyFloat_AS_DOUBLE(o)
 */
        __pyx_t_10 = PyFloat_Check(__pyx_v_o);
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":346
 *                             b.buffer = <void *>&c.ll
 *                     elif PyFloat_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_DOUBLE             # <<<<<<<<<<<<<<
 *                         c.d = PyFloat_AS_DOUBLE(o)
 *                         b.buffer = <void *>&c.d
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_DOUBLE;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":347
 *                     elif PyFloat_Check(o):
 *                         b.buffer_type = MYSQL_TYPE_DOUBLE
 *                         c.d = PyFloat_AS_DOUBLE(o)             # <<<<<<<<<<<<<<
 *                         b.buffer = <void *>&c.d
 *                     elif isinstance(o, datetime.datetime):
 */
          __pyx_v_c->d = PyFloat_AS_DOUBLE(__pyx_v_o);

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":348
 *                         b.buffer_type = MYSQL_TYPE_DOUBLE
 *                         c.d = PyFloat_AS_DOUBLE(o)
 *                         b.buffer = <void *>&c.d             # <<<<<<<<<<<<<<
 *                     elif isinstance(o, datetime.datetime):
 *                         b.buffer_type = MYSQL_TYPE_DATETIME
 */
          __pyx_v_b->buffer = ((void *)(&__pyx_v_c->d));
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":349
 *                         c.d = PyFloat_AS_DOUBLE(o)
 *                         b.buffer = <void *>&c.d
 *                     elif isinstance(o, datetime.datetime):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_DATETIME
 *                         c.t.year = o.year
 */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__datetime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":350
 *                         b.buffer = <void *>&c.d
 *                     elif isinstance(o, datetime.datetime):
 *                         b.buffer_type = MYSQL_TYPE_DATETIME             # <<<<<<<<<<<<<<
 *                         c.t.year = o.year
 *                         c.t.month = o.month
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_DATETIME;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":351
 *                     elif isinstance(o, datetime.datetime):
 *                         b.buffer_type = MYSQL_TYPE_DATETIME
 *                         c.t.year = o.year             # <<<<<<<<<<<<<<
 *                         c.t.month = o.month
 *                         c.t.day = o.day
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.year = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":352
 *                         b.buffer_type = MYSQL_TYPE_DATETIME
 *                         c.t.year = o.year
 *                         c.t.month = o.month             # <<<<<<<<<<<<<<
 *                         c.t.day = o.day
 *                         c.t.hour = o.hour
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.month = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":353
 *                         c.t.year = o.year
 *                         c.t.month = o.month
 *                         c.t.day = o.day             # <<<<<<<<<<<<<<
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.day = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":354
 *                         c.t.month = o.month
 *                         c.t.day = o.day
 *                         c.t.hour = o.hour             # <<<<<<<<<<<<<<
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__hour); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.hour = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":355
 *                         c.t.day = o.day
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute             # <<<<<<<<<<<<<<
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__minute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.minute = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":356
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second             # <<<<<<<<<<<<<<
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__second); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.second = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":357
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond             # <<<<<<<<<<<<<<
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.date):
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_15 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_6); if (unlikely((__pyx_t_15 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.second_part = __pyx_t_15;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":358
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t             # <<<<<<<<<<<<<<
 *                     elif isinstance(o, datetime.date):
 *                         b.buffer_type = MYSQL_TYPE_DATE
 */
          __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t));
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":359
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.date):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_DATE
 *                         c.t.year = o.year
 */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__date); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":360
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.date):
 *                         b.buffer_type = MYSQL_TYPE_DATE             # <<<<<<<<<<<<<<
 *                         c.t.year = o.year
 *                         c.t.month = o.month
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_DATE;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":361
 *                     elif isinstance(o, datetime.date):
 *                         b.buffer_type = MYSQL_TYPE_DATE
 *                         c.t.year = o.year             # <<<<<<<<<<<<<<
 *                         c.t.month = o.month
 *                         c.t.day = o.day
 */
          __pyx_t_3 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__year); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_c->t.year = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":362
 *                         b.buffer_type = MYSQL_TYPE_DATE
 *                         c.t.year = o.year
 *                         c.t.month = o.month             # <<<<<<<<<<<<<<
 *                         c.t.day = o.day
 *                         b.buffer = <void *>&c.t
 */
          __pyx_t_3 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__month); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_c->t.month = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":363
 *                         c.t.year = o.year
 *                         c.t.month = o.month
 *                         c.t.day = o.day             # <<<<<<<<<<<<<<
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.time):
 */
          __pyx_t_3 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_c->t.day = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":364
 *                         c.t.month = o.month
 *                         c.t.day = o.day
 *                         b.buffer = <void *>&c.t             # <<<<<<<<<<<<<<
 *                     elif isinstance(o, datetime.time):
 *                         b.buffer_type = MYSQL_TYPE_TIME
 */
          __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t));
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":365
 *                         c.t.day = o.day
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.time):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_TIME
 *                         c.t.hour = o.hour
 */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":366
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, datetime.time):
 *                         b.buffer_type = MYSQL_TYPE_TIME             # <<<<<<<<<<<<<<
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_TIME;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":367
 *                     elif isinstance(o, datetime.time):
 *                         b.buffer_type = MYSQL_TYPE_TIME
 *                         c.t.hour = o.hour             # <<<<<<<<<<<<<<
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__hour); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.hour = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":368
 *                         b.buffer_type = MYSQL_TYPE_TIME
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute             # <<<<<<<<<<<<<<
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__minute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.minute = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":369
 *                         c.t.hour = o.hour
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second             # <<<<<<<<<<<<<<
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__second); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_6); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.second = __pyx_t_14;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":370
 *                         c.t.minute = o.minute
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond             # <<<<<<<<<<<<<<
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, decimal.Decimal):
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_15 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_6); if (unlikely((__pyx_t_15 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_c->t.second_part = __pyx_t_15;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":371
 *                         c.t.second = o.second
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t             # <<<<<<<<<<<<<<
 *                     elif isinstance(o, decimal.Decimal):
 *                         b.buffer_type = MYSQL_TYPE_NEWDECIMAL
 */
          __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t));
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":372
 *                         c.t.second_part = o.microsecond
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, decimal.Decimal):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_NEWDECIMAL
 *                         o = str(o)
 */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__Decimal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":373
 *                         b.buffer = <void *>&c.t
 *                     elif isinstance(o, decimal.Decimal):
 *                         b.buffer_type = MYSQL_TYPE_NEWDECIMAL             # <<<<<<<<<<<<<<
 *                         o = str(o)
 *                         temp_strings.append(o)
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_NEWDECIMAL;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":374
 *                     elif isinstance(o, decimal.Decimal):
 *                         b.buffer_type = MYSQL_TYPE_NEWDECIMAL
 *                         o = str(o)             # <<<<<<<<<<<<<<
 *                         temp_strings.append(o)
 *                         b.buffer = PyString_AS_STRING(o)
 */
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_INCREF(__pyx_v_o);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
          __Pyx_GIVEREF(__pyx_v_o);
          __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_v_o);
          __pyx_v_o = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":375
 *                         b.buffer_type = MYSQL_TYPE_NEWDECIMAL
 *                         o = str(o)
 *                         temp_strings.append(o)             # <<<<<<<<<<<<<<
 *                         b.buffer = PyString_AS_STRING(o)
 *                         c.ul = PyString_GET_SIZE(o)
 */
          if (unlikely(((PyObject *)__pyx_v_temp_strings) == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L8;} 
          }
          __pyx_t_11 = PyList_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L8;}

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":376
 *                         o = str(o)
 *                         temp_strings.append(o)
 *                         b.buffer = PyString_AS_STRING(o)             # <<<<<<<<<<<<<<
 *                         c.ul = PyString_GET_SIZE(o)
 *                         b.length = &c.ul
 */
          __pyx_v_b->buffer = PyString_AS_STRING(__pyx_v_o);

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":377
 *                         temp_strings.append(o)
 *                         b.buffer = PyString_AS_STRING(o)
 *                         c.ul = PyString_GET_SIZE(o)             # <<<<<<<<<<<<<<
 *                         b.length = &c.ul
 *                     elif isinstance(o, _AbstractIterWrapper):
 */
          __pyx_v_c->ul = PyString_GET_SIZE(__pyx_v_o);

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":378
 *                         b.buffer = PyString_AS_STRING(o)
 *                         c.ul = PyString_GET_SIZE(o)
 *                         b.length = &c.ul             # <<<<<<<<<<<<<<
 *                     elif isinstance(o, _AbstractIterWrapper):
 *                         b.buffer_type = MYSQL_TYPE_STRING
 */
          __pyx_v_b->length = (&__pyx_v_c->ul);
          goto __pyx_L14;
        }

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":379
 *                         c.ul = PyString_GET_SIZE(o)
 *                         b.length = &c.ul
 *                     elif isinstance(o, _AbstractIterWrapper):             # <<<<<<<<<<<<<<
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         b.length = &c.ul
 */
        __pyx_t_6 = ((PyObject *)((PyObject*)__pyx_ptype_6oursql__AbstractIterWrapper));
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_o, __pyx_t_6); 
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":380
 *                         b.length = &c.ul
 *                     elif isinstance(o, _AbstractIterWrapper):
 *                         b.buffer_type = MYSQL_TYPE_STRING             # <<<<<<<<<<<<<<
 *                         b.length = &c.ul
 *                         long_strings.append((i, o))
 */
          __pyx_v_b->buffer_type = MYSQL_TYPE_STRING;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":381
 *                     elif isinstance(o, _AbstractIterWrapper):
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         b.length = &c.ul             # <<<<<<<<<<<<<<
 *                         long_strings.append((i, o))
 *                     else:
 */
          __pyx_v_b->length = (&__pyx_v_c->ul);

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":382
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         b.length = &c.ul
 *                         long_strings.append((i, o))             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise TypeError('cannot bind %r object' % o.__class__)
 */
          if (unlikely(((PyObject *)__pyx_v_long_strings) == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;} 
          }
          __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_v_o);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_o);
          __Pyx_GIVEREF(__pyx_v_o);
          __pyx_t_6 = 0;
          __pyx_t_11 = PyList_Append(__pyx_v_long_strings, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":384
 *                         long_strings.append((i, o))
 *                     else:
 *                         raise TypeError('cannot bind %r object' % o.__class__)             # <<<<<<<<<<<<<<
 *             if mysql_stmt_bind_param(self.stmt, bind):
 *                 self._raise_error()
 */
          __pyx_t_3 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s____class__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
          __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
        }
        __pyx_L14:;
      }
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":385
 *                     else:
 *                         raise TypeError('cannot bind %r object' % o.__class__)
 *             if mysql_stmt_bind_param(self.stmt, bind):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             for i, o in long_strings:
 */
    __pyx_t_16 = mysql_stmt_bind_param(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, __pyx_v_bind);
    if (__pyx_t_16) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":386
 *                         raise TypeError('cannot bind %r object' % o.__class__)
 *             if mysql_stmt_bind_param(self.stmt, bind):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             for i, o in long_strings:
 *                 # Yaay consistency.
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":387
 *             if mysql_stmt_bind_param(self.stmt, bind):
 *                 self._raise_error()
 *             for i, o in long_strings:             # <<<<<<<<<<<<<<
 *                 # Yaay consistency.
 *                 for s in o:
 */
    if (unlikely(((PyObject *)__pyx_v_long_strings) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;} 
    }
    __pyx_t_6 = ((PyObject *)__pyx_v_long_strings); __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    for (;;) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        if (likely(PyTuple_CheckExact(sequence))) {
          if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
            if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
            else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
          }
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
            if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
            else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
          }
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_17 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_2 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_2)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        goto __pyx_L21_unpacking_done;
        __pyx_L20_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
        if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __pyx_L21_unpacking_done:;
      }
      __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_i = __pyx_t_19;
      __Pyx_XDECREF(__pyx_v_o);
      __pyx_v_o = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":389
 *             for i, o in long_strings:
 *                 # Yaay consistency.
 *                 for s in o:             # <<<<<<<<<<<<<<
 *                     if PyBuffer_Check(s):
 *                         _oursqlx_PyObject_AsReadBuffer(s,
 */
      if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
        __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3); __pyx_t_19 = 0;
        __pyx_t_20 = NULL;
      } else {
        __pyx_t_19 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext;
      }
      for (;;) {
        if (PyList_CheckExact(__pyx_t_3)) {
          if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_3)) break;
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++;
        } else if (PyTuple_CheckExact(__pyx_t_3)) {
          if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++;
        } else {
          __pyx_t_2 = __pyx_t_20(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L8;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF(__pyx_v_s);
        __pyx_v_s = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":390
 *                 # Yaay consistency.
 *                 for s in o:
 *                     if PyBuffer_Check(s):             # <<<<<<<<<<<<<<
 *                         _oursqlx_PyObject_AsReadBuffer(s,
 *                             &long_buffer, &long_buffer_size)
 */
        __pyx_t_10 = PyBuffer_Check(__pyx_v_s);
        if (__pyx_t_10) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":392
 *                     if PyBuffer_Check(s):
 *                         _oursqlx_PyObject_AsReadBuffer(s,
 *                             &long_buffer, &long_buffer_size)             # <<<<<<<<<<<<<<
 *                     else:
 *                         if self.conn.use_unicode:
 */
          __pyx_t_1 = _oursqlx_PyObject_AsReadBuffer(__pyx_v_s, (&__pyx_v_long_buffer), (&__pyx_v_long_buffer_size)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L8;}
          goto __pyx_L24;
        }
        /*else*/ {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":394
 *                             &long_buffer, &long_buffer_size)
 *                     else:
 *                         if self.conn.use_unicode:             # <<<<<<<<<<<<<<
 *                             s = s.encode(self.conn._charset)
 *                         PyString_AsStringAndSize(s,
 */
          if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode) {

            /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":395
 *                     else:
 *                         if self.conn.use_unicode:
 *                             s = s.encode(self.conn._charset)             # <<<<<<<<<<<<<<
 *                         PyString_AsStringAndSize(s,
 *                             <char **>&long_buffer, &long_buffer_size)
 */
            __pyx_t_2 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
            __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            __Pyx_GIVEREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            __pyx_t_17 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_v_s);
            __pyx_v_s = __pyx_t_17;
            __pyx_t_17 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":397
 *                             s = s.encode(self.conn._charset)
 *                         PyString_AsStringAndSize(s,
 *                             <char **>&long_buffer, &long_buffer_size)             # <<<<<<<<<<<<<<
 *                     if mysql_stmt_send_long_data(self.stmt, i,
 *                             <char *>long_buffer, long_buffer_size):
 */
          __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_s, ((char **)(&__pyx_v_long_buffer)), (&__pyx_v_long_buffer_size)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L8;}
        }
        __pyx_L24:;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":399
 *                             <char **>&long_buffer, &long_buffer_size)
 *                     if mysql_stmt_send_long_data(self.stmt, i,
 *                             <char *>long_buffer, long_buffer_size):             # <<<<<<<<<<<<<<
 *                         self._raise_error()
 *             if mysql_stmt_execute(self.stmt):
 */
        __pyx_t_16 = __pyx_f_6oursql_mysql_stmt_send_long_data(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, __pyx_v_i, ((char *)__pyx_v_long_buffer), __pyx_v_long_buffer_size);
        if (__pyx_t_16) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":400
 *                     if mysql_stmt_send_long_data(self.stmt, i,
 *                             <char *>long_buffer, long_buffer_size):
 *                         self._raise_error()             # <<<<<<<<<<<<<<
 *             if mysql_stmt_execute(self.stmt):
 *                 self._raise_error()
 */
          __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L8;}
          goto __pyx_L26;
        }
        __pyx_L26:;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":401
 *                             <char *>long_buffer, long_buffer_size):
 *                         self._raise_error()
 *             if mysql_stmt_execute(self.stmt):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered):
 */
    __pyx_t_1 = __pyx_f_6oursql_mysql_stmt_execute(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":402
 *                         self._raise_error()
 *             if mysql_stmt_execute(self.stmt):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered):
 *                 self._raise_error()
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L27;
    }
    __pyx_L27:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":403
 *             if mysql_stmt_execute(self.stmt):
 *                 self._raise_error()
 *             if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             self.exhausted = False
 */
    __pyx_t_1 = _oursqlx_stmt_cursor_prefetch(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, (&((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered));
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":404
 *                 self._raise_error()
 *             if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             self.exhausted = False
 *             if self.result_data:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L28;
    }
    __pyx_L28:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":405
 *             if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered):
 *                 self._raise_error()
 *             self.exhausted = False             # <<<<<<<<<<<<<<
 *             if self.result_data:
 *                 self.data_waiting = True
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->exhausted = 0;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":406
 *                 self._raise_error()
 *             self.exhausted = False
 *             if self.result_data:             # <<<<<<<<<<<<<<
 *                 self.data_waiting = True
 *             if self.conn.warning_count():
 */
    __pyx_t_10 = (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data != 0);
    if (__pyx_t_10) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":407
 *             self.exhausted = False
 *             if self.result_data:
 *                 self.data_waiting = True             # <<<<<<<<<<<<<<
 *             if self.conn.warning_count():
 *                 self.warnings.extend(_do_warnings_query(self.conn))
 */
      ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting = 1;
      goto __pyx_L29;
    }
    __pyx_L29:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":408
 *             if self.result_data:
 *                 self.data_waiting = True
 *             if self.conn.warning_count():             # <<<<<<<<<<<<<<
 *                 self.warnings.extend(_do_warnings_query(self.conn))
 *         finally:
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__warning_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":409
 *                 self.data_waiting = True
 *             if self.conn.warning_count():
 *                 self.warnings.extend(_do_warnings_query(self.conn))             # <<<<<<<<<<<<<<
 *         finally:
 *             PyMem_Free(buf)
 */
      __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings, __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s___do_warnings_query); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_17));
      __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn));
      PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn));
      __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn));
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
      __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_17));
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L30;
    }
    __pyx_L30:;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":411
 *                 self.warnings.extend(_do_warnings_query(self.conn))
 *         finally:
 *             PyMem_Free(buf)             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L9;
    __pyx_L8: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L9;
    }
    __pyx_L9:;
    PyMem_Free(__pyx_v_buf);
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("oursql._Statement.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parameters);
  __Pyx_XDECREF(__pyx_v_long_strings);
  __Pyx_XDECREF(__pyx_v_temp_strings);
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":413
 *             PyMem_Free(buf)
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         cdef MYSQL_BIND b_tryagain
 *         cdef column_output *c
 */

static PyObject *__pyx_pf_6oursql_10_Statement_5fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_5fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  MYSQL_BIND __pyx_v_b_tryagain;
  struct __pyx_t_6oursql_column_output *__pyx_v_c;
  union __pyx_t_6oursql_column_data *__pyx_v_d;
  unsigned int __pyx_v_i;
  int __pyx_v_result;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  my_bool __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  enum enum_field_types __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":420
 *         cdef int result
 *         cdef uint64_t u
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if not self.result_data or self.exhausted:
 *             return None
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":421
 *         cdef uint64_t u
 *         self._check_closed()
 *         if not self.result_data or self.exhausted:             # <<<<<<<<<<<<<<
 *             return None
 *         elif self.result_data:
 */
  __pyx_t_2 = (!(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data != 0));
  if (!__pyx_t_2) {
    __pyx_t_3 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->exhausted;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":422
 *         self._check_closed()
 *         if not self.result_data or self.exhausted:
 *             return None             # <<<<<<<<<<<<<<
 *         elif self.result_data:
 *             self._bind_buffer()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":423
 *         if not self.result_data or self.exhausted:
 *             return None
 *         elif self.result_data:             # <<<<<<<<<<<<<<
 *             self._bind_buffer()
 *         result = mysql_stmt_fetch(self.stmt)
 */
  __pyx_t_3 = (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data != 0);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":424
 *             return None
 *         elif self.result_data:
 *             self._bind_buffer()             # <<<<<<<<<<<<<<
 *         result = mysql_stmt_fetch(self.stmt)
 *         self.fetched += 1
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_bind_buffer(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":425
 *         elif self.result_data:
 *             self._bind_buffer()
 *         result = mysql_stmt_fetch(self.stmt)             # <<<<<<<<<<<<<<
 *         self.fetched += 1
 *         if result == 1:
 */
  __pyx_v_result = __pyx_f_6oursql_mysql_stmt_fetch(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":426
 *             self._bind_buffer()
 *         result = mysql_stmt_fetch(self.stmt)
 *         self.fetched += 1             # <<<<<<<<<<<<<<
 *         if result == 1:
 *             self._raise_error()
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->fetched = (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->fetched + 1);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":427
 *         result = mysql_stmt_fetch(self.stmt)
 *         self.fetched += 1
 *         if result == 1:             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         elif result == MYSQL_NO_DATA:
 */
  __pyx_t_3 = (__pyx_v_result == 1);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":428
 *         self.fetched += 1
 *         if result == 1:
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         elif result == MYSQL_NO_DATA:
 *             if mysql_stmt_free_result(self.stmt):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":429
 *         if result == 1:
 *             self._raise_error()
 *         elif result == MYSQL_NO_DATA:             # <<<<<<<<<<<<<<
 *             if mysql_stmt_free_result(self.stmt):
 *                 self._raise_error()
 */
  __pyx_t_3 = (__pyx_v_result == MYSQL_NO_DATA);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":430
 *             self._raise_error()
 *         elif result == MYSQL_NO_DATA:
 *             if mysql_stmt_free_result(self.stmt):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             self.buffered = self.data_waiting = False
 */
    __pyx_t_4 = mysql_stmt_free_result(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);
    if (__pyx_t_4) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":431
 *         elif result == MYSQL_NO_DATA:
 *             if mysql_stmt_free_result(self.stmt):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             self.buffered = self.data_waiting = False
 *             self.exhausted = True
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":432
 *             if mysql_stmt_free_result(self.stmt):
 *                 self._raise_error()
 *             self.buffered = self.data_waiting = False             # <<<<<<<<<<<<<<
 *             self.exhausted = True
 *             return None
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered = 0;
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting = 0;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":433
 *                 self._raise_error()
 *             self.buffered = self.data_waiting = False
 *             self.exhausted = True             # <<<<<<<<<<<<<<
 *             return None
 *         if self.result_fields == 0:
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->exhausted = 1;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":434
 *             self.buffered = self.data_waiting = False
 *             self.exhausted = True
 *             return None             # <<<<<<<<<<<<<<
 *         if self.result_fields == 0:
 *             return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":435
 *             self.exhausted = True
 *             return None
 *         if self.result_fields == 0:             # <<<<<<<<<<<<<<
 *             return ()
 *         ret = PyTuple_New(self.result_fields)
 */
  __pyx_t_3 = (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_fields == 0);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":436
 *             return None
 *         if self.result_fields == 0:
 *             return ()             # <<<<<<<<<<<<<<
 *         ret = PyTuple_New(self.result_fields)
 *         # Cache the connection charset.
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
    __pyx_r = ((PyObject *)__pyx_empty_tuple);
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":437
 *         if self.result_fields == 0:
 *             return ()
 *         ret = PyTuple_New(self.result_fields)             # <<<<<<<<<<<<<<
 *         # Cache the connection charset.
 *         self.conn.charset
 */
  __pyx_t_5 = PyTuple_New(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_ret = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":439
 *         ret = PyTuple_New(self.result_fields)
 *         # Cache the connection charset.
 *         self.conn.charset             # <<<<<<<<<<<<<<
 *         for 0 <= i < self.result_fields:
 *             c = &self.result_data[i]
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":440
 *         # Cache the connection charset.
 *         self.conn.charset
 *         for 0 <= i < self.result_fields:             # <<<<<<<<<<<<<<
 *             c = &self.result_data[i]
 *             d = &c.buf
 */
  __pyx_t_6 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_fields;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":441
 *         self.conn.charset
 *         for 0 <= i < self.result_fields:
 *             c = &self.result_data[i]             # <<<<<<<<<<<<<<
 *             d = &c.buf
 *             if c.is_null:
 */
    __pyx_v_c = (&(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data[__pyx_v_i]));

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":442
 *         for 0 <= i < self.result_fields:
 *             c = &self.result_data[i]
 *             d = &c.buf             # <<<<<<<<<<<<<<
 *             if c.is_null:
 *                 val = None
 */
    __pyx_v_d = (&__pyx_v_c->buf);

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":443
 *             c = &self.result_data[i]
 *             d = &c.buf
 *             if c.is_null:             # <<<<<<<<<<<<<<
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB,
 */
    if (__pyx_v_c->is_null) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":444
 *             d = &c.buf
 *             if c.is_null:
 *                 val = None             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB,
 *                     MYSQL_TYPE_VAR_STRING):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = Py_None;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":445
 *             if c.is_null:
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB,             # <<<<<<<<<<<<<<
 *                     MYSQL_TYPE_VAR_STRING):
 *                 # Oh string handling.
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_STRING));
    if (!__pyx_t_3) {
      __pyx_t_2 = ((int)(__pyx_t_7 == MYSQL_TYPE_BLOB));
      __pyx_t_8 = __pyx_t_2;
    } else {
      __pyx_t_8 = __pyx_t_3;
    }
    if (!__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":446
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB,
 *                     MYSQL_TYPE_VAR_STRING):             # <<<<<<<<<<<<<<
 *                 # Oh string handling.
 *                 val = None
 */
      __pyx_t_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_VAR_STRING));
      __pyx_t_2 = __pyx_t_3;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_2;
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":448
 *                     MYSQL_TYPE_VAR_STRING):
 *                 # Oh string handling.
 *                 val = None             # <<<<<<<<<<<<<<
 *                 # If the string wasn't too long to fit in our minimal buffer,
 *                 # then we can just copy it out of the buffer.
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = Py_None;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":451
 *                 # If the string wasn't too long to fit in our minimal buffer,
 *                 # then we can just copy it out of the buffer.
 *                 if not c.error:             # <<<<<<<<<<<<<<
 *                     val = PyString_FromStringAndSize(&d.c, c.length)
 *                 # If we already have all the results stored clientside, or we
 */
      __pyx_t_8 = (!__pyx_v_c->error);
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":452
 *                 # then we can just copy it out of the buffer.
 *                 if not c.error:
 *                     val = PyString_FromStringAndSize(&d.c, c.length)             # <<<<<<<<<<<<<<
 *                 # If we already have all the results stored clientside, or we
 *                 # don't care about strings being too long, or we *do* care
 */
        __pyx_t_5 = PyString_FromStringAndSize((&__pyx_v_d->c), __pyx_v_c->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L12;
      }

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":456
 *                 # don't care about strings being too long, or we *do* care
 *                 # about strings being too long and it's not too long...
 *                 elif (self.buffered             # <<<<<<<<<<<<<<
 *                         or not self.string_limit
 *                         or c.length <= self.string_limit):
 */
      if (!((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":457
 *                 # about strings being too long and it's not too long...
 *                 elif (self.buffered
 *                         or not self.string_limit             # <<<<<<<<<<<<<<
 *                         or c.length <= self.string_limit):
 *                     # First, allocate a string of the necessary length.
 */
        __pyx_t_8 = (!((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit);
        if (!__pyx_t_8) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":458
 *                 elif (self.buffered
 *                         or not self.string_limit
 *                         or c.length <= self.string_limit):             # <<<<<<<<<<<<<<
 *                     # First, allocate a string of the necessary length.
 *                     val = PyString_FromStringAndSize(NULL, c.length)
 */
          __pyx_t_2 = (__pyx_v_c->length <= ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit);
          __pyx_t_3 = __pyx_t_2;
        } else {
          __pyx_t_3 = __pyx_t_8;
        }
        __pyx_t_8 = __pyx_t_3;
      } else {
        __pyx_t_8 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered;
      }
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":460
 *                         or c.length <= self.string_limit):
 *                     # First, allocate a string of the necessary length.
 *                     val = PyString_FromStringAndSize(NULL, c.length)             # <<<<<<<<<<<<<<
 *                     # Then, fill up a MYSQL_BIND that will fetch into the
 *                     # aforementioned string.
 */
        __pyx_t_5 = PyString_FromStringAndSize(NULL, __pyx_v_c->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":463
 *                     # Then, fill up a MYSQL_BIND that will fetch into the
 *                     # aforementioned string.
 *                     memset(&b_tryagain, 0, sizeof(MYSQL_BIND))             # <<<<<<<<<<<<<<
 *                     b_tryagain.buffer_type = MYSQL_TYPE_BLOB
 *                     b_tryagain.buffer_length = c.length
 */
        memset((&__pyx_v_b_tryagain), 0, (sizeof(MYSQL_BIND)));

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":464
 *                     # aforementioned string.
 *                     memset(&b_tryagain, 0, sizeof(MYSQL_BIND))
 *                     b_tryagain.buffer_type = MYSQL_TYPE_BLOB             # <<<<<<<<<<<<<<
 *                     b_tryagain.buffer_length = c.length
 *                     b_tryagain.buffer = PyString_AS_STRING(val)
 */
        __pyx_v_b_tryagain.buffer_type = MYSQL_TYPE_BLOB;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":465
 *                     memset(&b_tryagain, 0, sizeof(MYSQL_BIND))
 *                     b_tryagain.buffer_type = MYSQL_TYPE_BLOB
 *                     b_tryagain.buffer_length = c.length             # <<<<<<<<<<<<<<
 *                     b_tryagain.buffer = PyString_AS_STRING(val)
 *                     # This means that if there is still a truncation error for
 */
        __pyx_v_b_tryagain.buffer_length = __pyx_v_c->length;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":466
 *                     b_tryagain.buffer_type = MYSQL_TYPE_BLOB
 *                     b_tryagain.buffer_length = c.length
 *                     b_tryagain.buffer = PyString_AS_STRING(val)             # <<<<<<<<<<<<<<
 *                     # This means that if there is still a truncation error for
 *                     # whatever reason, something later in the function will
 */
        __pyx_v_b_tryagain.buffer = PyString_AS_STRING(__pyx_v_val);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":470
 *                     # whatever reason, something later in the function will
 *                     # complain.
 *                     b_tryagain.error = &c.error             # <<<<<<<<<<<<<<
 *                     # Aaand fetch it.
 *                     if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0):
 */
        __pyx_v_b_tryagain.error = (&__pyx_v_c->error);

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":472
 *                     b_tryagain.error = &c.error
 *                     # Aaand fetch it.
 *                     if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0):             # <<<<<<<<<<<<<<
 *                         self._raise_error()
 *                 # But, if we care about the length of the string, we need to
 */
        __pyx_t_1 = __pyx_f_6oursql_mysql_stmt_fetch_column(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, (&__pyx_v_b_tryagain), __pyx_v_i, 0);
        if (__pyx_t_1) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":473
 *                     # Aaand fetch it.
 *                     if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0):
 *                         self._raise_error()             # <<<<<<<<<<<<<<
 *                 # But, if we care about the length of the string, we need to
 *                 # make sure we have a consistent API.
 */
          __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":476
 *                 # But, if we care about the length of the string, we need to
 *                 # make sure we have a consistent API.
 *                 if self.string_limit:             # <<<<<<<<<<<<<<
 *                     # At this point, if 'val' still isn't set, it means we
 *                     # should stream it from the database.
 */
      if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":479
 *                     # At this point, if 'val' still isn't set, it means we
 *                     # should stream it from the database.
 *                     if val is None:             # <<<<<<<<<<<<<<
 *                         val = _ResultStringStream(self, i, c.length)
 *                         c.error = False
 */
        __pyx_t_8 = (__pyx_v_val == Py_None);
        if (__pyx_t_8) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":480
 *                     # should stream it from the database.
 *                     if val is None:
 *                         val = _ResultStringStream(self, i, c.length)             # <<<<<<<<<<<<<<
 *                         c.error = False
 *                     # Since _ResultStringStream has a file-like interface, we
 */
          __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = PyLong_FromUnsignedLong(__pyx_v_c->length); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_10));
          __Pyx_INCREF(__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_self);
          __Pyx_GIVEREF(__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_5 = 0;
          __pyx_t_9 = 0;
          __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultStringStream)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":481
 *                     if val is None:
 *                         val = _ResultStringStream(self, i, c.length)
 *                         c.error = False             # <<<<<<<<<<<<<<
 *                     # Since _ResultStringStream has a file-like interface, we
 *                     # make sure that everything passed back has a file-like
 */
          __pyx_v_c->error = 0;
          goto __pyx_L15;
        }
        /*else*/ {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":486
 *                     # interface.
 *                     else:
 *                         val = cStringIO.StringIO(val)             # <<<<<<<<<<<<<<
 *                     # And if we're decoding unicode, decode unicode in a
 *                     # streaming fashion!
 */
          __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__cStringIO); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__StringIO); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_9));
          __Pyx_INCREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          __pyx_t_5 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_5;
          __pyx_t_5 = 0;
        }
        __pyx_L15:;

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":489
 *                     # And if we're decoding unicode, decode unicode in a
 *                     # streaming fashion!
 *                     if self.conn.use_unicode and not c.is_binary:             # <<<<<<<<<<<<<<
 *                         val = codecs.getreader(self.conn._charset)(val)
 *                 else:
 */
        if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode) {
          __pyx_t_8 = (!__pyx_v_c->is_binary);
          __pyx_t_3 = __pyx_t_8;
        } else {
          __pyx_t_3 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode;
        }
        if (__pyx_t_3) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":490
 *                     # streaming fashion!
 *                     if self.conn.use_unicode and not c.is_binary:
 *                         val = codecs.getreader(self.conn._charset)(val)             # <<<<<<<<<<<<<<
 *                 else:
 *                     # At this point, 'val' should be a string read in from the
 */
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__codecs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__getreader); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          __Pyx_GIVEREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          __Pyx_INCREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_9;
          __pyx_t_9 = 0;
          goto __pyx_L16;
        }
        __pyx_L16:;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":495
 *                     # database since there's no possibility of streaming. If
 *                     # we're handling unicode, decode it.
 *                     if self.conn.use_unicode and not c.is_binary:             # <<<<<<<<<<<<<<
 *                         val = val.decode(self.conn._charset)
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):
 */
        if (((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode) {
          __pyx_t_3 = (!__pyx_v_c->is_binary);
          __pyx_t_8 = __pyx_t_3;
        } else {
          __pyx_t_8 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode;
        }
        if (__pyx_t_8) {

          /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":496
 *                     # we're handling unicode, decode it.
 *                     if self.conn.use_unicode and not c.is_binary:
 *                         val = val.decode(self.conn._charset)             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):
 *                 val = decimal.Decimal(
 */
          __pyx_t_9 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          __Pyx_GIVEREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
          __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_10;
          __pyx_t_10 = 0;
          goto __pyx_L17;
        }
        __pyx_L17:;
      }
      __pyx_L14:;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":497
 *                     if self.conn.use_unicode and not c.is_binary:
 *                         val = val.decode(self.conn._charset)
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):             # <<<<<<<<<<<<<<
 *                 val = decimal.Decimal(
 *                     PyString_FromStringAndSize(d.dec, c.length))
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_DECIMAL));
    if (!__pyx_t_8) {
      __pyx_t_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_NEWDECIMAL));
      __pyx_t_2 = __pyx_t_3;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_2;
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":498
 *                         val = val.decode(self.conn._charset)
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):
 *                 val = decimal.Decimal(             # <<<<<<<<<<<<<<
 *                     PyString_FromStringAndSize(d.dec, c.length))
 *             # Sometimes mysql likes to give back invalid data instead of doing
 */
      __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__Decimal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":499
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):
 *                 val = decimal.Decimal(
 *                     PyString_FromStringAndSize(d.dec, c.length))             # <<<<<<<<<<<<<<
 *             # Sometimes mysql likes to give back invalid data instead of doing
 *             # anything sensible.
 */
      __pyx_t_10 = PyString_FromStringAndSize(__pyx_v_d->dec, __pyx_v_c->length); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":502
 *             # Sometimes mysql likes to give back invalid data instead of doing
 *             # anything sensible.
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,             # <<<<<<<<<<<<<<
 *                     MYSQL_TYPE_DATE) and d.t.year == 0:
 *                 val = None
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_DATETIME));
    if (!__pyx_t_8) {
      __pyx_t_2 = ((int)(__pyx_t_7 == MYSQL_TYPE_TIMESTAMP));
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_8;
    }
    if (!__pyx_t_3) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":503
 *             # anything sensible.
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
 *                     MYSQL_TYPE_DATE) and d.t.year == 0:             # <<<<<<<<<<<<<<
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 */
      __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_DATE));
      __pyx_t_2 = __pyx_t_8;
    } else {
      __pyx_t_2 = __pyx_t_3;
    }
    __pyx_t_3 = __pyx_t_2;
    if (__pyx_t_3) {
      __pyx_t_2 = (__pyx_v_d->t.year == 0);
      __pyx_t_8 = __pyx_t_2;
    } else {
      __pyx_t_8 = __pyx_t_3;
    }
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":504
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
 *                     MYSQL_TYPE_DATE) and d.t.year == 0:
 *                 val = None             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = Py_None;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":505
 *                     MYSQL_TYPE_DATE) and d.t.year == 0:
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):             # <<<<<<<<<<<<<<
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_DATETIME));
    if (!__pyx_t_8) {
      __pyx_t_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_TIMESTAMP));
      __pyx_t_2 = __pyx_t_3;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_2;
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":506
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,             # <<<<<<<<<<<<<<
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_DATE:
 */
      __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__datetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyLong_FromUnsignedLong(__pyx_v_d->t.year); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_d->t.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = PyLong_FromUnsignedLong(__pyx_v_d->t.day); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":507
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_DATE:
 *                 val = datetime.date(d.t.year, d.t.month, d.t.day)
 */
      __pyx_t_12 = PyLong_FromUnsignedLong(__pyx_v_d->t.hour); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyLong_FromUnsignedLong(__pyx_v_d->t.minute); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyLong_FromUnsignedLong(__pyx_v_d->t.second); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.second_part); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = PyTuple_New(7); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_16));
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_10 = 0;
      __pyx_t_5 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":508
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_DATE:             # <<<<<<<<<<<<<<
 *                 val = datetime.date(d.t.year, d.t.month, d.t.day)
 *             elif c.type == MYSQL_TYPE_TIME:
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_DATE);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":509
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_DATE:
 *                 val = datetime.date(d.t.year, d.t.month, d.t.day)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_TIME:
 *                 val = datetime.time(
 */
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__date); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.year); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_9 = PyLong_FromUnsignedLong(__pyx_v_d->t.month); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_14 = PyLong_FromUnsignedLong(__pyx_v_d->t.day); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_15 = 0;
      __pyx_t_9 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_14;
      __pyx_t_14 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":510
 *             elif c.type == MYSQL_TYPE_DATE:
 *                 val = datetime.date(d.t.year, d.t.month, d.t.day)
 *             elif c.type == MYSQL_TYPE_TIME:             # <<<<<<<<<<<<<<
 *                 val = datetime.time(
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_TIME);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":511
 *                 val = datetime.date(d.t.year, d.t.month, d.t.day)
 *             elif c.type == MYSQL_TYPE_TIME:
 *                 val = datetime.time(             # <<<<<<<<<<<<<<
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_TINY:
 */
      __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__time); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":512
 *             elif c.type == MYSQL_TYPE_TIME:
 *                 val = datetime.time(
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_TINY:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 */
      __pyx_t_14 = PyLong_FromUnsignedLong(__pyx_v_d->t.hour); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_16 = PyLong_FromUnsignedLong(__pyx_v_d->t.minute); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_9 = PyLong_FromUnsignedLong(__pyx_v_d->t.second); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.second_part); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_12));
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_14 = 0;
      __pyx_t_16 = 0;
      __pyx_t_9 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":513
 *                 val = datetime.time(
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_TINY:             # <<<<<<<<<<<<<<
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u8)
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_TINY);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":514
 *                     d.t.hour, d.t.minute, d.t.second, d.t.second_part)
 *             elif c.type == MYSQL_TYPE_TINY:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:             # <<<<<<<<<<<<<<
 *                     val = PyLong_FromUnsignedLong(d.u8)
 *                 else:
 */
      __pyx_t_8 = ((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG);
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":515
 *             elif c.type == MYSQL_TYPE_TINY:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u8)             # <<<<<<<<<<<<<<
 *                 else:
 *                     val = PyLong_FromLong(d.s8)
 */
        __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->u8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":517
 *                     val = PyLong_FromUnsignedLong(d.u8)
 *                 else:
 *                     val = PyLong_FromLong(d.s8)             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 */
        __pyx_t_15 = PyLong_FromLong(__pyx_v_d->s8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
      }
      __pyx_L18:;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":518
 *                 else:
 *                     val = PyLong_FromLong(d.s8)
 *             elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR):             # <<<<<<<<<<<<<<
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u16)
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_SHORT));
    if (!__pyx_t_8) {
      __pyx_t_2 = ((int)(__pyx_t_7 == MYSQL_TYPE_YEAR));
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_3;
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":519
 *                     val = PyLong_FromLong(d.s8)
 *             elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:             # <<<<<<<<<<<<<<
 *                     val = PyLong_FromUnsignedLong(d.u16)
 *                 else:
 */
      __pyx_t_8 = ((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG);
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":520
 *             elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u16)             # <<<<<<<<<<<<<<
 *                 else:
 *                     val = PyLong_FromLong(d.s16)
 */
        __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->u16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":522
 *                     val = PyLong_FromUnsignedLong(d.u16)
 *                 else:
 *                     val = PyLong_FromLong(d.s16)             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 */
        __pyx_t_15 = PyLong_FromLong(__pyx_v_d->s16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
      }
      __pyx_L19:;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":523
 *                 else:
 *                     val = PyLong_FromLong(d.s16)
 *             elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24):             # <<<<<<<<<<<<<<
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u32)
 */
    __pyx_t_7 = __pyx_v_c->type;
    __pyx_t_8 = ((int)(__pyx_t_7 == MYSQL_TYPE_LONG));
    if (!__pyx_t_8) {
      __pyx_t_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_INT24));
      __pyx_t_2 = __pyx_t_3;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_2;
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":524
 *                     val = PyLong_FromLong(d.s16)
 *             elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:             # <<<<<<<<<<<<<<
 *                     val = PyLong_FromUnsignedLong(d.u32)
 *                 else:
 */
      __pyx_t_8 = ((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG);
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":525
 *             elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24):
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLong(d.u32)             # <<<<<<<<<<<<<<
 *                 else:
 *                     val = PyLong_FromLong(d.s32)
 */
        __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->u32); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":527
 *                     val = PyLong_FromUnsignedLong(d.u32)
 *                 else:
 *                     val = PyLong_FromLong(d.s32)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_LONGLONG:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 */
        __pyx_t_15 = PyLong_FromLong(__pyx_v_d->s32); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
      }
      __pyx_L20:;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":528
 *                 else:
 *                     val = PyLong_FromLong(d.s32)
 *             elif c.type == MYSQL_TYPE_LONGLONG:             # <<<<<<<<<<<<<<
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLongLong(d.u64)
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_LONGLONG);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":529
 *                     val = PyLong_FromLong(d.s32)
 *             elif c.type == MYSQL_TYPE_LONGLONG:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:             # <<<<<<<<<<<<<<
 *                     val = PyLong_FromUnsignedLongLong(d.u64)
 *                 else:
 */
      __pyx_t_8 = ((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG);
      if (__pyx_t_8) {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":530
 *             elif c.type == MYSQL_TYPE_LONGLONG:
 *                 if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG:
 *                     val = PyLong_FromUnsignedLongLong(d.u64)             # <<<<<<<<<<<<<<
 *                 else:
 *                     val = PyLong_FromLongLong(d.s64)
 */
        __pyx_t_15 = PyLong_FromUnsignedLongLong(__pyx_v_d->u64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":532
 *                     val = PyLong_FromUnsignedLongLong(d.u64)
 *                 else:
 *                     val = PyLong_FromLongLong(d.s64)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_FLOAT:
 *                 val = d.f
 */
        __pyx_t_15 = PyLong_FromLongLong(__pyx_v_d->s64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_15;
        __pyx_t_15 = 0;
      }
      __pyx_L21:;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":533
 *                 else:
 *                     val = PyLong_FromLongLong(d.s64)
 *             elif c.type == MYSQL_TYPE_FLOAT:             # <<<<<<<<<<<<<<
 *                 val = d.f
 *             elif c.type == MYSQL_TYPE_DOUBLE:
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_FLOAT);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":534
 *                     val = PyLong_FromLongLong(d.s64)
 *             elif c.type == MYSQL_TYPE_FLOAT:
 *                 val = d.f             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_DOUBLE:
 *                 val = d.d
 */
      __pyx_t_15 = PyFloat_FromDouble(__pyx_v_d->f); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":535
 *             elif c.type == MYSQL_TYPE_FLOAT:
 *                 val = d.f
 *             elif c.type == MYSQL_TYPE_DOUBLE:             # <<<<<<<<<<<<<<
 *                 val = d.d
 *             elif c.type == MYSQL_TYPE_BIT:
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_DOUBLE);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":536
 *                 val = d.f
 *             elif c.type == MYSQL_TYPE_DOUBLE:
 *                 val = d.d             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_BIT:
 *                 # Bitfields column come variable-length and always in big-
 */
      __pyx_t_15 = PyFloat_FromDouble(__pyx_v_d->d); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":537
 *             elif c.type == MYSQL_TYPE_DOUBLE:
 *                 val = d.d
 *             elif c.type == MYSQL_TYPE_BIT:             # <<<<<<<<<<<<<<
 *                 # Bitfields column come variable-length and always in big-
 *                 # endian format. Convert it to an int instead of passing back
 */
    __pyx_t_8 = (__pyx_v_c->type == MYSQL_TYPE_BIT);
    if (__pyx_t_8) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":542
 *                 # a string that people would probably be converting to ints
 *                 # anyway.
 *                 val = bitval_from_char_p(<unsigned char *>&d.c, c.length)             # <<<<<<<<<<<<<<
 *             else:
 *                 val = PyString_FromStringAndSize(&d.c, c.length)
 */
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_f_6oursql_bitval_from_char_p(((unsigned char *)(&__pyx_v_d->c)), __pyx_v_c->length)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":544
 *                 val = bitval_from_char_p(<unsigned char *>&d.c, c.length)
 *             else:
 *                 val = PyString_FromStringAndSize(&d.c, c.length)             # <<<<<<<<<<<<<<
 *                 PyErr_WarnEx(Warning, "unknown column returned as string", 1)
 *             if c.error:
 */
      __pyx_t_15 = PyString_FromStringAndSize((&__pyx_v_d->c), __pyx_v_c->length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":545
 *             else:
 *                 val = PyString_FromStringAndSize(&d.c, c.length)
 *                 PyErr_WarnEx(Warning, "unknown column returned as string", 1)             # <<<<<<<<<<<<<<
 *             if c.error:
 *                 # This *shouldn't* ever happen.
 */
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__Warning); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_1 = PyErr_WarnEx(__pyx_t_15, __pyx_k_37, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __pyx_L11:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":546
 *                 val = PyString_FromStringAndSize(&d.c, c.length)
 *                 PyErr_WarnEx(Warning, "unknown column returned as string", 1)
 *             if c.error:             # <<<<<<<<<<<<<<
 *                 # This *shouldn't* ever happen.
 *                 raise InterfaceError('truncated column %d, type %d' % (
 */
    if (__pyx_v_c->error) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":548
 *             if c.error:
 *                 # This *shouldn't* ever happen.
 *                 raise InterfaceError('truncated column %d, type %d' % (             # <<<<<<<<<<<<<<
 *                     i, c.type))
 *             Py_INCREF(val)
 */
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":549
 *                 # This *shouldn't* ever happen.
 *                 raise InterfaceError('truncated column %d, type %d' % (
 *                     i, c.type))             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(ret, i, val)
 */
      __pyx_t_12 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyInt_FromLong(__pyx_v_c->type); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_13));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
      __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_13, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":550
 *                 raise InterfaceError('truncated column %d, type %d' % (
 *                     i, c.type))
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(ret, i, val)
 *         return ret
 */
    Py_INCREF(__pyx_v_val);

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":551
 *                     i, c.type))
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(ret, i, val)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_val);
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":552
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(ret, i, val)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def fetchall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("oursql._Statement.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":554
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         # buffer_results() calls _check_closed()
 *         self.buffer_results()
 */

static PyObject *__pyx_pf_6oursql_10_Statement_6fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_6fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":556
 *     def fetchall(self):
 *         # buffer_results() calls _check_closed()
 *         self.buffer_results()             # <<<<<<<<<<<<<<
 *         return PySequence_List(self)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__buffer_results); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":557
 *         # buffer_results() calls _check_closed()
 *         self.buffer_results()
 *         return PySequence_List(self)             # <<<<<<<<<<<<<<
 * 
 *     def buffer_results(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PySequence_List(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":559
 *         return PySequence_List(self)
 * 
 *     def buffer_results(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         if not self.buffered:
 */

static PyObject *__pyx_pf_6oursql_10_Statement_7buffer_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_7buffer_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("buffer_results");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":560
 * 
 *     def buffer_results(self):
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if not self.buffered:
 *             if mysql_stmt_store_result(self.stmt):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":561
 *     def buffer_results(self):
 *         self._check_closed()
 *         if not self.buffered:             # <<<<<<<<<<<<<<
 *             if mysql_stmt_store_result(self.stmt):
 *                 self._raise_error()
 */
  __pyx_t_2 = (!((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":562
 *         self._check_closed()
 *         if not self.buffered:
 *             if mysql_stmt_store_result(self.stmt):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 *             self.buffered = True
 */
    __pyx_t_1 = __pyx_f_6oursql_mysql_stmt_store_result(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":563
 *         if not self.buffered:
 *             if mysql_stmt_store_result(self.stmt):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 *             self.buffered = True
 * 
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":564
 *             if mysql_stmt_store_result(self.stmt):
 *                 self._raise_error()
 *             self.buffered = True             # <<<<<<<<<<<<<<
 * 
 *     def nextset(self):
 */
    ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->buffered = 1;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql._Statement.buffer_results", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":566
 *             self.buffered = True
 * 
 *     def nextset(self):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

static PyObject *__pyx_pf_6oursql_10_Statement_8nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_8nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nextset");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":567
 * 
 *     def nextset(self):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._Statement.nextset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":569
 *         return False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)
 */

static PyObject *__pyx_pf_6oursql_10_Statement_9__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_9__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":570
 * 
 *     def __iter__(self):
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         return PyCallIter_New(self.fetchone, None)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":571
 *     def __iter__(self):
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)             # <<<<<<<<<<<<<<
 * 
 *     property rowcount:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = Py_None;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyCallIter_New(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._Statement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":574
 * 
 *     property rowcount:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef my_ulonglong res
 *             self._check_closed()
 */

static PyObject *__pyx_pf_6oursql_10_Statement_8rowcount___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_8rowcount___get__(PyObject *__pyx_v_self) {
  my_ulonglong __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":576
 *         def __get__(self):
 *             cdef my_ulonglong res
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             res = mysql_stmt_affected_rows(self.stmt)
 *             if res == ull_negone:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":577
 *             cdef my_ulonglong res
 *             self._check_closed()
 *             res = mysql_stmt_affected_rows(self.stmt)             # <<<<<<<<<<<<<<
 *             if res == ull_negone:
 *                 return -1
 */
  __pyx_v_res = mysql_stmt_affected_rows(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":578
 *             self._check_closed()
 *             res = mysql_stmt_affected_rows(self.stmt)
 *             if res == ull_negone:             # <<<<<<<<<<<<<<
 *                 return -1
 *             else:
 */
  __pyx_t_2 = (__pyx_v_res == __pyx_v_6oursql_ull_negone);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":579
 *             res = mysql_stmt_affected_rows(self.stmt)
 *             if res == ull_negone:
 *                 return -1             # <<<<<<<<<<<<<<
 *             else:
 *                 return res
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":581
 *                 return -1
 *             else:
 *                 return res             # <<<<<<<<<<<<<<
 * 
 *     property lastrowid:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_to_py_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.rowcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":584
 * 
 *     property lastrowid:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef my_ulonglong res
 *             self._check_closed()
 */

static PyObject *__pyx_pf_6oursql_10_Statement_9lastrowid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_9lastrowid___get__(PyObject *__pyx_v_self) {
  my_ulonglong __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":586
 *         def __get__(self):
 *             cdef my_ulonglong res
 *             self._check_closed()             # <<<<<<<<<<<<<<
 *             res = mysql_stmt_insert_id(self.stmt)
 *             if res == 0:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":587
 *             cdef my_ulonglong res
 *             self._check_closed()
 *             res = mysql_stmt_insert_id(self.stmt)             # <<<<<<<<<<<<<<
 *             if res == 0:
 *                 return None
 */
  __pyx_v_res = mysql_stmt_insert_id(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":588
 *             self._check_closed()
 *             res = mysql_stmt_insert_id(self.stmt)
 *             if res == 0:             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  __pyx_t_2 = (__pyx_v_res == 0);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":589
 *             res = mysql_stmt_insert_id(self.stmt)
 *             if res == 0:
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return res
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":591
 *                 return None
 *             else:
 *                 return res             # <<<<<<<<<<<<<<
 * 
 *     property prefetch_rows:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_to_py_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.lastrowid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":594
 * 
 *     property prefetch_rows:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._prefetch_rows
 * 
 */

static PyObject *__pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":595
 *     property prefetch_rows:
 *         def __get__(self):
 *             return self._prefetch_rows             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, unsigned long value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->_prefetch_rows); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":597
 *             return self._prefetch_rows
 * 
 *         def __set__(self, unsigned long value):             # <<<<<<<<<<<<<<
 *             if value < 1:
 *                 raise ValueError('must prefetch at least 1 row')
 */

static int __pyx_pf_6oursql_10_Statement_13prefetch_rows_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pf_6oursql_10_Statement_13prefetch_rows_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  unsigned long __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  my_bool __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_AsUnsignedLong(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":598
 * 
 *         def __set__(self, unsigned long value):
 *             if value < 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError('must prefetch at least 1 row')
 *             self._prefetch_rows = value
 */
  __pyx_t_1 = (__pyx_v_value < 1);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":599
 *         def __set__(self, unsigned long value):
 *             if value < 1:
 *                 raise ValueError('must prefetch at least 1 row')             # <<<<<<<<<<<<<<
 *             self._prefetch_rows = value
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":600
 *             if value < 1:
 *                 raise ValueError('must prefetch at least 1 row')
 *             self._prefetch_rows = value             # <<<<<<<<<<<<<<
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 *                     &self._prefetch_rows):
 */
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->_prefetch_rows = __pyx_v_value;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":602
 *             self._prefetch_rows = value
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 *                     &self._prefetch_rows):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 * 
 */
  __pyx_t_3 = _oursqlx_stmt_set_prefetch_rows(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, (&((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->_prefetch_rows));
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":603
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 *                     &self._prefetch_rows):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 * 
 * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement),
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":99
 *     cdef int buffered, data_waiting, show_table, exhausted
 *     cdef Connection conn
 *     cdef public object warnings             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Connection connection not None,
 */

static PyObject *__pyx_pf_6oursql_10_Statement_8warnings___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_8warnings___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  __pyx_r = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10_Statement_8warnings_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_10_Statement_8warnings_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10_Statement_8warnings_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6oursql_10_Statement_8warnings_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":624
 *     cdef int done
 * 
 *     def __cinit__(self, _Statement stmt not None, unsigned int index,             # <<<<<<<<<<<<<<
 *             unsigned int length):
 *         self.stmt = stmt
 */

static int __pyx_pf_6oursql_19_ResultStringStream___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_19_ResultStringStream___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6oursql__Statement *__pyx_v_stmt = 0;
  unsigned int __pyx_v_index;
  unsigned int __pyx_v_length;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stmt,&__pyx_n_s__index,&__pyx_n_s__length,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stmt);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__length);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_stmt = ((struct __pyx_obj_6oursql__Statement *)values[0]);
    __pyx_v_index = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_index == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_length = __Pyx_PyInt_AsUnsignedInt(values[2]); if (unlikely((__pyx_v_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._ResultStringStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stmt), __pyx_ptype_6oursql__Statement, 0, "stmt", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":626
 *     def __cinit__(self, _Statement stmt not None, unsigned int index,
 *             unsigned int length):
 *         self.stmt = stmt             # <<<<<<<<<<<<<<
 *         self.stmt_fetched = stmt.fetched
 *         self.index = index
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_stmt));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_stmt));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt));
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt = __pyx_v_stmt;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":627
 *             unsigned int length):
 *         self.stmt = stmt
 *         self.stmt_fetched = stmt.fetched             # <<<<<<<<<<<<<<
 *         self.index = index
 *         self.length = length
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt_fetched = __pyx_v_stmt->fetched;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":628
 *         self.stmt = stmt
 *         self.stmt_fetched = stmt.fetched
 *         self.index = index             # <<<<<<<<<<<<<<
 *         self.length = length
 *         self.offset = 0
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->index = __pyx_v_index;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":629
 *         self.stmt_fetched = stmt.fetched
 *         self.index = index
 *         self.length = length             # <<<<<<<<<<<<<<
 *         self.offset = 0
 *         memset(&self.bind, 0, sizeof(MYSQL_BIND))
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->length = __pyx_v_length;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":630
 *         self.index = index
 *         self.length = length
 *         self.offset = 0             # <<<<<<<<<<<<<<
 *         memset(&self.bind, 0, sizeof(MYSQL_BIND))
 *         self.bind.buffer_type = MYSQL_TYPE_BLOB
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":631
 *         self.length = length
 *         self.offset = 0
 *         memset(&self.bind, 0, sizeof(MYSQL_BIND))             # <<<<<<<<<<<<<<
 *         self.bind.buffer_type = MYSQL_TYPE_BLOB
 *         self.bind.length = &self.length
 */
  memset((&((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind), 0, (sizeof(MYSQL_BIND)));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":632
 *         self.offset = 0
 *         memset(&self.bind, 0, sizeof(MYSQL_BIND))
 *         self.bind.buffer_type = MYSQL_TYPE_BLOB             # <<<<<<<<<<<<<<
 *         self.bind.length = &self.length
 *         self.done = False
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind.buffer_type = MYSQL_TYPE_BLOB;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":633
 *         memset(&self.bind, 0, sizeof(MYSQL_BIND))
 *         self.bind.buffer_type = MYSQL_TYPE_BLOB
 *         self.bind.length = &self.length             # <<<<<<<<<<<<<<
 *         self.done = False
 * 
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind.length = (&((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->length);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":634
 *         self.bind.buffer_type = MYSQL_TYPE_BLOB
 *         self.bind.length = &self.length
 *         self.done = False             # <<<<<<<<<<<<<<
 * 
 *     def read(self, Py_ssize_t size=-1):
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->done = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql._ResultStringStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/statement.pyx":636
 *         self.done = False
 * 
 *     def read(self, Py_ssize_t size=-1):             # <<<<<<<<<<<<<<
 *         """read(size=-1) -> str
 * 
 */

static PyObject *__pyx_pf_6oursql_19_ResultStringStream_1read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_19_ResultStringStream_1read[] = "read(size=-1) -> str\n        \n        Read some bytes from the database. Reading -1 bytes will attempt to \n        fetch all remaining bytes.\n        ";
static PyObject *__pyx_pf_6oursql_19_ResultStringStream_1read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_v_left;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
  __Pyx_RefNannySetupContext("read");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_size = ((Py_ssize_t)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._ResultStringStream.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":643
 *         """
 *         cdef Py_ssize_t left
 *         if self.done:             # <<<<<<<<<<<<<<
 *             return ''
 *         self.stmt._check_closed()
 */
  if (((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->done) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":644
 *         cdef Py_ssize_t left
 *         if self.done:
 *             return ''             # <<<<<<<<<<<<<<
 *         self.stmt._check_closed()
 *         if self.stmt.fetched != self.stmt_fetched:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
    __pyx_r = ((PyObject *)__pyx_kp_s_41);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":645
 *         if self.done:
 *             return ''
 *         self.stmt._check_closed()             # <<<<<<<<<<<<<<
 *         if self.stmt.fetched != self.stmt_fetched:
 *             raise ProgrammingError('row no longer available from database')
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":646
 *             return ''
 *         self.stmt._check_closed()
 *         if self.stmt.fetched != self.stmt_fetched:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('row no longer available from database')
 *         left = self.length - self.offset
 */
  __pyx_t_2 = (((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt->fetched != ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt_fetched);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":647
 *         self.stmt._check_closed()
 *         if self.stmt.fetched != self.stmt_fetched:
 *             raise ProgrammingError('row no longer available from database')             # <<<<<<<<<<<<<<
 *         left = self.length - self.offset
 *         if size == -1 or size > left:
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":648
 *         if self.stmt.fetched != self.stmt_fetched:
 *             raise ProgrammingError('row no longer available from database')
 *         left = self.length - self.offset             # <<<<<<<<<<<<<<
 *         if size == -1 or size > left:
 *             size = left
 */
  __pyx_v_left = (((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->length - ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":649
 *             raise ProgrammingError('row no longer available from database')
 *         left = self.length - self.offset
 *         if size == -1 or size > left:             # <<<<<<<<<<<<<<
 *             size = left
 *         elif size < 0:
 */
  __pyx_t_2 = (__pyx_v_size == -1);
  if (!__pyx_t_2) {
    __pyx_t_5 = (__pyx_v_size > __pyx_v_left);
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_2;
  }
  if (__pyx_t_6) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":650
 *         left = self.length - self.offset
 *         if size == -1 or size > left:
 *             size = left             # <<<<<<<<<<<<<<
 *         elif size < 0:
 *             raise ValueError("can't read negative bytes")
 */
    __pyx_v_size = __pyx_v_left;
    goto __pyx_L8;
  }

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":651
 *         if size == -1 or size > left:
 *             size = left
 *         elif size < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("can't read negative bytes")
 *         ret = PyString_FromStringAndSize(NULL, size)
 */
  __pyx_t_6 = (__pyx_v_size < 0);
  if (__pyx_t_6) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":652
 *             size = left
 *         elif size < 0:
 *             raise ValueError("can't read negative bytes")             # <<<<<<<<<<<<<<
 *         ret = PyString_FromStringAndSize(NULL, size)
 *         self.bind.buffer_length = size
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":653
 *         elif size < 0:
 *             raise ValueError("can't read negative bytes")
 *         ret = PyString_FromStringAndSize(NULL, size)             # <<<<<<<<<<<<<<
 *         self.bind.buffer_length = size
 *         self.bind.buffer = PyString_AS_STRING(ret)
 */
  __pyx_t_4 = PyString_FromStringAndSize(NULL, __pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_ret = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":654
 *             raise ValueError("can't read negative bytes")
 *         ret = PyString_FromStringAndSize(NULL, size)
 *         self.bind.buffer_length = size             # <<<<<<<<<<<<<<
 *         self.bind.buffer = PyString_AS_STRING(ret)
 *         if mysql_stmt_fetch_column(self.stmt.stmt,
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind.buffer_length = __pyx_v_size;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":655
 *         ret = PyString_FromStringAndSize(NULL, size)
 *         self.bind.buffer_length = size
 *         self.bind.buffer = PyString_AS_STRING(ret)             # <<<<<<<<<<<<<<
 *         if mysql_stmt_fetch_column(self.stmt.stmt,
 *                 &self.bind, self.index, self.offset):
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind.buffer = PyString_AS_STRING(__pyx_v_ret);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":657
 *         self.bind.buffer = PyString_AS_STRING(ret)
 *         if mysql_stmt_fetch_column(self.stmt.stmt,
 *                 &self.bind, self.index, self.offset):             # <<<<<<<<<<<<<<
 *             self.stmt._raise_error()
 *         self.offset += size
 */
  __pyx_t_1 = __pyx_f_6oursql_mysql_stmt_fetch_column(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt->stmt, (&((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->bind), ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->index, ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":658
 *         if mysql_stmt_fetch_column(self.stmt.stmt,
 *                 &self.bind, self.index, self.offset):
 *             self.stmt._raise_error()             # <<<<<<<<<<<<<<
 *         self.offset += size
 *         left = self.length - self.offset
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->stmt); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":659
 *                 &self.bind, self.index, self.offset):
 *             self.stmt._raise_error()
 *         self.offset += size             # <<<<<<<<<<<<<<
 *         left = self.length - self.offset
 *         assert left >= 0, 'size remaining should be >= 0'
 */
  ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset = (((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset + __pyx_v_size);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":660
 *             self.stmt._raise_error()
 *         self.offset += size
 *         left = self.length - self.offset             # <<<<<<<<<<<<<<
 *         assert left >= 0, 'size remaining should be >= 0'
 *         if left == 0:
 */
  __pyx_v_left = (((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->length - ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->offset);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":661
 *         self.offset += size
 *         left = self.length - self.offset
 *         assert left >= 0, 'size remaining should be >= 0'             # <<<<<<<<<<<<<<
 *         if left == 0:
 *             self.done = True
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_left >= 0))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_46));
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":662
 *         left = self.length - self.offset
 *         assert left >= 0, 'size remaining should be >= 0'
 *         if left == 0:             # <<<<<<<<<<<<<<
 *             self.done = True
 *         return ret
 */
  __pyx_t_6 = (__pyx_v_left == 0);
  if (__pyx_t_6) {

    /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":663
 *         assert left >= 0, 'size remaining should be >= 0'
 *         if left == 0:
 *             self.done = True             # <<<<<<<<<<<<<<
 *         return ret
 */
    ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->done = 1;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":664
 *         if left == 0:
 *             self.done = True
 *         return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._ResultStringStream.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":21
 *     conversions_dict = _conversions
 * 
 *     def __cinit__(self, Connection conn not None, bint show_table=False,             # <<<<<<<<<<<<<<
 *             **kwargs):
 *         cdef my_ulonglong res
 */

static int __pyx_pf_6oursql_10_ResultSet___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_10_ResultSet___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0;
  int __pyx_v_show_table;
  PyObject *__pyx_v_kwargs = 0;
  my_ulonglong __pyx_v_res;
  PyObject *__pyx_v_d = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__conn,&__pyx_n_s__show_table,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__conn);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__show_table);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]);
    if (values[1]) {
      __pyx_v_show_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_show_table == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_show_table = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("oursql._ResultSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":24
 *             **kwargs):
 *         cdef my_ulonglong res
 *         conn._check_closed()             # <<<<<<<<<<<<<<
 *         self.conn = conn
 *         self.fields = mysql_field_count(self.conn.conn)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_check_closed(__pyx_v_conn); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":25
 *         cdef my_ulonglong res
 *         conn._check_closed()
 *         self.conn = conn             # <<<<<<<<<<<<<<
 *         self.fields = mysql_field_count(self.conn.conn)
 *         self.res = mysql_store_result(self.conn.conn)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_conn));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_conn));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn));
  ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn = __pyx_v_conn;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":26
 *         conn._check_closed()
 *         self.conn = conn
 *         self.fields = mysql_field_count(self.conn.conn)             # <<<<<<<<<<<<<<
 *         self.res = mysql_store_result(self.conn.conn)
 *         if not self.res and self.fields != 0:
 */
  ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields = mysql_field_count(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->conn);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":27
 *         self.conn = conn
 *         self.fields = mysql_field_count(self.conn.conn)
 *         self.res = mysql_store_result(self.conn.conn)             # <<<<<<<<<<<<<<
 *         if not self.res and self.fields != 0:
 *             self._raise_error()
 */
  ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res = __pyx_f_6oursql_mysql_store_result(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->conn);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":28
 *         self.fields = mysql_field_count(self.conn.conn)
 *         self.res = mysql_store_result(self.conn.conn)
 *         if not self.res and self.fields != 0:             # <<<<<<<<<<<<<<
 *             self._raise_error()
 * 
 */
  __pyx_t_2 = (!(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res != 0));
  if (__pyx_t_2) {
    __pyx_t_3 = (((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":29
 *         self.res = mysql_store_result(self.conn.conn)
 *         if not self.res and self.fields != 0:
 *             self._raise_error()             # <<<<<<<<<<<<<<
 * 
 *         res = mysql_affected_rows(self.conn.conn)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":31
 *             self._raise_error()
 * 
 *         res = mysql_affected_rows(self.conn.conn)             # <<<<<<<<<<<<<<
 *         if res == ull_negone:
 *             self.rowcount = -1
 */
  __pyx_v_res = mysql_affected_rows(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->conn);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":32
 * 
 *         res = mysql_affected_rows(self.conn.conn)
 *         if res == ull_negone:             # <<<<<<<<<<<<<<
 *             self.rowcount = -1
 *         else:
 */
  __pyx_t_4 = (__pyx_v_res == __pyx_v_6oursql_ull_negone);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":33
 *         res = mysql_affected_rows(self.conn.conn)
 *         if res == ull_negone:
 *             self.rowcount = -1             # <<<<<<<<<<<<<<
 *         else:
 *             self.rowcount = res
 */
    __Pyx_INCREF(__pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount = __pyx_int_neg_1;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":35
 *             self.rowcount = -1
 *         else:
 *             self.rowcount = res             # <<<<<<<<<<<<<<
 *         res = mysql_insert_id(self.conn.conn)
 *         if res == 0:
 */
    __pyx_t_5 = __Pyx_PyInt_to_py_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L7:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":36
 *         else:
 *             self.rowcount = res
 *         res = mysql_insert_id(self.conn.conn)             # <<<<<<<<<<<<<<
 *         if res == 0:
 *             self.lastrowid = None
 */
  __pyx_v_res = mysql_insert_id(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->conn);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":37
 *             self.rowcount = res
 *         res = mysql_insert_id(self.conn.conn)
 *         if res == 0:             # <<<<<<<<<<<<<<
 *             self.lastrowid = None
 *         else:
 */
  __pyx_t_4 = (__pyx_v_res == 0);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":38
 *         res = mysql_insert_id(self.conn.conn)
 *         if res == 0:
 *             self.lastrowid = None             # <<<<<<<<<<<<<<
 *         else:
 *             self.lastrowid = res
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid = Py_None;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":40
 *             self.lastrowid = None
 *         else:
 *             self.lastrowid = res             # <<<<<<<<<<<<<<
 * 
 *         if self.fields:
 */
    __pyx_t_5 = __Pyx_PyInt_to_py_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L8:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":42
 *             self.lastrowid = res
 * 
 *         if self.fields:             # <<<<<<<<<<<<<<
 *             self.description = description_from_res(
 *                 self.res, self.fields, self.show_table)
 */
  if (((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":44
 *         if self.fields:
 *             self.description = description_from_res(
 *                 self.res, self.fields, self.show_table)             # <<<<<<<<<<<<<<
 *             self.conversion_info = conversion_info_from_res(
 *                 self.res, self.fields)
 */
    __pyx_t_5 = __pyx_f_6oursql_description_from_res(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res, ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields, ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->show_table); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":43
 * 
 *         if self.fields:
 *             self.description = description_from_res(             # <<<<<<<<<<<<<<
 *                 self.res, self.fields, self.show_table)
 *             self.conversion_info = conversion_info_from_res(
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":46
 *                 self.res, self.fields, self.show_table)
 *             self.conversion_info = conversion_info_from_res(
 *                 self.res, self.fields)             # <<<<<<<<<<<<<<
 *             self.column_names = [d[0] for d in self.description]
 *         else:
 */
    __pyx_t_5 = __pyx_f_6oursql_conversion_info_from_res(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res, ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":45
 *             self.description = description_from_res(
 *                 self.res, self.fields, self.show_table)
 *             self.conversion_info = conversion_info_from_res(             # <<<<<<<<<<<<<<
 *                 self.res, self.fields)
 *             self.column_names = [d[0] for d in self.description]
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conversion_info);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conversion_info);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conversion_info = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":47
 *             self.conversion_info = conversion_info_from_res(
 *                 self.res, self.fields)
 *             self.column_names = [d[0] for d in self.description]             # <<<<<<<<<<<<<<
 *         else:
 *             self.description = self.column_names = None
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description) || PyTuple_CheckExact(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description)) {
      __pyx_t_6 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    for (;;) {
      if (PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
      } else if (PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF(__pyx_v_d);
      __pyx_v_d = __pyx_t_9;
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_d, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_INCREF(((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names = ((PyObject *)__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":49
 *             self.column_names = [d[0] for d in self.description]
 *         else:
 *             self.description = self.column_names = None             # <<<<<<<<<<<<<<
 * 
 *         if self.conn.warning_count():
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names = Py_None;
  }
  __pyx_L9:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":51
 *             self.description = self.column_names = None
 * 
 *         if self.conn.warning_count():             # <<<<<<<<<<<<<<
 *             self.warnings = _do_warnings_query(self.conn)
 *         else:
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn), __pyx_n_s__warning_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":52
 * 
 *         if self.conn.warning_count():
 *             self.warnings = _do_warnings_query(self.conn)             # <<<<<<<<<<<<<<
 *         else:
 *             self.warnings = []
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s___do_warnings_query); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn));
    __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn));
    __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_9);
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":54
 *             self.warnings = _do_warnings_query(self.conn)
 *         else:
 *             self.warnings = []             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
    __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings = ((PyObject *)__pyx_t_9);
    __pyx_t_9 = 0;
  }
  __pyx_L12:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("oursql._ResultSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":56
 *             self.warnings = []
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

static void __pyx_pf_6oursql_10_ResultSet_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6oursql_10_ResultSet_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":57
 * 
 *     def __dealloc__(self):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._ResultSet.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":59
 *         self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.res:
 *             mysql_free_result(self.res)
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":60
 * 
 *     def close(self):
 *         if self.res:             # <<<<<<<<<<<<<<
 *             mysql_free_result(self.res)
 *             self.res = NULL
 */
  __pyx_t_1 = (((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res != 0);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":61
 *     def close(self):
 *         if self.res:
 *             mysql_free_result(self.res)             # <<<<<<<<<<<<<<
 *             self.res = NULL
 * 
 */
    mysql_free_result(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res);

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":62
 *         if self.res:
 *             mysql_free_result(self.res)
 *             self.res = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef int _raise_error(self) except -1:
 */
    ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":64
 *             self.res = NULL
 * 
 *     cdef int _raise_error(self) except -1:             # <<<<<<<<<<<<<<
 *         return self.conn._raise_error()
 * 
 */

static int __pyx_f_6oursql_10_ResultSet__raise_error(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":65
 * 
 *     cdef int _raise_error(self) except -1:
 *         return self.conn._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     cdef int _check_closed(self) except -1:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->conn->__pyx_vtab)->_raise_error(__pyx_v_self->conn); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql._ResultSet._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":67
 *         return self.conn._raise_error()
 * 
 *     cdef int _check_closed(self) except -1:             # <<<<<<<<<<<<<<
 *         if not self.conn.conn:
 *             if self.res:
 */

static int __pyx_f_6oursql_10_ResultSet__check_closed(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_closed");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":68
 * 
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:             # <<<<<<<<<<<<<<
 *             if self.res:
 *                 self.close()
 */
  __pyx_t_1 = (!(__pyx_v_self->conn->conn != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":69
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:
 *             if self.res:             # <<<<<<<<<<<<<<
 *                 self.close()
 *             raise ProgrammingError('connection closed')
 */
    __pyx_t_1 = (__pyx_v_self->res != 0);
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":70
 *         if not self.conn.conn:
 *             if self.res:
 *                 self.close()             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('connection closed')
 *         if not self.res:
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":71
 *             if self.res:
 *                 self.close()
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if not self.res:
 *             raise ProgrammingError('query closed')
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":72
 *                 self.close()
 *             raise ProgrammingError('connection closed')
 *         if not self.res:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('query closed')
 * 
 */
  __pyx_t_1 = (!(__pyx_v_self->res != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":73
 *             raise ProgrammingError('connection closed')
 *         if not self.res:
 *             raise ProgrammingError('query closed')             # <<<<<<<<<<<<<<
 * 
 *     property has_result:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._ResultSet._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":76
 * 
 *     property has_result:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.fields != 0
 * 
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_10has_result___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_10has_result___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":77
 *     property has_result:
 *         def __get__(self):
 *             return self.fields != 0             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._ResultSet.has_result.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":79
 *             return self.fields != 0
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         cdef MYSQL_ROW row
 *         cdef unsigned int i
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_3fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_3fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  MYSQL_ROW __pyx_v_row;
  unsigned int __pyx_v_i;
  unsigned long *__pyx_v_lengths;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_field_type = NULL;
  PyObject *__pyx_v_flags = NULL;
  PyObject *__pyx_v_charsetnr = NULL;
  PyObject *__pyx_v_converter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":83
 *         cdef unsigned int i
 *         cdef unsigned long *lengths
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         row = mysql_fetch_row(self.res)
 *         if not row:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":84
 *         cdef unsigned long *lengths
 *         self._check_closed()
 *         row = mysql_fetch_row(self.res)             # <<<<<<<<<<<<<<
 *         if not row:
 *             return None
 */
  __pyx_v_row = __pyx_f_6oursql_mysql_fetch_row(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":85
 *         self._check_closed()
 *         row = mysql_fetch_row(self.res)
 *         if not row:             # <<<<<<<<<<<<<<
 *             return None
 *         lengths = mysql_fetch_lengths(self.res)
 */
  __pyx_t_2 = (!(__pyx_v_row != 0));
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":86
 *         row = mysql_fetch_row(self.res)
 *         if not row:
 *             return None             # <<<<<<<<<<<<<<
 *         lengths = mysql_fetch_lengths(self.res)
 *         if not lengths:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":87
 *         if not row:
 *             return None
 *         lengths = mysql_fetch_lengths(self.res)             # <<<<<<<<<<<<<<
 *         if not lengths:
 *             self._raise_error()
 */
  __pyx_v_lengths = mysql_fetch_lengths(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":88
 *             return None
 *         lengths = mysql_fetch_lengths(self.res)
 *         if not lengths:             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         ret = PyTuple_New(self.fields)
 */
  __pyx_t_2 = (!(__pyx_v_lengths != 0));
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":89
 *         lengths = mysql_fetch_lengths(self.res)
 *         if not lengths:
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         ret = PyTuple_New(self.fields)
 *         # Cache the connection charset.
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":90
 *         if not lengths:
 *             self._raise_error()
 *         ret = PyTuple_New(self.fields)             # <<<<<<<<<<<<<<
 *         # Cache the connection charset.
 *         self.conn.charset
 */
  __pyx_t_3 = PyTuple_New(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":92
 *         ret = PyTuple_New(self.fields)
 *         # Cache the connection charset.
 *         self.conn.charset             # <<<<<<<<<<<<<<
 *         for 0 <= i < self.fields:
 *             if not row[i]:
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":93
 *         # Cache the connection charset.
 *         self.conn.charset
 *         for 0 <= i < self.fields:             # <<<<<<<<<<<<<<
 *             if not row[i]:
 *                 d = None
 */
  __pyx_t_4 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":94
 *         self.conn.charset
 *         for 0 <= i < self.fields:
 *             if not row[i]:             # <<<<<<<<<<<<<<
 *                 d = None
 *             else:
 */
    __pyx_t_2 = (!((__pyx_v_row[__pyx_v_i]) != 0));
    if (__pyx_t_2) {

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":95
 *         for 0 <= i < self.fields:
 *             if not row[i]:
 *                 d = None             # <<<<<<<<<<<<<<
 *             else:
 *                 d = PyString_FromStringAndSize(row[i], lengths[i])
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF(__pyx_v_d);
      __pyx_v_d = Py_None;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":97
 *                 d = None
 *             else:
 *                 d = PyString_FromStringAndSize(row[i], lengths[i])             # <<<<<<<<<<<<<<
 *                 field_type, flags, charsetnr = self.conversion_info[i]
 *                 converter = self.conversions_dict.get(field_type)
 */
      __pyx_t_3 = PyString_FromStringAndSize((__pyx_v_row[__pyx_v_i]), (__pyx_v_lengths[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_v_d);
      __pyx_v_d = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":98
 *             else:
 *                 d = PyString_FromStringAndSize(row[i], lengths[i])
 *                 field_type, flags, charsetnr = self.conversion_info[i]             # <<<<<<<<<<<<<<
 *                 converter = self.conversions_dict.get(field_type)
 *                 if converter:
 */
      __pyx_t_3 = __Pyx_GetItemInt(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conversion_info, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        if (likely(PyTuple_CheckExact(sequence))) {
          if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) {
            if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
            else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          if (unlikely(PyList_GET_SIZE(sequence) != 3)) {
            if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
            else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_unpacking_done;
        __pyx_L10_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
        if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L11_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_v_field_type);
      __pyx_v_field_type = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_flags);
      __pyx_v_flags = __pyx_t_6;
      __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_v_charsetnr);
      __pyx_v_charsetnr = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":99
 *                 d = PyString_FromStringAndSize(row[i], lengths[i])
 *                 field_type, flags, charsetnr = self.conversion_info[i]
 *                 converter = self.conversions_dict.get(field_type)             # <<<<<<<<<<<<<<
 *                 if converter:
 *                     d = converter(d)
 */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__conversions_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_field_type);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field_type);
      __Pyx_GIVEREF(__pyx_v_field_type);
      __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_v_converter);
      __pyx_v_converter = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":100
 *                 field_type, flags, charsetnr = self.conversion_info[i]
 *                 converter = self.conversions_dict.get(field_type)
 *                 if converter:             # <<<<<<<<<<<<<<
 *                     d = converter(d)
 *                 elif self.conn.use_unicode and charsetnr != CS_BINARY:
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_converter); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_2) {

        /* "/home/sthorne/src/oursql/oursqlx/query.pyx":101
 *                 converter = self.conversions_dict.get(field_type)
 *                 if converter:
 *                     d = converter(d)             # <<<<<<<<<<<<<<
 *                 elif self.conn.use_unicode and charsetnr != CS_BINARY:
 *                     d = d.decode(self.conn._charset)
 */
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        __pyx_t_3 = PyObject_Call(__pyx_v_converter, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_d);
        __pyx_v_d = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L12;
      }

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":102
 *                 if converter:
 *                     d = converter(d)
 *                 elif self.conn.use_unicode and charsetnr != CS_BINARY:             # <<<<<<<<<<<<<<
 *                     d = d.decode(self.conn._charset)
 *             Py_INCREF(d)
 */
      if (((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->use_unicode) {
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_charsetnr, __pyx_int_63, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __pyx_t_2;
      } else {
        __pyx_t_10 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->use_unicode;
      }
      if (__pyx_t_10) {

        /* "/home/sthorne/src/oursql/oursqlx/query.pyx":103
 *                     d = converter(d)
 *                 elif self.conn.use_unicode and charsetnr != CS_BINARY:
 *                     d = d.decode(self.conn._charset)             # <<<<<<<<<<<<<<
 *             Py_INCREF(d)
 *             PyTuple_SET_ITEM(ret, i, d)
 */
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->_charset);
        PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->_charset);
        __Pyx_GIVEREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->_charset);
        __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_d);
        __pyx_v_d = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
    __pyx_L9:;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":104
 *                 elif self.conn.use_unicode and charsetnr != CS_BINARY:
 *                     d = d.decode(self.conn._charset)
 *             Py_INCREF(d)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(ret, i, d)
 *         return ret
 */
    Py_INCREF(__pyx_v_d);

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":105
 *                     d = d.decode(self.conn._charset)
 *             Py_INCREF(d)
 *             PyTuple_SET_ITEM(ret, i, d)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_d);
  }

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":106
 *             Py_INCREF(d)
 *             PyTuple_SET_ITEM(ret, i, d)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def fetchall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("oursql._ResultSet.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_field_type);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_XDECREF(__pyx_v_charsetnr);
  __Pyx_XDECREF(__pyx_v_converter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":108
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PySequence_List(self)
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_4fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_4fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":109
 * 
 *     def fetchall(self):
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         return PySequence_List(self)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":110
 *     def fetchall(self):
 *         self._check_closed()
 *         return PySequence_List(self)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PySequence_List(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._ResultSet.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":112
 *         return PySequence_List(self)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":113
 * 
 *     def __iter__(self):
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         return PyCallIter_New(self.fetchone, None)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":114
 *     def __iter__(self):
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)             # <<<<<<<<<<<<<<
 * 
 * cdef class _Query:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = Py_None;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyCallIter_New(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._ResultSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":15
 *     cdef unsigned int fields
 *     cdef object conversion_info
 *     cdef readonly object rowcount, lastrowid, description, column_names             # <<<<<<<<<<<<<<
 *     cdef public object warnings
 *     cdef int show_table
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_8rowcount___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_8rowcount___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount);
  __pyx_r = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->rowcount;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid);
  __pyx_r = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->lastrowid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_10_ResultSet_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_11description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description);
  __pyx_r = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_10_ResultSet_12column_names___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_12column_names___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names);
  __pyx_r = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->column_names;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":16
 *     cdef object conversion_info
 *     cdef readonly object rowcount, lastrowid, description, column_names
 *     cdef public object warnings             # <<<<<<<<<<<<<<
 *     cdef int show_table
 * 
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_8warnings___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_8warnings___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
  __pyx_r = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10_ResultSet_8warnings_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_10_ResultSet_8warnings_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_10_ResultSet_8warnings_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6oursql_10_ResultSet_8warnings_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->warnings = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":128
 *     cdef readonly object rowcount, lastrowid, description, warnings, has_result
 * 
 *     def __cinit__(self, Connection conn not None, query, *a, **kw):             # <<<<<<<<<<<<<<
 *         cdef char *qstr
 *         cdef Py_ssize_t qlen
 */

static int __pyx_pf_6oursql_6_Query___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_6_Query___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  char *__pyx_v_qstr;
  Py_ssize_t __pyx_v_qlen;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__conn,&__pyx_n_s__query,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_a = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_a)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return -1;
    }
    __Pyx_GOTREF(__pyx_v_a);
  } else {
    __pyx_v_a = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__conn);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__query);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 2) ? PyTuple_GET_SIZE(__pyx_args) : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]);
    __pyx_v_query = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_a); __pyx_v_a = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("oursql._Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_query);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":131
 *         cdef char *qstr
 *         cdef Py_ssize_t qlen
 *         conn._check_closed()             # <<<<<<<<<<<<<<
 *         self.conn = conn
 *         if PyUnicode_Check(query):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_check_closed(__pyx_v_conn); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":132
 *         cdef Py_ssize_t qlen
 *         conn._check_closed()
 *         self.conn = conn             # <<<<<<<<<<<<<<
 *         if PyUnicode_Check(query):
 *             query = query.encode(self.conn.charset)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_conn));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_conn));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn));
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn = __pyx_v_conn;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":133
 *         conn._check_closed()
 *         self.conn = conn
 *         if PyUnicode_Check(query):             # <<<<<<<<<<<<<<
 *             query = query.encode(self.conn.charset)
 *         PyString_AsStringAndSize(query, &qstr, &qlen)
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_query);
  if (__pyx_t_2) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":134
 *         self.conn = conn
 *         if PyUnicode_Check(query):
 *             query = query.encode(self.conn.charset)             # <<<<<<<<<<<<<<
 *         PyString_AsStringAndSize(query, &qstr, &qlen)
 *         if mysql_real_query(self.conn.conn, qstr, qlen):
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_query, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_query);
    __pyx_v_query = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":135
 *         if PyUnicode_Check(query):
 *             query = query.encode(self.conn.charset)
 *         PyString_AsStringAndSize(query, &qstr, &qlen)             # <<<<<<<<<<<<<<
 *         if mysql_real_query(self.conn.conn, qstr, qlen):
 *             self._raise_error()
 */
  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_query, (&__pyx_v_qstr), (&__pyx_v_qlen)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":136
 *             query = query.encode(self.conn.charset)
 *         PyString_AsStringAndSize(query, &qstr, &qlen)
 *         if mysql_real_query(self.conn.conn, qstr, qlen):             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         self.res_a, self.res_kw = a, kw
 */
  __pyx_t_1 = __pyx_f_6oursql_mysql_real_query(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn->conn, __pyx_v_qstr, __pyx_v_qlen);
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":137
 *         PyString_AsStringAndSize(query, &qstr, &qlen)
 *         if mysql_real_query(self.conn.conn, qstr, qlen):
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         self.res_a, self.res_kw = a, kw
 *         self.warnings = []
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Query *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->__pyx_vtab)->_raise_error(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":138
 *         if mysql_real_query(self.conn.conn, qstr, qlen):
 *             self._raise_error()
 *         self.res_a, self.res_kw = a, kw             # <<<<<<<<<<<<<<
 *         self.warnings = []
 *         self.new_result()
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_a);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = ((PyObject *)__pyx_v_kw);
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_a);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_a);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_a = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_kw);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_kw);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_kw = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":139
 *             self._raise_error()
 *         self.res_a, self.res_kw = a, kw
 *         self.warnings = []             # <<<<<<<<<<<<<<
 *         self.new_result()
 *         # XXX: support multiple result sets.
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":140
 *         self.res_a, self.res_kw = a, kw
 *         self.warnings = []
 *         self.new_result()             # <<<<<<<<<<<<<<
 *         # XXX: support multiple result sets.
 *         self.has_result = self.result.has_result
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__new_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":142
 *         self.new_result()
 *         # XXX: support multiple result sets.
 *         self.has_result = self.result.has_result             # <<<<<<<<<<<<<<
 * 
 *     _result_class = _ResultSet
 */
  __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result, __pyx_n_s__has_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->has_result);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->has_result);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->has_result = __pyx_t_4;
  __pyx_t_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql._Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":145
 * 
 *     _result_class = _ResultSet
 *     def new_result(self):             # <<<<<<<<<<<<<<
 *         res = self._result_class(self.conn, *self.res_a, **self.res_kw)
 *         self.warnings.extend(res.warnings)
 */

static PyObject *__pyx_pf_6oursql_6_Query_1new_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_1new_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_result");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":146
 *     _result_class = _ResultSet
 *     def new_result(self):
 *         res = self._result_class(self.conn, *self.res_a, **self.res_kw)             # <<<<<<<<<<<<<<
 *         self.warnings.extend(res.warnings)
 *         self.rowcount = res.rowcount
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___result_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn));
  __pyx_t_3 = PySequence_Tuple(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_a); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->res_kw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":147
 *     def new_result(self):
 *         res = self._result_class(self.conn, *self.res_a, **self.res_kw)
 *         self.warnings.extend(res.warnings)             # <<<<<<<<<<<<<<
 *         self.rowcount = res.rowcount
 *         self.lastrowid = res.lastrowid
 */
  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings, __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":148
 *         res = self._result_class(self.conn, *self.res_a, **self.res_kw)
 *         self.warnings.extend(res.warnings)
 *         self.rowcount = res.rowcount             # <<<<<<<<<<<<<<
 *         self.lastrowid = res.lastrowid
 *         self.description = res.description
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__rowcount); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->rowcount);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->rowcount);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->rowcount = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":149
 *         self.warnings.extend(res.warnings)
 *         self.rowcount = res.rowcount
 *         self.lastrowid = res.lastrowid             # <<<<<<<<<<<<<<
 *         self.description = res.description
 *         self.result = res
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__lastrowid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->lastrowid);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->lastrowid);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->lastrowid = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":150
 *         self.rowcount = res.rowcount
 *         self.lastrowid = res.lastrowid
 *         self.description = res.description             # <<<<<<<<<<<<<<
 *         self.result = res
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__description); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->description);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->description);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->description = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":151
 *         self.lastrowid = res.lastrowid
 *         self.description = res.description
 *         self.result = res             # <<<<<<<<<<<<<<
 * 
 *     cdef int _raise_error(self) except -1:
 */
  __Pyx_INCREF(__pyx_v_res);
  __Pyx_GIVEREF(__pyx_v_res);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result = __pyx_v_res;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._Query.new_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":153
 *         self.result = res
 * 
 *     cdef int _raise_error(self) except -1:             # <<<<<<<<<<<<<<
 *         return self.conn._raise_error()
 * 
 */

static int __pyx_f_6oursql_6_Query__raise_error(struct __pyx_obj_6oursql__Query *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":154
 * 
 *     cdef int _raise_error(self) except -1:
 *         return self.conn._raise_error()             # <<<<<<<<<<<<<<
 * 
 *     def nextset(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->conn->__pyx_vtab)->_raise_error(__pyx_v_self->conn); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql._Query._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":156
 *         return self.conn._raise_error()
 * 
 *     def nextset(self):             # <<<<<<<<<<<<<<
 *         cdef int res
 *         # XXX: support multiple result sets.
 */

static PyObject *__pyx_pf_6oursql_6_Query_2nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_2nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nextset");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":159
 *         cdef int res
 *         # XXX: support multiple result sets.
 *         self.result = None             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result);
  ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result = Py_None;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":160
 *         # XXX: support multiple result sets.
 *         self.result = None
 *         return False             # <<<<<<<<<<<<<<
 * 
 *         if not self.result:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._Query.nextset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":175
 *             return True
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         while self.result is not None:
 *             if self.result.has_result:
 */

static PyObject *__pyx_pf_6oursql_6_Query_3fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_3fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":176
 * 
 *     def fetchone(self):
 *         while self.result is not None:             # <<<<<<<<<<<<<<
 *             if self.result.has_result:
 *                 row = self.result.fetchone()
 */
  while (1) {
    __pyx_t_1 = (((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result != Py_None);
    if (!__pyx_t_1) break;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":177
 *     def fetchone(self):
 *         while self.result is not None:
 *             if self.result.has_result:             # <<<<<<<<<<<<<<
 *                 row = self.result.fetchone()
 *                 if row is not None:
 */
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result, __pyx_n_s__has_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":178
 *         while self.result is not None:
 *             if self.result.has_result:
 *                 row = self.result.fetchone()             # <<<<<<<<<<<<<<
 *                 if row is not None:
 *                     return row
 */
      __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_v_row);
      __pyx_v_row = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/query.pyx":179
 *             if self.result.has_result:
 *                 row = self.result.fetchone()
 *                 if row is not None:             # <<<<<<<<<<<<<<
 *                     return row
 *             self.nextset()
 */
      __pyx_t_1 = (__pyx_v_row != Py_None);
      if (__pyx_t_1) {

        /* "/home/sthorne/src/oursql/oursqlx/query.pyx":180
 *                 row = self.result.fetchone()
 *                 if row is not None:
 *                     return row             # <<<<<<<<<<<<<<
 *             self.nextset()
 *         return None
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_row);
        __pyx_r = __pyx_v_row;
        goto __pyx_L0;
        goto __pyx_L8;
      }
      __pyx_L8:;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sthorne/src/oursql/oursqlx/query.pyx":181
 *                 if row is not None:
 *                     return row
 *             self.nextset()             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nextset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":182
 *                     return row
 *             self.nextset()
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Query.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":184
 *         return None
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return PyCallIter_New(self.fetchone, None)
 * 
 */

static PyObject *__pyx_pf_6oursql_6_Query_4__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_4__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":185
 * 
 *     def __iter__(self):
 *         return PyCallIter_New(self.fetchone, None)             # <<<<<<<<<<<<<<
 * 
 *     def fetchall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = Py_None;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyCallIter_New(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Query.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":187
 *         return PyCallIter_New(self.fetchone, None)
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         return PySequence_List(self)
 * 
 */

static PyObject *__pyx_pf_6oursql_6_Query_5fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_5fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":188
 * 
 *     def fetchall(self):
 *         return PySequence_List(self)             # <<<<<<<<<<<<<<
 * 
 * # Cython should support multiple inheritance one of these days.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PySequence_List(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql._Query.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/query.pyx":126
 *     cdef Connection conn
 *     cdef object result, res_a, res_kw
 *     cdef readonly object rowcount, lastrowid, description, warnings, has_result             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Connection conn not None, query, *a, **kw):
 */

static PyObject *__pyx_pf_6oursql_6_Query_8rowcount___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_8rowcount___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->rowcount);
  __pyx_r = ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->rowcount;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6_Query_9lastrowid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_9lastrowid___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->lastrowid);
  __pyx_r = ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->lastrowid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6_Query_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_11description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->description);
  __pyx_r = ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->description;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6_Query_8warnings___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_8warnings___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings);
  __pyx_r = ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->warnings;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6_Query_10has_result___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_10has_result___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->has_result);
  __pyx_r = ((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->has_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":38
 *     _query_class = _Query
 * 
 *     def __cinit__(self, Connection conn not None, bint try_plain_query=True,             # <<<<<<<<<<<<<<
 *             **kwargs):
 *         self.conn = conn
 */

static int __pyx_pf_6oursql_6Cursor___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_6Cursor___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0;
  int __pyx_v_try_plain_query;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__conn,&__pyx_n_s__try_plain_query,0};
  __Pyx_RefNannySetupContext("__cinit__");
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__conn);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__try_plain_query);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]);
    if (values[1]) {
      __pyx_v_try_plain_query = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_try_plain_query == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_try_plain_query = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("oursql.Cursor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":40
 *     def __cinit__(self, Connection conn not None, bint try_plain_query=True,
 *             **kwargs):
 *         self.conn = conn             # <<<<<<<<<<<<<<
 *         self._stmt_kwargs = kwargs
 *         self._statements = collections.deque()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_conn));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_conn));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn = __pyx_v_conn;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":41
 *             **kwargs):
 *         self.conn = conn
 *         self._stmt_kwargs = kwargs             # <<<<<<<<<<<<<<
 *         self._statements = collections.deque()
 *         self.messages = []
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwargs));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs);
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs = ((PyObject *)__pyx_v_kwargs);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":42
 *         self.conn = conn
 *         self._stmt_kwargs = kwargs
 *         self._statements = collections.deque()             # <<<<<<<<<<<<<<
 *         self.messages = []
 *         self.closed = False
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__collections); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__deque); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements);
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":43
 *         self._stmt_kwargs = kwargs
 *         self._statements = collections.deque()
 *         self.messages = []             # <<<<<<<<<<<<<<
 *         self.closed = False
 *         self.rowcount = -1
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->messages);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->messages);
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->messages = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":44
 *         self._statements = collections.deque()
 *         self.messages = []
 *         self.closed = False             # <<<<<<<<<<<<<<
 *         self.rowcount = -1
 *         self.arraysize = 1
 */
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->closed = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":45
 *         self.messages = []
 *         self.closed = False
 *         self.rowcount = -1             # <<<<<<<<<<<<<<
 *         self.arraysize = 1
 *         self.try_plain_query = try_plain_query
 */
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->rowcount);
  __Pyx_DECREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->rowcount);
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->rowcount = __pyx_int_neg_1;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":46
 *         self.closed = False
 *         self.rowcount = -1
 *         self.arraysize = 1             # <<<<<<<<<<<<<<
 *         self.try_plain_query = try_plain_query
 * 
 */
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->arraysize = 1;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":47
 *         self.rowcount = -1
 *         self.arraysize = 1
 *         self.try_plain_query = try_plain_query             # <<<<<<<<<<<<<<
 * 
 *     cdef int _check_closed(self) except -1:
 */
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->try_plain_query = __pyx_v_try_plain_query;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Cursor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":49
 *         self.try_plain_query = try_plain_query
 * 
 *     cdef int _check_closed(self) except -1:             # <<<<<<<<<<<<<<
 *         if not self.conn.conn:
 *             raise ProgrammingError('connection closed')
 */

static int __pyx_f_6oursql_6Cursor__check_closed(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_closed");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":50
 * 
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('connection closed')
 *         if self.closed:
 */
  __pyx_t_1 = (!(__pyx_v_self->conn->conn != 0));
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":51
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ProgrammingError('cursor closed')
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":52
 *         if not self.conn.conn:
 *             raise ProgrammingError('connection closed')
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('cursor closed')
 * 
 */
  if (__pyx_v_self->closed) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":53
 *             raise ProgrammingError('connection closed')
 *         if self.closed:
 *             raise ProgrammingError('cursor closed')             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":55
 *             raise ProgrammingError('cursor closed')
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """close()
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_1close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_1close[] = "close()\n        \n        Close the cursor and discard the rest of the results. The cursor will\n        immediately become unusable.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_1close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":61
 *         immediately become unusable.
 *         """
 *         self.closed = True             # <<<<<<<<<<<<<<
 *         self._statements.clear()
 * 
 */
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->closed = 1;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":62
 *         """
 *         self.closed = True
 *         self._statements.clear()             # <<<<<<<<<<<<<<
 * 
 *     def _new_statement(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, __pyx_n_s__clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Cursor.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":64
 *         self._statements.clear()
 * 
 *     def _new_statement(self):             # <<<<<<<<<<<<<<
 *         stmt = self._statement_class(self.conn, **self._stmt_kwargs)
 *         stmt.prefetch_rows = self.arraysize
 */

static PyObject *__pyx_pf_6oursql_6Cursor_2_new_statement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_2_new_statement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_stmt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_new_statement");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":65
 * 
 *     def _new_statement(self):
 *         stmt = self._statement_class(self.conn, **self._stmt_kwargs)             # <<<<<<<<<<<<<<
 *         stmt.prefetch_rows = self.arraysize
 *         return stmt
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___statement_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  __pyx_t_3 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_stmt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":66
 *     def _new_statement(self):
 *         stmt = self._statement_class(self.conn, **self._stmt_kwargs)
 *         stmt.prefetch_rows = self.arraysize             # <<<<<<<<<<<<<<
 *         return stmt
 * 
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->arraysize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_v_stmt, __pyx_n_s__prefetch_rows, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":67
 *         stmt = self._statement_class(self.conn, **self._stmt_kwargs)
 *         stmt.prefetch_rows = self.arraysize
 *         return stmt             # <<<<<<<<<<<<<<
 * 
 *     def _new_query(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_stmt);
  __pyx_r = __pyx_v_stmt;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor._new_statement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":69
 *         return stmt
 * 
 *     def _new_query(self, query):             # <<<<<<<<<<<<<<
 *         return self._query_class(self.conn, query, **self._stmt_kwargs)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_3_new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_3_new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_new_query");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":70
 * 
 *     def _new_query(self, query):
 *         return self._query_class(self.conn, query, **self._stmt_kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def callproc(self, procname, params=()):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___query_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  __Pyx_INCREF(__pyx_v_query);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  __pyx_t_3 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor._new_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":72
 *         return self._query_class(self.conn, query, **self._stmt_kwargs)
 * 
 *     def callproc(self, procname, params=()):             # <<<<<<<<<<<<<<
 *         """callproc(procname, params=())
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_4callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_4callproc[] = "callproc(procname, params=())\n        \n        Supposedly, run a stored procedure. MySQL's C API has no direct call\n        for this; you need to execute stored procedures with the CALL statement\n        instead. Calling this method always raises an exception.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_4callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_procname = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__procname,&__pyx_n_s__params,0};
  __Pyx_RefNannySetupContext("callproc");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_empty_tuple);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__procname);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__params);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "callproc") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_procname = values[0];
    __pyx_v_params = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("callproc", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.callproc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":81
 *         # This is slightly irritating, but not too horribly bad. The horribly
 *         # bad part is getting the results from a procedure.
 *         raise NotSupportedError('use the CALL statement with the execute '             # <<<<<<<<<<<<<<
 *             'method to call stored procedures')
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NotSupportedError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Cursor.callproc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":84
 *             'method to call stored procedures')
 * 
 *     def _do_autoping(self):             # <<<<<<<<<<<<<<
 *         if self.conn.autoping:
 *             self.conn.ping()
 */

static PyObject *__pyx_pf_6oursql_6Cursor_5_do_autoping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_5_do_autoping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_autoping");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":85
 * 
 *     def _do_autoping(self):
 *         if self.conn.autoping:             # <<<<<<<<<<<<<<
 *             self.conn.ping()
 * 
 */
  if (((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn->autoping) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":86
 *     def _do_autoping(self):
 *         if self.conn.autoping:
 *             self.conn.ping()             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, query, params=(), plain_query=False):
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn), __pyx_n_s__ping); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql.Cursor._do_autoping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":88
 *             self.conn.ping()
 * 
 *     def execute(self, query, params=(), plain_query=False):             # <<<<<<<<<<<<<<
 *         """execute(query, params=(), plain_query=False)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_6execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_6execute[] = "execute(query, params=(), plain_query=False)\n        \n        Execute a query. If plain_query is true, run a plain, unparameterized\n        query. MySQL cannot parameterize all kinds of statements, which makes\n        it sometimes necessary to execute a plain query. If plain_query is true\n        and params is true, an exception will be raised as plain queries cannot\n        be parameterized.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_6execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_v_plain_query = 0;
  PyObject *__pyx_v_stmt = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__query,&__pyx_n_s__params,&__pyx_n_s__plain_query,0};
  __Pyx_RefNannySetupContext("execute");
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_empty_tuple);
    values[2] = __pyx_k_55;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__query);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__params);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__plain_query);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "execute") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_query = values[0];
    __pyx_v_params = values[1];
    __pyx_v_plain_query = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":97
 *         be parameterized.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         self._do_autoping()
 *         # This, on the other hand, is just plain stupid.
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":98
 *         """
 *         self._check_closed()
 *         self._do_autoping()             # <<<<<<<<<<<<<<
 *         # This, on the other hand, is just plain stupid.
 *         if plain_query:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___do_autoping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":100
 *         self._do_autoping()
 *         # This, on the other hand, is just plain stupid.
 *         if plain_query:             # <<<<<<<<<<<<<<
 *             if params:
 *                 # I *really* don't want to write an escaping API. Anything
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_plain_query); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":101
 *         # This, on the other hand, is just plain stupid.
 *         if plain_query:
 *             if params:             # <<<<<<<<<<<<<<
 *                 # I *really* don't want to write an escaping API. Anything
 *                 # worth parameterizing supports the prepared statement API
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_params); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":105
 *                 # worth parameterizing supports the prepared statement API
 *                 # anyway, so this shouldn't matter too much.
 *                 raise ProgrammingError("can't call execute with both "             # <<<<<<<<<<<<<<
 *                     "parameters and a plain query")
 *             stmt = self._new_query(query)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":107
 *                 raise ProgrammingError("can't call execute with both "
 *                     "parameters and a plain query")
 *             stmt = self._new_query(query)             # <<<<<<<<<<<<<<
 *         else:
 *             stmt = self._new_statement()
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___new_query); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_query);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_query);
    __Pyx_GIVEREF(__pyx_v_query);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_stmt = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":109
 *             stmt = self._new_query(query)
 *         else:
 *             stmt = self._new_statement()             # <<<<<<<<<<<<<<
 *             try:
 *                 stmt.prepare(query)
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___new_statement); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stmt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":110
 *         else:
 *             stmt = self._new_statement()
 *             try:             # <<<<<<<<<<<<<<
 *                 stmt.prepare(query)
 *             except Error, e:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":111
 *             stmt = self._new_statement()
 *             try:
 *                 stmt.prepare(query)             # <<<<<<<<<<<<<<
 *             except Error, e:
 *                 # So, if MySQL refuses to parameterize the query, we optionally
 */
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__prepare); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(__pyx_v_query);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_query);
        __Pyx_GIVEREF(__pyx_v_query);
        __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      /*else:*/ {

        /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":122
 *                     raise
 *             else:
 *                 stmt.execute(*params)             # <<<<<<<<<<<<<<
 *         self._update_fields(stmt)
 * 
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__execute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":112
 *             try:
 *                 stmt.prepare(query)
 *             except Error, e:             # <<<<<<<<<<<<<<
 *                 # So, if MySQL refuses to parameterize the query, we optionally
 *                 # try it again through the stupid query API. This is optional
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__Error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyErr_ExceptionMatches(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {
        __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_v_e = __pyx_t_5;

        /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":117
 *                 # because you can lose state data if this is always done
 *                 # implicitly.
 *                 if self.try_plain_query and e.errno == ER_UNSUPPORTED_PS:             # <<<<<<<<<<<<<<
 *                     return self.execute(query, params, plain_query=True)
 *                 else:
 */
        if (((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->try_plain_query) {
          __pyx_t_9 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PyInt_FromLong(ER_UNSUPPORTED_PS); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyObject_RichCompare(__pyx_t_9, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = __pyx_t_4;
        } else {
          __pyx_t_12 = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->try_plain_query;
        }
        if (__pyx_t_12) {

          /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":118
 *                 # implicitly.
 *                 if self.try_plain_query and e.errno == ER_UNSUPPORTED_PS:
 *                     return self.execute(query, params, plain_query=True)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__execute); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_10));
          __Pyx_INCREF(__pyx_v_query);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_query);
          __Pyx_GIVEREF(__pyx_v_query);
          __Pyx_INCREF(__pyx_v_params);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_params);
          __Pyx_GIVEREF(__pyx_v_params);
          __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_9));
          __pyx_t_13 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__plain_query), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_11, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __pyx_r = __pyx_t_13;
          __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L11_except_return;
          goto __pyx_L18;
        }
        /*else*/ {

          /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":120
 *                     return self.execute(query, params, plain_query=True)
 *                 else:
 *                     raise             # <<<<<<<<<<<<<<
 *             else:
 *                 stmt.execute(*params)
 */
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_ErrRestore(__pyx_t_3, __pyx_t_5, __pyx_t_2);
          __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; 
          {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        }
        __pyx_L18:;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L9_exception_handled;
      }
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L11_except_return:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L0;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L15_try_end:;
    }
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":123
 *             else:
 *                 stmt.execute(*params)
 *         self._update_fields(stmt)             # <<<<<<<<<<<<<<
 * 
 *     def executemany(self, query, parambatch):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_update_fields(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_stmt, NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stmt);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":125
 *         self._update_fields(stmt)
 * 
 *     def executemany(self, query, parambatch):             # <<<<<<<<<<<<<<
 *         """executemany(query, parambatch)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_7executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_7executemany[] = "executemany(query, parambatch)\n        \n        Execute the same query with different sets of parameters. This is more\n        efficient than calling execute many times with the same query.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_7executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_parambatch = 0;
  PyObject *__pyx_v_stmt = NULL;
  PyObject *__pyx_v_rowcount = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  struct __pyx_opt_args_6oursql_6Cursor__update_fields __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__query,&__pyx_n_s__parambatch,0};
  __Pyx_RefNannySetupContext("executemany");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__query);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parambatch);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("executemany", 1, 2, 2, 1); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "executemany") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_query = values[0];
    __pyx_v_parambatch = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("executemany", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":131
 *         efficient than calling execute many times with the same query.
 *         """
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         self._do_autoping()
 *         # No plain queries because they can't be parameterized anyway.
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":132
 *         """
 *         self._check_closed()
 *         self._do_autoping()             # <<<<<<<<<<<<<<
 *         # No plain queries because they can't be parameterized anyway.
 *         stmt = self._new_statement()
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___do_autoping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":134
 *         self._do_autoping()
 *         # No plain queries because they can't be parameterized anyway.
 *         stmt = self._new_statement()             # <<<<<<<<<<<<<<
 *         stmt.prepare(query)
 *         rowcount = 0
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___new_statement); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_stmt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":135
 *         # No plain queries because they can't be parameterized anyway.
 *         stmt = self._new_statement()
 *         stmt.prepare(query)             # <<<<<<<<<<<<<<
 *         rowcount = 0
 *         for params in parambatch:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__prepare); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_query);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":136
 *         stmt = self._new_statement()
 *         stmt.prepare(query)
 *         rowcount = 0             # <<<<<<<<<<<<<<
 *         for params in parambatch:
 *             stmt.execute(*params)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_rowcount = __pyx_int_0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":137
 *         stmt.prepare(query)
 *         rowcount = 0
 *         for params in parambatch:             # <<<<<<<<<<<<<<
 *             stmt.execute(*params)
 *             # There's probably a better way to do this, but whatever. As far as
 */
  if (PyList_CheckExact(__pyx_v_parambatch) || PyTuple_CheckExact(__pyx_v_parambatch)) {
    __pyx_t_4 = __pyx_v_parambatch; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_parambatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  for (;;) {
    if (PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
    } else if (PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_params);
    __pyx_v_params = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":138
 *         rowcount = 0
 *         for params in parambatch:
 *             stmt.execute(*params)             # <<<<<<<<<<<<<<
 *             # There's probably a better way to do this, but whatever. As far as
 *             # I know we should get all values -1 or all values >= 0.
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__execute); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":141
 *             # There's probably a better way to do this, but whatever. As far as
 *             # I know we should get all values -1 or all values >= 0.
 *             rowcount += stmt.rowcount             # <<<<<<<<<<<<<<
 *         # Whatevs.
 *         if rowcount < 0:
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__rowcount); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_rowcount, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_v_rowcount);
    __pyx_v_rowcount = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":143
 *             rowcount += stmt.rowcount
 *         # Whatevs.
 *         if rowcount < 0:             # <<<<<<<<<<<<<<
 *             rowcount = -1
 *         self._update_fields(stmt, rowcount)
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_rowcount, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":144
 *         # Whatevs.
 *         if rowcount < 0:
 *             rowcount = -1             # <<<<<<<<<<<<<<
 *         self._update_fields(stmt, rowcount)
 * 
 */
    __Pyx_INCREF(__pyx_int_neg_1);
    __Pyx_DECREF(__pyx_v_rowcount);
    __pyx_v_rowcount = __pyx_int_neg_1;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":145
 *         if rowcount < 0:
 *             rowcount = -1
 *         self._update_fields(stmt, rowcount)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.rowcount = __pyx_v_rowcount;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_update_fields(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_stmt, &__pyx_t_9); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("oursql.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stmt);
  __Pyx_XDECREF(__pyx_v_rowcount);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":147
 *         self._update_fields(stmt, rowcount)
 * 
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:             # <<<<<<<<<<<<<<
 *         self.messages.extend(stmt.warnings)
 *         if rowcount is None:
 */

static int __pyx_f_6oursql_6Cursor__update_fields(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_stmt, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args) {
  PyObject *__pyx_v_rowcount = ((PyObject *)Py_None);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_update_fields");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_rowcount = __pyx_optional_args->rowcount;
    }
  }

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":148
 * 
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:
 *         self.messages.extend(stmt.warnings)             # <<<<<<<<<<<<<<
 *         if rowcount is None:
 *             self.rowcount = stmt.rowcount
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->messages, __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":149
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:
 *         self.messages.extend(stmt.warnings)
 *         if rowcount is None:             # <<<<<<<<<<<<<<
 *             self.rowcount = stmt.rowcount
 *         else:
 */
  __pyx_t_4 = (__pyx_v_rowcount == Py_None);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":150
 *         self.messages.extend(stmt.warnings)
 *         if rowcount is None:
 *             self.rowcount = stmt.rowcount             # <<<<<<<<<<<<<<
 *         else:
 *             self.rowcount = rowcount
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__rowcount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->rowcount);
    __Pyx_DECREF(__pyx_v_self->rowcount);
    __pyx_v_self->rowcount = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":152
 *             self.rowcount = stmt.rowcount
 *         else:
 *             self.rowcount = rowcount             # <<<<<<<<<<<<<<
 *         self.lastrowid = stmt.lastrowid
 *         self.description = stmt.description
 */
    __Pyx_INCREF(__pyx_v_rowcount);
    __Pyx_GIVEREF(__pyx_v_rowcount);
    __Pyx_GOTREF(__pyx_v_self->rowcount);
    __Pyx_DECREF(__pyx_v_self->rowcount);
    __pyx_v_self->rowcount = __pyx_v_rowcount;
  }
  __pyx_L3:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":153
 *         else:
 *             self.rowcount = rowcount
 *         self.lastrowid = stmt.lastrowid             # <<<<<<<<<<<<<<
 *         self.description = stmt.description
 *         if stmt.has_result:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__lastrowid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->lastrowid);
  __Pyx_DECREF(__pyx_v_self->lastrowid);
  __pyx_v_self->lastrowid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":154
 *             self.rowcount = rowcount
 *         self.lastrowid = stmt.lastrowid
 *         self.description = stmt.description             # <<<<<<<<<<<<<<
 *         if stmt.has_result:
 *             self._statements.append(stmt)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->description);
  __Pyx_DECREF(__pyx_v_self->description);
  __pyx_v_self->description = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":155
 *         self.lastrowid = stmt.lastrowid
 *         self.description = stmt.description
 *         if stmt.has_result:             # <<<<<<<<<<<<<<
 *             self._statements.append(stmt)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__has_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":156
 *         self.description = stmt.description
 *         if stmt.has_result:
 *             self._statements.append(stmt)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _check_statements(self) except -1:
 */
    __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_self->_statements, __pyx_v_stmt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor._update_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":158
 *             self._statements.append(stmt)
 * 
 *     cdef int _check_statements(self) except -1:             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         if not self._statements:
 */

static int __pyx_f_6oursql_6Cursor__check_statements(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_statements");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":159
 * 
 *     cdef int _check_statements(self) except -1:
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         if not self._statements:
 *             raise ProgrammingError('no results available')
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":160
 *     cdef int _check_statements(self) except -1:
 *         self._check_closed()
 *         if not self._statements:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('no results available')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_statements); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":161
 *         self._check_closed()
 *         if not self._statements:
 *             raise ProgrammingError('no results available')             # <<<<<<<<<<<<<<
 * 
 *     def nextset(self):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql.Cursor._check_statements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":163
 *             raise ProgrammingError('no results available')
 * 
 *     def nextset(self):             # <<<<<<<<<<<<<<
 *         """nextset() -> True or None.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_8nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_8nextset[] = "nextset() -> True or None.\n        \n        Move to the next result set. If there are any result sets left, this\n        returns True. Otherwise, None.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_8nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nextset");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":169
 *         returns True. Otherwise, None.
 *         """
 *         self._check_statements()             # <<<<<<<<<<<<<<
 *         if self._statements[0].nextset():
 *             return True
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_statements(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":170
 *         """
 *         self._check_statements()
 *         if self._statements[0].nextset():             # <<<<<<<<<<<<<<
 *             return True
 *         self._statements.popleft()
 */
  __pyx_t_2 = __Pyx_GetItemInt(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nextset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":171
 *         self._check_statements()
 *         if self._statements[0].nextset():
 *             return True             # <<<<<<<<<<<<<<
 *         self._statements.popleft()
 *         # DB-API, you so wacky.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":172
 *         if self._statements[0].nextset():
 *             return True
 *         self._statements.popleft()             # <<<<<<<<<<<<<<
 *         # DB-API, you so wacky.
 *         return True if self._statements else None
 */
  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, __pyx_n_s__popleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":174
 *         self._statements.popleft()
 *         # DB-API, you so wacky.
 *         return True if self._statements else None             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_3 = Py_None;
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.nextset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":176
 *         return True if self._statements else None
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         """fetchone() -> row.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_9fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_9fetchone[] = "fetchone() -> row.\n        \n        Fetch one row from the current result set. If the result set was\n        exhausted, this returns None. If there were no result sets, a \n        ProgrammingError is raised.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_9fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":183
 *         ProgrammingError is raised.
 *         """
 *         self._check_statements()             # <<<<<<<<<<<<<<
 *         self._do_autoping()
 *         ret = self._statements[0].fetchone()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_statements(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":184
 *         """
 *         self._check_statements()
 *         self._do_autoping()             # <<<<<<<<<<<<<<
 *         ret = self._statements[0].fetchone()
 *         if ret is None:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___do_autoping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":185
 *         self._check_statements()
 *         self._do_autoping()
 *         ret = self._statements[0].fetchone()             # <<<<<<<<<<<<<<
 *         if ret is None:
 *             self.nextset()
 */
  __pyx_t_3 = __Pyx_GetItemInt(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":186
 *         self._do_autoping()
 *         ret = self._statements[0].fetchone()
 *         if ret is None:             # <<<<<<<<<<<<<<
 *             self.nextset()
 *         return ret
 */
  __pyx_t_4 = (__pyx_v_ret == Py_None);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":187
 *         ret = self._statements[0].fetchone()
 *         if ret is None:
 *             self.nextset()             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nextset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":188
 *         if ret is None:
 *             self.nextset()
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def fetchmany(self, size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":190
 *         return ret
 * 
 *     def fetchmany(self, size=None):             # <<<<<<<<<<<<<<
 *         """fetchmany(size=self.arraysize) -> list of rows.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_10fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_10fetchmany[] = "fetchmany(size=self.arraysize) -> list of rows.\n        \n        Fetch up to 'size' rows. If there aren't that many rows available in \n        the database, this returns as many as were available. If there were no \n        result sets, a ProgrammingError is raised.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_10fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  unsigned int __pyx_v_i;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_resultset = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
  __Pyx_RefNannySetupContext("fetchmany");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fetchmany") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fetchmany", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_size);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":198
 *         """
 *         cdef unsigned int i
 *         self._check_statements()             # <<<<<<<<<<<<<<
 *         self._do_autoping()
 *         if size is None:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_statements(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":199
 *         cdef unsigned int i
 *         self._check_statements()
 *         self._do_autoping()             # <<<<<<<<<<<<<<
 *         if size is None:
 *             size = self.arraysize
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___do_autoping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":200
 *         self._check_statements()
 *         self._do_autoping()
 *         if size is None:             # <<<<<<<<<<<<<<
 *             size = self.arraysize
 *         ret = []
 */
  __pyx_t_4 = (__pyx_v_size == Py_None);
  if (__pyx_t_4) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":201
 *         self._do_autoping()
 *         if size is None:
 *             size = self.arraysize             # <<<<<<<<<<<<<<
 *         ret = []
 *         resultset = self._statements[0]
 */
    __pyx_t_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->arraysize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_size);
    __pyx_v_size = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":202
 *         if size is None:
 *             size = self.arraysize
 *         ret = []             # <<<<<<<<<<<<<<
 *         resultset = self._statements[0]
 *         # This is a little bit wacky for DB-API compliance. If there's fewer
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":203
 *             size = self.arraysize
 *         ret = []
 *         resultset = self._statements[0]             # <<<<<<<<<<<<<<
 *         # This is a little bit wacky for DB-API compliance. If there's fewer
 *         # rows available than requested, return everything available without
 */
  __pyx_t_3 = __Pyx_GetItemInt(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_resultset = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":209
 *         # result set at all, *then* switch to the next result set and return an
 *         # empty sequence.
 *         for 0 <= i < size:             # <<<<<<<<<<<<<<
 *             row = resultset.fetchone()
 *             if row is None:
 */
  __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_size); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":210
 *         # empty sequence.
 *         for 0 <= i < size:
 *             row = resultset.fetchone()             # <<<<<<<<<<<<<<
 *             if row is None:
 *                 if i == 0:
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_resultset, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_row);
    __pyx_v_row = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":211
 *         for 0 <= i < size:
 *             row = resultset.fetchone()
 *             if row is None:             # <<<<<<<<<<<<<<
 *                 if i == 0:
 *                     self.nextset()
 */
    __pyx_t_4 = (__pyx_v_row == Py_None);
    if (__pyx_t_4) {

      /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":212
 *             row = resultset.fetchone()
 *             if row is None:
 *                 if i == 0:             # <<<<<<<<<<<<<<
 *                     self.nextset()
 *                 return ret
 */
      __pyx_t_4 = (__pyx_v_i == 0);
      if (__pyx_t_4) {

        /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":213
 *             if row is None:
 *                 if i == 0:
 *                     self.nextset()             # <<<<<<<<<<<<<<
 *                 return ret
 *             ret.append(row)
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nextset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":214
 *                 if i == 0:
 *                     self.nextset()
 *                 return ret             # <<<<<<<<<<<<<<
 *             ret.append(row)
 *         return ret
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_ret));
      __pyx_r = ((PyObject *)__pyx_v_ret);
      goto __pyx_L0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":215
 *                     self.nextset()
 *                 return ret
 *             ret.append(row)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_ret) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_6 = PyList_Append(__pyx_v_ret, __pyx_v_row); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":216
 *                 return ret
 *             ret.append(row)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def fetchall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_resultset);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":218
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         """fetchall() -> list of rows.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_11fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_11fetchall[] = "fetchall() -> list of rows.\n        \n        Fetch all available rows from the database. If there were no result \n        sets, a ProgrammingError is raised.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_11fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":224
 *         sets, a ProgrammingError is raised.
 *         """
 *         self._check_statements()             # <<<<<<<<<<<<<<
 *         self._do_autoping()
 *         ret = []
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_statements(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":225
 *         """
 *         self._check_statements()
 *         self._do_autoping()             # <<<<<<<<<<<<<<
 *         ret = []
 *         while self._statements:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___do_autoping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":226
 *         self._check_statements()
 *         self._do_autoping()
 *         ret = []             # <<<<<<<<<<<<<<
 *         while self._statements:
 *             ret.extend(self._statements.popleft().fetchall())
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":227
 *         self._do_autoping()
 *         ret = []
 *         while self._statements:             # <<<<<<<<<<<<<<
 *             ret.extend(self._statements.popleft().fetchall())
 *         return ret
 */
  while (1) {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_4) break;

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":228
 *         ret = []
 *         while self._statements:
 *             ret.extend(self._statements.popleft().fetchall())             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements, __pyx_n_s__popleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__fetchall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":229
 *         while self._statements:
 *             ret.extend(self._statements.popleft().fetchall())
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql.Cursor.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":231
 *         return ret
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)
 */

static PyObject *__pyx_pf_6oursql_6Cursor_12__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_12__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":232
 * 
 *     def __iter__(self):
 *         self._check_closed()             # <<<<<<<<<<<<<<
 *         return PyCallIter_New(self.fetchone, None)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->__pyx_vtab)->_check_closed(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":233
 *     def __iter__(self):
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)             # <<<<<<<<<<<<<<
 * 
 *     property connection:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = Py_None;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyCallIter_New(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Cursor.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":236
 * 
 *     property connection:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.conn
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_10connection___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_10connection___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":237
 *     property connection:
 *         def __get__(self):
 *             return self.conn             # <<<<<<<<<<<<<<
 * 
 *     def setinputsizes(self, sizes):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":239
 *             return self.conn
 * 
 *     def setinputsizes(self, sizes):             # <<<<<<<<<<<<<<
 *         """setinputsizes(sizes)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_13setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes); /*proto*/
static char __pyx_doc_6oursql_6Cursor_13setinputsizes[] = "setinputsizes(sizes)\n        \n        Do nothing; this operation is not supported by oursql.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_13setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setinputsizes");

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":248
 *         pass
 * 
 *     def setoutputsize(self, size, column=None):             # <<<<<<<<<<<<<<
 *         """setoutputsize(size, column=None)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_14setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_14setoutputsize[] = "setoutputsize(size, column=None)\n        \n        Do nothing; this operation is not supported by oursql.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_14setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__column,0};
  __Pyx_RefNannySetupContext("setoutputsize");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setoutputsize") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
    __pyx_v_column = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setoutputsize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.setoutputsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":255
 *         pass
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__");

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":256
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc, value, tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":258
 *         return self
 * 
 *     def __exit__(self, exc, value, tb):             # <<<<<<<<<<<<<<
 *         if exc:
 *             self.conn.rollback()
 */

static PyObject *__pyx_pf_6oursql_6Cursor_16__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_16__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_tb = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__exc,&__pyx_n_s__value,&__pyx_n_s__tb,0};
  __Pyx_RefNannySetupContext("__exit__");
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__exc);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tb);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__exit__") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc = values[0];
    __pyx_v_value = values[1];
    __pyx_v_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":259
 * 
 *     def __exit__(self, exc, value, tb):
 *         if exc:             # <<<<<<<<<<<<<<
 *             self.conn.rollback()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":260
 *     def __exit__(self, exc, value, tb):
 *         if exc:
 *             self.conn.rollback()             # <<<<<<<<<<<<<<
 *         else:
 *             self.conn.commit()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn), __pyx_n_s__rollback); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":262
 *             self.conn.rollback()
 *         else:
 *             self.conn.commit()             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn), __pyx_n_s__commit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":263
 *         else:
 *             self.conn.commit()
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 * cdef class DictCursor(Cursor):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":29
 *     """
 * 
 *     cdef readonly object _statements, _stmt_kwargs             # <<<<<<<<<<<<<<
 *     cdef Connection conn
 *     cdef int closed, try_plain_query
 */

static PyObject *__pyx_pf_6oursql_6Cursor_11_statements___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_11_statements___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_statements;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->_stmt_kwargs;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":32
 *     cdef Connection conn
 *     cdef int closed, try_plain_query
 *     cdef readonly object rowcount, lastrowid, description, messages             # <<<<<<<<<<<<<<
 *     cdef public unsigned long arraysize
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_8rowcount___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_8rowcount___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->rowcount);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->rowcount;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6Cursor_9lastrowid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_9lastrowid___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->lastrowid);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->lastrowid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6Cursor_11description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_11description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->description);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->description;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6oursql_6Cursor_8messages___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_8messages___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->messages);
  __pyx_r = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->messages;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":33
 *     cdef int closed, try_plain_query
 *     cdef readonly object rowcount, lastrowid, description, messages
 *     cdef public unsigned long arraysize             # <<<<<<<<<<<<<<
 * 
 *     _statement_class = _Statement
 */

static PyObject *__pyx_pf_6oursql_6Cursor_9arraysize___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor_9arraysize___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->arraysize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("oursql.Cursor.arraysize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6oursql_6Cursor_9arraysize_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_6Cursor_9arraysize_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned long __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  __pyx_t_1 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->arraysize = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("oursql.Cursor.arraysize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oursql.pyx":99
 *     cdef readonly object values
 * 
 *     def __init__(self, *values):             # <<<<<<<<<<<<<<
 *         self.values = frozenset(values)
 * 
 */

static int __pyx_pf_6oursql_16_DBAPITypeObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6oursql_16_DBAPITypeObject___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_values = __pyx_args;

  /* "oursql.pyx":100
 * 
 *     def __init__(self, *values):
 *         self.values = frozenset(values)             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  __Pyx_DECREF(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  ((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values = __pyx_t_2;
  __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._DBAPITypeObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oursql.pyx":102
 *         self.values = frozenset(values)
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         if op == Py_EQ:
 *             return other in self.values
 */

static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__");

  /* "oursql.pyx":103
 * 
 *     def __richcmp__(self, other, int op):
 *         if op == Py_EQ:             # <<<<<<<<<<<<<<
 *             return other in self.values
 *         elif op == Py_NE:
 */
  __pyx_t_1 = (__pyx_v_op == Py_EQ);
  if (__pyx_t_1) {

    /* "oursql.pyx":104
 *     def __richcmp__(self, other, int op):
 *         if op == Py_EQ:
 *             return other in self.values             # <<<<<<<<<<<<<<
 *         elif op == Py_NE:
 *             return other not in self.values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = ((PySequence_Contains(__pyx_t_2, __pyx_v_other))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "oursql.pyx":105
 *         if op == Py_EQ:
 *             return other in self.values
 *         elif op == Py_NE:             # <<<<<<<<<<<<<<
 *             return other not in self.values
 *         else:
 */
  __pyx_t_1 = (__pyx_v_op == Py_NE);
  if (__pyx_t_1) {

    /* "oursql.pyx":106
 *             return other in self.values
 *         elif op == Py_NE:
 *             return other not in self.values             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('unorderable types: %r and %r' % (
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_2, __pyx_v_other))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "oursql.pyx":109
 *         else:
 *             raise TypeError('unorderable types: %r and %r' % (
 *                 type(self), type(other)))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_self)));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_self)));
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_other)));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_TYPE(__pyx_v_other)));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_other)));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_60), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._DBAPITypeObject.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oursql.pyx":111
 *                 type(self), type(other)))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<_DBAPITypeObject representing %r at %#x>' % (
 *             self.values, id(self))
 */

static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_2__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_2__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__");

  /* "oursql.pyx":112
 * 
 *     def __repr__(self):
 *         return '<_DBAPITypeObject representing %r at %#x>' % (             # <<<<<<<<<<<<<<
 *             self.values, id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "oursql.pyx":113
 *     def __repr__(self):
 *         return '<_DBAPITypeObject representing %r at %#x>' % (
 *             self.values, id(self))             # <<<<<<<<<<<<<<
 * 
 * STRING = _DBAPITypeObject(
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  __Pyx_GIVEREF(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("oursql._DBAPITypeObject.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "oursql.pyx":97
 * 
 * cdef class _DBAPITypeObject:
 *     cdef readonly object values             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *values):
 */

static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values);
  __pyx_r = ((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)->values;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_6oursql_Connection __pyx_vtable_6oursql_Connection;

static PyObject *__pyx_tp_new_6oursql_Connection(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql_Connection *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql_Connection *)o);
  p->__pyx_vtab = __pyx_vtabptr_6oursql_Connection;
  p->__weakref__ = 0;
  p->_charset = Py_None; Py_INCREF(Py_None);
  p->_context_cursors = Py_None; Py_INCREF(Py_None);
  p->default_cursor = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_10Connection___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql_Connection(PyObject *o) {
  struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6oursql_10Connection_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  Py_XDECREF(p->_charset);
  Py_XDECREF(p->_context_cursors);
  Py_XDECREF(p->default_cursor);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql_Connection(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o;
  if (p->_charset) {
    e = (*v)(p->_charset, a); if (e) return e;
  }
  if (p->_context_cursors) {
    e = (*v)(p->_context_cursors, a); if (e) return e;
  }
  if (p->default_cursor) {
    e = (*v)(p->default_cursor, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql_Connection(PyObject *o) {
  struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_charset);
  p->_charset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_context_cursors);
  p->_context_cursors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->default_cursor);
  p->default_cursor = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_10Connection_charset(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_7charset___get__(o);
}

static int __pyx_setprop_6oursql_10Connection_charset(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10Connection_7charset_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6oursql_10Connection_server_info(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_11server_info___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10Connection_ssl_cipher(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_10ssl_cipher___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10Connection_use_unicode(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_11use_unicode___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10Connection_autoping(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_8autoping___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10Connection_raise_on_warnings(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10Connection_default_cursor(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10Connection_14default_cursor___get__(o);
}

static int __pyx_setprop_6oursql_10Connection_default_cursor(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10Connection_14default_cursor_1__set__(o, v);
  }
  else {
    return __pyx_pf_6oursql_10Connection_14default_cursor_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6oursql_Connection[] = {
  {__Pyx_NAMESTR("_setup_ssl_options"), (PyCFunction)__pyx_pf_6oursql_10Connection_1_setup_ssl_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10Connection_2close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_2close)},
  {__Pyx_NAMESTR("ping"), (PyCFunction)__pyx_pf_6oursql_10Connection_4ping, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_4ping)},
  {__Pyx_NAMESTR("commit"), (PyCFunction)__pyx_pf_6oursql_10Connection_5commit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_5commit)},
  {__Pyx_NAMESTR("rollback"), (PyCFunction)__pyx_pf_6oursql_10Connection_6rollback, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_6rollback)},
  {__Pyx_NAMESTR("warning_count"), (PyCFunction)__pyx_pf_6oursql_10Connection_7warning_count, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_7warning_count)},
  {__Pyx_NAMESTR("cursor"), (PyCFunction)__pyx_pf_6oursql_10Connection_8cursor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_8cursor)},
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6oursql_10Connection_9__enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6oursql_10Connection_10__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_escape_string"), (PyCFunction)__pyx_pf_6oursql_10Connection_11_escape_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_11_escape_string)},
  {__Pyx_NAMESTR("_escape_unicode_string"), (PyCFunction)__pyx_pf_6oursql_10Connection_12_escape_unicode_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_12_escape_unicode_string)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql_Connection[] = {
  {(char *)"charset", __pyx_getprop_6oursql_10Connection_charset, __pyx_setprop_6oursql_10Connection_charset, __Pyx_DOCSTR(__pyx_k_62), 0},
  {(char *)"server_info", __pyx_getprop_6oursql_10Connection_server_info, 0, 0, 0},
  {(char *)"ssl_cipher", __pyx_getprop_6oursql_10Connection_ssl_cipher, 0, 0, 0},
  {(char *)"use_unicode", __pyx_getprop_6oursql_10Connection_use_unicode, 0, 0, 0},
  {(char *)"autoping", __pyx_getprop_6oursql_10Connection_autoping, 0, 0, 0},
  {(char *)"raise_on_warnings", __pyx_getprop_6oursql_10Connection_raise_on_warnings, 0, 0, 0},
  {(char *)"default_cursor", __pyx_getprop_6oursql_10Connection_default_cursor, __pyx_setprop_6oursql_10Connection_default_cursor, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Connection = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Connection = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Connection = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Connection = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql_Connection = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql.Connection"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql_Connection), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql_Connection, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Connection, /*tp_as_number*/
  &__pyx_tp_as_sequence_Connection, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Connection, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Connection, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Connection([host, user, passwd,] db=None, port=0, unix_socket=None, \n        connect_timeout=None, read_timeout=None, write_timeout=None, \n        protocol=None, ssl=None, read_default_file=None, \n        read_default_group=None, init_command=None, charset_dir=None, \n        shared_memory_base_name=None, local_infile=False, \n        require_secure_auth=False, report_truncation=True, compress=False, \n        found_rows=True, use_unicode=True, charset='utf8', autoping=False, \n        default_cursor=None, raise_on_warnings=True, autoreconnect=False)\n    \n    Connect to the MySQL database. The first three parameters may be passed by \n    position, but the rest may only be passed by keyword. All options except \n    'use_unicode', 'charset', 'autoping', 'default_cursor', and \n    'raise_on_warnings' correspond with parameters or flags to the \n    mysql_real_connect function, or options to the mysql_options function. \n    \n    'protocol' can be one of None, 'tcp', 'socket', 'pipe', or 'memory'. A\n    'protocol' of None will use the default protocol, and values otherwise \n    correspond with the potential values of the 'protocol' option in the option \n    file.\n    \n    'ssl' can either be None or a dict where each key corresponds to a \n    parameter of the mysql_ssl_set function, e.g. {'capath': '/etc/ssl/ca', \n    'cipher': 'DHE-RSA-AES256-SHA'}. Unspecified keys are the same as passing\n    NULL to that parameter.\n    \n    If 'use_unicode' is true, oursql will attempt to return unicode wherever \n    feasible. If 'charset' is not None, oursql will set the connection charset \n    to the value provided. 'charset' defaults to using utf-8. If 'autoping' is \n    true, oursql will run the 'ping' method before executing queries or \n    fetching results to attempt to prevent connection timeout errors. \n    'default_cursor', if provided, will be used as the default cursor class \n    when calling the 'cursor' method. If 'raise_on_warnings' is true, oursql\n    will raise a CollatedWarningsError exception if there were any warnings\n    produced by running a query.\n    \n    Connections and their cursors can also be used as context managers.\n    \n        with some_connection.cursor() as cursor:\n            do_something_with(cursor)\n    \n    Can also be written as:\n    \n        with some_connection as cursor:\n            do_something_with(cursor)\n    \n    And both are equivalent to:\n    \n        cursor = some_connection.cursor()\n        try:\n            do_something_with(cursor)\n        except:\n            some_connection.rollback()\n            raise\n        else:\n            some_connection.commit()\n        finally:\n            cursor.close()\n    \n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql_Connection, /*tp_traverse*/
  __pyx_tp_clear_6oursql_Connection, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql_Connection, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql_Connection, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql_Connection, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql__DictWhateverMixin(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6oursql__DictWhateverMixin(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6oursql__DictWhateverMixin[] = {
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_18_DictWhateverMixin_fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__DictWhateverMixin = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__DictWhateverMixin = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__DictWhateverMixin = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__DictWhateverMixin = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__DictWhateverMixin = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._DictWhateverMixin"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__DictWhateverMixin), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__DictWhateverMixin, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__DictWhateverMixin, /*tp_as_number*/
  &__pyx_tp_as_sequence__DictWhateverMixin, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__DictWhateverMixin, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__DictWhateverMixin, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__DictWhateverMixin, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__DictWhateverMixin, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql__AbstractIterWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6oursql__AbstractIterWrapper(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6oursql__AbstractIterWrapper[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__AbstractIterWrapper = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__AbstractIterWrapper = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__AbstractIterWrapper = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__AbstractIterWrapper = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__AbstractIterWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._AbstractIterWrapper"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__AbstractIterWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__AbstractIterWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__AbstractIterWrapper, /*tp_as_number*/
  &__pyx_tp_as_sequence__AbstractIterWrapper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__AbstractIterWrapper, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__AbstractIterWrapper, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6oursql_20_AbstractIterWrapper___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__AbstractIterWrapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__AbstractIterWrapper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql__BinaryWhateverMixin(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6oursql__BinaryWhateverMixin(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6oursql__BinaryWhateverMixin[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6oursql_20_BinaryWhateverMixin___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BinaryWhateverMixin = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__BinaryWhateverMixin = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__BinaryWhateverMixin = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BinaryWhateverMixin = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__BinaryWhateverMixin = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._BinaryWhateverMixin"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__BinaryWhateverMixin), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__BinaryWhateverMixin, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__BinaryWhateverMixin, /*tp_as_number*/
  &__pyx_tp_as_sequence__BinaryWhateverMixin, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__BinaryWhateverMixin, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__BinaryWhateverMixin, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pf_6oursql_20_BinaryWhateverMixin___next__, /*tp_iternext*/
  __pyx_methods_6oursql__BinaryWhateverMixin, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__BinaryWhateverMixin, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql_IterWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql_IterWrapper *p;
  PyObject *o = __pyx_tp_new_6oursql__AbstractIterWrapper(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql_IterWrapper *)o);
  p->iterobj = Py_None; Py_INCREF(Py_None);
  p->nextfunc = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_11IterWrapper___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql_IterWrapper(PyObject *o) {
  struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o;
  Py_XDECREF(p->iterobj);
  Py_XDECREF(p->nextfunc);
  __pyx_tp_dealloc_6oursql__AbstractIterWrapper(o);
}

static int __pyx_tp_traverse_6oursql_IterWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o;
  if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse) {
    e = __pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->iterobj) {
    e = (*v)(p->iterobj, a); if (e) return e;
  }
  if (p->nextfunc) {
    e = (*v)(p->nextfunc, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql_IterWrapper(PyObject *o) {
  struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o;
  PyObject* tmp;
  if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_clear) {
    __pyx_ptype_6oursql__AbstractIterWrapper->tp_clear(o);
  }
  tmp = ((PyObject*)p->iterobj);
  p->iterobj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->nextfunc);
  p->nextfunc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6oursql_IterWrapper[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6oursql_11IterWrapper_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_IterWrapper = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_IterWrapper = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_IterWrapper = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_IterWrapper = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql_IterWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql.IterWrapper"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql_IterWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql_IterWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_IterWrapper, /*tp_as_number*/
  &__pyx_tp_as_sequence_IterWrapper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_IterWrapper, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_IterWrapper, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("IterWrapper(iterobj)\n    \n    IterWrapper is a wrapper class for arbitrary string-yielding iterable \n    objects so that their contents can be streamed over the wire as a bound \n    parameter for a query. The strings are assumed to be text and not arbitrary\n    bytes.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql_IterWrapper, /*tp_traverse*/
  __pyx_tp_clear_6oursql_IterWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pf_6oursql_11IterWrapper_1__next__, /*tp_iternext*/
  __pyx_methods_6oursql_IterWrapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql_IterWrapper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql_FileWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql_FileWrapper *p;
  PyObject *o = __pyx_tp_new_6oursql__AbstractIterWrapper(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql_FileWrapper *)o);
  p->fileobj = Py_None; Py_INCREF(Py_None);
  p->chunksize = Py_None; Py_INCREF(Py_None);
  p->readfunc = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_11FileWrapper___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql_FileWrapper(PyObject *o) {
  struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o;
  Py_XDECREF(p->fileobj);
  Py_XDECREF(p->chunksize);
  Py_XDECREF(p->readfunc);
  __pyx_tp_dealloc_6oursql__AbstractIterWrapper(o);
}

static int __pyx_tp_traverse_6oursql_FileWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o;
  if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse) {
    e = __pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->fileobj) {
    e = (*v)(p->fileobj, a); if (e) return e;
  }
  if (p->chunksize) {
    e = (*v)(p->chunksize, a); if (e) return e;
  }
  if (p->readfunc) {
    e = (*v)(p->readfunc, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql_FileWrapper(PyObject *o) {
  struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o;
  PyObject* tmp;
  if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_clear) {
    __pyx_ptype_6oursql__AbstractIterWrapper->tp_clear(o);
  }
  tmp = ((PyObject*)p->fileobj);
  p->fileobj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->chunksize);
  p->chunksize = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->readfunc);
  p->readfunc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6oursql_FileWrapper[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6oursql_11FileWrapper_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FileWrapper = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FileWrapper = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FileWrapper = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FileWrapper = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql_FileWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql.FileWrapper"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql_FileWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql_FileWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FileWrapper, /*tp_as_number*/
  &__pyx_tp_as_sequence_FileWrapper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FileWrapper, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FileWrapper, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("FileWrapper(fileobj, chunksize=8192, doclose=False)\n    \n    FileWrapper is a wrapper class for file-like objects so that their contents\n    can be streamed over the wire as a bound parameter for a query. Strings \n    read from the wrapped file are assumed to be text and not arbitrary bytes.\n    \n    Strings will be read by calling the 'read' method on the file object with\n    the 'chunksize' parameter until it returns the empty string. If 'doclose'\n    is true, the file will have its 'close' method called once it has been \n    exhausted.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql_FileWrapper, /*tp_traverse*/
  __pyx_tp_clear_6oursql_FileWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pf_6oursql_11FileWrapper_1__next__, /*tp_iternext*/
  __pyx_methods_6oursql_FileWrapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql_FileWrapper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql__Statement __pyx_vtable_6oursql__Statement;

static PyObject *__pyx_tp_new_6oursql__Statement(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__Statement *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__Statement *)o);
  p->__pyx_vtab = __pyx_vtabptr_6oursql__Statement;
  p->__weakref__ = 0;
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  p->warnings = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_10_Statement___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql__Statement(PyObject *o) {
  struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6oursql_10_Statement_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  Py_XDECREF(((PyObject *)p->conn));
  Py_XDECREF(p->warnings);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql__Statement(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o;
  if (p->conn) {
    e = (*v)(((PyObject*)p->conn), a); if (e) return e;
  }
  if (p->warnings) {
    e = (*v)(p->warnings, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql__Statement(PyObject *o) {
  struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->warnings);
  p->warnings = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_10_Statement_string_limit(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_12string_limit___get__(o);
}

static int __pyx_setprop_6oursql_10_Statement_string_limit(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10_Statement_12string_limit_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6oursql_10_Statement_has_result(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_10has_result___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_Statement_description(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_11description___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_Statement_column_names(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_12column_names___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_Statement_rowcount(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_8rowcount___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_Statement_lastrowid(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_9lastrowid___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_Statement_prefetch_rows(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(o);
}

static int __pyx_setprop_6oursql_10_Statement_prefetch_rows(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10_Statement_13prefetch_rows_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6oursql_10_Statement_warnings(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_Statement_8warnings___get__(o);
}

static int __pyx_setprop_6oursql_10_Statement_warnings(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10_Statement_8warnings_1__set__(o, v);
  }
  else {
    return __pyx_pf_6oursql_10_Statement_8warnings_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6oursql__Statement[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10_Statement_2close, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("prepare"), (PyCFunction)__pyx_pf_6oursql_10_Statement_3prepare, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_6oursql_10_Statement_4execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_10_Statement_5fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_10_Statement_6fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("buffer_results"), (PyCFunction)__pyx_pf_6oursql_10_Statement_7buffer_results, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_10_Statement_8nextset, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql__Statement[] = {
  {(char *)"string_limit", __pyx_getprop_6oursql_10_Statement_string_limit, __pyx_setprop_6oursql_10_Statement_string_limit, 0, 0},
  {(char *)"has_result", __pyx_getprop_6oursql_10_Statement_has_result, 0, 0, 0},
  {(char *)"description", __pyx_getprop_6oursql_10_Statement_description, 0, 0, 0},
  {(char *)"column_names", __pyx_getprop_6oursql_10_Statement_column_names, 0, 0, 0},
  {(char *)"rowcount", __pyx_getprop_6oursql_10_Statement_rowcount, 0, 0, 0},
  {(char *)"lastrowid", __pyx_getprop_6oursql_10_Statement_lastrowid, 0, 0, 0},
  {(char *)"prefetch_rows", __pyx_getprop_6oursql_10_Statement_prefetch_rows, __pyx_setprop_6oursql_10_Statement_prefetch_rows, 0, 0},
  {(char *)"warnings", __pyx_getprop_6oursql_10_Statement_warnings, __pyx_setprop_6oursql_10_Statement_warnings, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Statement = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__Statement = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Statement = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Statement = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__Statement = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._Statement"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__Statement), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__Statement, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__Statement, /*tp_as_number*/
  &__pyx_tp_as_sequence__Statement, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__Statement, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__Statement, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("_Statement(...)\n    \n    A class that represents a prepared statement. You should probably avoid\n    touching this, even if it's more stable than _Query/_ResultSet.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql__Statement, /*tp_traverse*/
  __pyx_tp_clear_6oursql__Statement, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6oursql_10_Statement_9__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__Statement, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql__Statement, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__Statement, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql__ResultStringStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__ResultStringStream *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__ResultStringStream *)o);
  p->stmt = ((struct __pyx_obj_6oursql__Statement *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_19_ResultStringStream___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql__ResultStringStream(PyObject *o) {
  struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o;
  Py_XDECREF(((PyObject *)p->stmt));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql__ResultStringStream(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o;
  if (p->stmt) {
    e = (*v)(((PyObject*)p->stmt), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql__ResultStringStream(PyObject *o) {
  struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->stmt);
  p->stmt = ((struct __pyx_obj_6oursql__Statement *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6oursql__ResultStringStream[] = {
  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6oursql_19_ResultStringStream_1read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_19_ResultStringStream_1read)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ResultStringStream = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__ResultStringStream = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ResultStringStream = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ResultStringStream = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__ResultStringStream = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._ResultStringStream"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__ResultStringStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__ResultStringStream, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__ResultStringStream, /*tp_as_number*/
  &__pyx_tp_as_sequence__ResultStringStream, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__ResultStringStream, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__ResultStringStream, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("_ResultStringStream(...)\n    \n    _ResultStringStream represents an incoming stream of binary data from the\n    database. You should never ever instantiate this class yourself.\n    \n    A _ResultStringStream must be used immediately; fetching any additional \n    rows from the database will cause it to go out of sync and become unusable.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql__ResultStringStream, /*tp_traverse*/
  __pyx_tp_clear_6oursql__ResultStringStream, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__ResultStringStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__ResultStringStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql__ResultSet __pyx_vtable_6oursql__ResultSet;

static PyObject *__pyx_tp_new_6oursql__ResultSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__ResultSet *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__ResultSet *)o);
  p->__pyx_vtab = __pyx_vtabptr_6oursql__ResultSet;
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  p->conversion_info = Py_None; Py_INCREF(Py_None);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  p->description = Py_None; Py_INCREF(Py_None);
  p->column_names = Py_None; Py_INCREF(Py_None);
  p->warnings = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_10_ResultSet___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql__ResultSet(PyObject *o) {
  struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6oursql_10_ResultSet_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->conn));
  Py_XDECREF(p->conversion_info);
  Py_XDECREF(p->rowcount);
  Py_XDECREF(p->lastrowid);
  Py_XDECREF(p->description);
  Py_XDECREF(p->column_names);
  Py_XDECREF(p->warnings);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql__ResultSet(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o;
  if (p->conn) {
    e = (*v)(((PyObject*)p->conn), a); if (e) return e;
  }
  if (p->conversion_info) {
    e = (*v)(p->conversion_info, a); if (e) return e;
  }
  if (p->rowcount) {
    e = (*v)(p->rowcount, a); if (e) return e;
  }
  if (p->lastrowid) {
    e = (*v)(p->lastrowid, a); if (e) return e;
  }
  if (p->description) {
    e = (*v)(p->description, a); if (e) return e;
  }
  if (p->column_names) {
    e = (*v)(p->column_names, a); if (e) return e;
  }
  if (p->warnings) {
    e = (*v)(p->warnings, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql__ResultSet(PyObject *o) {
  struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->conversion_info);
  p->conversion_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rowcount);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->lastrowid);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->description);
  p->description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->column_names);
  p->column_names = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->warnings);
  p->warnings = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_has_result(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_10has_result___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_rowcount(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_8rowcount___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_lastrowid(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_description(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_11description___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_column_names(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_12column_names___get__(o);
}

static PyObject *__pyx_getprop_6oursql_10_ResultSet_warnings(PyObject *o, void *x) {
  return __pyx_pf_6oursql_10_ResultSet_8warnings___get__(o);
}

static int __pyx_setprop_6oursql_10_ResultSet_warnings(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_10_ResultSet_8warnings_1__set__(o, v);
  }
  else {
    return __pyx_pf_6oursql_10_ResultSet_8warnings_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6oursql__ResultSet[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_2close, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_3fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_4fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql__ResultSet[] = {
  {(char *)"has_result", __pyx_getprop_6oursql_10_ResultSet_has_result, 0, 0, 0},
  {(char *)"rowcount", __pyx_getprop_6oursql_10_ResultSet_rowcount, 0, 0, 0},
  {(char *)"lastrowid", __pyx_getprop_6oursql_10_ResultSet_lastrowid, 0, 0, 0},
  {(char *)"description", __pyx_getprop_6oursql_10_ResultSet_description, 0, 0, 0},
  {(char *)"column_names", __pyx_getprop_6oursql_10_ResultSet_column_names, 0, 0, 0},
  {(char *)"warnings", __pyx_getprop_6oursql_10_ResultSet_warnings, __pyx_setprop_6oursql_10_ResultSet_warnings, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ResultSet = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__ResultSet = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ResultSet = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ResultSet = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__ResultSet = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._ResultSet"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__ResultSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__ResultSet, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__ResultSet, /*tp_as_number*/
  &__pyx_tp_as_sequence__ResultSet, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__ResultSet, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__ResultSet, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("_ResultSet(...)\n    \n    You should never ever instantiate a _ResultSet yourself unless you really\n    know what you're doing. \n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql__ResultSet, /*tp_traverse*/
  __pyx_tp_clear_6oursql__ResultSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6oursql_10_ResultSet_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__ResultSet, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql__ResultSet, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__ResultSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql__Query __pyx_vtable_6oursql__Query;

static PyObject *__pyx_tp_new_6oursql__Query(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__Query *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__Query *)o);
  p->__pyx_vtab = __pyx_vtabptr_6oursql__Query;
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  p->result = Py_None; Py_INCREF(Py_None);
  p->res_a = Py_None; Py_INCREF(Py_None);
  p->res_kw = Py_None; Py_INCREF(Py_None);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  p->description = Py_None; Py_INCREF(Py_None);
  p->warnings = Py_None; Py_INCREF(Py_None);
  p->has_result = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_6_Query___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql__Query(PyObject *o) {
  struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o;
  Py_XDECREF(((PyObject *)p->conn));
  Py_XDECREF(p->result);
  Py_XDECREF(p->res_a);
  Py_XDECREF(p->res_kw);
  Py_XDECREF(p->rowcount);
  Py_XDECREF(p->lastrowid);
  Py_XDECREF(p->description);
  Py_XDECREF(p->warnings);
  Py_XDECREF(p->has_result);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql__Query(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o;
  if (p->conn) {
    e = (*v)(((PyObject*)p->conn), a); if (e) return e;
  }
  if (p->result) {
    e = (*v)(p->result, a); if (e) return e;
  }
  if (p->res_a) {
    e = (*v)(p->res_a, a); if (e) return e;
  }
  if (p->res_kw) {
    e = (*v)(p->res_kw, a); if (e) return e;
  }
  if (p->rowcount) {
    e = (*v)(p->rowcount, a); if (e) return e;
  }
  if (p->lastrowid) {
    e = (*v)(p->lastrowid, a); if (e) return e;
  }
  if (p->description) {
    e = (*v)(p->description, a); if (e) return e;
  }
  if (p->warnings) {
    e = (*v)(p->warnings, a); if (e) return e;
  }
  if (p->has_result) {
    e = (*v)(p->has_result, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql__Query(PyObject *o) {
  struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result);
  p->result = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->res_a);
  p->res_a = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->res_kw);
  p->res_kw = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rowcount);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->lastrowid);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->description);
  p->description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->warnings);
  p->warnings = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->has_result);
  p->has_result = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_6_Query_rowcount(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6_Query_8rowcount___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6_Query_lastrowid(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6_Query_9lastrowid___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6_Query_description(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6_Query_11description___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6_Query_warnings(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6_Query_8warnings___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6_Query_has_result(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6_Query_10has_result___get__(o);
}

static PyMethodDef __pyx_methods_6oursql__Query[] = {
  {__Pyx_NAMESTR("new_result"), (PyCFunction)__pyx_pf_6oursql_6_Query_1new_result, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_6_Query_2nextset, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_6_Query_3fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_6_Query_5fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql__Query[] = {
  {(char *)"rowcount", __pyx_getprop_6oursql_6_Query_rowcount, 0, 0, 0},
  {(char *)"lastrowid", __pyx_getprop_6oursql_6_Query_lastrowid, 0, 0, 0},
  {(char *)"description", __pyx_getprop_6oursql_6_Query_description, 0, 0, 0},
  {(char *)"warnings", __pyx_getprop_6oursql_6_Query_warnings, 0, 0, 0},
  {(char *)"has_result", __pyx_getprop_6oursql_6_Query_has_result, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Query = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__Query = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Query = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Query = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__Query = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._Query"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__Query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__Query, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__Query, /*tp_as_number*/
  &__pyx_tp_as_sequence__Query, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__Query, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__Query, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("_Query(...)\n    \n    _Queries generate _ResultSets. Eventually they will also support generating\n    multiple _ResultSets when dealing with queries that produce multiple result\n    sets.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql__Query, /*tp_traverse*/
  __pyx_tp_clear_6oursql__Query, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6oursql_6_Query_4__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__Query, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql__Query, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__Query, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql__DictQuery __pyx_vtable_6oursql__DictQuery;

static PyObject *__pyx_tp_new_6oursql__DictQuery(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__DictQuery *p;
  PyObject *o = __pyx_tp_new_6oursql__Query(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__DictQuery *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6oursql__Query*)__pyx_vtabptr_6oursql__DictQuery;
  return o;
}

static PyMethodDef __pyx_methods_6oursql__DictQuery[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__DictQuery = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__DictQuery = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__DictQuery = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__DictQuery = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__DictQuery = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._DictQuery"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__DictQuery), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__Query, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__DictQuery, /*tp_as_number*/
  &__pyx_tp_as_sequence__DictQuery, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__DictQuery, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__DictQuery, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6oursql__Query, /*tp_traverse*/
  __pyx_tp_clear_6oursql__Query, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__DictQuery, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__DictQuery, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql_Cursor __pyx_vtable_6oursql_Cursor;

static PyObject *__pyx_tp_new_6oursql_Cursor(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql_Cursor *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql_Cursor *)o);
  p->__pyx_vtab = __pyx_vtabptr_6oursql_Cursor;
  p->_statements = Py_None; Py_INCREF(Py_None);
  p->_stmt_kwargs = Py_None; Py_INCREF(Py_None);
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  p->description = Py_None; Py_INCREF(Py_None);
  p->messages = Py_None; Py_INCREF(Py_None);
  if (__pyx_pf_6oursql_6Cursor___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6oursql_Cursor(PyObject *o) {
  struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o;
  Py_XDECREF(p->_statements);
  Py_XDECREF(p->_stmt_kwargs);
  Py_XDECREF(((PyObject *)p->conn));
  Py_XDECREF(p->rowcount);
  Py_XDECREF(p->lastrowid);
  Py_XDECREF(p->description);
  Py_XDECREF(p->messages);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql_Cursor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o;
  if (p->_statements) {
    e = (*v)(p->_statements, a); if (e) return e;
  }
  if (p->_stmt_kwargs) {
    e = (*v)(p->_stmt_kwargs, a); if (e) return e;
  }
  if (p->conn) {
    e = (*v)(((PyObject*)p->conn), a); if (e) return e;
  }
  if (p->rowcount) {
    e = (*v)(p->rowcount, a); if (e) return e;
  }
  if (p->lastrowid) {
    e = (*v)(p->lastrowid, a); if (e) return e;
  }
  if (p->description) {
    e = (*v)(p->description, a); if (e) return e;
  }
  if (p->messages) {
    e = (*v)(p->messages, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql_Cursor(PyObject *o) {
  struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_statements);
  p->_statements = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_stmt_kwargs);
  p->_stmt_kwargs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rowcount);
  p->rowcount = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->lastrowid);
  p->lastrowid = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->description);
  p->description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->messages);
  p->messages = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_6Cursor_connection(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_10connection___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor__statements(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_11_statements___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor__stmt_kwargs(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor_rowcount(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_8rowcount___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor_lastrowid(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_9lastrowid___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor_description(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_11description___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor_messages(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_8messages___get__(o);
}

static PyObject *__pyx_getprop_6oursql_6Cursor_arraysize(PyObject *o, void *x) {
  return __pyx_pf_6oursql_6Cursor_9arraysize___get__(o);
}

static int __pyx_setprop_6oursql_6Cursor_arraysize(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6oursql_6Cursor_9arraysize_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6oursql_Cursor[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_6Cursor_1close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_1close)},
  {__Pyx_NAMESTR("_new_statement"), (PyCFunction)__pyx_pf_6oursql_6Cursor_2_new_statement, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_new_query"), (PyCFunction)__pyx_pf_6oursql_6Cursor_3_new_query, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("callproc"), (PyCFunction)__pyx_pf_6oursql_6Cursor_4callproc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_4callproc)},
  {__Pyx_NAMESTR("_do_autoping"), (PyCFunction)__pyx_pf_6oursql_6Cursor_5_do_autoping, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_6oursql_6Cursor_6execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_6execute)},
  {__Pyx_NAMESTR("executemany"), (PyCFunction)__pyx_pf_6oursql_6Cursor_7executemany, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_7executemany)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_6Cursor_8nextset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_8nextset)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_6Cursor_9fetchone, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_9fetchone)},
  {__Pyx_NAMESTR("fetchmany"), (PyCFunction)__pyx_pf_6oursql_6Cursor_10fetchmany, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_10fetchmany)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_6Cursor_11fetchall, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_11fetchall)},
  {__Pyx_NAMESTR("setinputsizes"), (PyCFunction)__pyx_pf_6oursql_6Cursor_13setinputsizes, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_13setinputsizes)},
  {__Pyx_NAMESTR("setoutputsize"), (PyCFunction)__pyx_pf_6oursql_6Cursor_14setoutputsize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_14setoutputsize)},
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6oursql_6Cursor_15__enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6oursql_6Cursor_16__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql_Cursor[] = {
  {(char *)"connection", __pyx_getprop_6oursql_6Cursor_connection, 0, 0, 0},
  {(char *)"_statements", __pyx_getprop_6oursql_6Cursor__statements, 0, 0, 0},
  {(char *)"_stmt_kwargs", __pyx_getprop_6oursql_6Cursor__stmt_kwargs, 0, 0, 0},
  {(char *)"rowcount", __pyx_getprop_6oursql_6Cursor_rowcount, 0, 0, 0},
  {(char *)"lastrowid", __pyx_getprop_6oursql_6Cursor_lastrowid, 0, 0, 0},
  {(char *)"description", __pyx_getprop_6oursql_6Cursor_description, 0, 0, 0},
  {(char *)"messages", __pyx_getprop_6oursql_6Cursor_messages, 0, 0, 0},
  {(char *)"arraysize", __pyx_getprop_6oursql_6Cursor_arraysize, __pyx_setprop_6oursql_6Cursor_arraysize, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Cursor = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Cursor = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Cursor = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Cursor = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql_Cursor = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql.Cursor"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql_Cursor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql_Cursor, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Cursor, /*tp_as_number*/
  &__pyx_tp_as_sequence_Cursor, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Cursor, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Cursor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Cursor(...)\n    \n    Cursors should never be instantiated directly. They may be passed other \n    options via the Connection.cursor method:\n    \n      - try_plain_query=True: If this is true, oursql will first attempt to run\n        queries as prepared statements, and then fall back to the plain query \n        API if MySQL refuses to parameterize the query. Otherwise, oursql will \n        only run plain queries if explicitly asked.\n    \n      - show_table=False: If this is true, the name of the table will be \n        prepended to the name of the column in the 'description' attribute of\n        the cursor.\n    \n      - string_limit=0: Set a limit on the size of the buffer oursql will \n        allocate when fetching strings over the wire. If the string_limit is \n        nonzero, file-like objects will always be returned instead of strings. \n        If the size of the string value is greater than the string_limit, the \n        string will be streamed as necessary instead of fetched all at once.\n        Note: plain queries buffer incoming result differently, and are \n        therefore unaffected by the string_limit.\n    \n    Cursor instances yield tuples to represent rows.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql_Cursor, /*tp_traverse*/
  __pyx_tp_clear_6oursql_Cursor, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6oursql_6Cursor_12__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql_Cursor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql_Cursor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql_Cursor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6oursql_DictCursor __pyx_vtable_6oursql_DictCursor;

static PyObject *__pyx_tp_new_6oursql_DictCursor(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql_DictCursor *p;
  PyObject *o = __pyx_tp_new_6oursql_Cursor(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql_DictCursor *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6oursql_Cursor*)__pyx_vtabptr_6oursql_DictCursor;
  return o;
}

static PyMethodDef __pyx_methods_6oursql_DictCursor[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DictCursor = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DictCursor = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DictCursor = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DictCursor = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql_DictCursor = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql.DictCursor"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql_DictCursor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql_Cursor, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_DictCursor, /*tp_as_number*/
  &__pyx_tp_as_sequence_DictCursor, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DictCursor, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DictCursor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("DictCursor(...)\n    \n    Cursors should never be instantiated directly. They may be passed other \n    options via the Connection.cursor method. See the documentation for the\n    Cursor class for details.\n    \n    DictCursor instances represent rows as dicts mapping column names or \n    aliases to values. These key names are taken from the 'description' \n    attribute of the cursor, and are therefore affected by the 'show_table'\n    cursor option. A ProgrammingError is raised when fetching a row if there \n    were duplicate keys with inequal values.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6oursql_Cursor, /*tp_traverse*/
  __pyx_tp_clear_6oursql_Cursor, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql_DictCursor, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql_DictCursor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6oursql__DBAPITypeObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6oursql__DBAPITypeObject *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6oursql__DBAPITypeObject *)o);
  p->values = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6oursql__DBAPITypeObject(PyObject *o) {
  struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o;
  Py_XDECREF(p->values);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6oursql__DBAPITypeObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o;
  if (p->values) {
    e = (*v)(p->values, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6oursql__DBAPITypeObject(PyObject *o) {
  struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->values);
  p->values = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6oursql_16_DBAPITypeObject_values(PyObject *o, void *x) {
  return __pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(o);
}

static PyMethodDef __pyx_methods_6oursql__DBAPITypeObject[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql__DBAPITypeObject[] = {
  {(char *)"values", __pyx_getprop_6oursql_16_DBAPITypeObject_values, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__DBAPITypeObject = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__DBAPITypeObject = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__DBAPITypeObject = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__DBAPITypeObject = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6oursql__DBAPITypeObject = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("oursql._DBAPITypeObject"), /*tp_name*/
  sizeof(struct __pyx_obj_6oursql__DBAPITypeObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6oursql__DBAPITypeObject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_6oursql_16_DBAPITypeObject_2__repr__, /*tp_repr*/
  &__pyx_tp_as_number__DBAPITypeObject, /*tp_as_number*/
  &__pyx_tp_as_sequence__DBAPITypeObject, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__DBAPITypeObject, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__DBAPITypeObject, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6oursql__DBAPITypeObject, /*tp_traverse*/
  __pyx_tp_clear_6oursql__DBAPITypeObject, /*tp_clear*/
  __pyx_pf_6oursql_16_DBAPITypeObject_1__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__DBAPITypeObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6oursql__DBAPITypeObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6oursql_16_DBAPITypeObject___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6oursql__DBAPITypeObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("oursql"),
    __Pyx_DOCSTR(__pyx_k_63), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_n_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 1},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1},
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
  {&__pyx_n_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 1},
  {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
  {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__BINARY, __pyx_k__BINARY, sizeof(__pyx_k__BINARY), 0, 0, 1, 1},
  {&__pyx_n_s__Binary, __pyx_k__Binary, sizeof(__pyx_k__Binary), 0, 0, 1, 1},
  {&__pyx_n_s__BinaryFileWrapper, __pyx_k__BinaryFileWrapper, sizeof(__pyx_k__BinaryFileWrapper), 0, 0, 1, 1},
  {&__pyx_n_s__BinaryIterWrapper, __pyx_k__BinaryIterWrapper, sizeof(__pyx_k__BinaryIterWrapper), 0, 0, 1, 1},
  {&__pyx_n_s__DATE, __pyx_k__DATE, sizeof(__pyx_k__DATE), 0, 0, 1, 1},
  {&__pyx_n_s__DATETIME, __pyx_k__DATETIME, sizeof(__pyx_k__DATETIME), 0, 0, 1, 1},
  {&__pyx_n_s__DataError, __pyx_k__DataError, sizeof(__pyx_k__DataError), 0, 0, 1, 1},
  {&__pyx_n_s__DatabaseError, __pyx_k__DatabaseError, sizeof(__pyx_k__DatabaseError), 0, 0, 1, 1},
  {&__pyx_n_s__Date, __pyx_k__Date, sizeof(__pyx_k__Date), 0, 0, 1, 1},
  {&__pyx_n_s__DateFromTicks, __pyx_k__DateFromTicks, sizeof(__pyx_k__DateFromTicks), 0, 0, 1, 1},
  {&__pyx_n_s__Decimal, __pyx_k__Decimal, sizeof(__pyx_k__Decimal), 0, 0, 1, 1},
  {&__pyx_n_s__Error, __pyx_k__Error, sizeof(__pyx_k__Error), 0, 0, 1, 1},
  {&__pyx_n_s__IntegrityError, __pyx_k__IntegrityError, sizeof(__pyx_k__IntegrityError), 0, 0, 1, 1},
  {&__pyx_n_s__InterfaceError, __pyx_k__InterfaceError, sizeof(__pyx_k__InterfaceError), 0, 0, 1, 1},
  {&__pyx_n_s__InternalError, __pyx_k__InternalError, sizeof(__pyx_k__InternalError), 0, 0, 1, 1},
  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s__NUMBER, __pyx_k__NUMBER, sizeof(__pyx_k__NUMBER), 0, 0, 1, 1},
  {&__pyx_n_s__NotSupportedError, __pyx_k__NotSupportedError, sizeof(__pyx_k__NotSupportedError), 0, 0, 1, 1},
  {&__pyx_n_s__Note, __pyx_k__Note, sizeof(__pyx_k__Note), 0, 0, 1, 1},
  {&__pyx_n_s__OperationalError, __pyx_k__OperationalError, sizeof(__pyx_k__OperationalError), 0, 0, 1, 1},
  {&__pyx_n_s__PermissionsError, __pyx_k__PermissionsError, sizeof(__pyx_k__PermissionsError), 0, 0, 1, 1},
  {&__pyx_n_s__ProgrammingError, __pyx_k__ProgrammingError, sizeof(__pyx_k__ProgrammingError), 0, 0, 1, 1},
  {&__pyx_n_s__ROWID, __pyx_k__ROWID, sizeof(__pyx_k__ROWID), 0, 0, 1, 1},
  {&__pyx_n_s__STRING, __pyx_k__STRING, sizeof(__pyx_k__STRING), 0, 0, 1, 1},
  {&__pyx_n_s__StandardError, __pyx_k__StandardError, sizeof(__pyx_k__StandardError), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__StringIO, __pyx_k__StringIO, sizeof(__pyx_k__StringIO), 0, 0, 1, 1},
  {&__pyx_n_s__TIME, __pyx_k__TIME, sizeof(__pyx_k__TIME), 0, 0, 1, 1},
  {&__pyx_n_s__TIMESTAMP, __pyx_k__TIMESTAMP, sizeof(__pyx_k__TIMESTAMP), 0, 0, 1, 1},
  {&__pyx_n_s__Time, __pyx_k__Time, sizeof(__pyx_k__Time), 0, 0, 1, 1},
  {&__pyx_n_s__TimeFromTicks, __pyx_k__TimeFromTicks, sizeof(__pyx_k__TimeFromTicks), 0, 0, 1, 1},
  {&__pyx_n_s__Timestamp, __pyx_k__Timestamp, sizeof(__pyx_k__Timestamp), 0, 0, 1, 1},
  {&__pyx_n_s__TimestampFromTicks, __pyx_k__TimestampFromTicks, sizeof(__pyx_k__TimestampFromTicks), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__UnknownError, __pyx_k__UnknownError, sizeof(__pyx_k__UnknownError), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__Warning, __pyx_k__Warning, sizeof(__pyx_k__Warning), 0, 0, 1, 1},
  {&__pyx_n_s___DictResultSet, __pyx_k___DictResultSet, sizeof(__pyx_k___DictResultSet), 0, 0, 1, 1},
  {&__pyx_n_s___DictStatement, __pyx_k___DictStatement, sizeof(__pyx_k___DictStatement), 0, 0, 1, 1},
  {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____doc__, __pyx_k____doc__, sizeof(__pyx_k____doc__), 0, 0, 1, 1},
  {&__pyx_n_s____enter__, __pyx_k____enter__, sizeof(__pyx_k____enter__), 0, 0, 1, 1},
  {&__pyx_n_s____exit__, __pyx_k____exit__, sizeof(__pyx_k____exit__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____module__, __pyx_k____module__, sizeof(__pyx_k____module__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
  {&__pyx_n_s___bitval_from_string, __pyx_k___bitval_from_string, sizeof(__pyx_k___bitval_from_string), 0, 0, 1, 1},
  {&__pyx_n_s___conversions, __pyx_k___conversions, sizeof(__pyx_k___conversions), 0, 0, 1, 1},
  {&__pyx_n_s___date_from_string, __pyx_k___date_from_string, sizeof(__pyx_k___date_from_string), 0, 0, 1, 1},
  {&__pyx_n_s___do_autoping, __pyx_k___do_autoping, sizeof(__pyx_k___do_autoping), 0, 0, 1, 1},
  {&__pyx_n_s___do_warnings_query, __pyx_k___do_warnings_query, sizeof(__pyx_k___do_warnings_query), 0, 0, 1, 1},
  {&__pyx_n_s___escape_string, __pyx_k___escape_string, sizeof(__pyx_k___escape_string), 0, 0, 1, 1},
  {&__pyx_n_s___exception_enum_map, __pyx_k___exception_enum_map, sizeof(__pyx_k___exception_enum_map), 0, 0, 1, 1},
  {&__pyx_n_s___new_query, __pyx_k___new_query, sizeof(__pyx_k___new_query), 0, 0, 1, 1},
  {&__pyx_n_s___new_statement, __pyx_k___new_statement, sizeof(__pyx_k___new_statement), 0, 0, 1, 1},
  {&__pyx_n_s___protocol_enum_map, __pyx_k___protocol_enum_map, sizeof(__pyx_k___protocol_enum_map), 0, 0, 1, 1},
  {&__pyx_n_s___query_class, __pyx_k___query_class, sizeof(__pyx_k___query_class), 0, 0, 1, 1},
  {&__pyx_n_s___result_class, __pyx_k___result_class, sizeof(__pyx_k___result_class), 0, 0, 1, 1},
  {&__pyx_n_s___setup_ssl_options, __pyx_k___setup_ssl_options, sizeof(__pyx_k___setup_ssl_options), 0, 0, 1, 1},
  {&__pyx_n_s___statement_class, __pyx_k___statement_class, sizeof(__pyx_k___statement_class), 0, 0, 1, 1},
  {&__pyx_n_s___time_from_string, __pyx_k___time_from_string, sizeof(__pyx_k___time_from_string), 0, 0, 1, 1},
  {&__pyx_n_s__apilevel, __pyx_k__apilevel, sizeof(__pyx_k__apilevel), 0, 0, 1, 1},
  {&__pyx_n_s__autoping, __pyx_k__autoping, sizeof(__pyx_k__autoping), 0, 0, 1, 1},
  {&__pyx_n_s__autoreconnect, __pyx_k__autoreconnect, sizeof(__pyx_k__autoreconnect), 0, 0, 1, 1},
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
  {&__pyx_n_s__buffer_results, __pyx_k__buffer_results, sizeof(__pyx_k__buffer_results), 0, 0, 1, 1},
  {&__pyx_n_s__cStringIO, __pyx_k__cStringIO, sizeof(__pyx_k__cStringIO), 0, 0, 1, 1},
  {&__pyx_n_s__ca, __pyx_k__ca, sizeof(__pyx_k__ca), 0, 0, 1, 1},
  {&__pyx_n_s__capath, __pyx_k__capath, sizeof(__pyx_k__capath), 0, 0, 1, 1},
  {&__pyx_n_s__cert, __pyx_k__cert, sizeof(__pyx_k__cert), 0, 0, 1, 1},
  {&__pyx_n_s__charset, __pyx_k__charset, sizeof(__pyx_k__charset), 0, 0, 1, 1},
  {&__pyx_n_s__charset_dir, __pyx_k__charset_dir, sizeof(__pyx_k__charset_dir), 0, 0, 1, 1},
  {&__pyx_n_s__chunksize, __pyx_k__chunksize, sizeof(__pyx_k__chunksize), 0, 0, 1, 1},
  {&__pyx_n_s__cipher, __pyx_k__cipher, sizeof(__pyx_k__cipher), 0, 0, 1, 1},
  {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1},
  {&__pyx_n_s__client_info, __pyx_k__client_info, sizeof(__pyx_k__client_info), 0, 0, 1, 1},
  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
  {&__pyx_n_s__codecs, __pyx_k__codecs, sizeof(__pyx_k__codecs), 0, 0, 1, 1},
  {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
  {&__pyx_n_s__column, __pyx_k__column, sizeof(__pyx_k__column), 0, 0, 1, 1},
  {&__pyx_n_s__column_names, __pyx_k__column_names, sizeof(__pyx_k__column_names), 0, 0, 1, 1},
  {&__pyx_n_s__commit, __pyx_k__commit, sizeof(__pyx_k__commit), 0, 0, 1, 1},
  {&__pyx_n_s__compress, __pyx_k__compress, sizeof(__pyx_k__compress), 0, 0, 1, 1},
  {&__pyx_n_s__conn, __pyx_k__conn, sizeof(__pyx_k__conn), 0, 0, 1, 1},
  {&__pyx_n_s__connect, __pyx_k__connect, sizeof(__pyx_k__connect), 0, 0, 1, 1},
  {&__pyx_n_s__connect_timeout, __pyx_k__connect_timeout, sizeof(__pyx_k__connect_timeout), 0, 0, 1, 1},
  {&__pyx_n_s__connection, __pyx_k__connection, sizeof(__pyx_k__connection), 0, 0, 1, 1},
  {&__pyx_n_s__conversions_dict, __pyx_k__conversions_dict, sizeof(__pyx_k__conversions_dict), 0, 0, 1, 1},
  {&__pyx_n_s__cursor, __pyx_k__cursor, sizeof(__pyx_k__cursor), 0, 0, 1, 1},
  {&__pyx_n_s__cursor_class, __pyx_k__cursor_class, sizeof(__pyx_k__cursor_class), 0, 0, 1, 1},
  {&__pyx_n_s__date, __pyx_k__date, sizeof(__pyx_k__date), 0, 0, 1, 1},
  {&__pyx_n_s__datetime, __pyx_k__datetime, sizeof(__pyx_k__datetime), 0, 0, 1, 1},
  {&__pyx_n_s__day, __pyx_k__day, sizeof(__pyx_k__day), 0, 0, 1, 1},
  {&__pyx_n_s__db, __pyx_k__db, sizeof(__pyx_k__db), 0, 0, 1, 1},
  {&__pyx_n_s__decimal, __pyx_k__decimal, sizeof(__pyx_k__decimal), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__default_cursor, __pyx_k__default_cursor, sizeof(__pyx_k__default_cursor), 0, 0, 1, 1},
  {&__pyx_n_s__deque, __pyx_k__deque, sizeof(__pyx_k__deque), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__doclose, __pyx_k__doclose, sizeof(__pyx_k__doclose), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__errno, __pyx_k__errno, sizeof(__pyx_k__errno), 0, 0, 1, 1},
  {&__pyx_n_s__errnos, __pyx_k__errnos, sizeof(__pyx_k__errnos), 0, 0, 1, 1},
  {&__pyx_n_s__exc, __pyx_k__exc, sizeof(__pyx_k__exc), 0, 0, 1, 1},
  {&__pyx_n_s__exceptions, __pyx_k__exceptions, sizeof(__pyx_k__exceptions), 0, 0, 1, 1},
  {&__pyx_n_s__execute, __pyx_k__execute, sizeof(__pyx_k__execute), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__extra, __pyx_k__extra, sizeof(__pyx_k__extra), 0, 0, 1, 1},
  {&__pyx_n_s__fetchall, __pyx_k__fetchall, sizeof(__pyx_k__fetchall), 0, 0, 1, 1},
  {&__pyx_n_s__fetchone, __pyx_k__fetchone, sizeof(__pyx_k__fetchone), 0, 0, 1, 1},
  {&__pyx_n_s__fileobj, __pyx_k__fileobj, sizeof(__pyx_k__fileobj), 0, 0, 1, 1},
  {&__pyx_n_s__found_rows, __pyx_k__found_rows, sizeof(__pyx_k__found_rows), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__getreader, __pyx_k__getreader, sizeof(__pyx_k__getreader), 0, 0, 1, 1},
  {&__pyx_n_s__has_result, __pyx_k__has_result, sizeof(__pyx_k__has_result), 0, 0, 1, 1},
  {&__pyx_n_s__host, __pyx_k__host, sizeof(__pyx_k__host), 0, 0, 1, 1},
  {&__pyx_n_s__hour, __pyx_k__hour, sizeof(__pyx_k__hour), 0, 0, 1, 1},
  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__init_command, __pyx_k__init_command, sizeof(__pyx_k__init_command), 0, 0, 1, 1},
  {&__pyx_n_s__iterobj, __pyx_k__iterobj, sizeof(__pyx_k__iterobj), 0, 0, 1, 1},
  {&__pyx_n_s__itertools, __pyx_k__itertools, sizeof(__pyx_k__itertools), 0, 0, 1, 1},
  {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
  {&__pyx_n_s__lastrowid, __pyx_k__lastrowid, sizeof(__pyx_k__lastrowid), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__local_infile, __pyx_k__local_infile, sizeof(__pyx_k__local_infile), 0, 0, 1, 1},
  {&__pyx_n_s__localtime, __pyx_k__localtime, sizeof(__pyx_k__localtime), 0, 0, 1, 1},
  {&__pyx_n_s__memory, __pyx_k__memory, sizeof(__pyx_k__memory), 0, 0, 1, 1},
  {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
  {&__pyx_n_s__microsecond, __pyx_k__microsecond, sizeof(__pyx_k__microsecond), 0, 0, 1, 1},
  {&__pyx_n_s__minute, __pyx_k__minute, sizeof(__pyx_k__minute), 0, 0, 1, 1},
  {&__pyx_n_s__month, __pyx_k__month, sizeof(__pyx_k__month), 0, 0, 1, 1},
  {&__pyx_n_s__multi_results, __pyx_k__multi_results, sizeof(__pyx_k__multi_results), 0, 0, 1, 1},
  {&__pyx_n_s__multi_statements, __pyx_k__multi_statements, sizeof(__pyx_k__multi_statements), 0, 0, 1, 1},
  {&__pyx_n_s__new_result, __pyx_k__new_result, sizeof(__pyx_k__new_result), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
  {&__pyx_n_s__nextset, __pyx_k__nextset, sizeof(__pyx_k__nextset), 0, 0, 1, 1},
  {&__pyx_n_s__oursql, __pyx_k__oursql, sizeof(__pyx_k__oursql), 0, 0, 1, 1},
  {&__pyx_n_s__parambatch, __pyx_k__parambatch, sizeof(__pyx_k__parambatch), 0, 0, 1, 1},
  {&__pyx_n_s__params, __pyx_k__params, sizeof(__pyx_k__params), 0, 0, 1, 1},
  {&__pyx_n_s__paramstyle, __pyx_k__paramstyle, sizeof(__pyx_k__paramstyle), 0, 0, 1, 1},
  {&__pyx_n_s__passwd, __pyx_k__passwd, sizeof(__pyx_k__passwd), 0, 0, 1, 1},
  {&__pyx_n_s__ping, __pyx_k__ping, sizeof(__pyx_k__ping), 0, 0, 1, 1},
  {&__pyx_n_s__pipe, __pyx_k__pipe, sizeof(__pyx_k__pipe), 0, 0, 1, 1},
  {&__pyx_n_s__plain_query, __pyx_k__plain_query, sizeof(__pyx_k__plain_query), 0, 0, 1, 1},
  {&__pyx_n_s__popleft, __pyx_k__popleft, sizeof(__pyx_k__popleft), 0, 0, 1, 1},
  {&__pyx_n_s__port, __pyx_k__port, sizeof(__pyx_k__port), 0, 0, 1, 1},
  {&__pyx_n_s__prefetch_rows, __pyx_k__prefetch_rows, sizeof(__pyx_k__prefetch_rows), 0, 0, 1, 1},
  {&__pyx_n_s__prepare, __pyx_k__prepare, sizeof(__pyx_k__prepare), 0, 0, 1, 1},
  {&__pyx_n_s__procname, __pyx_k__procname, sizeof(__pyx_k__procname), 0, 0, 1, 1},
  {&__pyx_n_s__protocol, __pyx_k__protocol, sizeof(__pyx_k__protocol), 0, 0, 1, 1},
  {&__pyx_n_s__qmark, __pyx_k__qmark, sizeof(__pyx_k__qmark), 0, 0, 1, 1},
  {&__pyx_n_s__query, __pyx_k__query, sizeof(__pyx_k__query), 0, 0, 1, 1},
  {&__pyx_n_s__raise_on_warnings, __pyx_k__raise_on_warnings, sizeof(__pyx_k__raise_on_warnings), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__read_default_file, __pyx_k__read_default_file, sizeof(__pyx_k__read_default_file), 0, 0, 1, 1},
  {&__pyx_n_s__read_default_group, __pyx_k__read_default_group, sizeof(__pyx_k__read_default_group), 0, 0, 1, 1},
  {&__pyx_n_s__read_timeout, __pyx_k__read_timeout, sizeof(__pyx_k__read_timeout), 0, 0, 1, 1},
  {&__pyx_n_s__report_truncation, __pyx_k__report_truncation, sizeof(__pyx_k__report_truncation), 0, 0, 1, 1},
  {&__pyx_n_s__require_secure_auth, __pyx_k__require_secure_auth, sizeof(__pyx_k__require_secure_auth), 0, 0, 1, 1},
  {&__pyx_n_s__rollback, __pyx_k__rollback, sizeof(__pyx_k__rollback), 0, 0, 1, 1},
  {&__pyx_n_s__rowcount, __pyx_k__rowcount, sizeof(__pyx_k__rowcount), 0, 0, 1, 1},
  {&__pyx_n_s__second, __pyx_k__second, sizeof(__pyx_k__second), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__show_table, __pyx_k__show_table, sizeof(__pyx_k__show_table), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__socket, __pyx_k__socket, sizeof(__pyx_k__socket), 0, 0, 1, 1},
  {&__pyx_n_s__ssl, __pyx_k__ssl, sizeof(__pyx_k__ssl), 0, 0, 1, 1},
  {&__pyx_n_s__stmt, __pyx_k__stmt, sizeof(__pyx_k__stmt), 0, 0, 1, 1},
  {&__pyx_n_s__string_limit, __pyx_k__string_limit, sizeof(__pyx_k__string_limit), 0, 0, 1, 1},
  {&__pyx_n_s__strptime, __pyx_k__strptime, sizeof(__pyx_k__strptime), 0, 0, 1, 1},
  {&__pyx_n_s__super, __pyx_k__super, sizeof(__pyx_k__super), 0, 0, 1, 1},
  {&__pyx_n_s__tb, __pyx_k__tb, sizeof(__pyx_k__tb), 0, 0, 1, 1},
  {&__pyx_n_s__tcp, __pyx_k__tcp, sizeof(__pyx_k__tcp), 0, 0, 1, 1},
  {&__pyx_n_s__threadsafety, __pyx_k__threadsafety, sizeof(__pyx_k__threadsafety), 0, 0, 1, 1},
  {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1},
  {&__pyx_n_s__try_plain_query, __pyx_k__try_plain_query, sizeof(__pyx_k__try_plain_query), 0, 0, 1, 1},
  {&__pyx_n_s__unix_socket, __pyx_k__unix_socket, sizeof(__pyx_k__unix_socket), 0, 0, 1, 1},
  {&__pyx_n_s__use_unicode, __pyx_k__use_unicode, sizeof(__pyx_k__use_unicode), 0, 0, 1, 1},
  {&__pyx_n_s__user, __pyx_k__user, sizeof(__pyx_k__user), 0, 0, 1, 1},
  {&__pyx_n_s__utf8, __pyx_k__utf8, sizeof(__pyx_k__utf8), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 1, 1},
  {&__pyx_n_s__warning_count, __pyx_k__warning_count, sizeof(__pyx_k__warning_count), 0, 0, 1, 1},
  {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1},
  {&__pyx_n_s__write_timeout, __pyx_k__write_timeout, sizeof(__pyx_k__write_timeout), 0, 0, 1, 1},
  {&__pyx_n_s__year, __pyx_k__year, sizeof(__pyx_k__year), 0, 0, 1, 1},
  {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_buffer = __Pyx_GetName(__pyx_b, __pyx_n_s__buffer); if (!__pyx_builtin_buffer) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StandardError = __Pyx_GetName(__pyx_b, __pyx_n_s__StandardError); if (!__pyx_builtin_StandardError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":91
 *         ret.append((kind, (message, err)))
 *     if should_raise and conn.raise_on_warnings:
 *         raise CollatedWarningsError('query caused warnings', extra=ret)             # <<<<<<<<<<<<<<
 *     return ret
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":103
 *         self.conn = mysql_init(NULL)
 *         if not self.conn:
 *             raise MemoryError('alloc of conn object failed')             # <<<<<<<<<<<<<<
 *         if protocol not in _protocol_enum_map:
 *             raise ProgrammingError('unknown protocol %r' % (protocol,))
 */
  __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
  PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":187
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn:
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 * 
 *     def ping(self):
 */
  __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":106
 *         self.stmt = mysql_stmt_init(self.conn.conn)
 *         if not self.stmt:
 *             raise MemoryError('alloc of statement failed')             # <<<<<<<<<<<<<<
 *         self.string_limit = string_limit
 *         self.show_table = show_table
 */
  __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_19));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":133
 *             if self.stmt:
 *                 self.close()
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if not self.stmt:
 *             raise ProgrammingError('statement closed')
 */
  __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_20));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":135
 *             raise ProgrammingError('connection closed')
 *         if not self.stmt:
 *             raise ProgrammingError('statement closed')             # <<<<<<<<<<<<<<
 * 
 *     property string_limit:
 */
  __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":143
 *         def __set__(self, unsigned long value):
 *             if value < 0:
 *                 raise ValueError('string limit must be >= 0')             # <<<<<<<<<<<<<<
 *             self.string_limit = value
 * 
 */
  __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":151
 *         self._check_closed()
 *         if self.data_waiting:
 *             raise ProgrammingError('binding this query would cause rows to '             # <<<<<<<<<<<<<<
 *                 'become unfetchable')
 *         if PyUnicode_Check(statement):
 */
  __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":186
 *             bind = <MYSQL_BIND *>PyMem_Malloc(sizeof(MYSQL_BIND) * fields)
 *             if not bind:
 *                 raise MemoryError('alloc of result bind structure failed')             # <<<<<<<<<<<<<<
 *             memset(bind, 0, sizeof(MYSQL_BIND) * fields)
 *             result_data = <column_output *>PyMem_Malloc(
 */
  __pyx_k_tuple_28 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_28));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
  PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, ((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":191
 *                 sizeof(column_output) * fields)
 *             if not result_data:
 *                 raise MemoryError('alloc of result buffers failed')             # <<<<<<<<<<<<<<
 *             memset(result_data, 0, sizeof(column_output) * fields)
 *         except:
 */
  __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_29));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":278
 *         self._check_closed()
 *         if self.data_waiting:
 *             raise ProgrammingError('executing this query would cause rows to '             # <<<<<<<<<<<<<<
 *                 'become unfetchable')
 *         n_params = PyTuple_GET_SIZE(parameters)
 */
  __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_32));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
  PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, ((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":293
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)
 *                 if not buf:
 *                     raise MemoryError('alloc of bind parameters failed')             # <<<<<<<<<<<<<<
 *                 bind = <MYSQL_BIND *>buf
 *                 memset(bind, 0, sizeof(MYSQL_BIND) * n_params)
 */
  __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":599
 *         def __set__(self, unsigned long value):
 *             if value < 1:
 *                 raise ValueError('must prefetch at least 1 row')             # <<<<<<<<<<<<<<
 *             self._prefetch_rows = value
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 */
  __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":647
 *         self.stmt._check_closed()
 *         if self.stmt.fetched != self.stmt_fetched:
 *             raise ProgrammingError('row no longer available from database')             # <<<<<<<<<<<<<<
 *         left = self.length - self.offset
 *         if size == -1 or size > left:
 */
  __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_s_42));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":652
 *             size = left
 *         elif size < 0:
 *             raise ValueError("can't read negative bytes")             # <<<<<<<<<<<<<<
 *         ret = PyString_FromStringAndSize(NULL, size)
 *         self.bind.buffer_length = size
 */
  __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_44));
  PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_44));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_44));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":71
 *             if self.res:
 *                 self.close()
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if not self.res:
 *             raise ProgrammingError('query closed')
 */
  __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":73
 *             raise ProgrammingError('connection closed')
 *         if not self.res:
 *             raise ProgrammingError('query closed')             # <<<<<<<<<<<<<<
 * 
 *     property has_result:
 */
  __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_49));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":51
 *     cdef int _check_closed(self) except -1:
 *         if not self.conn.conn:
 *             raise ProgrammingError('connection closed')             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ProgrammingError('cursor closed')
 */
  __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":53
 *             raise ProgrammingError('connection closed')
 *         if self.closed:
 *             raise ProgrammingError('cursor closed')             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_k_tuple_52 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_52));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
  PyTuple_SET_ITEM(__pyx_k_tuple_52, 0, ((PyObject *)__pyx_kp_s_51));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":81
 *         # This is slightly irritating, but not too horribly bad. The horribly
 *         # bad part is getting the results from a procedure.
 *         raise NotSupportedError('use the CALL statement with the execute '             # <<<<<<<<<<<<<<
 *             'method to call stored procedures')
 * 
 */
  __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_54));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_53));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_53));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_53));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":105
 *                 # worth parameterizing supports the prepared statement API
 *                 # anyway, so this shouldn't matter too much.
 *                 raise ProgrammingError("can't call execute with both "             # <<<<<<<<<<<<<<
 *                     "parameters and a plain query")
 *             stmt = self._new_query(query)
 */
  __pyx_k_tuple_57 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_57));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_56));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, ((PyObject *)__pyx_kp_s_56));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_56));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":161
 *         self._check_closed()
 *         if not self._statements:
 *             raise ProgrammingError('no results available')             # <<<<<<<<<<<<<<
 * 
 *     def nextset(self):
 */
  __pyx_k_tuple_59 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_59));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_58));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, ((PyObject *)__pyx_kp_s_58));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_58));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "oursql.pyx":89
 * # time, so it's threadsafe to call this.
 * if mysql_library_init(0, NULL, NULL):
 *     raise InterfaceError('could not initialize mysql')             # <<<<<<<<<<<<<<
 * 
 * paramstyle = 'qmark'
 */
  __pyx_k_tuple_70 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_70));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_69));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 0, ((PyObject *)__pyx_kp_s_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  #if PY_VERSION_HEX < 0x02040000
  if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initoursql(void); /*proto*/
PyMODINIT_FUNC initoursql(void)
#else
PyMODINIT_FUNC PyInit_oursql(void); /*proto*/
PyMODINIT_FUNC PyInit_oursql(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_oursql(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("oursql"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_63), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_oursql) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_6oursql_Connection = &__pyx_vtable_6oursql_Connection;
  __pyx_vtable_6oursql_Connection._raise_error = (int (*)(struct __pyx_obj_6oursql_Connection *))__pyx_f_6oursql_10Connection__raise_error;
  __pyx_vtable_6oursql_Connection._check_closed = (int (*)(struct __pyx_obj_6oursql_Connection *))__pyx_f_6oursql_10Connection__check_closed;
  if (PyType_Ready(&__pyx_type_6oursql_Connection) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql_Connection.tp_dict, __pyx_vtabptr_6oursql_Connection) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Connection", (PyObject *)&__pyx_type_6oursql_Connection) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_type_6oursql_Connection.tp_weaklistoffset == 0) __pyx_type_6oursql_Connection.tp_weaklistoffset = offsetof(struct __pyx_obj_6oursql_Connection, __weakref__);
  __pyx_ptype_6oursql_Connection = &__pyx_type_6oursql_Connection;
  if (PyType_Ready(&__pyx_type_6oursql__DictWhateverMixin) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_DictWhateverMixin", (PyObject *)&__pyx_type_6oursql__DictWhateverMixin) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__DictWhateverMixin = &__pyx_type_6oursql__DictWhateverMixin;
  if (PyType_Ready(&__pyx_type_6oursql__AbstractIterWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_AbstractIterWrapper", (PyObject *)&__pyx_type_6oursql__AbstractIterWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__AbstractIterWrapper = &__pyx_type_6oursql__AbstractIterWrapper;
  if (PyType_Ready(&__pyx_type_6oursql__BinaryWhateverMixin) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_BinaryWhateverMixin", (PyObject *)&__pyx_type_6oursql__BinaryWhateverMixin) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__BinaryWhateverMixin = &__pyx_type_6oursql__BinaryWhateverMixin;
  __pyx_type_6oursql_IterWrapper.tp_base = __pyx_ptype_6oursql__AbstractIterWrapper;
  if (PyType_Ready(&__pyx_type_6oursql_IterWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IterWrapper", (PyObject *)&__pyx_type_6oursql_IterWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql_IterWrapper = &__pyx_type_6oursql_IterWrapper;
  __pyx_type_6oursql_FileWrapper.tp_base = __pyx_ptype_6oursql__AbstractIterWrapper;
  if (PyType_Ready(&__pyx_type_6oursql_FileWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FileWrapper", (PyObject *)&__pyx_type_6oursql_FileWrapper) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql_FileWrapper = &__pyx_type_6oursql_FileWrapper;
  __pyx_vtabptr_6oursql__Statement = &__pyx_vtable_6oursql__Statement;
  __pyx_vtable_6oursql__Statement._raise_error = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__raise_error;
  __pyx_vtable_6oursql__Statement._check_closed = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__check_closed;
  __pyx_vtable_6oursql__Statement._alloc_buffer = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__alloc_buffer;
  __pyx_vtable_6oursql__Statement._bind_buffer = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__bind_buffer;
  if (PyType_Ready(&__pyx_type_6oursql__Statement) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql__Statement.tp_dict, __pyx_vtabptr_6oursql__Statement) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_Statement", (PyObject *)&__pyx_type_6oursql__Statement) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_type_6oursql__Statement.tp_weaklistoffset == 0) __pyx_type_6oursql__Statement.tp_weaklistoffset = offsetof(struct __pyx_obj_6oursql__Statement, __weakref__);
  __pyx_ptype_6oursql__Statement = &__pyx_type_6oursql__Statement;
  if (PyType_Ready(&__pyx_type_6oursql__ResultStringStream) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_ResultStringStream", (PyObject *)&__pyx_type_6oursql__ResultStringStream) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__ResultStringStream = &__pyx_type_6oursql__ResultStringStream;
  __pyx_vtabptr_6oursql__ResultSet = &__pyx_vtable_6oursql__ResultSet;
  __pyx_vtable_6oursql__ResultSet._raise_error = (int (*)(struct __pyx_obj_6oursql__ResultSet *))__pyx_f_6oursql_10_ResultSet__raise_error;
  __pyx_vtable_6oursql__ResultSet._check_closed = (int (*)(struct __pyx_obj_6oursql__ResultSet *))__pyx_f_6oursql_10_ResultSet__check_closed;
  if (PyType_Ready(&__pyx_type_6oursql__ResultSet) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql__ResultSet.tp_dict, __pyx_vtabptr_6oursql__ResultSet) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_ResultSet", (PyObject *)&__pyx_type_6oursql__ResultSet) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__ResultSet = &__pyx_type_6oursql__ResultSet;
  __pyx_vtabptr_6oursql__Query = &__pyx_vtable_6oursql__Query;
  __pyx_vtable_6oursql__Query._raise_error = (int (*)(struct __pyx_obj_6oursql__Query *))__pyx_f_6oursql_6_Query__raise_error;
  if (PyType_Ready(&__pyx_type_6oursql__Query) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql__Query.tp_dict, __pyx_vtabptr_6oursql__Query) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_Query", (PyObject *)&__pyx_type_6oursql__Query) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__Query = &__pyx_type_6oursql__Query;
  __pyx_vtabptr_6oursql__DictQuery = &__pyx_vtable_6oursql__DictQuery;
  __pyx_vtable_6oursql__DictQuery.__pyx_base = *__pyx_vtabptr_6oursql__Query;
  __pyx_type_6oursql__DictQuery.tp_base = __pyx_ptype_6oursql__Query;
  if (PyType_Ready(&__pyx_type_6oursql__DictQuery) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql__DictQuery.tp_dict, __pyx_vtabptr_6oursql__DictQuery) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_DictQuery", (PyObject *)&__pyx_type_6oursql__DictQuery) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__DictQuery = &__pyx_type_6oursql__DictQuery;
  __pyx_vtabptr_6oursql_Cursor = &__pyx_vtable_6oursql_Cursor;
  __pyx_vtable_6oursql_Cursor._check_closed = (int (*)(struct __pyx_obj_6oursql_Cursor *))__pyx_f_6oursql_6Cursor__check_closed;
  __pyx_vtable_6oursql_Cursor._update_fields = (int (*)(struct __pyx_obj_6oursql_Cursor *, PyObject *, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args))__pyx_f_6oursql_6Cursor__update_fields;
  __pyx_vtable_6oursql_Cursor._check_statements = (int (*)(struct __pyx_obj_6oursql_Cursor *))__pyx_f_6oursql_6Cursor__check_statements;
  if (PyType_Ready(&__pyx_type_6oursql_Cursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql_Cursor.tp_dict, __pyx_vtabptr_6oursql_Cursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Cursor", (PyObject *)&__pyx_type_6oursql_Cursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql_Cursor = &__pyx_type_6oursql_Cursor;
  __pyx_vtabptr_6oursql_DictCursor = &__pyx_vtable_6oursql_DictCursor;
  __pyx_vtable_6oursql_DictCursor.__pyx_base = *__pyx_vtabptr_6oursql_Cursor;
  __pyx_type_6oursql_DictCursor.tp_base = __pyx_ptype_6oursql_Cursor;
  if (PyType_Ready(&__pyx_type_6oursql_DictCursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6oursql_DictCursor.tp_dict, __pyx_vtabptr_6oursql_DictCursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DictCursor", (PyObject *)&__pyx_type_6oursql_DictCursor) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql_DictCursor = &__pyx_type_6oursql_DictCursor;
  if (PyType_Ready(&__pyx_type_6oursql__DBAPITypeObject) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_DBAPITypeObject", (PyObject *)&__pyx_type_6oursql__DBAPITypeObject) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__DBAPITypeObject = &__pyx_type_6oursql__DBAPITypeObject;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "oursql.pyx":7
 * """
 * 
 * __author__ = 'Aaron Gallagher <habnabit@gmail.com>'             # <<<<<<<<<<<<<<
 * __version__ = '0.9.3.1'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_64)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":8
 * 
 * __author__ = 'Aaron Gallagher <habnabit@gmail.com>'
 * __version__ = '0.9.3.1'             # <<<<<<<<<<<<<<
 * 
 * include "oursql.pxi"
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_65)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":13
 * include "nogil.pyx"
 * 
 * cdef unsigned int UNSIGNED_NUM_FLAG = UNSIGNED_FLAG | NUM_FLAG             # <<<<<<<<<<<<<<
 * 
 * cdef union column_data:
 */
  __pyx_v_6oursql_UNSIGNED_NUM_FLAG = (UNSIGNED_FLAG | NUM_FLAG);

  /* "oursql.pyx":50
 *     column_data buf
 * 
 * import exceptions             # <<<<<<<<<<<<<<
 * 
 * class Warning(exceptions.Warning): pass
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__exceptions), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__exceptions, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "oursql.pyx":52
 * import exceptions
 * 
 * class Warning(exceptions.Warning): pass             # <<<<<<<<<<<<<<
 * class Note(Warning): pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__exceptions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__Warning, __pyx_n_s__oursql); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Warning, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":53
 * 
 * class Warning(exceptions.Warning): pass
 * class Note(Warning): pass             # <<<<<<<<<<<<<<
 * 
 * class Error(exceptions.StandardError):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__Warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__Note, __pyx_n_s__oursql); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Note, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":55
 * class Note(Warning): pass
 * 
 * class Error(exceptions.StandardError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, errno=None, extra=None):
 *         StandardError.__init__(self, errno, message, extra)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "oursql.pyx":56
 * 
 * class Error(exceptions.StandardError):
 *     def __init__(self, message, errno=None, extra=None):             # <<<<<<<<<<<<<<
 *         StandardError.__init__(self, errno, message, extra)
 *         self.errno = errno
 */
  __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6oursql_5Error___init__, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "oursql.pyx":55
 * class Note(Warning): pass
 * 
 * class Error(exceptions.StandardError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, errno=None, extra=None):
 *         StandardError.__init__(self, errno, message, extra)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__exceptions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__StandardError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__Error, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":61
 *         self.extra = extra
 * 
 * class InterfaceError(Error): pass             # <<<<<<<<<<<<<<
 * class DatabaseError(Error): pass
 * class DataError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__InterfaceError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__InterfaceError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":62
 * 
 * class InterfaceError(Error): pass
 * class DatabaseError(Error): pass             # <<<<<<<<<<<<<<
 * class DataError(DatabaseError): pass
 * class OperationalError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__DatabaseError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DatabaseError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":63
 * class InterfaceError(Error): pass
 * class DatabaseError(Error): pass
 * class DataError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class OperationalError(DatabaseError): pass
 * class IntegrityError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__DataError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DataError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":64
 * class DatabaseError(Error): pass
 * class DataError(DatabaseError): pass
 * class OperationalError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class IntegrityError(DatabaseError): pass
 * class InternalError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__OperationalError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__OperationalError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":65
 * class DataError(DatabaseError): pass
 * class OperationalError(DatabaseError): pass
 * class IntegrityError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class InternalError(DatabaseError): pass
 * class ProgrammingError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__IntegrityError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__IntegrityError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":66
 * class OperationalError(DatabaseError): pass
 * class IntegrityError(DatabaseError): pass
 * class InternalError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class ProgrammingError(DatabaseError): pass
 * class CollatedWarningsError(ProgrammingError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__InternalError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__InternalError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":67
 * class IntegrityError(DatabaseError): pass
 * class InternalError(DatabaseError): pass
 * class ProgrammingError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class CollatedWarningsError(ProgrammingError): pass
 * class NotSupportedError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__ProgrammingError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ProgrammingError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":68
 * class InternalError(DatabaseError): pass
 * class ProgrammingError(DatabaseError): pass
 * class CollatedWarningsError(ProgrammingError): pass             # <<<<<<<<<<<<<<
 * class NotSupportedError(DatabaseError): pass
 * class PermissionsError(DatabaseError): pass
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s_6, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_6, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":69
 * class ProgrammingError(DatabaseError): pass
 * class CollatedWarningsError(ProgrammingError): pass
 * class NotSupportedError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * class PermissionsError(DatabaseError): pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__NotSupportedError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NotSupportedError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":70
 * class CollatedWarningsError(ProgrammingError): pass
 * class NotSupportedError(DatabaseError): pass
 * class PermissionsError(DatabaseError): pass             # <<<<<<<<<<<<<<
 * 
 * # This exception type is specifically for _exception_from_errno. I think this
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatabaseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__PermissionsError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PermissionsError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "oursql.pyx":75
 * # is a good compromise: if the errno you get isn't valid, return something to
 * # indicate that while also being functional.
 * class UnknownError(Error): pass             # <<<<<<<<<<<<<<
 * 
 * cdef class Connection
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__UnknownError, __pyx_n_s__oursql); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UnknownError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":60
 *         return ret
 * 
 * _exception_enum_map = {             # <<<<<<<<<<<<<<
 *     _oursqlx_InterfaceError: InterfaceError,
 *     _oursqlx_DataError: DataError,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":61
 * 
 * _exception_enum_map = {
 *     _oursqlx_InterfaceError: InterfaceError,             # <<<<<<<<<<<<<<
 *     _oursqlx_DataError: DataError,
 *     _oursqlx_OperationalError: OperationalError,
 */
  __pyx_t_2 = PyInt_FromLong(_oursqlx_InterfaceError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":62
 * _exception_enum_map = {
 *     _oursqlx_InterfaceError: InterfaceError,
 *     _oursqlx_DataError: DataError,             # <<<<<<<<<<<<<<
 *     _oursqlx_OperationalError: OperationalError,
 *     _oursqlx_IntegrityError: IntegrityError,
 */
  __pyx_t_3 = PyInt_FromLong(_oursqlx_DataError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DataError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":63
 *     _oursqlx_InterfaceError: InterfaceError,
 *     _oursqlx_DataError: DataError,
 *     _oursqlx_OperationalError: OperationalError,             # <<<<<<<<<<<<<<
 *     _oursqlx_IntegrityError: IntegrityError,
 *     _oursqlx_InternalError: InternalError,
 */
  __pyx_t_2 = PyInt_FromLong(_oursqlx_OperationalError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__OperationalError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":64
 *     _oursqlx_DataError: DataError,
 *     _oursqlx_OperationalError: OperationalError,
 *     _oursqlx_IntegrityError: IntegrityError,             # <<<<<<<<<<<<<<
 *     _oursqlx_InternalError: InternalError,
 *     _oursqlx_ProgrammingError: ProgrammingError,
 */
  __pyx_t_3 = PyInt_FromLong(_oursqlx_IntegrityError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__IntegrityError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":65
 *     _oursqlx_OperationalError: OperationalError,
 *     _oursqlx_IntegrityError: IntegrityError,
 *     _oursqlx_InternalError: InternalError,             # <<<<<<<<<<<<<<
 *     _oursqlx_ProgrammingError: ProgrammingError,
 *     _oursqlx_NotSupportedError: NotSupportedError,
 */
  __pyx_t_2 = PyInt_FromLong(_oursqlx_InternalError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__InternalError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":66
 *     _oursqlx_IntegrityError: IntegrityError,
 *     _oursqlx_InternalError: InternalError,
 *     _oursqlx_ProgrammingError: ProgrammingError,             # <<<<<<<<<<<<<<
 *     _oursqlx_NotSupportedError: NotSupportedError,
 *     _oursqlx_PermissionsError: PermissionsError,
 */
  __pyx_t_3 = PyInt_FromLong(_oursqlx_ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":67
 *     _oursqlx_InternalError: InternalError,
 *     _oursqlx_ProgrammingError: ProgrammingError,
 *     _oursqlx_NotSupportedError: NotSupportedError,             # <<<<<<<<<<<<<<
 *     _oursqlx_PermissionsError: PermissionsError,
 *     _oursqlx_UnknownError: UnknownError,
 */
  __pyx_t_2 = PyInt_FromLong(_oursqlx_NotSupportedError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__NotSupportedError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":68
 *     _oursqlx_ProgrammingError: ProgrammingError,
 *     _oursqlx_NotSupportedError: NotSupportedError,
 *     _oursqlx_PermissionsError: PermissionsError,             # <<<<<<<<<<<<<<
 *     _oursqlx_UnknownError: UnknownError,
 * }
 */
  __pyx_t_3 = PyInt_FromLong(_oursqlx_PermissionsError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PermissionsError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":69
 *     _oursqlx_NotSupportedError: NotSupportedError,
 *     _oursqlx_PermissionsError: PermissionsError,
 *     _oursqlx_UnknownError: UnknownError,             # <<<<<<<<<<<<<<
 * }
 * def _exception_from_errno(int err):
 */
  __pyx_t_2 = PyInt_FromLong(_oursqlx_UnknownError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__UnknownError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___exception_enum_map, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":71
 *     _oursqlx_UnknownError: UnknownError,
 * }
 * def _exception_from_errno(int err):             # <<<<<<<<<<<<<<
 *     return _exception_enum_map[_oursqlx_exc_from_errno(err)]
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql__exception_from_errno, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/util.pyx":74
 *     return _exception_enum_map[_oursqlx_exc_from_errno(err)]
 * 
 * def _do_warnings_query(Connection conn not None):             # <<<<<<<<<<<<<<
 *     cdef int should_raise = False
 *     q = _Query(conn, 'SHOW WARNINGS')
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_1_do_warnings_query, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___do_warnings_query, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":1
 * import decimal, datetime, time             # <<<<<<<<<<<<<<
 * 
 * def _bitval_from_string(s):
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__decimal), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decimal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__datetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__time), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":3
 * import decimal, datetime, time
 * 
 * def _bitval_from_string(s):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef unsigned char *ss
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_2_bitval_from_string, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___bitval_from_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":9
 *     return bitval_from_char_p(ss, length)
 * 
 * def _datetime_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%Y-%m-%d %H:%M:%S')
 *     return datetime.datetime(*tt[:6])
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_3_datetime_from_string, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_66, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":13
 *     return datetime.datetime(*tt[:6])
 * 
 * def _date_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%Y-%m-%d')
 *     return datetime.date(*tt[:3])
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_4_date_from_string, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___date_from_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":17
 *     return datetime.date(*tt[:3])
 * 
 * def _time_from_string(s):             # <<<<<<<<<<<<<<
 *     tt = time.strptime(s, '%H:%M:%S')
 *     return datetime.time(*tt[3:6])
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_5_time_from_string, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___time_from_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":21
 *     return datetime.time(*tt[3:6])
 * 
 * _conversions = {             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_TINY: int,
 *     MYSQL_TYPE_SHORT: int,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":22
 * 
 * _conversions = {
 *     MYSQL_TYPE_TINY: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_SHORT: int,
 *     MYSQL_TYPE_LONG: long,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_TINY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":23
 * _conversions = {
 *     MYSQL_TYPE_TINY: int,
 *     MYSQL_TYPE_SHORT: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_LONG: long,
 *     MYSQL_TYPE_FLOAT: float,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":24
 *     MYSQL_TYPE_TINY: int,
 *     MYSQL_TYPE_SHORT: int,
 *     MYSQL_TYPE_LONG: long,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_FLOAT: float,
 *     MYSQL_TYPE_DOUBLE: float,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyLong_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":25
 *     MYSQL_TYPE_SHORT: int,
 *     MYSQL_TYPE_LONG: long,
 *     MYSQL_TYPE_FLOAT: float,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_DOUBLE: float,
 *     MYSQL_TYPE_DECIMAL: float,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":26
 *     MYSQL_TYPE_LONG: long,
 *     MYSQL_TYPE_FLOAT: float,
 *     MYSQL_TYPE_DOUBLE: float,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_DECIMAL: float,
 *     MYSQL_TYPE_NEWDECIMAL: float,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":27
 *     MYSQL_TYPE_FLOAT: float,
 *     MYSQL_TYPE_DOUBLE: float,
 *     MYSQL_TYPE_DECIMAL: float,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_NEWDECIMAL: float,
 *     MYSQL_TYPE_LONGLONG: long,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":28
 *     MYSQL_TYPE_DOUBLE: float,
 *     MYSQL_TYPE_DECIMAL: float,
 *     MYSQL_TYPE_NEWDECIMAL: float,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_LONGLONG: long,
 *     MYSQL_TYPE_INT24: int,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_NEWDECIMAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":29
 *     MYSQL_TYPE_DECIMAL: float,
 *     MYSQL_TYPE_NEWDECIMAL: float,
 *     MYSQL_TYPE_LONGLONG: long,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_INT24: int,
 *     MYSQL_TYPE_YEAR: int,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyLong_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":30
 *     MYSQL_TYPE_NEWDECIMAL: float,
 *     MYSQL_TYPE_LONGLONG: long,
 *     MYSQL_TYPE_INT24: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_YEAR: int,
 *     MYSQL_TYPE_DECIMAL: decimal.Decimal,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":31
 *     MYSQL_TYPE_LONGLONG: long,
 *     MYSQL_TYPE_INT24: int,
 *     MYSQL_TYPE_YEAR: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_DECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_NEWDECIMAL: decimal.Decimal,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_YEAR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":32
 *     MYSQL_TYPE_INT24: int,
 *     MYSQL_TYPE_YEAR: int,
 *     MYSQL_TYPE_DECIMAL: decimal.Decimal,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_NEWDECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_BIT: _bitval_from_string,
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Decimal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":33
 *     MYSQL_TYPE_YEAR: int,
 *     MYSQL_TYPE_DECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_NEWDECIMAL: decimal.Decimal,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_BIT: _bitval_from_string,
 *     MYSQL_TYPE_TIMESTAMP: _datetime_from_string,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_NEWDECIMAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__Decimal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":34
 *     MYSQL_TYPE_DECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_NEWDECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_BIT: _bitval_from_string,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_TIMESTAMP: _datetime_from_string,
 *     MYSQL_TYPE_DATETIME: _datetime_from_string,
 */
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_BIT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___bitval_from_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":35
 *     MYSQL_TYPE_NEWDECIMAL: decimal.Decimal,
 *     MYSQL_TYPE_BIT: _bitval_from_string,
 *     MYSQL_TYPE_TIMESTAMP: _datetime_from_string,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_DATETIME: _datetime_from_string,
 *     MYSQL_TYPE_DATE: _date_from_string,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_66); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":36
 *     MYSQL_TYPE_BIT: _bitval_from_string,
 *     MYSQL_TYPE_TIMESTAMP: _datetime_from_string,
 *     MYSQL_TYPE_DATETIME: _datetime_from_string,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_DATE: _date_from_string,
 *     MYSQL_TYPE_TIME: _time_from_string,
 */
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_DATETIME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_66); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":37
 *     MYSQL_TYPE_TIMESTAMP: _datetime_from_string,
 *     MYSQL_TYPE_DATETIME: _datetime_from_string,
 *     MYSQL_TYPE_DATE: _date_from_string,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_TIME: _time_from_string,
 * 
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_DATE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___date_from_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":38
 *     MYSQL_TYPE_DATETIME: _datetime_from_string,
 *     MYSQL_TYPE_DATE: _date_from_string,
 *     MYSQL_TYPE_TIME: _time_from_string,             # <<<<<<<<<<<<<<
 * 
 *     # None means to try to decode if we're using unicode and the field isn't
 */
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_TIME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___time_from_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":42
 *     # None means to try to decode if we're using unicode and the field isn't
 *     # in 'binary' encoding.
 *     MYSQL_TYPE_BLOB: None,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_STRING: None,
 *     MYSQL_TYPE_VAR_STRING: None,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":43
 *     # in 'binary' encoding.
 *     MYSQL_TYPE_BLOB: None,
 *     MYSQL_TYPE_STRING: None,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_VAR_STRING: None,
 *     MYSQL_TYPE_VARCHAR: None,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_STRING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":44
 *     MYSQL_TYPE_BLOB: None,
 *     MYSQL_TYPE_STRING: None,
 *     MYSQL_TYPE_VAR_STRING: None,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_VARCHAR: None,
 *     # For consistency with the statement API.
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_VAR_STRING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":45
 *     MYSQL_TYPE_STRING: None,
 *     MYSQL_TYPE_VAR_STRING: None,
 *     MYSQL_TYPE_VARCHAR: None,             # <<<<<<<<<<<<<<
 *     # For consistency with the statement API.
 *     MYSQL_TYPE_SET: None,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_VARCHAR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":47
 *     MYSQL_TYPE_VARCHAR: None,
 *     # For consistency with the statement API.
 *     MYSQL_TYPE_SET: None,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_SET); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___conversions, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":50
 * }
 * 
 * Timestamp = datetime.datetime             # <<<<<<<<<<<<<<
 * Date = datetime.date
 * Time = datetime.time
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Timestamp, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":51
 * 
 * Timestamp = datetime.datetime
 * Date = datetime.date             # <<<<<<<<<<<<<<
 * Time = datetime.time
 * Binary = buffer
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Date, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":52
 * Timestamp = datetime.datetime
 * Date = datetime.date
 * Time = datetime.time             # <<<<<<<<<<<<<<
 * Binary = buffer
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Time, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":53
 * Date = datetime.date
 * Time = datetime.time
 * Binary = buffer             # <<<<<<<<<<<<<<
 * 
 * def TimestampFromTicks(ticks):
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Binary, __pyx_builtin_buffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":55
 * Binary = buffer
 * 
 * def TimestampFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """TimestampFromTicks(ticks) -> Timestamp.
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_6TimestampFromTicks, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TimestampFromTicks, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":62
 *     return Timestamp(*time.localtime(ticks)[:6])
 * 
 * def DateFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """DateFromTicks(ticks) -> Date.
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_7DateFromTicks, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DateFromTicks, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/conversions.pyx":69
 *     return Date(*time.localtime(ticks)[:3])
 * 
 * def TimeFromTicks(ticks):             # <<<<<<<<<<<<<<
 *     """TimeFromTicks(ticks) -> Time.
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_8TimeFromTicks, NULL, __pyx_n_s__oursql); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TimeFromTicks, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":1
 * _protocol_enum_map = {             # <<<<<<<<<<<<<<
 *     None: MYSQL_PROTOCOL_DEFAULT,
 *     'tcp': MYSQL_PROTOCOL_TCP,
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":2
 * _protocol_enum_map = {
 *     None: MYSQL_PROTOCOL_DEFAULT,             # <<<<<<<<<<<<<<
 *     'tcp': MYSQL_PROTOCOL_TCP,
 *     'socket': MYSQL_PROTOCOL_SOCKET,
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_PROTOCOL_DEFAULT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, Py_None, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":3
 * _protocol_enum_map = {
 *     None: MYSQL_PROTOCOL_DEFAULT,
 *     'tcp': MYSQL_PROTOCOL_TCP,             # <<<<<<<<<<<<<<
 *     'socket': MYSQL_PROTOCOL_SOCKET,
 *     'pipe': MYSQL_PROTOCOL_PIPE,
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_PROTOCOL_TCP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__tcp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":4
 *     None: MYSQL_PROTOCOL_DEFAULT,
 *     'tcp': MYSQL_PROTOCOL_TCP,
 *     'socket': MYSQL_PROTOCOL_SOCKET,             # <<<<<<<<<<<<<<
 *     'pipe': MYSQL_PROTOCOL_PIPE,
 *     'memory': MYSQL_PROTOCOL_MEMORY,
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_PROTOCOL_SOCKET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__socket), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":5
 *     'tcp': MYSQL_PROTOCOL_TCP,
 *     'socket': MYSQL_PROTOCOL_SOCKET,
 *     'pipe': MYSQL_PROTOCOL_PIPE,             # <<<<<<<<<<<<<<
 *     'memory': MYSQL_PROTOCOL_MEMORY,
 * }
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_PROTOCOL_PIPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__pipe), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/connection.pyx":6
 *     'socket': MYSQL_PROTOCOL_SOCKET,
 *     'pipe': MYSQL_PROTOCOL_PIPE,
 *     'memory': MYSQL_PROTOCOL_MEMORY,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_PROTOCOL_MEMORY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__memory), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___protocol_enum_map, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":1
 * import cStringIO             # <<<<<<<<<<<<<<
 * import datetime
 * import decimal
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__cStringIO), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cStringIO, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":2
 * import cStringIO
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal
 * import codecs
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__datetime, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":3
 * import cStringIO
 * import datetime
 * import decimal             # <<<<<<<<<<<<<<
 * import codecs
 * 
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__decimal), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decimal, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":4
 * import datetime
 * import decimal
 * import codecs             # <<<<<<<<<<<<<<
 * 
 * cdef my_ulonglong ull_negone = <my_ulonglong>-1
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__codecs), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__codecs, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":6
 * import codecs
 * 
 * cdef my_ulonglong ull_negone = <my_ulonglong>-1             # <<<<<<<<<<<<<<
 * 
 * cdef class _AbstractIterWrapper:
 */
  __pyx_v_6oursql_ull_negone = ((my_ulonglong)-1);

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":36
 * 
 * BinaryIterWrapper = type('BinaryIterWrapper',
 *     (_BinaryWhateverMixin, IterWrapper), {'__module__': __name__, '__doc__':             # <<<<<<<<<<<<<<
 *     """BinaryIterWrapper(iterobj)
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql_IterWrapper)));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)__pyx_ptype_6oursql_IterWrapper)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql_IterWrapper)));
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s____module__), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s____doc__), ((PyObject *)__pyx_kp_s_67)) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BinaryIterWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__BinaryIterWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BinaryIterWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyType_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BinaryIterWrapper, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":78
 * 
 * BinaryFileWrapper = type('BinaryFileWrapper',
 *     (_BinaryWhateverMixin, FileWrapper), {'__module__': __name__, '__doc__':             # <<<<<<<<<<<<<<
 *     """BinaryFileWrapper(fileobj, chunksize=8192, doclose=False)
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql_FileWrapper)));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((PyObject*)__pyx_ptype_6oursql_FileWrapper)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql_FileWrapper)));
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s____module__), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s____doc__), ((PyObject *)__pyx_kp_s_68)) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BinaryFileWrapper));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__BinaryFileWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BinaryFileWrapper));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyType_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BinaryFileWrapper, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":605
 *                 self._raise_error()
 * 
 * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement),             # <<<<<<<<<<<<<<
 *     {'__module__': __name__})
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__Statement)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__Statement)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__Statement)));

  /* "/home/sthorne/src/oursql/oursqlx/statement.pyx":606
 * 
 * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement),
 *     {'__module__': __name__})             # <<<<<<<<<<<<<<
 * 
 * cdef class _ResultStringStream:
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s____module__), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s___DictStatement));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___DictStatement));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___DictStatement));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyType_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___DictStatement, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":19
 *     cdef int show_table
 * 
 *     conversions_dict = _conversions             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Connection conn not None, bint show_table=False,
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___conversions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__ResultSet->tp_dict, __pyx_n_s__conversions_dict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_6oursql__ResultSet);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":144
 *         self.has_result = self.result.has_result
 * 
 *     _result_class = _ResultSet             # <<<<<<<<<<<<<<
 *     def new_result(self):
 *         res = self._result_class(self.conn, *self.res_a, **self.res_kw)
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__Query->tp_dict, __pyx_n_s___result_class, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet))) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_6oursql__Query);

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":191
 * 
 * # Cython should support multiple inheritance one of these days.
 * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet),             # <<<<<<<<<<<<<<
 *     {'__module__': __name__})
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet)));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet)));

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":192
 * # Cython should support multiple inheritance one of these days.
 * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet),
 *     {'__module__': __name__})             # <<<<<<<<<<<<<<
 * 
 * cdef class _DictQuery(_Query):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s____module__), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s___DictResultSet));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s___DictResultSet));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___DictResultSet));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyType_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___DictResultSet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/query.pyx":195
 * 
 * cdef class _DictQuery(_Query):
 *     _result_class = _DictResultSet             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___DictResultSet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__DictQuery->tp_dict, __pyx_n_s___result_class, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6oursql__DictQuery);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":1
 * import collections, itertools             # <<<<<<<<<<<<<<
 * 
 * cdef class Cursor:
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__itertools), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":35
 *     cdef public unsigned long arraysize
 * 
 *     _statement_class = _Statement             # <<<<<<<<<<<<<<
 *     _query_class = _Query
 * 
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_Cursor->tp_dict, __pyx_n_s___statement_class, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__Statement))) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_6oursql_Cursor);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":36
 * 
 *     _statement_class = _Statement
 *     _query_class = _Query             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Connection conn not None, bint try_plain_query=True,
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_Cursor->tp_dict, __pyx_n_s___query_class, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__Query))) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_6oursql_Cursor);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":88
 *             self.conn.ping()
 * 
 *     def execute(self, query, params=(), plain_query=False):             # <<<<<<<<<<<<<<
 *         """execute(query, params=(), plain_query=False)
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_55 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":279
 *     """
 * 
 *     _statement_class = _DictStatement             # <<<<<<<<<<<<<<
 *     _query_class = _DictQuery
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___DictStatement); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_DictCursor->tp_dict, __pyx_n_s___statement_class, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6oursql_DictCursor);

  /* "/home/sthorne/src/oursql/oursqlx/cursor.pyx":280
 * 
 *     _statement_class = _DictStatement
 *     _query_class = _DictQuery             # <<<<<<<<<<<<<<
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_DictCursor->tp_dict, __pyx_n_s___query_class, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictQuery))) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_6oursql_DictCursor);

  /* "oursql.pyx":88
 * # The global import lock is held while modules are being imported for the first
 * # time, so it's threadsafe to call this.
 * if mysql_library_init(0, NULL, NULL):             # <<<<<<<<<<<<<<
 *     raise InterfaceError('could not initialize mysql')
 * 
 */
  __pyx_t_5 = mysql_library_init(0, NULL, NULL);
  if (__pyx_t_5) {

    /* "oursql.pyx":89
 * # time, so it's threadsafe to call this.
 * if mysql_library_init(0, NULL, NULL):
 *     raise InterfaceError('could not initialize mysql')             # <<<<<<<<<<<<<<
 * 
 * paramstyle = 'qmark'
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "oursql.pyx":91
 *     raise InterfaceError('could not initialize mysql')
 * 
 * paramstyle = 'qmark'             # <<<<<<<<<<<<<<
 * threadsafety = 1
 * apilevel = '2.0'
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__paramstyle, ((PyObject *)__pyx_n_s__qmark)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":92
 * 
 * paramstyle = 'qmark'
 * threadsafety = 1             # <<<<<<<<<<<<<<
 * apilevel = '2.0'
 * connect = Connection
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__threadsafety, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":93
 * paramstyle = 'qmark'
 * threadsafety = 1
 * apilevel = '2.0'             # <<<<<<<<<<<<<<
 * connect = Connection
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__apilevel, ((PyObject *)__pyx_kp_s_71)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":94
 * threadsafety = 1
 * apilevel = '2.0'
 * connect = Connection             # <<<<<<<<<<<<<<
 * 
 * cdef class _DBAPITypeObject:
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__connect, ((PyObject *)((PyObject*)__pyx_ptype_6oursql_Connection))) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "oursql.pyx":116
 * 
 * STRING = _DBAPITypeObject(
 *     MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING)             # <<<<<<<<<<<<<<
 * BINARY = _DBAPITypeObject(
 *     MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB,
 */
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_ENUM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromLong(MYSQL_TYPE_STRING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_VAR_STRING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__STRING, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "oursql.pyx":118
 *     MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING)
 * BINARY = _DBAPITypeObject(
 *     MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB)
 * NUMBER = _DBAPITypeObject(
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_LONG_BLOB); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "oursql.pyx":119
 * BINARY = _DBAPITypeObject(
 *     MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB,
 *     MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB)             # <<<<<<<<<<<<<<
 * NUMBER = _DBAPITypeObject(
 *     MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24,
 */
  __pyx_t_1 = PyInt_FromLong(MYSQL_TYPE_MEDIUM_BLOB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_TINY_BLOB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BINARY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "oursql.pyx":121
 *     MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB)
 * NUMBER = _DBAPITypeObject(
 *     MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR)
 * DATE = _DBAPITypeObject(
 */
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyInt_FromLong(MYSQL_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyInt_FromLong(MYSQL_TYPE_FLOAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "oursql.pyx":122
 * NUMBER = _DBAPITypeObject(
 *     MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24,
 *     MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR)             # <<<<<<<<<<<<<<
 * DATE = _DBAPITypeObject(
 *     MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE)
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyInt_FromLong(MYSQL_TYPE_LONGLONG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyInt_FromLong(MYSQL_TYPE_TINY); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyInt_FromLong(MYSQL_TYPE_YEAR); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NUMBER, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "oursql.pyx":124
 *     MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR)
 * DATE = _DBAPITypeObject(
 *     MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE)             # <<<<<<<<<<<<<<
 * TIME = _DBAPITypeObject(
 *     MYSQL_TYPE_TIME)
 */
  __pyx_t_9 = PyInt_FromLong(MYSQL_TYPE_DATE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyInt_FromLong(MYSQL_TYPE_NEWDATE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DATE, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "oursql.pyx":126
 *     MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE)
 * TIME = _DBAPITypeObject(
 *     MYSQL_TYPE_TIME)             # <<<<<<<<<<<<<<
 * DATETIME = TIMESTAMP = _DBAPITypeObject(
 *     MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME)
 */
  __pyx_t_10 = PyInt_FromLong(MYSQL_TYPE_TIME); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TIME, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "oursql.pyx":128
 *     MYSQL_TYPE_TIME)
 * DATETIME = TIMESTAMP = _DBAPITypeObject(
 *     MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME)             # <<<<<<<<<<<<<<
 * ROWID = _DBAPITypeObject()
 * 
 */
  __pyx_t_10 = PyInt_FromLong(MYSQL_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = PyInt_FromLong(MYSQL_TYPE_DATETIME); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_10 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DATETIME, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TIMESTAMP, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "oursql.pyx":129
 * DATETIME = TIMESTAMP = _DBAPITypeObject(
 *     MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME)
 * ROWID = _DBAPITypeObject()             # <<<<<<<<<<<<<<
 * 
 * client_info = mysql_get_client_info()
 */
  __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ROWID, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "oursql.pyx":131
 * ROWID = _DBAPITypeObject()
 * 
 * client_info = mysql_get_client_info()             # <<<<<<<<<<<<<<
 * errnos = _oursqlx_generate_errno_dict()
 */
  __pyx_t_8 = PyBytes_FromString(mysql_get_client_info()); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__client_info, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

  /* "oursql.pyx":132
 * 
 * client_info = mysql_get_client_info()
 * errnos = _oursqlx_generate_errno_dict()             # <<<<<<<<<<<<<<
 */
  __pyx_t_8 = _oursqlx_generate_errno_dict(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__errnos, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "oursql.pyx":1
 * """oursql python bindings for MySQL.             # <<<<<<<<<<<<<<
 * 
 * This module is a new, better set of MySQL bindings for python, supporting novel
 */
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  if (__pyx_m) {
    __Pyx_AddTraceback("init oursql", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init oursql");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else if (PyErr_Occurred()) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    /* cause is unused */
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    if (cause) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject *callable, PyObject *args, PyObject *kwargs) {
    PyObject* result;
    if (likely(PyDict_Check(kwargs))) {
        return PyEval_CallObjectWithKeywords(callable, args, kwargs);
    } else {
        PyObject* real_dict;
        real_dict = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, kwargs, NULL);
        if (unlikely(!real_dict))
            return NULL;
        result = PyEval_CallObjectWithKeywords(callable, args, real_dict);
        Py_DECREF(real_dict);
        return result; /* may be NULL */
    }
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}



static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        PyObject *py_level = PyInt_FromLong(level);
        if (!py_level)
            goto bad;
        module = PyObject_CallFunctionObjArgs(py_import,
            name, global_dict, empty_dict, list, py_level, NULL);
        Py_DECREF(py_level);
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
    /* Default metaclass */
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;

    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;

    /* Python2 __metaclass__ */
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}


static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
    __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
    if (op == NULL)
        return NULL;
    op->func.m_ml = ml;
    Py_XINCREF(self);
    op->func.m_self = self;
    Py_XINCREF(module);
    op->func.m_module = module;
    PyObject_GC_Track(op);
    return (PyObject *)op;
}

static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
    PyObject_GC_UnTrack(m);
    Py_XDECREF(m->func.m_self);
    Py_XDECREF(m->func.m_module);
    PyObject_GC_Del(m);
}

static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
    if (obj == Py_None)
            obj = NULL;
    return PyMethod_New(func, obj, type);
}

static int __pyx_binding_PyCFunctionType_init(void) {
    __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
    __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
    __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
    __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
    if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
        return -1;
    }
    __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
    return 0;

}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {   /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyBytes_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]);
            else
                return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
        } else {
            int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {   /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
        return (equals == Py_EQ);
    } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
        if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyUnicode_AS_UNICODE(s1)[0] == PyUnicode_AS_UNICODE(s2)[0]);
            else
                return (PyUnicode_AS_UNICODE(s1)[0] != PyUnicode_AS_UNICODE(s2)[0]);
        } else {
            int result = PyUnicode_Compare(s1, s2);
            if ((result == -1) && unlikely(PyErr_Occurred()))
                return -1;
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyUnicode_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_my_ulonglong(my_ulonglong val) {
    const my_ulonglong neg_one = (my_ulonglong)-1, const_zero = (my_ulonglong)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(my_ulonglong) == sizeof(char))  ||
        (sizeof(my_ulonglong) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(my_ulonglong) == sizeof(int)) ||
               (sizeof(my_ulonglong) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(my_ulonglong) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(my_ulonglong),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
