/* Generated by Cython 0.12 on Tue Apr 27 03:27:35 2010 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#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)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
#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 PyString_Type                PyUnicode_Type
  #define PyString_CheckExact          PyUnicode_CheckExact
#else
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_CheckExact           PyString_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #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
  #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
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#else
  #define _USE_MATH_DEFINES
#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
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__oursql
#include "compat.h"
#include "string.h"
#include "mysql.h"
#include "mysqld_error.h"

#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE 
#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 */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString          PyString_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyString_AsString
#else
#define __Pyx_PyBytes_FromString          PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyBytes_AsString
#endif

#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))

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

#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
#define T_PYSSIZET T_INT
#elif !defined(T_LONGLONG)
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
#else
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
#endif
#endif


#if !defined(T_ULONGLONG)
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
#else
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
#endif
#if !defined(T_LONGLONG)
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
#else
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
#endif

#define __Pyx_T_FLOATING(x) \
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))

#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
#else
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
#endif
#endif

static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static 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;


/* Type declarations */

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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;
};

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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;
};

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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;
};

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":265
 *         self.close()
 * 
 * cdef class DictCursor(Cursor):             # <<<<<<<<<<<<<<
 *     """DictCursor(...)
 * 
 */

struct __pyx_obj_6oursql_DictCursor {
  struct __pyx_obj_6oursql_Cursor __pyx_base;
};

/* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":96
 * connect = Connection
 * 
 * cdef class _DBAPITypeObject:             # <<<<<<<<<<<<<<
 *     cdef readonly object values
 * 
 */

struct __pyx_obj_6oursql__DBAPITypeObject {
  PyObject_HEAD
  PyObject *values;
};

/* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":601
 *     {'__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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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) {
    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;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__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_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #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_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_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 int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static INLINE void __Pyx_RaiseTooManyValuesError(void);

static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

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

static 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 INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) {
    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));
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "pop");
        if (!m) return NULL;
        r = PyObject_CallObject(m, NULL);
        Py_DECREF(m);
        return r;
    }
}

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

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


static 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, size <= sizeof(long)) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
}

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

static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
}


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

static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
    }
    return r;
}

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

static INLINE PyObject* __Pyx_Type(PyObject* o) {
    PyObject* type = (PyObject*) Py_TYPE(o);
    Py_INCREF(type);
    return type;
}

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

static 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); /*proto*/

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

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

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*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

static INLINE PyObject *__Pyx_PyInt_to_py_my_ulonglong(my_ulonglong);

static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static INLINE char __Pyx_PyInt_AsChar(PyObject *);

static INLINE short __Pyx_PyInt_AsShort(PyObject *);

static INLINE int __Pyx_PyInt_AsInt(PyObject *);

static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static INLINE long __Pyx_PyInt_AsLong(PyObject *);

static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static void __Pyx_AddTraceback(const char *funcname); /*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 INLINE MYSQL *__pyx_f_6oursql_mysql_real_connect(MYSQL *, char *, char *, char *, char *, unsigned int, char *, unsigned long); /*proto*/
static INLINE int __pyx_f_6oursql_mysql_ping(MYSQL *); /*proto*/
static INLINE my_bool __pyx_f_6oursql_mysql_commit(MYSQL *); /*proto*/
static INLINE my_bool __pyx_f_6oursql_mysql_rollback(MYSQL *); /*proto*/
static INLINE int __pyx_f_6oursql_mysql_stmt_prepare(MYSQL_STMT *, char *, unsigned long); /*proto*/
static INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *); /*proto*/
static INLINE my_bool __pyx_f_6oursql_mysql_stmt_send_long_data(MYSQL_STMT *, unsigned int, char *, unsigned long); /*proto*/
static INLINE int __pyx_f_6oursql_mysql_stmt_fetch_column(MYSQL_STMT *, MYSQL_BIND *, unsigned int, unsigned long); /*proto*/
static INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *); /*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_8[] = "%Y-%m-%d %H:%M:%S";
static char __pyx_k_9[] = "%Y-%m-%d";
static char __pyx_k_10[] = "%H:%M:%S";
static char __pyx_k_11[] = "shared_memory_base_name";
static char __pyx_k_12[] = "alloc of conn object failed";
static char __pyx_k_13[] = "unknown protocol %r";
static char __pyx_k_14[] = "connection closed";
static char __pyx_k_15[] = "alloc of statement failed";
static char __pyx_k_16[] = "statement closed";
static char __pyx_k_17[] = "string limit must be >= 0";
static char __pyx_k_18[] = "binding this query would cause rows to become unfetchable";
static char __pyx_k_19[] = "alloc of result bind structure failed";
static char __pyx_k_20[] = "alloc of result buffers failed";
static char __pyx_k_21[] = "executing this query would cause rows to become unfetchable";
static char __pyx_k_22[] = "%d parameters expected, %d given";
static char __pyx_k_23[] = "alloc of bind parameters failed";
static char __pyx_k_24[] = "cannot bind %r object";
static char __pyx_k_25[] = "unknown column returned as string";
static char __pyx_k_26[] = "truncated column %d, type %d";
static char __pyx_k_27[] = "must prefetch at least 1 row";
static char __pyx_k_28[] = "";
static char __pyx_k_29[] = "row no longer available from database";
static char __pyx_k_30[] = "can't read negative bytes";
static char __pyx_k_31[] = "size remaining should be >= 0";
static char __pyx_k_32[] = "query closed";
static char __pyx_k_33[] = "cursor closed";
static char __pyx_k_34[] = "use the CALL statement with the execute method to call stored procedures";
static char __pyx_k_36[] = "can't call execute with both parameters and a plain query";
static char __pyx_k_37[] = "no results available";
static char __pyx_k_38[] = "unorderable types: %r and %r";
static char __pyx_k_39[] = "<_DBAPITypeObject representing %r at %#x>";
static char __pyx_k_40[] = "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_41[] = "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_42[] = "Aaron Gallagher <habnabit@gmail.com>";
static char __pyx_k_43[] = "0.9.2";
static char __pyx_k_44[] = "_datetime_from_string";
static char __pyx_k_45[] = "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_46[] = "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_47[] = "could not initialize mysql";
static char __pyx_k_48[] = "2.0";
static char __pyx_k_49[] = "TimestampFromTicks (line 55)";
static char __pyx_k_50[] = "DateFromTicks (line 62)";
static char __pyx_k_51[] = "TimeFromTicks (line 69)";
static char __pyx_k_52[] = "Connection.close (line 160)";
static char __pyx_k_53[] = "Connection.ping (line 186)";
static char __pyx_k_54[] = "Connection.commit (line 196)";
static char __pyx_k_55[] = "Connection.rollback (line 205)";
static char __pyx_k_56[] = "Connection.warning_count (line 233)";
static char __pyx_k_57[] = "Connection.cursor (line 241)";
static char __pyx_k_58[] = "Connection._escape_string (line 281)";
static char __pyx_k_59[] = "Connection._escape_unicode_string (line 291)";
static char __pyx_k_60[] = "_escape_unicode_string";
static char __pyx_k_61[] = "_ResultStringStream.read (line 629)";
static char __pyx_k_62[] = "Cursor.close (line 55)";
static char __pyx_k_63[] = "Cursor.callproc (line 72)";
static char __pyx_k_64[] = "Cursor.execute (line 88)";
static char __pyx_k_65[] = "Cursor.executemany (line 125)";
static char __pyx_k_66[] = "Cursor.nextset (line 163)";
static char __pyx_k_67[] = "Cursor.fetchone (line 176)";
static char __pyx_k_68[] = "Cursor.fetchmany (line 190)";
static char __pyx_k_69[] = "Cursor.fetchall (line 218)";
static char __pyx_k_70[] = "Cursor.setinputsizes (line 239)";
static char __pyx_k_71[] = "Cursor.setoutputsize (line 248)";
static char __pyx_k__c[] = "c";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__t[] = "t";
static char __pyx_k__ca[] = "ca";
static char __pyx_k__db[] = "db";
static char __pyx_k__id[] = "id";
static char __pyx_k__ll[] = "ll";
static char __pyx_k__s8[] = "s8";
static char __pyx_k__st[] = "st";
static char __pyx_k__tb[] = "tb";
static char __pyx_k__u8[] = "u8";
static char __pyx_k__ul[] = "ul";
static char __pyx_k__buf[] = "buf";
static char __pyx_k__day[] = "day";
static char __pyx_k__dec[] = "dec";
static char __pyx_k__exc[] = "exc";
static char __pyx_k__get[] = "get";
static char __pyx_k__key[] = "key";
static char __pyx_k__res[] = "res";
static char __pyx_k__s16[] = "s16";
static char __pyx_k__s32[] = "s32";
static char __pyx_k__s64[] = "s64";
static char __pyx_k__ssl[] = "ssl";
static char __pyx_k__tcp[] = "tcp";
static char __pyx_k__u16[] = "u16";
static char __pyx_k__u32[] = "u32";
static char __pyx_k__u64[] = "u64";
static char __pyx_k__ull[] = "ull";
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__bind[] = "bind";
static char __pyx_k__cert[] = "cert";
static char __pyx_k__conn[] = "conn";
static char __pyx_k__date[] = "date";
static char __pyx_k__done[] = "done";
static char __pyx_k__host[] = "host";
static char __pyx_k__hour[] = "hour";
static char __pyx_k__name[] = "name";
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__type[] = "type";
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__error[] = "error";
static char __pyx_k__extra[] = "extra";
static char __pyx_k__flags[] = "flags";
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__res_a[] = "res_a";
static char __pyx_k__super[] = "super";
static char __pyx_k__table[] = "table";
static char __pyx_k__value[] = "value";
static char __pyx_k__BINARY[] = "BINARY";
static char __pyx_k__Binary[] = "Binary";
static char __pyx_k__Cursor[] = "Cursor";
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__closed[] = "closed";
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__fields[] = "fields";
static char __pyx_k__length[] = "length";
static char __pyx_k__memory[] = "memory";
static char __pyx_k__minute[] = "minute";
static char __pyx_k__offset[] = "offset";
static char __pyx_k__params[] = "params";
static char __pyx_k__passwd[] = "passwd";
static char __pyx_k__res_kw[] = "res_kw";
static char __pyx_k__result[] = "result";
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__fetched[] = "fetched";
static char __pyx_k__fileobj[] = "fileobj";
static char __pyx_k__is_null[] = "is_null";
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___charset[] = "_charset";
static char __pyx_k__apilevel[] = "apilevel";
static char __pyx_k__autoping[] = "autoping";
static char __pyx_k__buffered[] = "buffered";
static char __pyx_k__callproc[] = "callproc";
static char __pyx_k__compress[] = "compress";
static char __pyx_k__datetime[] = "datetime";
static char __pyx_k__decimals[] = "decimals";
static char __pyx_k__fetchall[] = "fetchall";
static char __pyx_k__fetchone[] = "fetchone";
static char __pyx_k__messages[] = "messages";
static char __pyx_k__nextfunc[] = "nextfunc";
static char __pyx_k__procname[] = "procname";
static char __pyx_k__protocol[] = "protocol";
static char __pyx_k__readfunc[] = "readfunc";
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__arraysize[] = "arraysize";
static char __pyx_k__cStringIO[] = "cStringIO";
static char __pyx_k__charsetnr[] = "charsetnr";
static char __pyx_k__chunksize[] = "chunksize";
static char __pyx_k__exhausted[] = "exhausted";
static char __pyx_k__fetchmany[] = "fetchmany";
static char __pyx_k__getreader[] = "getreader";
static char __pyx_k__is_binary[] = "is_binary";
static char __pyx_k__itertools[] = "itertools";
static char __pyx_k__lastrowid[] = "lastrowid";
static char __pyx_k__localtime[] = "localtime";
static char __pyx_k__Connection[] = "Connection";
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__max_length[] = "max_length";
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___statements[] = "_statements";
static char __pyx_k__buffer_type[] = "buffer_type";
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__cursor_type[] = "cursor_type";
static char __pyx_k__description[] = "description";
static char __pyx_k__executemany[] = "executemany";
static char __pyx_k__is_unsigned[] = "is_unsigned";
static char __pyx_k__microsecond[] = "microsecond";
static char __pyx_k__plain_query[] = "plain_query";
static char __pyx_k__result_data[] = "result_data";
static char __pyx_k__second_part[] = "second_part";
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___bind_buffer[] = "_bind_buffer";
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___raise_error[] = "_raise_error";
static char __pyx_k___stmt_kwargs[] = "_stmt_kwargs";
static char __pyx_k__column_names[] = "column_names";
static char __pyx_k__cursor_class[] = "cursor_class";
static char __pyx_k__data_waiting[] = "data_waiting";
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__stmt_fetched[] = "stmt_fetched";
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___alloc_buffer[] = "_alloc_buffer";
static char __pyx_k___check_closed[] = "_check_closed";
static char __pyx_k___result_class[] = "_result_class";
static char __pyx_k__buffer_length[] = "buffer_length";
static char __pyx_k__multi_results[] = "multi_results";
static char __pyx_k__prefetch_rows[] = "prefetch_rows";
static char __pyx_k__result_fields[] = "result_fields";
static char __pyx_k__setinputsizes[] = "setinputsizes";
static char __pyx_k__setoutputsize[] = "setoutputsize";
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___prefetch_rows[] = "_prefetch_rows";
static char __pyx_k___update_fields[] = "_update_fields";
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__conversion_info[] = "conversion_info";
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___context_cursors[] = "_context_cursors";
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___check_statements[] = "_check_statements";
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___ResultStringStream[] = "_ResultStringStream";
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_n_s_11;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_n_s_4;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_n_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_u_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_u_50;
static PyObject *__pyx_kp_u_51;
static PyObject *__pyx_kp_u_52;
static PyObject *__pyx_kp_u_53;
static PyObject *__pyx_kp_u_54;
static PyObject *__pyx_kp_u_55;
static PyObject *__pyx_kp_u_56;
static PyObject *__pyx_kp_u_57;
static PyObject *__pyx_kp_u_58;
static PyObject *__pyx_kp_u_59;
static PyObject *__pyx_n_s_6;
static PyObject *__pyx_n_s_60;
static PyObject *__pyx_kp_u_61;
static PyObject *__pyx_kp_u_62;
static PyObject *__pyx_kp_u_63;
static PyObject *__pyx_kp_u_64;
static PyObject *__pyx_kp_u_65;
static PyObject *__pyx_kp_u_66;
static PyObject *__pyx_kp_u_67;
static PyObject *__pyx_kp_u_68;
static PyObject *__pyx_kp_u_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_u_70;
static PyObject *__pyx_kp_u_71;
static PyObject *__pyx_kp_s_8;
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__Connection;
static PyObject *__pyx_n_s__Cursor;
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___ResultStringStream;
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___alloc_buffer;
static PyObject *__pyx_n_s___bind_buffer;
static PyObject *__pyx_n_s___bitval_from_string;
static PyObject *__pyx_n_s___charset;
static PyObject *__pyx_n_s___check_closed;
static PyObject *__pyx_n_s___check_statements;
static PyObject *__pyx_n_s___context_cursors;
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___prefetch_rows;
static PyObject *__pyx_n_s___protocol_enum_map;
static PyObject *__pyx_n_s___query_class;
static PyObject *__pyx_n_s___raise_error;
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___statements;
static PyObject *__pyx_n_s___stmt_kwargs;
static PyObject *__pyx_n_s___time_from_string;
static PyObject *__pyx_n_s___update_fields;
static PyObject *__pyx_n_s__apilevel;
static PyObject *__pyx_n_s__arraysize;
static PyObject *__pyx_n_s__autoping;
static PyObject *__pyx_n_s__bind;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__buffer_length;
static PyObject *__pyx_n_s__buffer_results;
static PyObject *__pyx_n_s__buffer_type;
static PyObject *__pyx_n_s__buffered;
static PyObject *__pyx_n_s__c;
static PyObject *__pyx_n_s__cStringIO;
static PyObject *__pyx_n_s__ca;
static PyObject *__pyx_n_s__callproc;
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__charsetnr;
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__closed;
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__conversion_info;
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__cursor_type;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__data_waiting;
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__dec;
static PyObject *__pyx_n_s__decimal;
static PyObject *__pyx_n_s__decimals;
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__done;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__errno;
static PyObject *__pyx_n_s__errnos;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__exc;
static PyObject *__pyx_n_s__exceptions;
static PyObject *__pyx_n_s__execute;
static PyObject *__pyx_n_s__executemany;
static PyObject *__pyx_n_s__exhausted;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__extra;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__fetchall;
static PyObject *__pyx_n_s__fetched;
static PyObject *__pyx_n_s__fetchmany;
static PyObject *__pyx_n_s__fetchone;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__fileobj;
static PyObject *__pyx_n_s__flags;
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__is_binary;
static PyObject *__pyx_n_s__is_null;
static PyObject *__pyx_n_s__is_unsigned;
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__ll;
static PyObject *__pyx_n_s__local_infile;
static PyObject *__pyx_n_s__localtime;
static PyObject *__pyx_n_s__max_length;
static PyObject *__pyx_n_s__memory;
static PyObject *__pyx_n_s__message;
static PyObject *__pyx_n_s__messages;
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__name;
static PyObject *__pyx_n_s__new_result;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__nextfunc;
static PyObject *__pyx_n_s__nextset;
static PyObject *__pyx_n_s__offset;
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__readfunc;
static PyObject *__pyx_n_s__report_truncation;
static PyObject *__pyx_n_s__require_secure_auth;
static PyObject *__pyx_n_s__res;
static PyObject *__pyx_n_s__res_a;
static PyObject *__pyx_n_s__res_kw;
static PyObject *__pyx_n_s__result;
static PyObject *__pyx_n_s__result_data;
static PyObject *__pyx_n_s__result_fields;
static PyObject *__pyx_n_s__rollback;
static PyObject *__pyx_n_s__rowcount;
static PyObject *__pyx_n_s__s16;
static PyObject *__pyx_n_s__s32;
static PyObject *__pyx_n_s__s64;
static PyObject *__pyx_n_s__s8;
static PyObject *__pyx_n_s__second;
static PyObject *__pyx_n_s__second_part;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__setinputsizes;
static PyObject *__pyx_n_s__setoutputsize;
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__st;
static PyObject *__pyx_n_s__stmt;
static PyObject *__pyx_n_s__stmt_fetched;
static PyObject *__pyx_n_s__string_limit;
static PyObject *__pyx_n_s__strptime;
static PyObject *__pyx_n_s__super;
static PyObject *__pyx_n_s__t;
static PyObject *__pyx_n_s__table;
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__type;
static PyObject *__pyx_n_s__u16;
static PyObject *__pyx_n_s__u32;
static PyObject *__pyx_n_s__u64;
static PyObject *__pyx_n_s__u8;
static PyObject *__pyx_n_s__ul;
static PyObject *__pyx_n_s__ull;
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_35;

/* "/home/habnabit/hab-bzr/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 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_RefNannySetupContext("mysql_real_connect");

  /* "/home/habnabit/hab-bzr/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)
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/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)
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

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

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":13
 * 
 * cdef inline int mysql_ping(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_ping(conn)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":13
 * 
 * cdef inline int mysql_ping(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_ping(conn)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

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

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":17
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_commit(conn)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":17
 * 
 * cdef inline my_bool mysql_commit(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_commit(conn)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

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

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":21
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_rollback(conn)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":21
 * 
 * cdef inline my_bool mysql_rollback(MYSQL *conn):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_rollback(conn)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/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 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_RefNannySetupContext("mysql_stmt_prepare");

  /* "/home/habnabit/hab-bzr/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)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/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)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/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 INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *__pyx_v_stmt) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("mysql_stmt_execute");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":30
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_execute(stmt)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":31
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:
 *         return _mysql_stmt_execute(stmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,
 */
      __pyx_r = mysql_stmt_execute(__pyx_v_stmt);
      goto __pyx_L3;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":30
 * 
 * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_execute(stmt)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":33
 *         return _mysql_stmt_execute(stmt)
 * 
 * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,             # <<<<<<<<<<<<<<
 *         unsigned int index, char *data, unsigned long length):
 *     with nogil:
 */

static 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_RefNannySetupContext("mysql_stmt_send_long_data");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":35
 * 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)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":36
 *         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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":35
 * 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)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":38
 *         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 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_RefNannySetupContext("mysql_stmt_fetch_column");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":40
 * 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)
 * 
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":41
 *         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;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":40
 * 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)
 * 
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":43
 *         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 INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *__pyx_v_stmt) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("mysql_stmt_store_result");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":44
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_store_result(stmt)
 */
  { PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":45
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:
 *         return _mysql_stmt_store_result(stmt)             # <<<<<<<<<<<<<<
 */
      __pyx_r = mysql_stmt_store_result(__pyx_v_stmt);
      goto __pyx_L3;
    }
    /*finally:*/ {
      int __pyx_why;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L3: __pyx_why = 3; goto __pyx_L5;
      __pyx_L5:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/nogil.pyx":44
 * 
 * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         return _mysql_stmt_store_result(stmt)
 */
      Py_BLOCK_THREADS
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
      }
    }
  }

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    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;
    }
    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 (unlikely(value)) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__extra);
        if (unlikely(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;}
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_errno = values[2];
    __pyx_v_extra = values[3];
  } else {
    __pyx_v_errno = ((PyObject *)Py_None);
    __pyx_v_extra = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_extra = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3:
      __pyx_v_errno = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2:
      __pyx_v_message = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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__");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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, __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(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  Py_ssize_t __pyx_t_1;
  __Pyx_RefNannySetupContext("bitval_from_char_p");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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;
  PyObject *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("conversion_info_from_res");
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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(__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_DECREF(__pyx_v_data);
    __pyx_v_data = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":18
 *             field.flags,
 *             field.charsetnr)
 *         Py_INCREF(data)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(ret, i, data)
 *     return ret
 */
    Py_INCREF(__pyx_v_data);

    /* "/home/habnabit/hab-bzr/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, __pyx_v_data);
  }

  /* "/home/habnabit/hab-bzr/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_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  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;
  __Pyx_RefNannySetupContext("description_from_res");
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":32
 *                 field.table, field.name)
 *         else:
 *             name = field.name             # <<<<<<<<<<<<<<
 *         data = (
 *             name,
 */
      __pyx_t_1 = __Pyx_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(__pyx_t_1);
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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(__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_DECREF(__pyx_v_data);
    __pyx_v_data = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "/home/habnabit/hab-bzr/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(__pyx_v_data);

    /* "/home/habnabit/hab-bzr/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, __pyx_v_data);
  }

  /* "/home/habnabit/hab-bzr/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_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_fetchone(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_row;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("fetchone");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_row = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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, __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(__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_DECREF(__pyx_v_row);
  __pyx_v_row = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
  } 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(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 (likely(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 = PyIter_Next(__pyx_t_1);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
      PyObject* tuple = __pyx_t_2;
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;
    }

    /* "/home/habnabit/hab-bzr/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'
 */
    __pyx_t_3 = ((PySequence_Contains(__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/habnabit/hab-bzr/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 = PyObject_GetItem(__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_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_value, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); 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_6); __pyx_t_6 = 0;
      if (__pyx_t_3) {

        /* "/home/habnabit/hab-bzr/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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);

        /* "/home/habnabit/hab-bzr/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(__pyx_t_2);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__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_6, __pyx_t_5, 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_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_2, 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_L9;
      }
      __pyx_L9:;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":57
 *                         ' in output' % name)
 *             else:
 *                 ret[name] = value             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
      if (PyObject_SetItem(__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_L8:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":58
 *             else:
 *                 ret[name] = value
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * _exception_enum_map = {
 */
  __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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("oursql._DictWhateverMixin.fetchone");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_row);
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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 PyObject *__pyx_pf_6oursql__exception_from_errno(PyObject *__pyx_self, PyObject *__pyx_arg_err) {
  int __pyx_v_err;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __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");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn); /*proto*/
static PyObject *__pyx_pf_6oursql__do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn) {
  int __pyx_v_should_raise;
  PyObject *__pyx_v_q;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_kind;
  PyObject *__pyx_v_err;
  PyObject *__pyx_v_message;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_do_warnings_query");
  __pyx_self = __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_v_conn);
  __pyx_v_q = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_kind = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
  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/habnabit/hab-bzr/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/habnabit/hab-bzr/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(__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)), __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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_q);
  __pyx_v_q = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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(__pyx_v_q) || PyTuple_CheckExact(__pyx_v_q)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_q; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__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);
  }
  for (;;) {
    if (likely(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 (likely(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 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
      PyObject* tuple = __pyx_t_1;
      __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_v_err);
      __pyx_v_err = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_v_err);
      __pyx_v_err = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_t_6;
      __pyx_t_6 = 0;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":79
 *     ret = []
 *     for kind, err, message in q:
 *         if kind == 'Note':             # <<<<<<<<<<<<<<
 *             kind = Note
 *         elif kind == 'Warning':
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, ((PyObject *)__pyx_n_s__Note), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/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_L7;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":81
 *         if kind == 'Note':
 *             kind = Note
 *         elif kind == 'Warning':             # <<<<<<<<<<<<<<
 *             kind = Warning
 *             should_raise = True
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, ((PyObject *)__pyx_n_s__Warning), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_L7;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/util.pyx":84
 *             kind = Warning
 *             should_raise = True
 *         elif kind == 'Error':             # <<<<<<<<<<<<<<
 *             kind = _exception_from_errno(err)
 *             should_raise = True
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, ((PyObject *)__pyx_n_s__Error), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/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_6 = PyTuple_New(1); 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_INCREF(__pyx_v_err);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_err);
      __Pyx_GIVEREF(__pyx_v_err);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_v_kind);
      __pyx_v_kind = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "/home/habnabit/hab-bzr/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_L7;
    }
    /*else*/ {

      /* "/home/habnabit/hab-bzr/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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_v_kind); 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_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(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L7:;

    /* "/home/habnabit/hab-bzr/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)
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    __Pyx_INCREF(__pyx_v_err);
    PyTuple_SET_ITEM(__pyx_t_6, 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(__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, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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_8 = ((struct __pyx_obj_6oursql_Connection *)__pyx_v_conn)->raise_on_warnings;
  } else {
    __pyx_t_8 = __pyx_v_should_raise;
  }
  if (__pyx_t_8) {

    /* "/home/habnabit/hab-bzr/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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
    __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), __pyx_v_ret) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_6, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/habnabit/hab-bzr/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(__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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("oursql._do_warnings_query");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_q);
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_kind);
  __Pyx_DECREF(__pyx_v_err);
  __Pyx_DECREF(__pyx_v_message);
  __Pyx_DECREF((PyObject *)__pyx_v_conn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__bitval_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyObject *__pyx_pf_6oursql__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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_bitval_from_string");
  __pyx_self = __pyx_self;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyObject *__pyx_pf_6oursql__datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_datetime_from_string");
  __pyx_self = __pyx_self;
  __pyx_v_tt = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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_8));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_tt);
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyObject *__pyx_pf_6oursql__date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_date_from_string");
  __pyx_self = __pyx_self;
  __pyx_v_tt = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_tt);
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyObject *__pyx_pf_6oursql__time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_v_tt;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_time_from_string");
  __pyx_self = __pyx_self;
  __pyx_v_tt = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_tt);
  __pyx_v_tt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6oursql_TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_TimestampFromTicks[] = "TimestampFromTicks(ticks) -> Timestamp.\n    \n    Convert a time in seconds since the epoch into a Timestamp.\n    ";
static PyObject *__pyx_pf_6oursql_TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("TimestampFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6oursql_DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_DateFromTicks[] = "DateFromTicks(ticks) -> Date.\n    \n    Convert a time in seconds since the epoch into a Date.\n    ";
static PyObject *__pyx_pf_6oursql_DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("DateFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6oursql_TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/
static char __pyx_doc_6oursql_TimeFromTicks[] = "TimeFromTicks(ticks) -> Time.\n    \n    Convert a time in seconds since the epoch into a Time.\n    ";
static PyObject *__pyx_pf_6oursql_TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("TimeFromTicks");
  __pyx_self = __pyx_self;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = 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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  unsigned long __pyx_v_flags;
  unsigned int __pyx_v_uint_tmp;
  my_bool __pyx_v_bool_tmp;
  int __pyx_r;
  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;
  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_11,&__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,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {

    /* "/home/habnabit/hab-bzr/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):
 */
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[28] = {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};
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)Py_None);
    values[8] = ((PyObject *)Py_None);
    values[9] = ((PyObject *)Py_None);
    values[10] = ((PyObject *)Py_None);
    values[22] = (PyObject*)((PyObject *)__pyx_n_s__utf8);
    values[24] = ((PyObject *)Py_None);
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__host);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__user);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__passwd);
        if (unlikely(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_11);
      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; }
      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;}
    }
    if (values[0]) {
      __pyx_v_host = __Pyx_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/habnabit/hab-bzr/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 = __Pyx_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 = __Pyx_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 = __Pyx_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/habnabit/hab-bzr/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 = __Pyx_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 = __Pyx_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/habnabit/hab-bzr/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 = __Pyx_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/habnabit/hab-bzr/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 = __Pyx_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 = __Pyx_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/habnabit/hab-bzr/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 = __Pyx_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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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))) {__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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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))) {__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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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))) {__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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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):
 */
      __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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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):
 *         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))) {__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))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":87
 *             bint autoping=False, default_cursor=None,
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True):             # <<<<<<<<<<<<<<
 *         cdef unsigned long flags = 0
 *         cdef unsigned int uint_tmp
 */
      __pyx_v_multi_statements = ((int)1);
    }
  } else {

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_user = ((char *)NULL);
    __pyx_v_passwd = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_port = ((unsigned int)0);
    __pyx_v_unix_socket = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/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,
 */
    __pyx_v_connect_timeout = ((PyObject *)Py_None);
    __pyx_v_read_timeout = ((PyObject *)Py_None);
    __pyx_v_write_timeout = ((PyObject *)Py_None);

    /* "/home/habnabit/hab-bzr/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_protocol = ((PyObject *)Py_None);
    __pyx_v_ssl = ((PyObject *)Py_None);
    __pyx_v_read_default_file = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_init_command = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_shared_memory_base_name = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_require_secure_auth = ((int)0);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_report_truncation = ((int)1);

    /* "/home/habnabit/hab-bzr/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);
    __pyx_v_use_unicode = ((int)1);
    __pyx_v_charset = ((PyObject *)__pyx_n_s__utf8);

    /* "/home/habnabit/hab-bzr/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):
 */
    __pyx_v_autoping = ((int)0);
    __pyx_v_default_cursor = ((PyObject *)Py_None);

    /* "/home/habnabit/hab-bzr/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):
 *         cdef unsigned long flags = 0
 */
    __pyx_v_raise_on_warnings = ((int)1);
    __pyx_v_multi_results = ((int)1);

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":87
 *             bint autoping=False, default_cursor=None,
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True):             # <<<<<<<<<<<<<<
 *         cdef unsigned long flags = 0
 *         cdef unsigned int uint_tmp
 */
    __pyx_v_multi_statements = ((int)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_passwd = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_user = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_host = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_host) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_connect_timeout);
  __Pyx_INCREF(__pyx_v_read_timeout);
  __Pyx_INCREF(__pyx_v_write_timeout);
  __Pyx_INCREF(__pyx_v_protocol);
  __Pyx_INCREF(__pyx_v_ssl);
  __Pyx_INCREF(__pyx_v_charset);
  __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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":88
 *             bint raise_on_warnings=True, bint multi_results=True,
 *             bint multi_statements=True):
 *         cdef unsigned long flags = 0             # <<<<<<<<<<<<<<
 *         cdef unsigned int uint_tmp
 *         cdef my_bool bool_tmp
 */
  __pyx_v_flags = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":91
 *         cdef unsigned int uint_tmp
 *         cdef my_bool bool_tmp
 *         if compress:             # <<<<<<<<<<<<<<
 *             flags |= CLIENT_COMPRESS
 *         if found_rows:
 */
  __pyx_t_1 = __pyx_v_compress;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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 |= CLIENT_COMPRESS;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/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
 */
  __pyx_t_1 = __pyx_v_found_rows;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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 |= CLIENT_FOUND_ROWS;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_12));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_12));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___protocol_enum_map); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_3, __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_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __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[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_protocol);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_protocol);
    __Pyx_GIVEREF(__pyx_v_protocol);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_2); 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_t_2 = PyTuple_New(1); 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);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, 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_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 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/habnabit/hab-bzr/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_2 = PyObject_GetItem(__pyx_t_4, __pyx_v_protocol); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); 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_2); __pyx_t_2 = 0;
  __pyx_v_uint_tmp = __pyx_t_5;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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:
 */
  __pyx_t_1 = __pyx_v_local_infile;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":142
 *         if charset is not None:
 *             mysql_options(self.conn,
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))             # <<<<<<<<<<<<<<
 *         if ssl is not None:
 *             self._setup_ssl_options(**ssl)
 */
    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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":143
 *             mysql_options(self.conn,
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":144
 *                 MYSQL_SET_CHARSET_NAME, PyString_AS_STRING(charset))
 *         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_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___setup_ssl_options); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), __pyx_v_ssl); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __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_4); __pyx_t_4 = 0;
    goto __pyx_L20;
  }
  __pyx_L20:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":146
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":147
 *         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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L21;
  }
  __pyx_L21:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":148
 *                 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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":149
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":150
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":151
 *         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_L22;
  }
  __pyx_L22:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":152
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":153
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":154
 *         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 = 154; __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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_connect_timeout);
  __Pyx_DECREF(__pyx_v_read_timeout);
  __Pyx_DECREF(__pyx_v_write_timeout);
  __Pyx_DECREF(__pyx_v_protocol);
  __Pyx_DECREF(__pyx_v_ssl);
  __Pyx_DECREF(__pyx_v_charset);
  __Pyx_DECREF(__pyx_v_default_cursor);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":156
 *         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__setup_ssl_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection__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;
  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");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    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 = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_key = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_key = ((char *)NULL);
    }
    if (values[1]) {
      __pyx_v_cert = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_cert) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cert = ((char *)NULL);
    }
    if (values[2]) {
      __pyx_v_ca = __Pyx_PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_ca) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":157
 * 
 *     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 = __Pyx_PyBytes_AsString(values[3]); if (unlikely((!__pyx_v_capath) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_capath = ((char *)NULL);
    }
    if (values[4]) {
      __pyx_v_cipher = __Pyx_PyBytes_AsString(values[4]); if (unlikely((!__pyx_v_cipher) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cipher = ((char *)NULL);
    }
  } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
    goto __pyx_L5_argtuple_error;
  } else {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":156
 *         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)
 */
    __pyx_v_key = ((char *)NULL);
    __pyx_v_cert = ((char *)NULL);

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":157
 * 
 *     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);
    __pyx_v_capath = ((char *)NULL);
    __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Connection._setup_ssl_options");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":158
 *     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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":160
 *         mysql_ssl_set(self.conn, key, cert, ca, capath, cipher)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """close()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_close[] = "close()\n        \n        Close the connection. The connection object and all associated cursors\n        will become unusable.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_close(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("close");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":166
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":167
 *         """
 *         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 = 167; __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 = 167; __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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":168
 *         if self.conn:
 *             self.rollback()
 *             mysql_close(self.conn)             # <<<<<<<<<<<<<<
 *             self.conn = NULL
 * 
 */
    mysql_close(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)->conn);

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":169
 *             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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":171
 *             self.conn = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             mysql_close(self.conn)
 */

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":172
 * 
 *     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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":173
 *     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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":174
 *         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_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":176
 *             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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":179
 *         # _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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":180
 *         # 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 = 180; __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 = 180; __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __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_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBytes_FromString(mysql_error(__pyx_v_self->conn)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__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, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __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_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":182
 *         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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_check_closed");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":183
 * 
 *     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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":184
 *     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 = 184; __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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_14));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __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_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection._check_closed");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":186
 *             raise ProgrammingError('connection closed')
 * 
 *     def ping(self):             # <<<<<<<<<<<<<<
 *         """ping()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_ping(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_ping[] = "ping()\n        \n        Make sure that the database connection is still open. If not, silently\n        reconnect.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_ping(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("ping");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":192
 *         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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":193
 *         """
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":194
 *         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 = 194; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":196
 *             self._raise_error()
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         """commit()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_commit(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_commit[] = "commit()\n        \n        Commit the current transaction.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_commit(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  my_bool __pyx_t_2;
  __Pyx_RefNannySetupContext("commit");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":201
 *         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 = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":202
 *         """
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":203
 *         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 = 203; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":205
 *             self._raise_error()
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         """rollback()
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_rollback(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_rollback[] = "rollback()\n        \n        Roll back the current transaction.\n        ";
static PyObject *__pyx_pf_6oursql_10Connection_rollback(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  my_bool __pyx_t_2;
  __Pyx_RefNannySetupContext("rollback");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":210
 *         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 = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":211
 *         """
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":212
 *         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 = 212; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":221
 *         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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":223
 *         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 = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":222
 *         """
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":224
 *             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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":225
 *                 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___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6oursql_10Connection_7charset___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  char *__pyx_v_svalue;
  int __pyx_r;
  int __pyx_t_1;
  char *__pyx_t_2;
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_value);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":227
 *         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 = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":228
 *             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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_svalue = __pyx_t_2;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":229
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":230
 *             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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":231
 *             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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":233
 *             self._charset = value
 * 
 *     def warning_count(self):             # <<<<<<<<<<<<<<
 *         """warning_count() -> int
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection_warning_count(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_10Connection_warning_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_warning_count(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("warning_count");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":239
 *         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 = 239; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":241
 *         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_cursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_10Connection_cursor[] = "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_cursor(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;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  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);
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cursor_class);
        if (unlikely(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 = 241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_cursor_class = values[0];
  } else {
    __pyx_v_cursor_class = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_cursor_class = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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 = 241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_AddTraceback("oursql.Connection.cursor");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_cursor_class);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":250
 *         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 = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":251
 *         """
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":252
 *         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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":253
 *         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 = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Connection.cursor");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_cursor_class);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":256
 * 
 *     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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":257
 *     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 = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":258
 *         def __get__(self):
 *             self._check_closed()
 *             return mysql_get_server_info(self.conn)             # <<<<<<<<<<<<<<
 * 
 *     property ssl_cipher:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_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 = 258; __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.Connection.server_info.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":261
 * 
 *     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;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":263
 *         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 = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":264
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":265
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":266
 *             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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":267
 *             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 = 267; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":271
 *     # 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___enter__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection___enter__(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_curs;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__enter__");
  __pyx_v_curs = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":272
 *     # 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 = 272; __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 = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_curs);
  __pyx_v_curs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":273
 *     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 = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":274
 *         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 = 274; __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 = 274; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_curs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":276
 *         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___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10Connection___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;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__exc,&__pyx_n_s__value,&__pyx_n_s__tb,0};
  __Pyx_RefNannySetupContext("__exit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    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;
    }
    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 = 276; __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 = 276; __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 = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_exc = values[0];
    __pyx_v_value = values[1];
    __pyx_v_tb = values[2];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_exc = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_tb = PyTuple_GET_ITEM(__pyx_args, 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 = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql.Connection.__exit__");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_curs = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":277
 * 
 *     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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_curs);
  __pyx_v_curs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":278
 *     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 = 278; __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 = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __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_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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_curs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":281
 * 
 *     # FML.
 *     def _escape_string(self, value):             # <<<<<<<<<<<<<<
 *         """_escape_string(value) -> str.
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection__escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6oursql_10Connection__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__escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_escape_string");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":289
 *         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 = 289; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":291
 *         return _oursqlx_escape_string(self.conn, value)
 * 
 *     def _escape_unicode_string(self, value):             # <<<<<<<<<<<<<<
 *         """_escape_unicode_stirng(value) -> unicode.
 * 
 */

static PyObject *__pyx_pf_6oursql_10Connection__escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6oursql_10Connection__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__escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_escape_unicode_string");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":298
 *         this function.
 *         """
 *         return self._escape_string(             # <<<<<<<<<<<<<<
 *             value.encode(self.charset)).decode(self.charset)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":299
 *         """
 *         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 = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":298
 *         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 = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":299
 *         """
 *         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 = 299; __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 = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; __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_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 298; __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_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 = 299; __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 = 299; __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 = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_RefNannySetupContext("__iter__");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__next__");
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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, __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(__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_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iterobj,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    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;
    }
    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;}
    }
    __pyx_v_iterobj = values[0];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_iterobj = PyTuple_GET_ITEM(__pyx_args, 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__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":32
 *         self.nextfunc = self.iterobj.next
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return self.nextfunc()
 * 
 */

static PyObject *__pyx_pf_6oursql_11IterWrapper___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_11IterWrapper___next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__next__");

  /* "/home/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fileobj,&__pyx_n_s__chunksize,&__pyx_n_s__doclose,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_8192);
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chunksize);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__doclose);
        if (unlikely(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;}
    }
    __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))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_doclose = ((int)0);
    }
  } else {
    __pyx_v_chunksize = ((PyObject *)__pyx_int_8192);
    __pyx_v_doclose = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_doclose = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_doclose == (int)-1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_chunksize = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_fileobj = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6oursql_11FileWrapper___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_11FileWrapper___next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ret;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__next__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

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

    /* "/home/habnabit/hab-bzr/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);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":69
 *         if self.done:
 *             raise StopIteration
 *         ret = self.readfunc(self.chunksize)             # <<<<<<<<<<<<<<
 *         if not ret:
 *             if self.doclose:
 */
  __pyx_t_2 = PyTuple_New(1); 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_INCREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  __Pyx_GIVEREF(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->chunksize);
  __pyx_t_3 = PyObject_Call(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->readfunc, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":72
 *         if not ret:
 *             if self.doclose:
 *                 self.fileobj.close()             # <<<<<<<<<<<<<<
 *             self.done = True
 *             raise StopIteration
 */
      __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)->fileobj, __pyx_n_s__close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; __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[4]; __pyx_lineno = 72; __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_L7;
    }
    __pyx_L7:;

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":74
 *                 self.fileobj.close()
 *             self.done = True
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.FileWrapper.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  my_bool __pyx_t_4;
  int __pyx_t_5;
  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);
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string_limit);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__show_table);
        if (unlikely(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;}
    }
    __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))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "/home/habnabit/hab-bzr/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);
    }
  } else {
    __pyx_v_string_limit = ((unsigned long)0);
    __pyx_v_show_table = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_show_table = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_show_table == (int)-1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2: __pyx_v_string_limit = __Pyx_PyInt_AsUnsignedLong(PyTuple_GET_ITEM(__pyx_args, 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;}
      case  1: __pyx_v_connection = ((struct __pyx_obj_6oursql_Connection *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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_AddTraceback("oursql._Statement.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_connection);
  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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_15));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_15));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __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_3);
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_4 = _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_4) {

    /* "/home/habnabit/hab-bzr/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_5 = ((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_5 == -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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_connection);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6oursql_10_Statement___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":116
 * 
 *     def __dealloc__(self):
 *         self.close()             # <<<<<<<<<<<<<<
 *         PyMem_Free(self.result_data)
 * 
 */
  __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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":117
 *     def __dealloc__(self):
 *         self.close()
 *         PyMem_Free(self.result_data)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  PyMem_Free(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->result_data);

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":119
 *         PyMem_Free(self.result_data)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.stmt:
 *             mysql_stmt_close(self.stmt)
 */

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":120
 * 
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":121
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":122
 *         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_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":124
 *             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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":125
 * 
 *     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/habnabit/hab-bzr/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)             # <<<<<<<<<<<<<<
 * 
 *     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 = 126; __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 = 126; __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 126; __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_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBytes_FromString(mysql_stmt_error(__pyx_v_self->stmt)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 126; __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__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, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 126; __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_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 126; __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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":128
 *         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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_check_closed");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":129
 * 
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":130
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":131
 *         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 = 131; __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 = 131; __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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":132
 *             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 = 132; __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[4]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_14));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 132; __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_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":133
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":134
 *             raise ProgrammingError('connection closed')
 *         if not self.stmt:
 *             raise ProgrammingError('statement closed')             # <<<<<<<<<<<<<<
 * 
 *     property string_limit:
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_16));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
    __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._Statement._check_closed");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":137
 * 
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":138
 *     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 = 138; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":140
 *             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___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pf_6oursql_10_Statement_12string_limit___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  unsigned long __pyx_v_value;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __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 = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._Statement.string_limit.__set__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":141
 * 
 *         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/habnabit/hab-bzr/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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_17));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 142; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":143
 *             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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.string_limit.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":145
 *             self.string_limit = value
 * 
 *     def prepare(self, statement):             # <<<<<<<<<<<<<<
 *         cdef char *buf
 *         cdef Py_ssize_t bufsize
 */

static PyObject *__pyx_pf_6oursql_10_Statement_prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement) {
  char *__pyx_v_buf;
  Py_ssize_t __pyx_v_bufsize;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("prepare");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_statement);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":148
 *         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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":149
 *         cdef Py_ssize_t bufsize
 *         self._check_closed()
 *         if self.data_waiting:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('binding this query would cause rows to '
 *                 'become unfetchable')
 */
  __pyx_t_1 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":150
 *         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 = 150; __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_18));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 150; __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_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":152
 *             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_5 = PyUnicode_Check(__pyx_v_statement);
  if (__pyx_t_5) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":153
 *                 '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_4 = PyObject_GetAttr(__pyx_v_statement, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __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[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_statement);
    __pyx_v_statement = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":154
 *         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 = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":155
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":156
 *         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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":157
 *         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 = 157; __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_AddTraceback("oursql._Statement.prepare");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_statement);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":159
 *         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;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_alloc_buffer");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_fields = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":161
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":162
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":163
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":174
 *         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":175
 *         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":177
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":178
 *         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":180
 *             return 0
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Otherwise, we (try to) allocate the result buffers.
 *             fields = mysql_num_fields(res)
 */
  /*try:*/ {
    {
      PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
      __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
      __Pyx_XGOTREF(__pyx_save_exc_type);
      __Pyx_XGOTREF(__pyx_save_exc_value);
      __Pyx_XGOTREF(__pyx_save_exc_tb);
      /*try:*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":182
 *         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_2 = PyLong_FromUnsignedLong(mysql_num_fields(__pyx_v_res)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_v_fields);
        __pyx_v_fields = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":183
 *             # 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_2 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_bind = ((MYSQL_BIND *)PyMem_Malloc(__pyx_t_4));

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":184
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":185
 *             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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_19));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
          __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_Raise(__pyx_t_2, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":186
 *             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_2 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        memset(__pyx_v_bind, 0, __pyx_t_4);

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":188
 *             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_3 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_result_data = ((struct __pyx_t_6oursql_column_output *)PyMem_Malloc(__pyx_t_4));

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":189
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":190
 *                 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
          PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_20));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
          __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_Raise(__pyx_t_3, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":191
 *             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_3 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        memset(__pyx_v_result_data, 0, __pyx_t_4);
      }
      /*else:*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":199
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":200
 *             # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":201
 *             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_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_fields); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __pyx_v_self->result_fields = __pyx_t_5;
      }
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":192
 *                 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");
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_6);

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":195
 *             # We only want to free the buffers if there was a failure and we
 *             # can't use 'em.
 *             PyMem_Free(result_data)             # <<<<<<<<<<<<<<
 *             raise
 *         else:
 */
        PyMem_Free(__pyx_v_result_data);

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":196
 *             # can't use 'em.
 *             PyMem_Free(result_data)
 *             raise             # <<<<<<<<<<<<<<
 *         else:
 *             # And we only want to save the buffers if there was no failure.
 */
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_6);
        __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0; 
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_exception_handled;
      }
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_save_exc_type);
      __Pyx_XGIVEREF(__pyx_save_exc_value);
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
      goto __pyx_L5;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_save_exc_type);
      __Pyx_XGIVEREF(__pyx_save_exc_value);
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
      __pyx_L14_try_end:;
    }
  }
  /*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_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":204
 *         finally:
 *             # But in any case, we don't need the result.
 *             mysql_free_result(res)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _bind_buffer(self) except -1:
 */
    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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("oursql._Statement._alloc_buffer");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_fields);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":206
 *             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;
  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;
  __Pyx_RefNannySetupContext("_bind_buffer");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":212
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":214
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":216
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":217
 *             # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":218
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":219
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":220
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":221
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":223
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":224
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":225
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":226
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":227
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":228
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":229
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":230
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":231
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":232
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":233
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":234
 *                     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 = 234; __pyx_clineno = __LINE__; goto __pyx_L4;}
      goto __pyx_L10;
    }
    __pyx_L10:;
  }
  /*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:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":237
 *         finally:
 *             # And clean up the result data.
 *             mysql_free_result(res)             # <<<<<<<<<<<<<<
 * 
 *     property has_result:
 */
    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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":240
 * 
 *     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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":241
 *     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 = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":242
 *         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 = 242; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":245
 * 
 *     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;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":247
 *         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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":248
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":249
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":250
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":251
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":252
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":253
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":254
 *                 self.result_data = NULL
 *                 return
 *             try:             # <<<<<<<<<<<<<<
 *                 ret = description_from_res(
 *                     res, self.result_fields, self.show_table)
 */
  /*try:*/ {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":256
 *             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 = 255; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_ret);
    __pyx_v_ret = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  /*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:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":258
 *                     res, self.result_fields, self.show_table)
 *             finally:
 *                 mysql_free_result(res)             # <<<<<<<<<<<<<<
 *             return ret
 * 
 */
    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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":259
 *             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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":262
 * 
 *     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;
  PyObject *__pyx_v_x;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_desc = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":263
 *     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 = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_desc);
  __pyx_v_desc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":264
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":265
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":266
 *             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 = 266; __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 = 0; __pyx_t_4 = __pyx_v_desc; __Pyx_INCREF(__pyx_t_4);
  } else {
    __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_desc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else {
      __pyx_t_5 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_5) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql._Statement.column_names.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_desc);
  __Pyx_DECREF(__pyx_v_x);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":268
 *             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_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_execute(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;
  PyObject *__pyx_v_temp_strings;
  PyObject *__pyx_v_o;
  PyObject *__pyx_v_s;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  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;
  unsigned PY_LONG_LONG __pyx_t_11;
  PY_LONG_LONG __pyx_t_12;
  unsigned int __pyx_t_13;
  unsigned long __pyx_t_14;
  my_bool __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  __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;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_long_strings = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_temp_strings = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_o = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":269
 * 
 *     def execute(self, *parameters):
 *         cdef char *buf = NULL             # <<<<<<<<<<<<<<
 *         cdef void *long_buffer
 *         cdef MYSQL_BIND *bind = NULL, *b
 */
  __pyx_v_buf = NULL;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":271
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":274
 *         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 = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":275
 *         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')
 */
  __pyx_t_1 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->data_waiting;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":276
 *         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 = 276; __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 = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_21));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 276; __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_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":278
 *             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(__pyx_v_parameters);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":279
 *                 '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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":280
 *         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_5 = (__pyx_v_stmt_params != __pyx_v_n_params);
  if (__pyx_t_5) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":281
 *         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":282
 *         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_3 = PyInt_FromSsize_t(__pyx_v_stmt_params); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":283
 *             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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_v_long_strings);
  __pyx_v_long_strings = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

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

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":286
 *         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":287
 *         temp_strings = []
 *         try:
 *             if n_params > 0:             # <<<<<<<<<<<<<<
 *                 buf = <char *>PyMem_Malloc(
 *                     (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params)
 */
    __pyx_t_5 = (__pyx_v_n_params > 0);
    if (__pyx_t_5) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":289
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":290
 *                 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_5 = (!(__pyx_v_buf != 0));
      if (__pyx_t_5) {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":291
 *                     (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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_23));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
        __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_6, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L8;}
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":292
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":293
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":294
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":295
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":297
 *                 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_6 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__charset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":298
 *                 # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":299
 *                 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_6 = PyTuple_GET_ITEM(__pyx_v_parameters, __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_v_o);
        __pyx_v_o = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":300
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":301
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":306
 *                     # 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_5 = (__pyx_v_o == Py_None);
        if (__pyx_t_5) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":307
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":308
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":313
 *                     # 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:
 */
        __pyx_t_1 = PyString_Check(__pyx_v_o);
        if (!__pyx_t_1) {
          __pyx_t_5 = PyUnicode_Check(__pyx_v_o);
          __pyx_t_10 = __pyx_t_5;
        } else {
          __pyx_t_10 = __pyx_t_1;
        }
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":314
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":315
 *                     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)
 */
          __pyx_t_1 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode;
          if (__pyx_t_1) {

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":316
 *                         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_6 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__encode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->_charset);
            PyTuple_SET_ITEM(__pyx_t_2, 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_4 = PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_v_o);
            __pyx_v_o = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":317
 *                         if self.conn.use_unicode:
 *                             o = o.encode(self.conn._charset)
 *                             temp_strings.append(o)             # <<<<<<<<<<<<<<
 *                         PyString_AsStringAndSize(o,
 *                             <char **>&b.buffer, &c.st)
 */
            __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L15;
          }
          __pyx_L15:;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":319
 *                             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 = 318; __pyx_clineno = __LINE__; goto __pyx_L8;}

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":320
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":321
 *                             <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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":322
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":323
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":324
 *                     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 = 324; __pyx_clineno = __LINE__; goto __pyx_L8;}

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":325
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":326
 *                         _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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":327
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":331
 *                         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":332
 *                         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":333
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":334
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":335
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":336
 *                     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_4 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_10) {

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":337
 *                         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_11 = PyLong_AsUnsignedLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __pyx_v_c->ull = __pyx_t_11;

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":338
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":339
 *                             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":341
 *                             b.is_unsigned = True
 *                         else:
 *                             c.ll = PyLong_AsLongLong(o)             # <<<<<<<<<<<<<<
 *                             b.buffer = <void *>&c.ll
 *                     elif PyFloat_Check(o):
 */
            __pyx_t_12 = PyLong_AsLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __pyx_v_c->ll = __pyx_t_12;

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":342
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":343
 *                             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":344
 *                             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":345
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":346
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":347
 *                         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":348
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":349
 *                     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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.year = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":350
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.month = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":351
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__day); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.day = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":352
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__hour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.hour = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":353
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__minute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.minute = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":354
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__second); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.second = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":355
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_14 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.second_part = __pyx_t_14;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":356
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":357
 *                         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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":358
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":359
 *                     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_4 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_c->t.year = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":360
 *                         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_4 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_c->t.month = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":361
 *                         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_4 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_c->t.day = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":362
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":363
 *                         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":364
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":365
 *                     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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__hour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.hour = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":366
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__minute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.minute = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":367
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__second); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.second = __pyx_t_13;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":368
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_14 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_c->t.second_part = __pyx_t_14;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":369
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":370
 *                         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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __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[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_o, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":371
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":372
 *                     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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_v_o);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_o);
          __Pyx_GIVEREF(__pyx_v_o);
          __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_v_o);
          __pyx_v_o = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":373
 *                         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)
 */
          __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":374
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":375
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":376
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":377
 *                         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_10 = PyObject_TypeCheck(__pyx_v_o, ((PyTypeObject *)((PyObject*)__pyx_ptype_6oursql__AbstractIterWrapper))); 
        if (__pyx_t_10) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":378
 *                         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":379
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":380
 *                         b.buffer_type = MYSQL_TYPE_STRING
 *                         b.length = &c.ul
 *                         long_strings.append((i, o))             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise TypeError('cannot bind %r object' % o.__class__)
 */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_o);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_o);
          __Pyx_GIVEREF(__pyx_v_o);
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_long_strings, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":382
 *                         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_2 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_Raise(__pyx_t_4, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          {__pyx_filename = __pyx_f[4]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8;}
        }
        __pyx_L14:;
      }
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":383
 *                     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_15 = mysql_stmt_bind_param(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt, __pyx_v_bind);
    if (__pyx_t_15) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":384
 *                         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 = 384; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":385
 *             if mysql_stmt_bind_param(self.stmt, bind):
 *                 self._raise_error()
 *             for i, o in long_strings:             # <<<<<<<<<<<<<<
 *                 # Yaay consistency.
 *                 for s in o:
 */
    if (PyList_CheckExact(__pyx_v_long_strings) || PyTuple_CheckExact(__pyx_v_long_strings)) {
      __pyx_t_7 = 0; __pyx_t_4 = __pyx_v_long_strings; __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_long_strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_4);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
      } else {
        __pyx_t_2 = PyIter_Next(__pyx_t_4);
        if (!__pyx_t_2) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
        PyObject* tuple = __pyx_t_2;
        __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6);
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_i = __pyx_t_16;
        __Pyx_DECREF(__pyx_v_o);
        __pyx_v_o = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __pyx_t_17 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_17, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_17, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_EndUnpack(__pyx_t_17) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_v_i = __pyx_t_16;
        __Pyx_DECREF(__pyx_v_o);
        __pyx_v_o = __pyx_t_3;
        __pyx_t_3 = 0;
      }

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":387
 *             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_16 = 0; __pyx_t_2 = __pyx_v_o; __Pyx_INCREF(__pyx_t_2);
      } else {
        __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
        __Pyx_GOTREF(__pyx_t_2);
      }
      for (;;) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_2)) break;
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
        } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
          if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
        } else {
          __pyx_t_3 = PyIter_Next(__pyx_t_2);
          if (!__pyx_t_3) {
            if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8;}
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_v_s);
        __pyx_v_s = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":388
 *                 # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":390
 *                     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 = 389; __pyx_clineno = __LINE__; goto __pyx_L8;}
          goto __pyx_L22;
        }
        /*else*/ {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":392
 *                             &long_buffer, &long_buffer_size)
 *                     else:
 *                         if self.conn.use_unicode:             # <<<<<<<<<<<<<<
 *                             s = s.encode(self.conn._charset)
 *                         PyString_AsStringAndSize(s,
 */
          __pyx_t_1 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn->use_unicode;
          if (__pyx_t_1) {

            /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":393
 *                     else:
 *                         if self.conn.use_unicode:
 *                             s = s.encode(self.conn._charset)             # <<<<<<<<<<<<<<
 *                         PyString_AsStringAndSize(s,
 *                             <char **>&long_buffer, &long_buffer_size)
 */
            __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__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_17 = PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L8;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_v_s);
            __pyx_v_s = __pyx_t_17;
            __pyx_t_17 = 0;
            goto __pyx_L23;
          }
          __pyx_L23:;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":395
 *                             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 = 394; __pyx_clineno = __LINE__; goto __pyx_L8;}
        }
        __pyx_L22:;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":397
 *                             <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_15 = __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_15) {

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":398
 *                     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 = 398; __pyx_clineno = __LINE__; goto __pyx_L8;}
          goto __pyx_L24;
        }
        __pyx_L24:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":399
 *                             <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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":400
 *                         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 = 400; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L25;
    }
    __pyx_L25:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":401
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":402
 *                 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 = 402; __pyx_clineno = __LINE__; goto __pyx_L8;}
      goto __pyx_L26;
    }
    __pyx_L26:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":403
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":404
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":405
 *             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_L27;
    }
    __pyx_L27:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":406
 *             if self.result_data:
 *                 self.data_waiting = True
 *             if self.conn.warning_count():             # <<<<<<<<<<<<<<
 *                 self.warnings.extend(_do_warnings_query(self.conn))
 *         finally:
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->conn), __pyx_n_s__warning_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L8;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":407
 *                 self.data_waiting = True
 *             if self.conn.warning_count():
 *                 self.warnings.extend(_do_warnings_query(self.conn))             # <<<<<<<<<<<<<<
 *         finally:
 *             PyMem_Free(buf)
 */
      __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->warnings, __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___do_warnings_query); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__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_6 = PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__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 = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, __pyx_t_17, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L28;
    }
    __pyx_L28:;
  }
  /*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_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":409
 *                 self.warnings.extend(_do_warnings_query(self.conn))
 *         finally:
 *             PyMem_Free(buf)             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
    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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("oursql._Statement.execute");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_parameters);
  __Pyx_DECREF(__pyx_v_long_strings);
  __Pyx_DECREF(__pyx_v_temp_strings);
  __Pyx_DECREF(__pyx_v_o);
  __Pyx_DECREF(__pyx_v_s);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":411
 *             PyMem_Free(buf)
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         cdef MYSQL_BIND b_tryagain
 *         cdef column_output *c
 */

static PyObject *__pyx_pf_6oursql_10_Statement_fetchone(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_fetchone(PyObject *__pyx_v_self, 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;
  PyObject *__pyx_v_val;
  PyObject *__pyx_r = NULL;
  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;
  unsigned long __pyx_t_9;
  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;
  PyObject *__pyx_t_17 = NULL;
  __Pyx_RefNannySetupContext("fetchone");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_val = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":418
 *         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 = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":419
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":420
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":421
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":422
 *             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 = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":423
 *         elif self.result_data:
 *             self._bind_buffer()
 *         result = mysql_stmt_fetch(self.stmt)             # <<<<<<<<<<<<<<
 *         self.fetched += 1
 *         if result == 1:
 */
  __pyx_v_result = mysql_stmt_fetch(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->stmt);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":424
 *             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 += 1;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":425
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":426
 *         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 = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":427
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":428
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":429
 *         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 = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":430
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":431
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":432
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":433
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":434
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":435
 *         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 = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":437
 *         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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":438
 *         # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":439
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":440
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":441
 *             c = &self.result_data[i]
 *             d = &c.buf
 *             if c.is_null:             # <<<<<<<<<<<<<<
 *                 val = None
 *             elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB,
 */
    __pyx_t_4 = __pyx_v_c->is_null;
    if (__pyx_t_4) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":442
 *             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_DECREF(__pyx_v_val);
      __pyx_v_val = Py_None;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":443
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":444
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":446
 *                     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_DECREF(__pyx_v_val);
      __pyx_v_val = Py_None;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":449
 *                 # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":450
 *                 # 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 = 450; __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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":454
 *                 # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":455
 *                 # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":456
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":458
 *                         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 = 458; __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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":461
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":462
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":463
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":464
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":468
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":470
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":471
 *                     # 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 = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":474
 *                 # 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.
 */
      __pyx_t_9 = ((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)->string_limit;
      if (__pyx_t_9) {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":477
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":478
 *                     # 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 = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = PyLong_FromUnsignedLong(__pyx_v_c->length); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self);
          __Pyx_GIVEREF(__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_10);
          __pyx_t_5 = 0;
          __pyx_t_10 = 0;
          __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultStringStream)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":479
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":484
 *                     # interface.
 *                     else:
 *                         val = cStringIO.StringIO(val)             # <<<<<<<<<<<<<<
 *                     # And if we're decoding unicode, decode unicode in a
 *                     # streaming fashion!
 */
          __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__cStringIO); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__StringIO); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          __pyx_t_5 = PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_5;
          __pyx_t_5 = 0;
        }
        __pyx_L15:;

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":487
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":488
 *                     # 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 = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__getreader); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __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 = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__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_11 = PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __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 = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__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_10 = PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_10;
          __pyx_t_10 = 0;
          goto __pyx_L16;
        }
        __pyx_L16:;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":493
 *                     # 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":494
 *                     # 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_10 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__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_11 = PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_11;
          __pyx_t_11 = 0;
          goto __pyx_L17;
        }
        __pyx_L17:;
      }
      __pyx_L14:;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":495
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":496
 *                         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))
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 */
      __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__Decimal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":497
 *             elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL):
 *                 val = decimal.Decimal(
 *                     PyString_FromStringAndSize(d.dec, c.length))             # <<<<<<<<<<<<<<
 *             elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP):
 *                 val = datetime.datetime(d.t.year, d.t.month, d.t.day,
 */
      __pyx_t_11 = PyString_FromStringAndSize(__pyx_v_d->dec, __pyx_v_c->length); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyTuple_New(1); 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);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":498
 *                 val = decimal.Decimal(
 *                     PyString_FromStringAndSize(d.dec, c.length))
 *             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_2 = ((int)(__pyx_t_7 == MYSQL_TYPE_TIMESTAMP));
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_3;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":499
 *                     PyString_FromStringAndSize(d.dec, c.length))
 *             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_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__datetime); 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_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyLong_FromUnsignedLong(__pyx_v_d->t.year); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_d->t.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = PyLong_FromUnsignedLong(__pyx_v_d->t.day); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":500
 *             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_13 = PyLong_FromUnsignedLong(__pyx_v_d->t.hour); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyLong_FromUnsignedLong(__pyx_v_d->t.minute); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.second); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = PyLong_FromUnsignedLong(__pyx_v_d->t.second_part); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_t_11 = 0;
      __pyx_t_5 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
      __pyx_t_16 = PyObject_Call(__pyx_t_10, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":501
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":502
 *                     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_16 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__date); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = PyLong_FromUnsignedLong(__pyx_v_d->t.year); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_10 = PyLong_FromUnsignedLong(__pyx_v_d->t.month); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.day); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_16 = 0;
      __pyx_t_10 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_t_17, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":503
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":504
 *                 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_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":505
 *             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_15 = PyLong_FromUnsignedLong(__pyx_v_d->t.hour); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_17 = PyLong_FromUnsignedLong(__pyx_v_d->t.minute); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_10 = PyLong_FromUnsignedLong(__pyx_v_d->t.second); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_16 = PyLong_FromUnsignedLong(__pyx_v_d->t.second_part); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_t_15 = 0;
      __pyx_t_17 = 0;
      __pyx_t_10 = 0;
      __pyx_t_16 = 0;
      __pyx_t_16 = PyObject_Call(__pyx_t_14, __pyx_t_13, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":506
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":507
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":508
 *             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_16 = PyLong_FromUnsignedLong(__pyx_v_d->u8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":510
 *                     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_16 = PyLong_FromLong(__pyx_v_d->s8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
      }
      __pyx_L18:;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":511
 *                 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_3 = ((int)(__pyx_t_7 == MYSQL_TYPE_YEAR));
      __pyx_t_2 = __pyx_t_3;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_2;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":512
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":513
 *             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_16 = PyLong_FromUnsignedLong(__pyx_v_d->u16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":515
 *                     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_16 = PyLong_FromLong(__pyx_v_d->s16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
      }
      __pyx_L19:;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":516
 *                 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_2 = ((int)(__pyx_t_7 == MYSQL_TYPE_INT24));
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_3;
    if (__pyx_t_8) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":517
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":518
 *             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_16 = PyLong_FromUnsignedLong(__pyx_v_d->u32); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":520
 *                     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_16 = PyLong_FromLong(__pyx_v_d->s32); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
      }
      __pyx_L20:;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":521
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":522
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":523
 *             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_16 = PyLong_FromUnsignedLongLong(__pyx_v_d->u64); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":525
 *                     val = PyLong_FromUnsignedLongLong(d.u64)
 *                 else:
 *                     val = PyLong_FromLongLong(d.s64)             # <<<<<<<<<<<<<<
 *             elif c.type == MYSQL_TYPE_FLOAT:
 *                 val = d.f
 */
        __pyx_t_16 = PyLong_FromLongLong(__pyx_v_d->s64); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_16;
        __pyx_t_16 = 0;
      }
      __pyx_L21:;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":526
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":527
 *                     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_16 = PyFloat_FromDouble(__pyx_v_d->f); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":528
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":529
 *                 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_16 = PyFloat_FromDouble(__pyx_v_d->d); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;
      goto __pyx_L11;
    }

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":530
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":535
 *                 # 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_16 = PyLong_FromUnsignedLong(__pyx_f_6oursql_bitval_from_char_p(((unsigned char *)(&__pyx_v_d->c)), __pyx_v_c->length)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":537
 *                 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_16 = PyString_FromStringAndSize((&__pyx_v_d->c), __pyx_v_c->length); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_16;
      __pyx_t_16 = 0;

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":538
 *             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_16 = __Pyx_GetName(__pyx_m, __pyx_n_s__Warning); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_1 = PyErr_WarnEx(__pyx_t_16, __pyx_k_25, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __pyx_L11:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":539
 *                 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' % (
 */
    __pyx_t_4 = __pyx_v_c->error;
    if (__pyx_t_4) {

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":541
 *             if c.error:
 *                 # This *shouldn't* ever happen.
 *                 raise InterfaceError('truncated column %d, type %d' % (             # <<<<<<<<<<<<<<
 *                     i, c.type))
 *             Py_INCREF(val)
 */
      __pyx_t_16 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);

      /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":542
 *                 # 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_13 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyInt_FromLong(__pyx_v_c->type); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_26), __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_16, __pyx_t_10, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_14, 0, 0);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":543
 *                 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":544
 *                     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":545
 *             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_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_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("oursql._Statement.fetchone");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_val);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":547
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         # buffer_results() calls _check_closed()
 *         self.buffer_results()
 */

static PyObject *__pyx_pf_6oursql_10_Statement_fetchall(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_fetchall(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":549
 *     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 = 549; __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 = 549; __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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":550
 *         # 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 = 550; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":552
 *         return PySequence_List(self)
 * 
 *     def buffer_results(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         if not self.buffered:
 */

static PyObject *__pyx_pf_6oursql_10_Statement_buffer_results(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_buffer_results(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("buffer_results");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":553
 * 
 *     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 = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":554
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":555
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":556
 *         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 = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":557
 *             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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":559
 *             self.buffered = True
 * 
 *     def nextset(self):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

static PyObject *__pyx_pf_6oursql_10_Statement_nextset(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement_nextset(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("nextset");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":560
 * 
 *     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 = 560; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":562
 *         return False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PyCallIter_New(self.fetchone, None)
 */

static PyObject *__pyx_pf_6oursql_10_Statement___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_Statement___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":563
 * 
 *     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 = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":564
 *     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 = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":567
 * 
 *     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;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":569
 *         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 = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":570
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":571
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":572
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":574
 *                 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 = 574; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":577
 * 
 *     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;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":579
 *         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 = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":580
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":581
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":582
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":584
 *                 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 = 584; __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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":587
 * 
 *     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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":588
 *     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 = 588; __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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":590
 *             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___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pf_6oursql_10_Statement_13prefetch_rows___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  unsigned long __pyx_v_value;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  my_bool __pyx_t_4;
  int __pyx_t_5;
  __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 = 590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":591
 * 
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":592
 *         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 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_27));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 592; __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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":593
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":595
 *             self._prefetch_rows = value
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 *                     &self._prefetch_rows):             # <<<<<<<<<<<<<<
 *                 self._raise_error()
 * 
 */
  __pyx_t_4 = _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_4) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":596
 *             if _oursqlx_stmt_set_prefetch_rows(self.stmt,
 *                     &self._prefetch_rows):
 *                 self._raise_error()             # <<<<<<<<<<<<<<
 * 
 * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement),
 */
    __pyx_t_5 = ((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_5 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":617
 *     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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stmt,&__pyx_n_s__index,&__pyx_n_s__length,0};
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    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;
    }
    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 = 617; __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 = 617; __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 = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __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 = 617; __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 = 618; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_stmt = ((struct __pyx_obj_6oursql__Statement *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_index = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_index == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_length = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 618; __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 = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._ResultStringStream.__cinit__");
  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 = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":619
 *     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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":620
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":621
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":622
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":623
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":624
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":625
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":626
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":627
 *         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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":629
 *         self.done = False
 * 
 *     def read(self, Py_ssize_t size=-1):             # <<<<<<<<<<<<<<
 *         """read(size=-1) -> str
 * 
 */

static PyObject *__pyx_pf_6oursql_19_ResultStringStream_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_19_ResultStringStream_read[] = "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_read(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;
  PyObject *__pyx_r = NULL;
  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_t_6;
  int __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
  __Pyx_RefNannySetupContext("read");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
        if (unlikely(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 = 629; __pyx_clineno = __LINE__; goto __pyx_L3_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 = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_size = ((Py_ssize_t)-1);
    }
  } else {
    __pyx_v_size = ((Py_ssize_t)-1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_size = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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 = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("oursql._ResultStringStream.read");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":636
 *         """
 *         cdef Py_ssize_t left
 *         if self.done:             # <<<<<<<<<<<<<<
 *             return ''
 *         self.stmt._check_closed()
 */
  __pyx_t_1 = ((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)->done;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":637
 *         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_28));
    __pyx_r = ((PyObject *)__pyx_kp_s_28);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":638
 *         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 = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":639
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":640
 *         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 = 640; __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[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_29));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
    __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":641
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":642
 *             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_6 = (__pyx_v_size > __pyx_v_left);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_2;
  }
  if (__pyx_t_7) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":643
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":644
 *         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_7 = (__pyx_v_size < 0);
  if (__pyx_t_7) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":645
 *             size = left
 *         elif size < 0:
 *             raise ValueError("can't read negative bytes")             # <<<<<<<<<<<<<<
 *         ret = PyString_FromStringAndSize(NULL, size)
 *         self.bind.buffer_length = size
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_30));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":646
 *         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 = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":647
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":648
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":650
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":651
 *         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 = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":652
 *                 &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 += __pyx_v_size;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":653
 *             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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":654
 *         self.offset += size
 *         left = self.length - self.offset
 *         assert left >= 0, 'size remaining should be >= 0'             # <<<<<<<<<<<<<<
 *         if left == 0:
 *             self.done = True
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_left >= 0))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_31));
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":655
 *         left = self.length - self.offset
 *         assert left >= 0, 'size remaining should be >= 0'
 *         if left == 0:             # <<<<<<<<<<<<<<
 *             self.done = True
 *         return ret
 */
  __pyx_t_7 = (__pyx_v_left == 0);
  if (__pyx_t_7) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":656
 *         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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":657
 *         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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql._ResultStringStream.read");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  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);
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__show_table);
        if (unlikely(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;}
    }
    __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))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_show_table = ((int)0);
    }
  } else {
    __pyx_v_show_table = ((int)0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_show_table = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_show_table == (int)-1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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_AddTraceback("oursql._ResultSet.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_conn);
  __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
  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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = mysql_store_result(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->conn);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/query.pyx":42
 *             self.lastrowid = res
 * 
 *         if self.fields:             # <<<<<<<<<<<<<<
 *             self.description = description_from_res(
 *                 self.res, self.fields, self.show_table)
 */
  __pyx_t_6 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->fields;
  if (__pyx_t_6) {

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_7 = 0; __pyx_t_8 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description; __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_7 = -1; __pyx_t_8 = PyObject_GetIter(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->description); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_8)) break;
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_8))) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
      } else {
        __pyx_t_9 = PyIter_Next(__pyx_t_8);
        if (!__pyx_t_9) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__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);
      __pyx_t_1 = PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_9); if (unlikely(__pyx_t_1)) {__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_8); __pyx_t_8 = 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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); 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_8); __pyx_t_8 = 0;
  if (__pyx_t_4) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":52
 * 
 *         if self.conn.warning_count():
 *             self.warnings = _do_warnings_query(self.conn)             # <<<<<<<<<<<<<<
 *         else:
 *             self.warnings = []
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s___do_warnings_query); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __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(__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_8, __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_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__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/habnabit/hab-bzr/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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("oursql._ResultSet.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_DECREF(__pyx_v_d);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_conn);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":56
 *             self.warnings = []
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

static void __pyx_pf_6oursql_10_ResultSet___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6oursql_10_ResultSet___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/habnabit/hab-bzr/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_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "/home/habnabit/hab-bzr/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_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_close(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_check_closed");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_14));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_14));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __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_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/query.pyx":73
 *             raise ProgrammingError('connection closed')
 *         if not self.res:
 *             raise ProgrammingError('query closed')             # <<<<<<<<<<<<<<
 * 
 *     property has_result:
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_32));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_32));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
    __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, 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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._ResultSet._check_closed");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_fetchone(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_fetchone(PyObject *__pyx_v_self, PyObject *unused) {
  MYSQL_ROW __pyx_v_row;
  unsigned int __pyx_v_i;
  unsigned long *__pyx_v_lengths;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_d;
  PyObject *__pyx_v_field_type;
  PyObject *__pyx_v_flags;
  PyObject *__pyx_v_charsetnr;
  PyObject *__pyx_v_converter;
  PyObject *__pyx_r = NULL;
  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;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("fetchone");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_field_type = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_flags = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_charsetnr = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_converter = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = mysql_fetch_row(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->res);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_d);
      __pyx_v_d = Py_None;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_d);
      __pyx_v_d = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/home/habnabit/hab-bzr/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 (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 3)) {
        PyObject* tuple = __pyx_t_3;
        __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_v_field_type);
        __pyx_v_field_type = __pyx_t_5;
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_flags);
        __pyx_v_flags = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_charsetnr);
        __pyx_v_charsetnr = __pyx_t_7;
        __pyx_t_7 = 0;
      } else {
        __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_5 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_EndUnpack(__pyx_t_8) < 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;
        __Pyx_DECREF(__pyx_v_field_type);
        __pyx_v_field_type = __pyx_t_5;
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_flags);
        __pyx_v_flags = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_charsetnr);
        __pyx_v_charsetnr = __pyx_t_7;
        __pyx_t_7 = 0;
      }

      /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_converter);
      __pyx_v_converter = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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(__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, __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(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_d);
        __pyx_v_d = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L10;
      }

      /* "/home/habnabit/hab-bzr/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)
 */
      __pyx_t_1 = ((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)->conn->use_unicode;
      if (__pyx_t_1) {
        __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_9 = __pyx_t_2;
      } else {
        __pyx_t_9 = __pyx_t_1;
      }
      if (__pyx_t_9) {

        /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_d);
        __pyx_v_d = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __pyx_L9:;

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_d);
  __Pyx_DECREF(__pyx_v_field_type);
  __Pyx_DECREF(__pyx_v_flags);
  __Pyx_DECREF(__pyx_v_charsetnr);
  __Pyx_DECREF(__pyx_v_converter);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":108
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         self._check_closed()
 *         return PySequence_List(self)
 */

static PyObject *__pyx_pf_6oursql_10_ResultSet_fetchall(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet_fetchall(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_10_ResultSet___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql._ResultSet.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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)); __Pyx_GOTREF(__pyx_v_a);

    if (unlikely(!__pyx_v_a)) {
      __Pyx_DECREF(__pyx_v_kw);
      return -1;
    }
  } else {
    __pyx_v_a = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    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;}
    }
    __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]);
    __pyx_v_query = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_query = PyTuple_GET_ITEM(__pyx_args, 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_DECREF(__pyx_v_kw);
  __Pyx_AddTraceback("oursql._Query.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF((PyObject *)__pyx_v_conn);
  __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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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(__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, __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(__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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = mysql_real_query(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn->conn, __pyx_v_qstr, __pyx_v_qlen);
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = __pyx_v_a;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = __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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_a);
  __Pyx_DECREF(__pyx_v_kw);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF((PyObject *)__pyx_v_conn);
  __Pyx_DECREF(__pyx_v_query);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_new_result(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_new_result(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_res;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("new_result");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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(__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(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, __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(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_raise_error");

  /* "/home/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_nextset(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_nextset(PyObject *__pyx_v_self, PyObject *unused) {
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("nextset");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":162
 *         return False
 * 
 *         if not self.result:             # <<<<<<<<<<<<<<
 *             return False
 *         self.result.close()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":163
 * 
 *         if not self.result:
 *             return False             # <<<<<<<<<<<<<<
 *         self.result.close()
 *         res = mysql_next_result(self.conn.conn)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":164
 *         if not self.result:
 *             return False
 *         self.result.close()             # <<<<<<<<<<<<<<
 *         res = mysql_next_result(self.conn.conn)
 *         if res > 0:
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->result, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":165
 *             return False
 *         self.result.close()
 *         res = mysql_next_result(self.conn.conn)             # <<<<<<<<<<<<<<
 *         if res > 0:
 *             self._raise_error()
 */
  __pyx_v_res = mysql_next_result(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)->conn->conn);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":166
 *         self.result.close()
 *         res = mysql_next_result(self.conn.conn)
 *         if res > 0:             # <<<<<<<<<<<<<<
 *             self._raise_error()
 *         elif res == -1:
 */
  __pyx_t_3 = (__pyx_v_res > 0);
  if (__pyx_t_3) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":167
 *         res = mysql_next_result(self.conn.conn)
 *         if res > 0:
 *             self._raise_error()             # <<<<<<<<<<<<<<
 *         elif res == -1:
 *             self.result = None
 */
    __pyx_t_5 = ((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_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":168
 *         if res > 0:
 *             self._raise_error()
 *         elif res == -1:             # <<<<<<<<<<<<<<
 *             self.result = None
 *             return False
 */
  __pyx_t_3 = (__pyx_v_res == -1);
  if (__pyx_t_3) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":169
 *             self._raise_error()
 *         elif res == -1:
 *             self.result = None             # <<<<<<<<<<<<<<
 *             return False
 *         elif res == 0:
 */
    __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/habnabit/hab-bzr/oursql/oursqlx/query.pyx":170
 *         elif res == -1:
 *             self.result = None
 *             return False             # <<<<<<<<<<<<<<
 *         elif res == 0:
 *             self.new_result()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":171
 *             self.result = None
 *             return False
 *         elif res == 0:             # <<<<<<<<<<<<<<
 *             self.new_result()
 *             return True
 */
  __pyx_t_3 = (__pyx_v_res == 0);
  if (__pyx_t_3) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":172
 *             return False
 *         elif res == 0:
 *             self.new_result()             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__new_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":173
 *         elif res == 0:
 *             self.new_result()
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._Query.nextset");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_fetchone(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_fetchone(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_row;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fetchone");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_row = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_row);
      __pyx_v_row = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_row);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/query.pyx":184
 *         return None
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return PyCallIter_New(self.fetchone, None)
 * 
 */

static PyObject *__pyx_pf_6oursql_6_Query___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/habnabit/hab-bzr/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 = PyCallIter_New(__pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_AddTraceback("oursql._Query.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_fetchall(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6_Query_fetchall(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("fetchall");

  /* "/home/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  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);
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__try_plain_query);
        if (unlikely(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;}
    }
    __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))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_try_plain_query = ((int)1);
    }
  } else {
    __pyx_v_try_plain_query = ((int)1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_try_plain_query = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_try_plain_query == (int)-1))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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_AddTraceback("oursql.Cursor.__cinit__");
  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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":41
 *             **kwargs):
 *         self.conn = conn
 *         self._stmt_kwargs = kwargs             # <<<<<<<<<<<<<<
 *         self._statements = collections.deque()
 *         self.messages = []
 */
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__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 = __pyx_v_kwargs;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_check_closed");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_14));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_14));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __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_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":52
 *         if not self.conn.conn:
 *             raise ProgrammingError('connection closed')
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ProgrammingError('cursor closed')
 * 
 */
  __pyx_t_5 = __pyx_v_self->closed;
  if (__pyx_t_5) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":53
 *             raise ProgrammingError('connection closed')
 *         if self.closed:
 *             raise ProgrammingError('cursor closed')             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_33));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_33));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33));
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, 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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql.Cursor._check_closed");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":55
 *             raise ProgrammingError('cursor closed')
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """close()
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_close[] = "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_close(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("close");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__new_statement(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor__new_statement(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_stmt;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_new_statement");
  __pyx_v_stmt = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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(__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 = PyEval_CallObjectWithKeywords(__pyx_t_1, __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(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_stmt);
  __pyx_v_stmt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_stmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor__new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_new_query");

  /* "/home/habnabit/hab-bzr/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(__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 = PyEval_CallObjectWithKeywords(__pyx_t_1, __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(__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_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_callproc[] = "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_callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_procname = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__procname,&__pyx_n_s__params,0};
  __Pyx_RefNannySetupContext("callproc");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_empty_tuple);
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__params);
        if (unlikely(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;}
    }
    __pyx_v_procname = values[0];
    __pyx_v_params = values[1];
  } else {
    __pyx_v_params = ((PyObject *)__pyx_empty_tuple);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_params = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_procname = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __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_Raise(__pyx_t_3, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.callproc");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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__do_autoping(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor__do_autoping(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_do_autoping");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":85
 * 
 *     def _do_autoping(self):
 *         if self.conn.autoping:             # <<<<<<<<<<<<<<
 *             self.conn.ping()
 * 
 */
  __pyx_t_1 = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn->autoping;
  if (__pyx_t_1) {

    /* "/home/habnabit/hab-bzr/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_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->conn), __pyx_n_s__ping); 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_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 86; __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_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.Cursor._do_autoping");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_execute[] = "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_execute(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;
  PyObject *__pyx_v_e;
  PyObject *__pyx_r = NULL;
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__query,&__pyx_n_s__params,&__pyx_n_s__plain_query,0};
  __Pyx_RefNannySetupContext("execute");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_empty_tuple);
    values[2] = __pyx_k_35;
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__params);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__plain_query);
        if (unlikely(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;}
    }
    __pyx_v_query = values[0];
    __pyx_v_params = values[1];
    __pyx_v_plain_query = values[2];
  } else {
    __pyx_v_params = ((PyObject *)__pyx_empty_tuple);
    __pyx_v_plain_query = __pyx_k_35;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_plain_query = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_params = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_query = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_INCREF(__pyx_v_params);
  __Pyx_INCREF(__pyx_v_plain_query);
  __pyx_v_stmt = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_e = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_36));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_36));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
      __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[6]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/habnabit/hab-bzr/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_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___new_query); 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_t_2 = PyTuple_New(1); 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_INCREF(__pyx_v_query);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_query);
    __Pyx_GIVEREF(__pyx_v_query);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_stmt);
    __pyx_v_stmt = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":109
 *             stmt = self._new_query(query)
 *         else:
 *             stmt = self._new_statement()             # <<<<<<<<<<<<<<
 *             try:
 *                 stmt.prepare(query)
 */
    __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 = 109; __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_stmt);
    __pyx_v_stmt = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":110
 *         else:
 *             stmt = self._new_statement()
 *             try:             # <<<<<<<<<<<<<<
 *                 stmt.prepare(query)
 *             except Error, e:
 */
    {
      PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
      __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
      __Pyx_XGOTREF(__pyx_save_exc_type);
      __Pyx_XGOTREF(__pyx_save_exc_value);
      __Pyx_XGOTREF(__pyx_save_exc_tb);
      /*try:*/ {

        /* "/home/habnabit/hab-bzr/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_2 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__prepare); 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_t_3 = PyTuple_New(1); 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_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, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __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;
      }
      /*else:*/ {

        /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":122
 *                     raise
 *             else:
 *                 stmt.execute(*params)             # <<<<<<<<<<<<<<
 *         self._update_fields(stmt)
 * 
 */
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__execute); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/habnabit/hab-bzr/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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyErr_ExceptionMatches(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {
        __Pyx_AddTraceback("oursql.Cursor.execute");
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_v_e);
        __pyx_v_e = __pyx_t_3;

        /* "/home/habnabit/hab-bzr/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:
 */
        __pyx_t_1 = ((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)->try_plain_query;
        if (__pyx_t_1) {
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PyInt_FromLong(ER_UNSUPPORTED_PS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); 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_8); __pyx_t_8 = 0;
          __pyx_t_9 = __pyx_t_4;
        } else {
          __pyx_t_9 = __pyx_t_1;
        }
        if (__pyx_t_9) {

          /* "/home/habnabit/hab-bzr/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_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__execute); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_query);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_query);
          __Pyx_GIVEREF(__pyx_v_query);
          __Pyx_INCREF(__pyx_v_params);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params);
          __Pyx_GIVEREF(__pyx_v_params);
          __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
          __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__plain_query), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":120
 *                     return self.execute(query, params, plain_query=True)
 *                 else:
 *                     raise             # <<<<<<<<<<<<<<
 *             else:
 *                 stmt.execute(*params)
 */
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5);
          __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_5);
          __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; 
          {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        }
        __pyx_L18:;
        __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_L9_exception_handled;
      }
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_save_exc_type);
      __Pyx_XGIVEREF(__pyx_save_exc_value);
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
      goto __pyx_L1_error;
      __pyx_L11_except_return:;
      __Pyx_XGIVEREF(__pyx_save_exc_type);
      __Pyx_XGIVEREF(__pyx_save_exc_value);
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
      goto __pyx_L0;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_save_exc_type);
      __Pyx_XGIVEREF(__pyx_save_exc_value);
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
      __pyx_L15_try_end:;
    }
  }
  __pyx_L6:;

  /* "/home/habnabit/hab-bzr/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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("oursql.Cursor.execute");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_stmt);
  __Pyx_DECREF(__pyx_v_e);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_query);
  __Pyx_DECREF(__pyx_v_params);
  __Pyx_DECREF(__pyx_v_plain_query);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":125
 *         self._update_fields(stmt)
 * 
 *     def executemany(self, query, parambatch):             # <<<<<<<<<<<<<<
 *         """executemany(query, parambatch)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_executemany[] = "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_executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_parambatch = 0;
  PyObject *__pyx_v_stmt;
  PyObject *__pyx_v_rowcount;
  PyObject *__pyx_v_params;
  PyObject *__pyx_r = NULL;
  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 = NULL;
  int __pyx_t_7;
  struct __pyx_opt_args_6oursql_6Cursor__update_fields __pyx_t_8;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__query,&__pyx_n_s__parambatch,0};
  __Pyx_RefNannySetupContext("executemany");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    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;}
    }
    __pyx_v_query = values[0];
    __pyx_v_parambatch = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_query = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_parambatch = PyTuple_GET_ITEM(__pyx_args, 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");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_INCREF(__pyx_v_parambatch);
  __pyx_v_stmt = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_rowcount = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_params = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_stmt);
  __pyx_v_stmt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_rowcount);
  __pyx_v_rowcount = __pyx_int_0;

  /* "/home/habnabit/hab-bzr/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_5 = 0; __pyx_t_4 = __pyx_v_parambatch; __Pyx_INCREF(__pyx_t_4);
  } 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);
  }
  for (;;) {
    if (likely(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 (likely(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 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_v_params);
    __pyx_v_params = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/habnabit/hab-bzr/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_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/habnabit/hab-bzr/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 < -1:
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_stmt, __pyx_n_s__rowcount); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_rowcount, __pyx_t_6); 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_6); __pyx_t_6 = 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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":143
 *             rowcount += stmt.rowcount
 *         # Whatevs.
 *         if rowcount < -1:             # <<<<<<<<<<<<<<
 *             rowcount = -1
 *         self._update_fields(stmt, rowcount)
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_rowcount, __pyx_int_neg_1, 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_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 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_7) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":144
 *         # Whatevs.
 *         if rowcount < -1:
 *             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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":145
 *         if rowcount < -1:
 *             rowcount = -1
 *         self._update_fields(stmt, rowcount)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _update_fields(self, stmt, rowcount=None) except -1:
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.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_8); 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_6);
  __Pyx_AddTraceback("oursql.Cursor.executemany");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_stmt);
  __Pyx_DECREF(__pyx_v_rowcount);
  __Pyx_DECREF(__pyx_v_params);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_query);
  __Pyx_DECREF(__pyx_v_parambatch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_update_fields");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_rowcount = __pyx_optional_args->rowcount;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_stmt);
  __Pyx_INCREF(__pyx_v_rowcount);

  /* "/home/habnabit/hab-bzr/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(__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, __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(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_stmt);
  __Pyx_DECREF(__pyx_v_rowcount);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_check_statements");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_37));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_37));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37));
    __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("oursql.Cursor._check_statements");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":163
 *             raise ProgrammingError('no results available')
 * 
 *     def nextset(self):             # <<<<<<<<<<<<<<
 *         """nextset() -> True or None.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_nextset(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_nextset[] = "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_nextset(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("nextset");
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":176
 *         return True if self._statements else None
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         """fetchone() -> row.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_fetchone(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_fetchone[] = "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_fetchone(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_ret;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("fetchone");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_fetchmany[] = "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_fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  unsigned int __pyx_v_i;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_resultset;
  PyObject *__pyx_v_row;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
  __Pyx_RefNannySetupContext("fetchmany");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
        if (unlikely(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;}
    }
    __pyx_v_size = values[0];
  } else {
    __pyx_v_size = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_size);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_resultset = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_row = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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_DECREF(__pyx_v_resultset);
  __pyx_v_resultset = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_row);
    __pyx_v_row = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":214
 *                 if i == 0:
 *                     self.nextset()
 *                 return ret             # <<<<<<<<<<<<<<
 *             ret.append(row)
 *         return ret
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_ret);
      __pyx_r = __pyx_v_ret;
      goto __pyx_L0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":215
 *                     self.nextset()
 *                 return ret
 *             ret.append(row)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_v_row); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":216
 *                 return ret
 *             ret.append(row)
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.fetchmany");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF(__pyx_v_resultset);
  __Pyx_DECREF(__pyx_v_row);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_size);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":218
 *         return ret
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         """fetchall() -> list of rows.
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_fetchall(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6oursql_6Cursor_fetchall[] = "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_fetchall(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_ret;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("fetchall");
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":228
 *         ret = []
 *         while self._statements:
 *             ret.extend(self._statements.popleft().fetchall())             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__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(__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, __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(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "/home/habnabit/hab-bzr/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(__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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("oursql.Cursor.fetchall");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("oursql.Cursor.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/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_RefNannySetupContext("__get__");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":239
 *             return self.conn
 * 
 *     def setinputsizes(self, sizes):             # <<<<<<<<<<<<<<
 *         """setinputsizes(sizes)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes); /*proto*/
static char __pyx_doc_6oursql_6Cursor_setinputsizes[] = "setinputsizes(sizes)\n        \n        Do nothing; this operation is not supported by oursql.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("setinputsizes");

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

/* "/home/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":248
 *         pass
 * 
 *     def setoutputsize(self, size, column=None):             # <<<<<<<<<<<<<<
 *         """setoutputsize(size, column=None)
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor_setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6oursql_6Cursor_setoutputsize[] = "setoutputsize(size, column=None)\n        \n        Do nothing; this operation is not supported by oursql.\n        ";
static PyObject *__pyx_pf_6oursql_6Cursor_setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__column,0};
  __Pyx_RefNannySetupContext("setoutputsize");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    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;
    }
    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 > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
        if (unlikely(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;}
    }
    __pyx_v_size = values[0];
    __pyx_v_column = values[1];
  } else {
    __pyx_v_column = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_column = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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");
  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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":255
 *         pass
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_6oursql_6Cursor___enter__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor___enter__(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__enter__");

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":258
 *         return self
 * 
 *     def __exit__(self, exc, value, tb):             # <<<<<<<<<<<<<<
 *         if exc:
 *             self.conn.rollback()
 */

static PyObject *__pyx_pf_6oursql_6Cursor___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6oursql_6Cursor___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;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__exc,&__pyx_n_s__value,&__pyx_n_s__tb,0};
  __Pyx_RefNannySetupContext("__exit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    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;
    }
    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;}
    }
    __pyx_v_exc = values[0];
    __pyx_v_value = values[1];
    __pyx_v_tb = values[2];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_exc = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_tb = PyTuple_GET_ITEM(__pyx_args, 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__");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_v_exc);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_INCREF(__pyx_v_tb);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_self);
  __Pyx_DECREF(__pyx_v_exc);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_DECREF(__pyx_v_tb);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyFrozenSet_Type)), __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(__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_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__richcmp__");
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_other);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;
  }

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/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*/ {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":109
 *         else:
 *             raise TypeError('unorderable types: %r and %r' % (
 *                 type(self), type(other)))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_2 = ((PyObject *)__Pyx_Type(__pyx_v_self)); 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_t_3 = ((PyObject *)__Pyx_Type(__pyx_v_other)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), __pyx_t_4); 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(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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_builtin_TypeError, __pyx_t_4, 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(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("oursql._DBAPITypeObject.__richcmp__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_self);
  __Pyx_DECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/habnabit/hab-bzr/oursql/oursqlx/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___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":112
 * 
 *     def __repr__(self):
 *         return '<_DBAPITypeObject representing %r at %#x>' % (             # <<<<<<<<<<<<<<
 *             self.values, id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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, __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(__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(__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_39), __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(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_AddTraceback("oursql._DBAPITypeObject.__repr__");
  __pyx_r = NULL;
  __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___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___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 struct PyMethodDef __pyx_methods_6oursql_Connection[] = {
  {__Pyx_NAMESTR("_setup_ssl_options"), (PyCFunction)__pyx_pf_6oursql_10Connection__setup_ssl_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10Connection_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_close)},
  {__Pyx_NAMESTR("ping"), (PyCFunction)__pyx_pf_6oursql_10Connection_ping, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_ping)},
  {__Pyx_NAMESTR("commit"), (PyCFunction)__pyx_pf_6oursql_10Connection_commit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_commit)},
  {__Pyx_NAMESTR("rollback"), (PyCFunction)__pyx_pf_6oursql_10Connection_rollback, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_rollback)},
  {__Pyx_NAMESTR("warning_count"), (PyCFunction)__pyx_pf_6oursql_10Connection_warning_count, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_warning_count)},
  {__Pyx_NAMESTR("cursor"), (PyCFunction)__pyx_pf_6oursql_10Connection_cursor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection_cursor)},
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6oursql_10Connection___enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6oursql_10Connection___exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_escape_string"), (PyCFunction)__pyx_pf_6oursql_10Connection__escape_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection__escape_string)},
  {__Pyx_NAMESTR("_escape_unicode_string"), (PyCFunction)__pyx_pf_6oursql_10Connection__escape_unicode_string, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_10Connection__escape_unicode_string)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql_Connection[] = {
  {(char *)"use_unicode", T_INT, offsetof(struct __pyx_obj_6oursql_Connection, use_unicode), READONLY, 0},
  {(char *)"autoping", T_INT, offsetof(struct __pyx_obj_6oursql_Connection, autoping), READONLY, 0},
  {(char *)"raise_on_warnings", T_INT, offsetof(struct __pyx_obj_6oursql_Connection, raise_on_warnings), READONLY, 0},
  {(char *)"default_cursor", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Connection, default_cursor), 0, 0},
  {0, 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_40), 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},
  {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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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)\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*/
  __pyx_members_6oursql_Connection, /*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 struct 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*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 struct PyMethodDef __pyx_methods_6oursql__AbstractIterWrapper[] = {
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6oursql_20_AbstractIterWrapper___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*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 struct 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*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 struct PyMethodDef __pyx_methods_6oursql_IterWrapper[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6oursql_11IterWrapper___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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___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 struct PyMethodDef __pyx_methods_6oursql_FileWrapper[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6oursql_11FileWrapper___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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___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___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___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___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_6oursql__Statement[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10_Statement_close, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("prepare"), (PyCFunction)__pyx_pf_6oursql_10_Statement_prepare, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_6oursql_10_Statement_execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_10_Statement_fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_10_Statement_fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("buffer_results"), (PyCFunction)__pyx_pf_6oursql_10_Statement_buffer_results, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_10_Statement_nextset, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6oursql_10_Statement___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql__Statement[] = {
  {(char *)"warnings", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Statement, warnings), 0, 0},
  {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},
  {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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__Statement, /*tp_methods*/
  __pyx_members_6oursql__Statement, /*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 struct PyMethodDef __pyx_methods_6oursql__ResultStringStream[] = {
  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6oursql_19_ResultStringStream_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_19_ResultStringStream_read)},
  {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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___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 struct PyMethodDef __pyx_methods_6oursql__ResultSet[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_close, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet_fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6oursql_10_ResultSet___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql__ResultSet[] = {
  {(char *)"rowcount", T_OBJECT, offsetof(struct __pyx_obj_6oursql__ResultSet, rowcount), READONLY, 0},
  {(char *)"lastrowid", T_OBJECT, offsetof(struct __pyx_obj_6oursql__ResultSet, lastrowid), READONLY, 0},
  {(char *)"description", T_OBJECT, offsetof(struct __pyx_obj_6oursql__ResultSet, description), READONLY, 0},
  {(char *)"column_names", T_OBJECT, offsetof(struct __pyx_obj_6oursql__ResultSet, column_names), READONLY, 0},
  {(char *)"warnings", T_OBJECT, offsetof(struct __pyx_obj_6oursql__ResultSet, warnings), 0, 0},
  {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},
  {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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__ResultSet, /*tp_methods*/
  __pyx_members_6oursql__ResultSet, /*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 struct PyMethodDef __pyx_methods_6oursql__Query[] = {
  {__Pyx_NAMESTR("new_result"), (PyCFunction)__pyx_pf_6oursql_6_Query_new_result, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_6_Query_nextset, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_6_Query_fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6oursql_6_Query___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_6_Query_fetchall, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql__Query[] = {
  {(char *)"rowcount", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Query, rowcount), READONLY, 0},
  {(char *)"lastrowid", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Query, lastrowid), READONLY, 0},
  {(char *)"description", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Query, description), READONLY, 0},
  {(char *)"warnings", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Query, warnings), READONLY, 0},
  {(char *)"has_result", T_OBJECT, offsetof(struct __pyx_obj_6oursql__Query, has_result), READONLY, 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__Query, /*tp_methods*/
  __pyx_members_6oursql__Query, /*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__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 struct 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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 struct PyMethodDef __pyx_methods_6oursql_Cursor[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6oursql_6Cursor_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_close)},
  {__Pyx_NAMESTR("_new_statement"), (PyCFunction)__pyx_pf_6oursql_6Cursor__new_statement, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_new_query"), (PyCFunction)__pyx_pf_6oursql_6Cursor__new_query, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("callproc"), (PyCFunction)__pyx_pf_6oursql_6Cursor_callproc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_callproc)},
  {__Pyx_NAMESTR("_do_autoping"), (PyCFunction)__pyx_pf_6oursql_6Cursor__do_autoping, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_6oursql_6Cursor_execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_execute)},
  {__Pyx_NAMESTR("executemany"), (PyCFunction)__pyx_pf_6oursql_6Cursor_executemany, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_executemany)},
  {__Pyx_NAMESTR("nextset"), (PyCFunction)__pyx_pf_6oursql_6Cursor_nextset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_nextset)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pf_6oursql_6Cursor_fetchone, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_fetchone)},
  {__Pyx_NAMESTR("fetchmany"), (PyCFunction)__pyx_pf_6oursql_6Cursor_fetchmany, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_fetchmany)},
  {__Pyx_NAMESTR("fetchall"), (PyCFunction)__pyx_pf_6oursql_6Cursor_fetchall, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_fetchall)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6oursql_6Cursor___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("setinputsizes"), (PyCFunction)__pyx_pf_6oursql_6Cursor_setinputsizes, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_setinputsizes)},
  {__Pyx_NAMESTR("setoutputsize"), (PyCFunction)__pyx_pf_6oursql_6Cursor_setoutputsize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6oursql_6Cursor_setoutputsize)},
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6oursql_6Cursor___enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6oursql_6Cursor___exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql_Cursor[] = {
  {(char *)"_statements", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, _statements), READONLY, 0},
  {(char *)"_stmt_kwargs", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, _stmt_kwargs), READONLY, 0},
  {(char *)"rowcount", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, rowcount), READONLY, 0},
  {(char *)"lastrowid", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, lastrowid), READONLY, 0},
  {(char *)"description", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, description), READONLY, 0},
  {(char *)"messages", T_OBJECT, offsetof(struct __pyx_obj_6oursql_Cursor, messages), READONLY, 0},
  {(char *)"arraysize", T_ULONG, offsetof(struct __pyx_obj_6oursql_Cursor, arraysize), 0, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6oursql_Cursor[] = {
  {(char *)"connection", __pyx_getprop_6oursql_6Cursor_connection, 0, 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql_Cursor, /*tp_methods*/
  __pyx_members_6oursql_Cursor, /*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 struct 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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 struct PyMethodDef __pyx_methods_6oursql__DBAPITypeObject[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6oursql_16_DBAPITypeObject___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6oursql__DBAPITypeObject[] = {
  {(char *)"values", T_OBJECT, offsetof(struct __pyx_obj_6oursql__DBAPITypeObject, values), READONLY, 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, /*reserved*/
  #else
  0, /*nb_long*/
  #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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  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
};

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*/
  0, /*tp_compare*/
  __pyx_pf_6oursql_16_DBAPITypeObject___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_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6oursql__DBAPITypeObject, /*tp_methods*/
  __pyx_members_6oursql__DBAPITypeObject, /*tp_members*/
  0, /*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 struct PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("_exception_from_errno"), (PyCFunction)__pyx_pf_6oursql__exception_from_errno, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_do_warnings_query"), (PyCFunction)__pyx_pf_6oursql__do_warnings_query, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_bitval_from_string"), (PyCFunction)__pyx_pf_6oursql__bitval_from_string, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_datetime_from_string"), (PyCFunction)__pyx_pf_6oursql__datetime_from_string, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_date_from_string"), (PyCFunction)__pyx_pf_6oursql__date_from_string, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_time_from_string"), (PyCFunction)__pyx_pf_6oursql__time_from_string, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("TimestampFromTicks"), (PyCFunction)__pyx_pf_6oursql_TimestampFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_TimestampFromTicks)},
  {__Pyx_NAMESTR("DateFromTicks"), (PyCFunction)__pyx_pf_6oursql_DateFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_DateFromTicks)},
  {__Pyx_NAMESTR("TimeFromTicks"), (PyCFunction)__pyx_pf_6oursql_TimeFromTicks, METH_O, __Pyx_DOCSTR(__pyx_doc_6oursql_TimeFromTicks)},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("oursql"),
    __Pyx_DOCSTR(__pyx_k_41), /* 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_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 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_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 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_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 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_37, __pyx_k_37, sizeof(__pyx_k_37), 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_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_n_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 1},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_u_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_u_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 1, 0, 0},
  {&__pyx_kp_u_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0, 0},
  {&__pyx_kp_u_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0, 0},
  {&__pyx_kp_u_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0, 0},
  {&__pyx_kp_u_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 1, 0, 0},
  {&__pyx_kp_u_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0, 0},
  {&__pyx_kp_u_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0, 0},
  {&__pyx_kp_u_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0, 0},
  {&__pyx_kp_u_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0, 0},
  {&__pyx_kp_u_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0, 0},
  {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1},
  {&__pyx_n_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 1},
  {&__pyx_kp_u_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0, 0},
  {&__pyx_kp_u_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0, 0},
  {&__pyx_kp_u_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0, 0},
  {&__pyx_kp_u_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 1, 0, 0},
  {&__pyx_kp_u_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0, 0},
  {&__pyx_kp_u_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 1, 0, 0},
  {&__pyx_kp_u_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0, 0},
  {&__pyx_kp_u_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 1, 0, 0},
  {&__pyx_kp_u_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_u_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 1, 0, 0},
  {&__pyx_kp_u_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 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__Connection, __pyx_k__Connection, sizeof(__pyx_k__Connection), 0, 0, 1, 1},
  {&__pyx_n_s__Cursor, __pyx_k__Cursor, sizeof(__pyx_k__Cursor), 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___ResultStringStream, __pyx_k___ResultStringStream, sizeof(__pyx_k___ResultStringStream), 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___alloc_buffer, __pyx_k___alloc_buffer, sizeof(__pyx_k___alloc_buffer), 0, 0, 1, 1},
  {&__pyx_n_s___bind_buffer, __pyx_k___bind_buffer, sizeof(__pyx_k___bind_buffer), 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___charset, __pyx_k___charset, sizeof(__pyx_k___charset), 0, 0, 1, 1},
  {&__pyx_n_s___check_closed, __pyx_k___check_closed, sizeof(__pyx_k___check_closed), 0, 0, 1, 1},
  {&__pyx_n_s___check_statements, __pyx_k___check_statements, sizeof(__pyx_k___check_statements), 0, 0, 1, 1},
  {&__pyx_n_s___context_cursors, __pyx_k___context_cursors, sizeof(__pyx_k___context_cursors), 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___prefetch_rows, __pyx_k___prefetch_rows, sizeof(__pyx_k___prefetch_rows), 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___raise_error, __pyx_k___raise_error, sizeof(__pyx_k___raise_error), 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___statements, __pyx_k___statements, sizeof(__pyx_k___statements), 0, 0, 1, 1},
  {&__pyx_n_s___stmt_kwargs, __pyx_k___stmt_kwargs, sizeof(__pyx_k___stmt_kwargs), 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___update_fields, __pyx_k___update_fields, sizeof(__pyx_k___update_fields), 0, 0, 1, 1},
  {&__pyx_n_s__apilevel, __pyx_k__apilevel, sizeof(__pyx_k__apilevel), 0, 0, 1, 1},
  {&__pyx_n_s__arraysize, __pyx_k__arraysize, sizeof(__pyx_k__arraysize), 0, 0, 1, 1},
  {&__pyx_n_s__autoping, __pyx_k__autoping, sizeof(__pyx_k__autoping), 0, 0, 1, 1},
  {&__pyx_n_s__bind, __pyx_k__bind, sizeof(__pyx_k__bind), 0, 0, 1, 1},
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
  {&__pyx_n_s__buffer_length, __pyx_k__buffer_length, sizeof(__pyx_k__buffer_length), 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__buffer_type, __pyx_k__buffer_type, sizeof(__pyx_k__buffer_type), 0, 0, 1, 1},
  {&__pyx_n_s__buffered, __pyx_k__buffered, sizeof(__pyx_k__buffered), 0, 0, 1, 1},
  {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 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__callproc, __pyx_k__callproc, sizeof(__pyx_k__callproc), 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__charsetnr, __pyx_k__charsetnr, sizeof(__pyx_k__charsetnr), 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__closed, __pyx_k__closed, sizeof(__pyx_k__closed), 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__conversion_info, __pyx_k__conversion_info, sizeof(__pyx_k__conversion_info), 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__cursor_type, __pyx_k__cursor_type, sizeof(__pyx_k__cursor_type), 0, 0, 1, 1},
  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__data_waiting, __pyx_k__data_waiting, sizeof(__pyx_k__data_waiting), 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__dec, __pyx_k__dec, sizeof(__pyx_k__dec), 0, 0, 1, 1},
  {&__pyx_n_s__decimal, __pyx_k__decimal, sizeof(__pyx_k__decimal), 0, 0, 1, 1},
  {&__pyx_n_s__decimals, __pyx_k__decimals, sizeof(__pyx_k__decimals), 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__done, __pyx_k__done, sizeof(__pyx_k__done), 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__error, __pyx_k__error, sizeof(__pyx_k__error), 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__executemany, __pyx_k__executemany, sizeof(__pyx_k__executemany), 0, 0, 1, 1},
  {&__pyx_n_s__exhausted, __pyx_k__exhausted, sizeof(__pyx_k__exhausted), 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__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__fetchall, __pyx_k__fetchall, sizeof(__pyx_k__fetchall), 0, 0, 1, 1},
  {&__pyx_n_s__fetched, __pyx_k__fetched, sizeof(__pyx_k__fetched), 0, 0, 1, 1},
  {&__pyx_n_s__fetchmany, __pyx_k__fetchmany, sizeof(__pyx_k__fetchmany), 0, 0, 1, 1},
  {&__pyx_n_s__fetchone, __pyx_k__fetchone, sizeof(__pyx_k__fetchone), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__fileobj, __pyx_k__fileobj, sizeof(__pyx_k__fileobj), 0, 0, 1, 1},
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 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__is_binary, __pyx_k__is_binary, sizeof(__pyx_k__is_binary), 0, 0, 1, 1},
  {&__pyx_n_s__is_null, __pyx_k__is_null, sizeof(__pyx_k__is_null), 0, 0, 1, 1},
  {&__pyx_n_s__is_unsigned, __pyx_k__is_unsigned, sizeof(__pyx_k__is_unsigned), 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__ll, __pyx_k__ll, sizeof(__pyx_k__ll), 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__max_length, __pyx_k__max_length, sizeof(__pyx_k__max_length), 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__messages, __pyx_k__messages, sizeof(__pyx_k__messages), 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__name, __pyx_k__name, sizeof(__pyx_k__name), 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__nextfunc, __pyx_k__nextfunc, sizeof(__pyx_k__nextfunc), 0, 0, 1, 1},
  {&__pyx_n_s__nextset, __pyx_k__nextset, sizeof(__pyx_k__nextset), 0, 0, 1, 1},
  {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 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__readfunc, __pyx_k__readfunc, sizeof(__pyx_k__readfunc), 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__res, __pyx_k__res, sizeof(__pyx_k__res), 0, 0, 1, 1},
  {&__pyx_n_s__res_a, __pyx_k__res_a, sizeof(__pyx_k__res_a), 0, 0, 1, 1},
  {&__pyx_n_s__res_kw, __pyx_k__res_kw, sizeof(__pyx_k__res_kw), 0, 0, 1, 1},
  {&__pyx_n_s__result, __pyx_k__result, sizeof(__pyx_k__result), 0, 0, 1, 1},
  {&__pyx_n_s__result_data, __pyx_k__result_data, sizeof(__pyx_k__result_data), 0, 0, 1, 1},
  {&__pyx_n_s__result_fields, __pyx_k__result_fields, sizeof(__pyx_k__result_fields), 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__s16, __pyx_k__s16, sizeof(__pyx_k__s16), 0, 0, 1, 1},
  {&__pyx_n_s__s32, __pyx_k__s32, sizeof(__pyx_k__s32), 0, 0, 1, 1},
  {&__pyx_n_s__s64, __pyx_k__s64, sizeof(__pyx_k__s64), 0, 0, 1, 1},
  {&__pyx_n_s__s8, __pyx_k__s8, sizeof(__pyx_k__s8), 0, 0, 1, 1},
  {&__pyx_n_s__second, __pyx_k__second, sizeof(__pyx_k__second), 0, 0, 1, 1},
  {&__pyx_n_s__second_part, __pyx_k__second_part, sizeof(__pyx_k__second_part), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__setinputsizes, __pyx_k__setinputsizes, sizeof(__pyx_k__setinputsizes), 0, 0, 1, 1},
  {&__pyx_n_s__setoutputsize, __pyx_k__setoutputsize, sizeof(__pyx_k__setoutputsize), 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__st, __pyx_k__st, sizeof(__pyx_k__st), 0, 0, 1, 1},
  {&__pyx_n_s__stmt, __pyx_k__stmt, sizeof(__pyx_k__stmt), 0, 0, 1, 1},
  {&__pyx_n_s__stmt_fetched, __pyx_k__stmt_fetched, sizeof(__pyx_k__stmt_fetched), 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__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1},
  {&__pyx_n_s__table, __pyx_k__table, sizeof(__pyx_k__table), 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__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
  {&__pyx_n_s__u16, __pyx_k__u16, sizeof(__pyx_k__u16), 0, 0, 1, 1},
  {&__pyx_n_s__u32, __pyx_k__u32, sizeof(__pyx_k__u32), 0, 0, 1, 1},
  {&__pyx_n_s__u64, __pyx_k__u64, sizeof(__pyx_k__u64), 0, 0, 1, 1},
  {&__pyx_n_s__u8, __pyx_k__u8, sizeof(__pyx_k__u8), 0, 0, 1, 1},
  {&__pyx_n_s__ul, __pyx_k__ul, sizeof(__pyx_k__ul), 0, 0, 1, 1},
  {&__pyx_n_s__ull, __pyx_k__ull, sizeof(__pyx_k__ull), 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 = 142; __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 = 382; __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_InitGlobals(void) {
  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;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __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");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_oursql(void)", __LINE__, __FILE__);
  #endif
  __pyx_init_filenames();
  __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;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __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;}
  #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_41), 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;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_6oursql_Connection = &__pyx_vtable_6oursql_Connection;
  #if PY_MAJOR_VERSION >= 3
  __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;
  #else
  *(void(**)(void))&__pyx_vtable_6oursql_Connection._raise_error = (void(*)(void))__pyx_f_6oursql_10Connection__raise_error;
  *(void(**)(void))&__pyx_vtable_6oursql_Connection._check_closed = (void(*)(void))__pyx_f_6oursql_10Connection__check_closed;
  #endif
  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;
  #if PY_MAJOR_VERSION >= 3
  __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;
  #else
  *(void(**)(void))&__pyx_vtable_6oursql__Statement._raise_error = (void(*)(void))__pyx_f_6oursql_10_Statement__raise_error;
  *(void(**)(void))&__pyx_vtable_6oursql__Statement._check_closed = (void(*)(void))__pyx_f_6oursql_10_Statement__check_closed;
  *(void(**)(void))&__pyx_vtable_6oursql__Statement._alloc_buffer = (void(*)(void))__pyx_f_6oursql_10_Statement__alloc_buffer;
  *(void(**)(void))&__pyx_vtable_6oursql__Statement._bind_buffer = (void(*)(void))__pyx_f_6oursql_10_Statement__bind_buffer;
  #endif
  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 = 601; __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 = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6oursql__ResultStringStream = &__pyx_type_6oursql__ResultStringStream;
  __pyx_vtabptr_6oursql__ResultSet = &__pyx_vtable_6oursql__ResultSet;
  #if PY_MAJOR_VERSION >= 3
  __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;
  #else
  *(void(**)(void))&__pyx_vtable_6oursql__ResultSet._raise_error = (void(*)(void))__pyx_f_6oursql_10_ResultSet__raise_error;
  *(void(**)(void))&__pyx_vtable_6oursql__ResultSet._check_closed = (void(*)(void))__pyx_f_6oursql_10_ResultSet__check_closed;
  #endif
  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;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_6oursql__Query._raise_error = (int (*)(struct __pyx_obj_6oursql__Query *))__pyx_f_6oursql_6_Query__raise_error;
  #else
  *(void(**)(void))&__pyx_vtable_6oursql__Query._raise_error = (void(*)(void))__pyx_f_6oursql_6_Query__raise_error;
  #endif
  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;
  #if PY_MAJOR_VERSION >= 3
  __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;
  #else
  *(void(**)(void))&__pyx_vtable_6oursql_Cursor._check_closed = (void(*)(void))__pyx_f_6oursql_6Cursor__check_closed;
  *(void(**)(void))&__pyx_vtable_6oursql_Cursor._update_fields = (void(*)(void))__pyx_f_6oursql_6Cursor__update_fields;
  *(void(**)(void))&__pyx_vtable_6oursql_Cursor._check_statements = (void(*)(void))__pyx_f_6oursql_6Cursor__check_statements;
  #endif
  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 ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":7
 * """
 * 
 * __author__ = 'Aaron Gallagher <habnabit@gmail.com>'             # <<<<<<<<<<<<<<
 * __version__ = '0.9.2'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_42)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":8
 * 
 * __author__ = 'Aaron Gallagher <habnabit@gmail.com>'
 * __version__ = '0.9.2'             # <<<<<<<<<<<<<<
 * 
 * include "oursql.pxi"
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_43)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":50
 *     column_data buf
 * 
 * import exceptions             # <<<<<<<<<<<<<<
 * 
 * class Warning(exceptions.Warning): pass
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__exceptions), 0); 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Warning, "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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Note, "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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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));
  __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(__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(__pyx_t_3, ((PyObject *)__pyx_t_1), __pyx_n_s__Error, "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(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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 = PyCFunction_New(&__pyx_mdef_6oursql_5Error___init__, 0); 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);
  __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__InterfaceError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__DatabaseError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__DataError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__OperationalError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__IntegrityError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__InternalError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__ProgrammingError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s_6, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__NotSupportedError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__PermissionsError, "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(__pyx_t_4); __pyx_t_4 = 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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__UnknownError, "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(__pyx_t_4); __pyx_t_4 = 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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__InterfaceError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __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[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/oursql/oursqlx/util.pyx":62
 * _exception_enum_map = {
 *     _oursqlx_InterfaceError: InterfaceError,
 *     _oursqlx_DataError: DataError,             # <<<<<<<<<<<<<<
 *     _oursqlx_OperationalError: OperationalError,
 *     _oursqlx_IntegrityError: IntegrityError,
 */
  __pyx_t_4 = PyInt_FromLong(_oursqlx_DataError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__OperationalError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __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[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/oursql/oursqlx/util.pyx":64
 *     _oursqlx_DataError: DataError,
 *     _oursqlx_OperationalError: OperationalError,
 *     _oursqlx_IntegrityError: IntegrityError,             # <<<<<<<<<<<<<<
 *     _oursqlx_InternalError: InternalError,
 *     _oursqlx_ProgrammingError: ProgrammingError,
 */
  __pyx_t_4 = PyInt_FromLong(_oursqlx_IntegrityError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__InternalError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __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[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/oursql/oursqlx/util.pyx":66
 *     _oursqlx_IntegrityError: IntegrityError,
 *     _oursqlx_InternalError: InternalError,
 *     _oursqlx_ProgrammingError: ProgrammingError,             # <<<<<<<<<<<<<<
 *     _oursqlx_NotSupportedError: NotSupportedError,
 *     _oursqlx_PermissionsError: PermissionsError,
 */
  __pyx_t_4 = PyInt_FromLong(_oursqlx_ProgrammingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__NotSupportedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __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[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/oursql/oursqlx/util.pyx":68
 *     _oursqlx_ProgrammingError: ProgrammingError,
 *     _oursqlx_NotSupportedError: NotSupportedError,
 *     _oursqlx_PermissionsError: PermissionsError,             # <<<<<<<<<<<<<<
 *     _oursqlx_UnknownError: UnknownError,
 * }
 */
  __pyx_t_4 = PyInt_FromLong(_oursqlx_PermissionsError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __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/habnabit/hab-bzr/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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__UnknownError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __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[2]; __pyx_lineno = 60; __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;
  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/habnabit/hab-bzr/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); 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); 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); 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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/conversions.pyx":22
 * 
 * _conversions = {
 *     MYSQL_TYPE_TINY: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_SHORT: int,
 *     MYSQL_TYPE_LONG: long,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_TINY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyInt_Type))) < 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/habnabit/hab-bzr/oursql/oursqlx/conversions.pyx":23
 * _conversions = {
 *     MYSQL_TYPE_TINY: int,
 *     MYSQL_TYPE_SHORT: int,             # <<<<<<<<<<<<<<
 *     MYSQL_TYPE_LONG: long,
 *     MYSQL_TYPE_FLOAT: float,
 */
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyInt_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyLong_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyFloat_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyFloat_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyFloat_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_NEWDECIMAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyFloat_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyLong_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyInt_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_YEAR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, ((PyObject *)((PyObject*)&PyInt_Type))) < 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/habnabit/hab-bzr/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_4 = PyInt_FromLong(MYSQL_TYPE_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_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_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_3) < 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_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_NEWDECIMAL); 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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__decimal); 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_2 = PyObject_GetAttr(__pyx_t_4, __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_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 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_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___bitval_from_string); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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[0]; __pyx_lineno = 21; __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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_44); 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_3, __pyx_t_2) < 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_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_44); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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[0]; __pyx_lineno = 21; __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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_DATE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_3, __pyx_t_2) < 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_2); __pyx_t_2 = 0;

  /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___time_from_string); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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[0]; __pyx_lineno = 21; __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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, Py_None) < 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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_STRING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, Py_None) < 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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_VAR_STRING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, Py_None) < 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/habnabit/hab-bzr/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_3 = PyInt_FromLong(MYSQL_TYPE_VARCHAR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, Py_None) < 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/habnabit/hab-bzr/oursql/oursqlx/conversions.pyx":47
 *     MYSQL_TYPE_VARCHAR: None,
 *     # For consistency with the statement API.
 *     MYSQL_TYPE_SET: None,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_3 = PyInt_FromLong(MYSQL_TYPE_SET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, Py_None) < 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;
  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/habnabit/hab-bzr/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_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Timestamp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/conversions.pyx":51
 * 
 * Timestamp = datetime.datetime
 * Date = datetime.date             # <<<<<<<<<<<<<<
 * Time = datetime.time
 * Binary = buffer
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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/habnabit/hab-bzr/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_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/connection.pyx":1
 * _protocol_enum_map = {             # <<<<<<<<<<<<<<
 *     None: MYSQL_PROTOCOL_DEFAULT,
 *     'tcp': MYSQL_PROTOCOL_TCP,
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "/home/habnabit/hab-bzr/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_3, 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/habnabit/hab-bzr/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_3, ((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/habnabit/hab-bzr/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_3, ((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/habnabit/hab-bzr/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_3, ((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/habnabit/hab-bzr/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_3, ((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_3)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":1
 * import cStringIO             # <<<<<<<<<<<<<<
 * import datetime
 * import decimal
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__cStringIO), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cStringIO, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":2
 * import cStringIO
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal
 * import codecs
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__datetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":3
 * import cStringIO
 * import datetime
 * import decimal             # <<<<<<<<<<<<<<
 * import codecs
 * 
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__decimal), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decimal, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":4
 * import datetime
 * import decimal
 * import codecs             # <<<<<<<<<<<<<<
 * 
 * cdef my_ulonglong ull_negone = <my_ulonglong>-1
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__codecs), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__codecs, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":36
 * 
 * BinaryIterWrapper = type('BinaryIterWrapper',
 *     (_BinaryWhateverMixin, IterWrapper), {'__module__': __name__, '__doc__':             # <<<<<<<<<<<<<<
 *     """BinaryIterWrapper(iterobj)
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__BinaryWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_3, 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_3, 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_45)) < 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(__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, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), __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(__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/habnabit/hab-bzr/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(__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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s____module__), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s____doc__), ((PyObject *)__pyx_kp_s_46)) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BinaryFileWrapper));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__BinaryFileWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BinaryFileWrapper));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 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)), __pyx_t_3, 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(__pyx_t_3); __pyx_t_3 = 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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":598
 *                 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 = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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/habnabit/hab-bzr/oursql/oursqlx/statement.pyx":599
 * 
 * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement),
 *     {'__module__': __name__})             # <<<<<<<<<<<<<<
 * 
 * cdef class _ResultStringStream:
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s____module__), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 599; __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 = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___DictStatement, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___conversions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__ResultSet->tp_dict, __pyx_n_s__conversions_dict, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6oursql__ResultSet);

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/query.pyx":191
 * 
 * # Cython should support multiple inheritance one of these days.
 * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet),             # <<<<<<<<<<<<<<
 *     {'__module__': __name__})
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DictWhateverMixin)));
  PyTuple_SET_ITEM(__pyx_t_3, 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_3, 1, ((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6oursql__ResultSet)));

  /* "/home/habnabit/hab-bzr/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(__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, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), __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(__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/habnabit/hab-bzr/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/habnabit/hab-bzr/oursql/oursqlx/cursor.pyx":1
 * import collections, itertools             # <<<<<<<<<<<<<<
 * 
 * cdef class Cursor:
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), 0); 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); 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/habnabit/hab-bzr/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/habnabit/hab-bzr/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/habnabit/hab-bzr/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_35 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/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/habnabit/hab-bzr/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);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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) {

    /* "/home/habnabit/hab-bzr/oursql/oursqlx/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 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_47));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_47));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47));
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __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_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_48)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;}

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_3 = PyInt_FromLong(MYSQL_TYPE_ENUM); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyInt_FromLong(MYSQL_TYPE_STRING); 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_VAR_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 = PyTuple_New(3); 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);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __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__STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_1 = PyInt_FromLong(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_FromLong(MYSQL_TYPE_LONG_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);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_2 = PyInt_FromLong(MYSQL_TYPE_MEDIUM_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_3 = PyInt_FromLong(MYSQL_TYPE_TINY_BLOB); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BINARY, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_3 = PyInt_FromLong(MYSQL_TYPE_DECIMAL); 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);
  __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_2 = PyInt_FromLong(MYSQL_TYPE_FLOAT); 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_4 = PyInt_FromLong(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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_1 = PyInt_FromLong(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  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_3 = 0;
  __pyx_t_6 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6oursql__DBAPITypeObject)), __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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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)), __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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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)), __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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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(__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)), __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(__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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/oursql.pyx":131
 * ROWID = _DBAPITypeObject()
 * 
 * client_info = mysql_get_client_info()             # <<<<<<<<<<<<<<
 * errnos = _oursqlx_generate_errno_dict()
 */
  __pyx_t_8 = __Pyx_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(__pyx_t_8);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__client_info, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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;

  /* "/home/habnabit/hab-bzr/oursql/oursqlx/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));
  __pyx_t_9 = PyObject_GetAttr(__pyx_m, __pyx_n_s__TimestampFromTicks); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_49), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__DateFromTicks); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_GetAttrString(__pyx_t_10, "__doc__");
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_50), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_GetAttr(__pyx_m, __pyx_n_s__TimeFromTicks); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_51), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__close); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_52), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__ping); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_53), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__commit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_54), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__rollback); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_55), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__warning_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_56), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__cursor); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_57), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s___escape_string); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_58), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Connection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s_60); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_59), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s___ResultStringStream); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__read); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_61), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__close); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_62), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__callproc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_63), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__execute); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_64), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__executemany); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_65), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__nextset); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_66), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__fetchone); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_67), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__fetchmany); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_68), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__fetchall); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_69), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__setinputsizes); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_70), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Cursor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__setoutputsize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetAttrString(__pyx_t_9, "__doc__");
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_kp_u_71), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  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");
    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
}

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

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

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 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 *number, *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";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

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 INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
                 "need more than %d value%s to unpack", (int)index,
        #else
                 "need more than %zd value%s to unpack", index,
        #endif
                 (index == 1) ? "" : "s");
}

static INLINE void __Pyx_RaiseTooManyValuesError(void) {
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
}

static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

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 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 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;
}



static 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 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 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) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!__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;
    module = PyObject_CallFunctionObjArgs(__import__,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;

    #if PY_MAJOR_VERSION < 3
    py_modname = PyString_FromString(modname);
    #else
    py_modname = PyUnicode_FromString(modname);
    #endif
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    result = PyClass_New(bases, dict, name);
    #else
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
    #endif
bad:
    Py_XDECREF(py_modname);
    return result;
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    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) {
    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;
    }

    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 INLINE PyObject *__Pyx_PyInt_to_py_my_ulonglong(my_ulonglong val) {
    const my_ulonglong neg_one = (my_ulonglong)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(my_ulonglong) <  sizeof(long)) {
        return PyInt_FromLong((long)val);
    } else if (sizeof(my_ulonglong) == sizeof(long)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else { /* (sizeof(my_ulonglong) > sizeof(long)) */
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    }
}

static 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 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 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 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 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 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 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 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 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 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 PyLong_AsUnsignedLong(x);
        } else {
            return 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 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 PyLong_AsUnsignedLongLong(x);
        } else {
            return 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 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 PyLong_AsUnsignedLong(x);
        } else {
            return 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 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 PyLong_AsUnsignedLongLong(x);
        } else {
            return 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 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 PyLong_AsUnsignedLong(x);
        } else {
            return 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 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 PyLong_AsUnsignedLongLong(x);
        } else {
            return 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_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX < 0x03010000
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#else
    PyObject *ob = PyCapsule_New(vtable, 0, 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) {
    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 INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if ((x == Py_False) | (x == Py_None)) return 0;
   else return PyObject_IsTrue(x);
}

static 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 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 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 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 */
