/* Generated by Cython 0.17.3 on Tue Jul 15 07:52:48 2014 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#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 CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#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)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#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_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__cymysql__packetx
#define __PYX_HAVE_API__cymysql__packetx
#include "stdint.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


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

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

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


/* Type Conversion Predeclarations */

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_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[] = {
  "packetx.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_7cymysql_7packetx_MysqlPacket;
struct __pyx_obj_7cymysql_7packetx_MySQLResult;
struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket;

/* "cymysql/packetx.pyx":55
 * 
 * 
 * cdef class MysqlPacket(object):             # <<<<<<<<<<<<<<
 *     """Representation of a MySQL response packet.  Reads in the packet
 *     from the network socket, removes packet header and provides an interface
 */
struct __pyx_obj_7cymysql_7packetx_MysqlPacket {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *__pyx_vtab;
  PyObject *connection;
  PyObject *__pyx___data;
  int __pyx___data_length;
  int __pyx___position;
};


/* "cymysql/packetx.pyx":272
 * # TODO: move OK and EOF packet parsing/logic into a proper subclass
 * #       of MysqlPacket like has been done with FieldDescriptorPacket.
 * cdef class MySQLResult(object):             # <<<<<<<<<<<<<<
 *     cdef public object affected_rows, insert_id, rest_rows, has_next, has_result
 *     cdef public object message, description
 */
struct __pyx_obj_7cymysql_7packetx_MySQLResult {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cymysql_7packetx_MySQLResult *__pyx_vtab;
  PyObject *affected_rows;
  PyObject *insert_id;
  PyObject *rest_rows;
  PyObject *has_next;
  PyObject *has_result;
  PyObject *message;
  PyObject *description;
  PyObject *server_status;
  PyObject *warning_count;
  PyObject *field_count;
  PyObject *connection;
  PyObject *first_packet;
  PyObject *fields;
  int rest_row_index;
};


/* "cymysql/packetx.pyx":208
 * 
 * 
 * cdef class FieldDescriptorPacket(MysqlPacket):             # <<<<<<<<<<<<<<
 *     """A MysqlPacket that represents a specific column's metadata in the result.
 * 
 */
struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket {
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket __pyx_base;
  PyObject *catalog;
  PyObject *db;
  PyObject *table_name;
  PyObject *org_table;
  PyObject *name;
  PyObject *org_name;
  int charsetnr;
  int length;
  int type_code;
  int flags;
  int scale;
};



/* "cymysql/packetx.pyx":272
 * # TODO: move OK and EOF packet parsing/logic into a proper subclass
 * #       of MysqlPacket like has been done with FieldDescriptorPacket.
 * cdef class MySQLResult(object):             # <<<<<<<<<<<<<<
 *     cdef public object affected_rows, insert_id, rest_rows, has_next, has_result
 *     cdef public object message, description
 */

struct __pyx_vtabstruct_7cymysql_7packetx_MySQLResult {
  void (*_get_descriptions)(struct __pyx_obj_7cymysql_7packetx_MySQLResult *);
};
static struct __pyx_vtabstruct_7cymysql_7packetx_MySQLResult *__pyx_vtabptr_7cymysql_7packetx_MySQLResult;


/* "cymysql/packetx.pyx":55
 * 
 * 
 * cdef class MysqlPacket(object):             # <<<<<<<<<<<<<<
 *     """Representation of a MySQL response packet.  Reads in the packet
 *     from the network socket, removes packet header and provides an interface
 */

struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket {
  PyObject *(*__pyx___recv_from_socket)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *, int);
  PyObject *(*__pyx___recv_packet)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *);
  PyObject *(*_read)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *, int);
  int (*read_length_coded_binary)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *);
  PyObject *(*read_length_coded_string)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *);
  PyObject *(*_read_length_coded_string)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *);
};
static struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *__pyx_vtabptr_7cymysql_7packetx_MysqlPacket;


/* "cymysql/packetx.pyx":208
 * 
 * 
 * cdef class FieldDescriptorPacket(MysqlPacket):             # <<<<<<<<<<<<<<
 *     """A MysqlPacket that represents a specific column's metadata in the result.
 * 
 */

struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket {
  struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket __pyx_base;
};
static struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *__pyx_vtabptr_7cymysql_7packetx_FieldDescriptorPacket;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

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

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

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

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

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

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {  /* inlined PySequence_SetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return -1;
                i += l;
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PySequence_Check(o) && !PyDict_Check(o)) {
#else
    if (PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds) {
    if (check_bounds) {
        Py_ssize_t size = PyBytes_GET_SIZE(bytes);
        if (unlikely(index >= size) | ((index < 0) & unlikely(index < -size))) {
            PyErr_Format(PyExc_IndexError, "string index out of range");
            return -1;
        }
    }
    if (index < 0)
        index += PyBytes_GET_SIZE(bytes);
    return PyBytes_AS_STRING(bytes)[index];
}

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

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

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

static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */

static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */

#define UNARY_NEG_WOULD_OVERFLOW(x)            (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

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

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint16_t(uint16_t);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*proto*/

static int __Pyx_check_binary_version(void);

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

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

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


/* Module declarations from 'libc.stdint' */

/* Module declarations from 'cymysql.packetx' */
static PyTypeObject *__pyx_ptype_7cymysql_7packetx_MysqlPacket = 0;
static PyTypeObject *__pyx_ptype_7cymysql_7packetx_FieldDescriptorPacket = 0;
static PyTypeObject *__pyx_ptype_7cymysql_7packetx_MySQLResult = 0;
static int __pyx_v_7cymysql_7packetx_PYTHON3;
static int __pyx_v_7cymysql_7packetx_FIELD_TYPE_VAR_STRING;
static int __pyx_v_7cymysql_7packetx_UNSIGNED_CHAR_COLUMN;
static int __pyx_v_7cymysql_7packetx_UNSIGNED_SHORT_COLUMN;
static int __pyx_v_7cymysql_7packetx_UNSIGNED_INT24_COLUMN;
static int __pyx_v_7cymysql_7packetx_UNSIGNED_INT64_COLUMN;
static uint16_t __pyx_f_7cymysql_7packetx_unpack_uint16(PyObject *); /*proto*/
static uint32_t __pyx_f_7cymysql_7packetx_unpack_uint24(PyObject *); /*proto*/
static uint32_t __pyx_f_7cymysql_7packetx_unpack_uint32(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cymysql_7packetx_unpack_uint64(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "cymysql.packetx"
int __pyx_module_is_main_cymysql__packetx = 0;

/* Implementation of 'cymysql.packetx' */
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_pf_7cymysql_7packetx_get_decode_values(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_charset, PyObject *__pyx_v_fields, PyObject *__pyx_v_use_unicode, PyObject *__pyx_v_decoders); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MysqlPacket___init__(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_connection); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_2get_all_data(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_4read(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_6read_all(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_8read_decode_data(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_10is_ok_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_12is_eof_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_14is_eof_and_status(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_16read_ok_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket___init__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2__parse_field_descriptor(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4description(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6get_column_length(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8__str__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult___init__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_connection); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_2read_rest_rowdata_packet(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_4fetchone(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_7message___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_11description___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "<Q";
static char __pyx_k_3[] = "raise_mysql_exception";
static char __pyx_k_4[] = "";
static char __pyx_k_5[] = "Lost connection to MySQL server during query";
static char __pyx_k_8[] = "Result length not requested length:\nExpected=%s.  Actual=%s.  Position: %s.  Data Length: %s";
static char __pyx_k_10[] = "__parse_field_descriptor";
static char __pyx_k_13[] = "%s %s.%s.%s, type=%s";
static char __pyx_k_15[] = "read_rest_rowdata_packet";
static char __pyx_k_16[] = "SERVER_MORE_RESULTS_EXISTS";
static char __pyx_k_17[] = "Protocol error, expecting EOF";
static char __pyx_k_18[] = "cymysql.err";
static char __pyx_k_19[] = "cymysql.constants";
static char __pyx_k_20[] = "cymysql.converters";
static char __pyx_k_23[] = "/Users/nakagami/CyMySQL/cymysql/packetx.pyx";
static char __pyx_k_24[] = "cymysql.packetx";
static char __pyx_k__i[] = "i";
static char __pyx_k__r[] = "r";
static char __pyx_k__get[] = "get";
static char __pyx_k__ord[] = "ord";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__conv[] = "conv";
static char __pyx_k__read[] = "read";
static char __pyx_k__recv[] = "recv";
static char __pyx_k__proxy[] = "proxy";
static char __pyx_k__range[] = "range";
static char __pyx_k__value[] = "value";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__socket[] = "socket";
static char __pyx_k__struct[] = "struct";
static char __pyx_k__unpack[] = "unpack";
static char __pyx_k__values[] = "values";
static char __pyx_k__charset[] = "charset";
static char __pyx_k__weakref[] = "weakref";
static char __pyx_k__MBLENGTH[] = "MBLENGTH";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__decoders[] = "decoders";
static char __pyx_k__read_all[] = "read_all";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__type_code[] = "type_code";
static char __pyx_k__connection[] = "connection";
static char __pyx_k__description[] = "description";
static char __pyx_k__use_unicode[] = "use_unicode";
static char __pyx_k__is_ok_packet[] = "is_ok_packet";
static char __pyx_k__version_info[] = "version_info";
static char __pyx_k__SERVER_STATUS[] = "SERVER_STATUS";
static char __pyx_k__is_eof_packet[] = "is_eof_packet";
static char __pyx_k__AssertionError[] = "AssertionError";
static char __pyx_k__read_ok_packet[] = "read_ok_packet";
static char __pyx_k__OperationalError[] = "OperationalError";
static char __pyx_k__default_decoders[] = "default_decoders";
static char __pyx_k__read_decode_data[] = "read_decode_data";
static char __pyx_k__get_column_length[] = "get_column_length";
static char __pyx_k__get_decode_values[] = "get_decode_values";
static char __pyx_k__is_eof_and_status[] = "is_eof_and_status";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_10;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_15;
static PyObject *__pyx_n_s_16;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_n_s_18;
static PyObject *__pyx_n_s_19;
static PyObject *__pyx_n_s_20;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_n_s_24;
static PyObject *__pyx_n_s_3;
static PyObject *__pyx_kp_b_4;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s__AssertionError;
static PyObject *__pyx_n_s__MBLENGTH;
static PyObject *__pyx_n_s__OperationalError;
static PyObject *__pyx_n_s__SERVER_STATUS;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__charset;
static PyObject *__pyx_n_s__connection;
static PyObject *__pyx_n_s__conv;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__decoders;
static PyObject *__pyx_n_s__default_decoders;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__get_column_length;
static PyObject *__pyx_n_s__get_decode_values;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__is_eof_and_status;
static PyObject *__pyx_n_s__is_eof_packet;
static PyObject *__pyx_n_s__is_ok_packet;
static PyObject *__pyx_n_s__ord;
static PyObject *__pyx_n_s__proxy;
static PyObject *__pyx_n_s__r;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__read_all;
static PyObject *__pyx_n_s__read_decode_data;
static PyObject *__pyx_n_s__read_ok_packet;
static PyObject *__pyx_n_s__recv;
static PyObject *__pyx_n_s__socket;
static PyObject *__pyx_n_s__struct;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__type_code;
static PyObject *__pyx_n_s__unpack;
static PyObject *__pyx_n_s__use_unicode;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__values;
static PyObject *__pyx_n_s__version_info;
static PyObject *__pyx_n_s__weakref;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_33;
static PyObject *__pyx_int_88;
static PyObject *__pyx_int_91;
static PyObject *__pyx_int_2013;
static PyObject *__pyx_k_2;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_codeobj_22;

/* "cymysql/packetx.pyx":27
 * cdef int UNSIGNED_INT64_COLUMN = 254
 * 
 * cdef uint16_t unpack_uint16(bytes s):             # <<<<<<<<<<<<<<
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8)
 */

static uint16_t __pyx_f_7cymysql_7packetx_unpack_uint16(PyObject *__pyx_v_s) {
  unsigned char *__pyx_v_n;
  uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpack_uint16", 0);

  /* "cymysql/packetx.pyx":28
 * 
 * cdef uint16_t unpack_uint16(bytes s):
 *     cdef unsigned char* n = s             # <<<<<<<<<<<<<<
 *     return n[0] + (n[1] << 8)
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_AsUString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "cymysql/packetx.pyx":29
 * cdef uint16_t unpack_uint16(bytes s):
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8)             # <<<<<<<<<<<<<<
 * 
 * cdef uint32_t unpack_uint24(bytes s):
 */
  __pyx_r = ((__pyx_v_n[0]) + ((__pyx_v_n[1]) << 8));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cymysql.packetx.unpack_uint16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":31
 *     return n[0] + (n[1] << 8)
 * 
 * cdef uint32_t unpack_uint24(bytes s):             # <<<<<<<<<<<<<<
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8) + (n[2] << 16)
 */

static uint32_t __pyx_f_7cymysql_7packetx_unpack_uint24(PyObject *__pyx_v_s) {
  unsigned char *__pyx_v_n;
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpack_uint24", 0);

  /* "cymysql/packetx.pyx":32
 * 
 * cdef uint32_t unpack_uint24(bytes s):
 *     cdef unsigned char* n = s             # <<<<<<<<<<<<<<
 *     return n[0] + (n[1] << 8) + (n[2] << 16)
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_AsUString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "cymysql/packetx.pyx":33
 * cdef uint32_t unpack_uint24(bytes s):
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8) + (n[2] << 16)             # <<<<<<<<<<<<<<
 * 
 * cdef uint32_t unpack_uint32(bytes s):
 */
  __pyx_r = (((__pyx_v_n[0]) + ((__pyx_v_n[1]) << 8)) + ((__pyx_v_n[2]) << 16));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cymysql.packetx.unpack_uint24", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":35
 *     return n[0] + (n[1] << 8) + (n[2] << 16)
 * 
 * cdef uint32_t unpack_uint32(bytes s):             # <<<<<<<<<<<<<<
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8) + (n[2] << 16) + (n[3] << 24)
 */

static uint32_t __pyx_f_7cymysql_7packetx_unpack_uint32(PyObject *__pyx_v_s) {
  unsigned char *__pyx_v_n;
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpack_uint32", 0);

  /* "cymysql/packetx.pyx":36
 * 
 * cdef uint32_t unpack_uint32(bytes s):
 *     cdef unsigned char* n = s             # <<<<<<<<<<<<<<
 *     return n[0] + (n[1] << 8) + (n[2] << 16) + (n[3] << 24)
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_AsUString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "cymysql/packetx.pyx":37
 * cdef uint32_t unpack_uint32(bytes s):
 *     cdef unsigned char* n = s
 *     return n[0] + (n[1] << 8) + (n[2] << 16) + (n[3] << 24)             # <<<<<<<<<<<<<<
 * 
 * cdef long long unpack_uint64(bytes n):
 */
  __pyx_r = ((((__pyx_v_n[0]) + ((__pyx_v_n[1]) << 8)) + ((__pyx_v_n[2]) << 16)) + ((__pyx_v_n[3]) << 24));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cymysql.packetx.unpack_uint32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":39
 *     return n[0] + (n[1] << 8) + (n[2] << 16) + (n[3] << 24)
 * 
 * cdef long long unpack_uint64(bytes n):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<Q', n)[0]
 * 
 */

static PY_LONG_LONG __pyx_f_7cymysql_7packetx_unpack_uint64(PyObject *__pyx_v_n) {
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PY_LONG_LONG __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unpack_uint64", 0);

  /* "cymysql/packetx.pyx":40
 * 
 * cdef long long unpack_uint64(bytes n):
 *     return struct.unpack('<Q', n)[0]             # <<<<<<<<<<<<<<
 * 
 * def get_decode_values(values, charset, fields, use_unicode, decoders=default_decoders):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__unpack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_n));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_n));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_n));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_AsLongLong(__pyx_t_1); if (unlikely((__pyx_t_4 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  __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_WriteUnraisable("cymysql.packetx.unpack_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_1get_decode_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7cymysql_7packetx_1get_decode_values = {__Pyx_NAMESTR("get_decode_values"), (PyCFunction)__pyx_pw_7cymysql_7packetx_1get_decode_values, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7cymysql_7packetx_1get_decode_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_charset = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_use_unicode = 0;
  PyObject *__pyx_v_decoders = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_decode_values (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__charset,&__pyx_n_s__fields,&__pyx_n_s__use_unicode,&__pyx_n_s__decoders,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = __pyx_k_2;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__charset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_decode_values", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_decode_values", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_unicode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_decode_values", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__decoders);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_decode_values") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_charset = values[1];
    __pyx_v_fields = values[2];
    __pyx_v_use_unicode = values[3];
    __pyx_v_decoders = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_decode_values", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymysql.packetx.get_decode_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cymysql_7packetx_get_decode_values(__pyx_self, __pyx_v_values, __pyx_v_charset, __pyx_v_fields, __pyx_v_use_unicode, __pyx_v_decoders);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":42
 *     return struct.unpack('<Q', n)[0]
 * 
 * def get_decode_values(values, charset, fields, use_unicode, decoders=default_decoders):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     r = [None] * len(values)
 */

static PyObject *__pyx_pf_7cymysql_7packetx_get_decode_values(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_charset, PyObject *__pyx_v_fields, PyObject *__pyx_v_use_unicode, PyObject *__pyx_v_decoders) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_type_code = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_decode_values", 0);

  /* "cymysql/packetx.pyx":44
 * def get_decode_values(values, charset, fields, use_unicode, decoders=default_decoders):
 *     cdef Py_ssize_t i
 *     r = [None] * len(values)             # <<<<<<<<<<<<<<
 *     for i, value in enumerate(values):
 *         if value is not None:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyList_New(1 * ((__pyx_t_1<0) ? 0:__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_1; __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      PyList_SET_ITEM(__pyx_t_2, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_v_r = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":45
 *     cdef Py_ssize_t i
 *     r = [None] * len(values)
 *     for i, value in enumerate(values):             # <<<<<<<<<<<<<<
 *         if value is not None:
 *             type_code = fields[i].type_code
 */
  __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "cymysql/packetx.pyx":46
 *     r = [None] * len(values)
 *     for i, value in enumerate(values):
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             type_code = fields[i].type_code
 *             if decoders[type_code] != default_decoders[type_code]:
 */
    __pyx_t_6 = (__pyx_v_value != Py_None);
    if (__pyx_t_6) {

      /* "cymysql/packetx.pyx":47
 *     for i, value in enumerate(values):
 *         if value is not None:
 *             type_code = fields[i].type_code             # <<<<<<<<<<<<<<
 *             if decoders[type_code] != default_decoders[type_code]:
 *                 r[i] = decoders[type_code](value)
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__type_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_type_code);
      __pyx_v_type_code = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "cymysql/packetx.pyx":48
 *         if value is not None:
 *             type_code = fields[i].type_code
 *             if decoders[type_code] != default_decoders[type_code]:             # <<<<<<<<<<<<<<
 *                 r[i] = decoders[type_code](value)
 *             else:
 */
      __pyx_t_7 = PyObject_GetItem(__pyx_v_decoders, __pyx_v_type_code); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__default_decoders); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyObject_GetItem(__pyx_t_5, __pyx_v_type_code); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "cymysql/packetx.pyx":49
 *             type_code = fields[i].type_code
 *             if decoders[type_code] != default_decoders[type_code]:
 *                 r[i] = decoders[type_code](value)             # <<<<<<<<<<<<<<
 *             else:
 *                 r[i] = decoders[type_code](value, charset, fields[i], use_unicode)
 */
        __pyx_t_5 = PyObject_GetItem(__pyx_v_decoders, __pyx_v_type_code); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_r), __pyx_v_i, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6;
      }
      /*else*/ {

        /* "cymysql/packetx.pyx":51
 *                 r[i] = decoders[type_code](value)
 *             else:
 *                 r[i] = decoders[type_code](value, charset, fields[i], use_unicode)             # <<<<<<<<<<<<<<
 *     return r
 * 
 */
        __pyx_t_7 = PyObject_GetItem(__pyx_v_decoders, __pyx_v_type_code); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        __Pyx_INCREF(__pyx_v_charset);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_charset);
        __Pyx_GIVEREF(__pyx_v_charset);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_use_unicode);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_use_unicode);
        __Pyx_GIVEREF(__pyx_v_use_unicode);
        __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_r), __pyx_v_i, __pyx_t_8, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __pyx_L6:;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":52
 *             else:
 *                 r[i] = decoders[type_code](value, charset, fields[i], use_unicode)
 *     return r             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_r));
  __pyx_r = ((PyObject *)__pyx_v_r);
  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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymysql.packetx.get_decode_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_type_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MysqlPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MysqlPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_connection = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__connection,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__connection)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_connection = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket___init__(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), __pyx_v_connection);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":64
 *     cdef int __position
 * 
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         cdef int is_error
 *         cdef int errno
 */

static int __pyx_pf_7cymysql_7packetx_11MysqlPacket___init__(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_connection) {
  int __pyx_v_is_error;
  CYTHON_UNUSED int __pyx_v_errno;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymysql/packetx.pyx":67
 *         cdef int is_error
 *         cdef int errno
 *         self.connection = connection             # <<<<<<<<<<<<<<
 *         self.__position = 0
 *         self.__recv_packet()
 */
  __Pyx_INCREF(__pyx_v_connection);
  __Pyx_GIVEREF(__pyx_v_connection);
  __Pyx_GOTREF(__pyx_v_self->connection);
  __Pyx_DECREF(__pyx_v_self->connection);
  __pyx_v_self->connection = __pyx_v_connection;

  /* "cymysql/packetx.pyx":68
 *         cdef int errno
 *         self.connection = connection
 *         self.__position = 0             # <<<<<<<<<<<<<<
 *         self.__recv_packet()
 *         is_error = (<unsigned char>(self.__data[0])) == 0xff
 */
  __pyx_v_self->__pyx___position = 0;

  /* "cymysql/packetx.pyx":69
 *         self.connection = connection
 *         self.__position = 0
 *         self.__recv_packet()             # <<<<<<<<<<<<<<
 *         is_error = (<unsigned char>(self.__data[0])) == 0xff
 *         if is_error:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->__pyx___recv_packet(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":70
 *         self.__position = 0
 *         self.__recv_packet()
 *         is_error = (<unsigned char>(self.__data[0])) == 0xff             # <<<<<<<<<<<<<<
 *         if is_error:
 *             self.__position += 1  # field_count == error (we already know that)
 */
  if (unlikely(((PyObject *)__pyx_v_self->__pyx___data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyBytes_GetItemInt(__pyx_v_self->__pyx___data, 0, 1); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_is_error = (((unsigned char)__pyx_t_2) == 0xff);

  /* "cymysql/packetx.pyx":71
 *         self.__recv_packet()
 *         is_error = (<unsigned char>(self.__data[0])) == 0xff
 *         if is_error:             # <<<<<<<<<<<<<<
 *             self.__position += 1  # field_count == error (we already know that)
 *             errno = unpack_uint16(self._read(2))
 */
  if (__pyx_v_is_error) {

    /* "cymysql/packetx.pyx":72
 *         is_error = (<unsigned char>(self.__data[0])) == 0xff
 *         if is_error:
 *             self.__position += 1  # field_count == error (we already know that)             # <<<<<<<<<<<<<<
 *             errno = unpack_uint16(self._read(2))
 *             raise_mysql_exception(self.__data)
 */
    __pyx_v_self->__pyx___position = (__pyx_v_self->__pyx___position + 1);

    /* "cymysql/packetx.pyx":73
 *         if is_error:
 *             self.__position += 1  # field_count == error (we already know that)
 *             errno = unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *             raise_mysql_exception(self.__data)
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_errno = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_1));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymysql/packetx.pyx":74
 *             self.__position += 1  # field_count == error (we already know that)
 *             errno = unpack_uint16(self._read(2))
 *             raise_mysql_exception(self.__data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_3); 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_3 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_v_self->__pyx___data));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx___data));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx___data));
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), 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_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":77
 * 
 * 
 *     cdef bytes __recv_from_socket(self, int size):             # <<<<<<<<<<<<<<
 *         cdef bytes r
 *         cdef int recieved
 */

static PyObject *__pyx_f_7cymysql_7packetx_11MysqlPacket___recv_from_socket(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, int __pyx_v_size) {
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_recv_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__recv_from_socket", 0);

  /* "cymysql/packetx.pyx":81
 *         cdef int recieved
 * 
 *         r = b''             # <<<<<<<<<<<<<<
 *         while size:
 *             recv_data = self.connection.socket.recv(size)
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_4));
  __pyx_v_r = __pyx_kp_b_4;

  /* "cymysql/packetx.pyx":82
 * 
 *         r = b''
 *         while size:             # <<<<<<<<<<<<<<
 *             recv_data = self.connection.socket.recv(size)
 *             if not recv_data:
 */
  while (1) {
    if (!__pyx_v_size) break;

    /* "cymysql/packetx.pyx":83
 *         r = b''
 *         while size:
 *             recv_data = self.connection.socket.recv(size)             # <<<<<<<<<<<<<<
 *             if not recv_data:
 *                 break
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->connection, __pyx_n_s__socket); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__recv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_recv_data);
    __pyx_v_recv_data = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymysql/packetx.pyx":84
 *         while size:
 *             recv_data = self.connection.socket.recv(size)
 *             if not recv_data:             # <<<<<<<<<<<<<<
 *                 break
 *             size -= len(recv_data)
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_recv_data); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = (!__pyx_t_4);
    if (__pyx_t_5) {

      /* "cymysql/packetx.pyx":85
 *             recv_data = self.connection.socket.recv(size)
 *             if not recv_data:
 *                 break             # <<<<<<<<<<<<<<
 *             size -= len(recv_data)
 *             r += recv_data
 */
      goto __pyx_L4_break;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "cymysql/packetx.pyx":86
 *             if not recv_data:
 *                 break
 *             size -= len(recv_data)             # <<<<<<<<<<<<<<
 *             r += recv_data
 *         return r
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_recv_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_size = (__pyx_v_size - __pyx_t_6);

    /* "cymysql/packetx.pyx":87
 *                 break
 *             size -= len(recv_data)
 *             r += recv_data             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_r), __pyx_v_recv_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_r));
    __pyx_v_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L4_break:;

  /* "cymysql/packetx.pyx":88
 *             size -= len(recv_data)
 *             r += recv_data
 *         return r             # <<<<<<<<<<<<<<
 * 
 *     cdef __recv_packet(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_r));
  __pyx_r = __pyx_v_r;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)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("cymysql.packetx.MysqlPacket.__recv_from_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_recv_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":90
 *         return r
 * 
 *     cdef __recv_packet(self):             # <<<<<<<<<<<<<<
 *         """Parse the packet header and read entire packet payload into buffer."""
 *         cdef bytes packet_header, recv_data
 */

static PyObject *__pyx_f_7cymysql_7packetx_11MysqlPacket___recv_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_v_packet_header = 0;
  PyObject *__pyx_v_recv_data = 0;
  int __pyx_v_bytes_to_read;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__recv_packet", 0);

  /* "cymysql/packetx.pyx":95
 *         cdef int bytes_to_read
 * 
 *         packet_header = self.__recv_from_socket(4)             # <<<<<<<<<<<<<<
 *         if len(packet_header) < 4:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->__pyx___recv_from_socket(__pyx_v_self, 4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_packet_header = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":96
 * 
 *         packet_header = self.__recv_from_socket(4)
 *         if len(packet_header) < 4:             # <<<<<<<<<<<<<<
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_packet_header) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_packet_header)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 < 4);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":97
 *         packet_header = self.__recv_from_socket(4)
 *         if len(packet_header) < 4:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")             # <<<<<<<<<<<<<<
 * 
 *         bytes_to_read = unpack_uint24(packet_header)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OperationalError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":99
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 * 
 *         bytes_to_read = unpack_uint24(packet_header)             # <<<<<<<<<<<<<<
 *         # TODO: check packet_num is correct (+1 from last packet)
 *         # self.packet_number = ord(packet_header[3:])
 */
  __pyx_v_bytes_to_read = __pyx_f_7cymysql_7packetx_unpack_uint24(__pyx_v_packet_header);

  /* "cymysql/packetx.pyx":103
 *         # self.packet_number = ord(packet_header[3:])
 * 
 *         recv_data = self.__recv_from_socket(bytes_to_read)             # <<<<<<<<<<<<<<
 *         if len(recv_data) < bytes_to_read:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 */
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->__pyx___recv_from_socket(__pyx_v_self, __pyx_v_bytes_to_read)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_recv_data = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cymysql/packetx.pyx":104
 * 
 *         recv_data = self.__recv_from_socket(bytes_to_read)
 *         if len(recv_data) < bytes_to_read:             # <<<<<<<<<<<<<<
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_recv_data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_recv_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 < __pyx_v_bytes_to_read);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":105
 *         recv_data = self.__recv_from_socket(bytes_to_read)
 *         if len(recv_data) < bytes_to_read:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")             # <<<<<<<<<<<<<<
 * 
 *         self.__data = recv_data
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__OperationalError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "cymysql/packetx.pyx":107
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")
 * 
 *         self.__data = recv_data             # <<<<<<<<<<<<<<
 *         self.__data_length = bytes_to_read
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_recv_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_recv_data));
  __Pyx_GOTREF(__pyx_v_self->__pyx___data);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___data));
  __pyx_v_self->__pyx___data = __pyx_v_recv_data;

  /* "cymysql/packetx.pyx":108
 * 
 *         self.__data = recv_data
 *         self.__data_length = bytes_to_read             # <<<<<<<<<<<<<<
 * 
 *     def get_all_data(self): return self.__data
 */
  __pyx_v_self->__pyx___data_length = __pyx_v_bytes_to_read;

  __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("cymysql.packetx.MysqlPacket.__recv_packet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_packet_header);
  __Pyx_XDECREF(__pyx_v_recv_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_3get_all_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_3get_all_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_data (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_2get_all_data(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":110
 *         self.__data_length = bytes_to_read
 * 
 *     def get_all_data(self): return self.__data             # <<<<<<<<<<<<<<
 * 
 *     def read(self, size):
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_2get_all_data(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx___data));
  __pyx_r = ((PyObject *)__pyx_v_self->__pyx___data);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_5read(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_5read(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_4read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), ((PyObject *)__pyx_v_size));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":112
 *     def get_all_data(self): return self.__data
 * 
 *     def read(self, size):             # <<<<<<<<<<<<<<
 *         return self._read(size)
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_4read(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "cymysql/packetx.pyx":113
 * 
 *     def read(self, size):
 *         return self._read(size)             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes _read(self, int size):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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("cymysql.packetx.MysqlPacket.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":115
 *         return self._read(size)
 * 
 *     cdef bytes _read(self, int size):             # <<<<<<<<<<<<<<
 *         """Read the first 'size' bytes in packet and advance cursor past them."""
 *         cdef bytes result
 */

static PyObject *__pyx_f_7cymysql_7packetx_11MysqlPacket__read(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, int __pyx_v_size) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "cymysql/packetx.pyx":119
 *         cdef bytes result
 * 
 *         if self.__position + size > self.__data_length:             # <<<<<<<<<<<<<<
 *             error = ('Result length not requested length:\n'
 *                  'Expected=%s.  Actual=%s.  Position: %s.  Data Length: %s'
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx___position + __pyx_v_size) > __pyx_v_self->__pyx___data_length);
  if (__pyx_t_1) {

    /* "cymysql/packetx.pyx":122
 *             error = ('Result length not requested length:\n'
 *                  'Expected=%s.  Actual=%s.  Position: %s.  Data Length: %s'
 *                  % (size, self.__data_length - self.__position,             # <<<<<<<<<<<<<<
 *                     self.__position, self.__data_length))
 *             raise AssertionError(error)
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_self->__pyx___data_length - __pyx_v_self->__pyx___position)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "cymysql/packetx.pyx":123
 *                  'Expected=%s.  Actual=%s.  Position: %s.  Data Length: %s'
 *                  % (size, self.__data_length - self.__position,
 *                     self.__position, self.__data_length))             # <<<<<<<<<<<<<<
 *             raise AssertionError(error)
 *         result = self.__data[self.__position:(self.__position+size)]
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_self->__pyx___position); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromLong(__pyx_v_self->__pyx___data_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __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);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_error = ((PyObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymysql/packetx.pyx":124
 *                  % (size, self.__data_length - self.__position,
 *                     self.__position, self.__data_length))
 *             raise AssertionError(error)             # <<<<<<<<<<<<<<
 *         result = self.__data[self.__position:(self.__position+size)]
 * 
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_error);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_error);
    __Pyx_GIVEREF(__pyx_v_error);
    __pyx_t_6 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":125
 *                     self.__position, self.__data_length))
 *             raise AssertionError(error)
 *         result = self.__data[self.__position:(self.__position+size)]             # <<<<<<<<<<<<<<
 * 
 *         self.__position += size
 */
  __pyx_t_6 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_self->__pyx___data), __pyx_v_self->__pyx___position, (__pyx_v_self->__pyx___position + __pyx_v_size)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_v_result = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cymysql/packetx.pyx":127
 *         result = self.__data[self.__position:(self.__position+size)]
 * 
 *         self.__position += size             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_v_self->__pyx___position = (__pyx_v_self->__pyx___position + __pyx_v_size);

  /* "cymysql/packetx.pyx":128
 * 
 *         self.__position += size
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7cymysql_7packetx_11MysqlPacket_6read_all[] = "Read all remaining data in the packet.\n\n        (Subsequent read() or peek() will return errors.)\n        ";
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_6read_all(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":130
 *         return result
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read all remaining data in the packet.
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_6read_all(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "cymysql/packetx.pyx":135
 *         (Subsequent read() or peek() will return errors.)
 *         """
 *         result = self.__data[self.__position:]             # <<<<<<<<<<<<<<
 *         self.__position = -1  # ensure no subsequent read() or peek()
 *         return result
 */
  __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_self->__pyx___data), __pyx_v_self->__pyx___position, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":136
 *         """
 *         result = self.__data[self.__position:]
 *         self.__position = -1  # ensure no subsequent read() or peek()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_v_self->__pyx___position = -1;

  /* "cymysql/packetx.pyx":137
 *         result = self.__data[self.__position:]
 *         self.__position = -1  # ensure no subsequent read() or peek()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef int read_length_coded_binary(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":139
 *         return result
 * 
 *     cdef int read_length_coded_binary(self):             # <<<<<<<<<<<<<<
 *         """Read a 'Length Coded Binary' number from the data buffer.
 * 
 */

static int __pyx_f_7cymysql_7packetx_11MysqlPacket_read_length_coded_binary(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  unsigned char __pyx_v_c;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_length_coded_binary", 0);

  /* "cymysql/packetx.pyx":145
 *         on the value of the first byte.
 *         """
 *         cdef unsigned char c = self._read(1)[0]             # <<<<<<<<<<<<<<
 *         if c < UNSIGNED_CHAR_COLUMN:
 *             return c
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyBytes_GetItemInt(((PyObject*)__pyx_t_1), 0, 1); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c = __pyx_t_2;

  /* "cymysql/packetx.pyx":146
 *         """
 *         cdef unsigned char c = self._read(1)[0]
 *         if c < UNSIGNED_CHAR_COLUMN:             # <<<<<<<<<<<<<<
 *             return c
 *         elif c == UNSIGNED_SHORT_COLUMN:
 */
  __pyx_t_3 = (__pyx_v_c < __pyx_v_7cymysql_7packetx_UNSIGNED_CHAR_COLUMN);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":147
 *         cdef unsigned char c = self._read(1)[0]
 *         if c < UNSIGNED_CHAR_COLUMN:
 *             return c             # <<<<<<<<<<<<<<
 *         elif c == UNSIGNED_SHORT_COLUMN:
 *             return unpack_uint16(self._read(2))
 */
    __pyx_r = __pyx_v_c;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "cymysql/packetx.pyx":148
 *         if c < UNSIGNED_CHAR_COLUMN:
 *             return c
 *         elif c == UNSIGNED_SHORT_COLUMN:             # <<<<<<<<<<<<<<
 *             return unpack_uint16(self._read(2))
 *         elif c == UNSIGNED_INT24_COLUMN:
 */
  __pyx_t_3 = (__pyx_v_c == __pyx_v_7cymysql_7packetx_UNSIGNED_SHORT_COLUMN);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":149
 *             return c
 *         elif c == UNSIGNED_SHORT_COLUMN:
 *             return unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *         elif c == UNSIGNED_INT24_COLUMN:
 *             return unpack_uint24(self._read(3))
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_1));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "cymysql/packetx.pyx":150
 *         elif c == UNSIGNED_SHORT_COLUMN:
 *             return unpack_uint16(self._read(2))
 *         elif c == UNSIGNED_INT24_COLUMN:             # <<<<<<<<<<<<<<
 *             return unpack_uint24(self._read(3))
 *         elif c == UNSIGNED_INT64_COLUMN:
 */
  __pyx_t_3 = (__pyx_v_c == __pyx_v_7cymysql_7packetx_UNSIGNED_INT24_COLUMN);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":151
 *             return unpack_uint16(self._read(2))
 *         elif c == UNSIGNED_INT24_COLUMN:
 *             return unpack_uint24(self._read(3))             # <<<<<<<<<<<<<<
 *         elif c == UNSIGNED_INT64_COLUMN:
 *             return unpack_uint64(self._read(8))
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_f_7cymysql_7packetx_unpack_uint24(((PyObject*)__pyx_t_1));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "cymysql/packetx.pyx":152
 *         elif c == UNSIGNED_INT24_COLUMN:
 *             return unpack_uint24(self._read(3))
 *         elif c == UNSIGNED_INT64_COLUMN:             # <<<<<<<<<<<<<<
 *             return unpack_uint64(self._read(8))
 *         else:
 */
  __pyx_t_3 = (__pyx_v_c == __pyx_v_7cymysql_7packetx_UNSIGNED_INT64_COLUMN);
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":153
 *             return unpack_uint24(self._read(3))
 *         elif c == UNSIGNED_INT64_COLUMN:
 *             return unpack_uint64(self._read(8))             # <<<<<<<<<<<<<<
 *         else:
 *             return -1
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_f_7cymysql_7packetx_unpack_uint64(((PyObject*)__pyx_t_1));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cymysql/packetx.pyx":155
 *             return unpack_uint64(self._read(8))
 *         else:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *     cdef read_length_coded_string(self):
 */
    __pyx_r = -1;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cymysql.packetx.MysqlPacket.read_length_coded_binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":157
 *             return -1
 * 
 *     cdef read_length_coded_string(self):             # <<<<<<<<<<<<<<
 *         return self._read_length_coded_string()
 * 
 */

static PyObject *__pyx_f_7cymysql_7packetx_11MysqlPacket_read_length_coded_string(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_length_coded_string", 0);

  /* "cymysql/packetx.pyx":158
 * 
 *     cdef read_length_coded_string(self):
 *         return self._read_length_coded_string()             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes _read_length_coded_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read_length_coded_string(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __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("cymysql.packetx.MysqlPacket.read_length_coded_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":160
 *         return self._read_length_coded_string()
 * 
 *     cdef bytes _read_length_coded_string(self):             # <<<<<<<<<<<<<<
 *         """Read a 'Length Coded String' from the data buffer.
 * 
 */

static PyObject *__pyx_f_7cymysql_7packetx_11MysqlPacket__read_length_coded_string(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  int __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_length_coded_string", 0);

  /* "cymysql/packetx.pyx":168
 *         """
 *         cdef int length
 *         length = self.read_length_coded_binary()             # <<<<<<<<<<<<<<
 *         if length < 0:
 *             return None
 */
  __pyx_v_length = ((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->read_length_coded_binary(__pyx_v_self);

  /* "cymysql/packetx.pyx":169
 *         cdef int length
 *         length = self.read_length_coded_binary()
 *         if length < 0:             # <<<<<<<<<<<<<<
 *             return None
 *         return self._read(length)
 */
  __pyx_t_1 = (__pyx_v_length < 0);
  if (__pyx_t_1) {

    /* "cymysql/packetx.pyx":170
 *         length = self.read_length_coded_binary()
 *         if length < 0:
 *             return None             # <<<<<<<<<<<<<<
 *         return self._read(length)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(Py_None);
    __pyx_r = ((PyObject*)Py_None);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":171
 *         if length < 0:
 *             return None
 *         return self._read(length)             # <<<<<<<<<<<<<<
 * 
 *     def read_decode_data(self, fields):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, __pyx_v_length)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket._read_length_coded_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_9read_decode_data(PyObject *__pyx_v_self, PyObject *__pyx_v_fields); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_9read_decode_data(PyObject *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_decode_data (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_8read_decode_data(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), ((PyObject *)__pyx_v_fields));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":173
 *         return self._read(length)
 * 
 *     def read_decode_data(self, fields):             # <<<<<<<<<<<<<<
 *         values = [self._read_length_coded_string() for f in fields]
 *         return tuple(
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_8read_decode_data(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_v_values = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_decode_data", 0);

  /* "cymysql/packetx.pyx":174
 * 
 *     def read_decode_data(self, fields):
 *         values = [self._read_length_coded_string() for f in fields]             # <<<<<<<<<<<<<<
 *         return tuple(
 *             get_decode_values(values,
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_v_fields) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_f);
    __pyx_v_f = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read_length_coded_string(__pyx_v_self)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_values = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":175
 *     def read_decode_data(self, fields):
 *         values = [self._read_length_coded_string() for f in fields]
 *         return tuple(             # <<<<<<<<<<<<<<
 *             get_decode_values(values,
 *                 self.connection.charset,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cymysql/packetx.pyx":176
 *         values = [self._read_length_coded_string() for f in fields]
 *         return tuple(
 *             get_decode_values(values,             # <<<<<<<<<<<<<<
 *                 self.connection.charset,
 *                 fields,
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_decode_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "cymysql/packetx.pyx":177
 *         return tuple(
 *             get_decode_values(values,
 *                 self.connection.charset,             # <<<<<<<<<<<<<<
 *                 fields,
 *                 self.connection.use_unicode,
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->connection, __pyx_n_s__charset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymysql/packetx.pyx":179
 *                 self.connection.charset,
 *                 fields,
 *                 self.connection.use_unicode,             # <<<<<<<<<<<<<<
 *                 self.connection.conv)
 *         )
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->connection, __pyx_n_s__use_unicode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);

  /* "cymysql/packetx.pyx":180
 *                 fields,
 *                 self.connection.use_unicode,
 *                 self.connection.conv)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->connection, __pyx_n_s__conv); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_fields);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_fields);
  __Pyx_GIVEREF(__pyx_v_fields);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.read_decode_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_11is_ok_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_11is_ok_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ok_packet (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_10is_ok_packet(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":183
 *         )
 * 
 *     def is_ok_packet(self):             # <<<<<<<<<<<<<<
 *         return (<unsigned char>(self.__data[0])) == 0
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_10is_ok_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_ok_packet", 0);

  /* "cymysql/packetx.pyx":184
 * 
 *     def is_ok_packet(self):
 *         return (<unsigned char>(self.__data[0])) == 0             # <<<<<<<<<<<<<<
 * 
 *     def is_eof_packet(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self->__pyx___data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyBytes_GetItemInt(__pyx_v_self->__pyx___data, 0, 1); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong((((unsigned char)__pyx_t_1) == 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __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("cymysql.packetx.MysqlPacket.is_ok_packet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_13is_eof_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_13is_eof_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_eof_packet (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_12is_eof_packet(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":186
 *         return (<unsigned char>(self.__data[0])) == 0
 * 
 *     def is_eof_packet(self):             # <<<<<<<<<<<<<<
 *         return (<unsigned char>(self.__data[0])) == 0xfe
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_12is_eof_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_eof_packet", 0);

  /* "cymysql/packetx.pyx":187
 * 
 *     def is_eof_packet(self):
 *         return (<unsigned char>(self.__data[0])) == 0xfe             # <<<<<<<<<<<<<<
 * 
 *     def is_eof_and_status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self->__pyx___data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyBytes_GetItemInt(__pyx_v_self->__pyx___data, 0, 1); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong((((unsigned char)__pyx_t_1) == 0xfe)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __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("cymysql.packetx.MysqlPacket.is_eof_packet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_15is_eof_and_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_15is_eof_and_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_eof_and_status (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_14is_eof_and_status(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":189
 *         return (<unsigned char>(self.__data[0])) == 0xfe
 * 
 *     def is_eof_and_status(self):             # <<<<<<<<<<<<<<
 *         if (<unsigned char>(self.__data[0])) != 0xfe:
 *            return False, 0, 0
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_14is_eof_and_status(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_eof_and_status", 0);

  /* "cymysql/packetx.pyx":190
 * 
 *     def is_eof_and_status(self):
 *         if (<unsigned char>(self.__data[0])) != 0xfe:             # <<<<<<<<<<<<<<
 *            return False, 0, 0
 *         return True, unpack_uint16(self._read(2)), unpack_uint16(self._read(2))
 */
  if (unlikely(((PyObject *)__pyx_v_self->__pyx___data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyBytes_GetItemInt(__pyx_v_self->__pyx___data, 0, 1); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (((unsigned char)__pyx_t_1) != 0xfe);
  if (__pyx_t_2) {

    /* "cymysql/packetx.pyx":191
 *     def is_eof_and_status(self):
 *         if (<unsigned char>(self.__data[0])) != 0xfe:
 *            return False, 0, 0             # <<<<<<<<<<<<<<
 *         return True, unpack_uint16(self._read(2)), unpack_uint16(self._read(2))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_3 = 0;
    __pyx_r = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":192
 *         if (<unsigned char>(self.__data[0])) != 0xfe:
 *            return False, 0, 0
 *         return True, unpack_uint16(self._read(2)), unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 * 
 *     def read_ok_packet(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_to_py_uint16_t(__pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_3))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyInt_to_py_uint16_t(__pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_3))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_r = ((PyObject *)__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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.is_eof_and_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_17read_ok_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MysqlPacket_17read_ok_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_ok_packet (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MysqlPacket_16read_ok_packet(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":194
 *         return True, unpack_uint16(self._read(2)), unpack_uint16(self._read(2))
 * 
 *     def read_ok_packet(self):             # <<<<<<<<<<<<<<
 *         cdef int affected_rows, insert_id, server_status, warning_count
 *         cdef message
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MysqlPacket_16read_ok_packet(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_self) {
  int __pyx_v_affected_rows;
  int __pyx_v_insert_id;
  int __pyx_v_server_status;
  int __pyx_v_warning_count;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_ok_packet", 0);

  /* "cymysql/packetx.pyx":197
 *         cdef int affected_rows, insert_id, server_status, warning_count
 *         cdef message
 *         self.read(1)  # field_count (always '0')             # <<<<<<<<<<<<<<
 *         affected_rows = self.read_length_coded_binary()
 *         insert_id = self.read_length_coded_binary()
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __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;

  /* "cymysql/packetx.pyx":198
 *         cdef message
 *         self.read(1)  # field_count (always '0')
 *         affected_rows = self.read_length_coded_binary()             # <<<<<<<<<<<<<<
 *         insert_id = self.read_length_coded_binary()
 *         server_status = unpack_uint16(self._read(2))
 */
  __pyx_v_affected_rows = ((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->read_length_coded_binary(__pyx_v_self);

  /* "cymysql/packetx.pyx":199
 *         self.read(1)  # field_count (always '0')
 *         affected_rows = self.read_length_coded_binary()
 *         insert_id = self.read_length_coded_binary()             # <<<<<<<<<<<<<<
 *         server_status = unpack_uint16(self._read(2))
 *         warning_count = unpack_uint16(self._read(2))
 */
  __pyx_v_insert_id = ((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->read_length_coded_binary(__pyx_v_self);

  /* "cymysql/packetx.pyx":200
 *         affected_rows = self.read_length_coded_binary()
 *         insert_id = self.read_length_coded_binary()
 *         server_status = unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *         warning_count = unpack_uint16(self._read(2))
 *         message = self.read_all()
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_server_status = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":201
 *         insert_id = self.read_length_coded_binary()
 *         server_status = unpack_uint16(self._read(2))
 *         warning_count = unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *         message = self.read_all()
 *         return (None if affected_rows < 0 else affected_rows,
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_warning_count = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":202
 *         server_status = unpack_uint16(self._read(2))
 *         warning_count = unpack_uint16(self._read(2))
 *         message = self.read_all()             # <<<<<<<<<<<<<<
 *         return (None if affected_rows < 0 else affected_rows,
 *                 None if insert_id < 0 else insert_id,
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_all); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_message = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":203
 *         warning_count = unpack_uint16(self._read(2))
 *         message = self.read_all()
 *         return (None if affected_rows < 0 else affected_rows,             # <<<<<<<<<<<<<<
 *                 None if insert_id < 0 else insert_id,
 *                 server_status, warning_count, message)
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_affected_rows < 0)) {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  } else {
    __pyx_t_2 = PyInt_FromLong(__pyx_v_affected_rows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }

  /* "cymysql/packetx.pyx":204
 *         message = self.read_all()
 *         return (None if affected_rows < 0 else affected_rows,
 *                 None if insert_id < 0 else insert_id,             # <<<<<<<<<<<<<<
 *                 server_status, warning_count, message)
 * 
 */
  if ((__pyx_v_insert_id < 0)) {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  } else {
    __pyx_t_3 = PyInt_FromLong(__pyx_v_insert_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "cymysql/packetx.pyx":205
 *         return (None if affected_rows < 0 else affected_rows,
 *                 None if insert_id < 0 else insert_id,
 *                 server_status, warning_count, message)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_server_status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_warning_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __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_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_message);
  __Pyx_GIVEREF(__pyx_v_message);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymysql.packetx.MysqlPacket.read_ok_packet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  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_args = __pyx_args;
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket___init__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":217
 *     cdef public int charsetnr, length, type_code, flags, scale
 * 
 *     def __init__(self, *args):             # <<<<<<<<<<<<<<
 *         MysqlPacket.__init__(self, *args)
 *         self.__parse_field_descriptor()
 */

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket___init__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_args) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymysql/packetx.pyx":218
 * 
 *     def __init__(self, *args):
 *         MysqlPacket.__init__(self, *args)             # <<<<<<<<<<<<<<
 *         self.__parse_field_descriptor()
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_MysqlPacket)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __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[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymysql/packetx.pyx":219
 *     def __init__(self, *args):
 *         MysqlPacket.__init__(self, *args)
 *         self.__parse_field_descriptor()             # <<<<<<<<<<<<<<
 * 
 *     def __parse_field_descriptor(self):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __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("cymysql.packetx.FieldDescriptorPacket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_3__parse_field_descriptor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7cymysql_7packetx_21FieldDescriptorPacket_2__parse_field_descriptor[] = "Parse the 'Field Descriptor' (Metadata) packet.\n    \n        This is compatible with MySQL 4.1+ (not compatible with MySQL 4.0).\n        ";
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_3__parse_field_descriptor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__parse_field_descriptor (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2__parse_field_descriptor(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":221
 *         self.__parse_field_descriptor()
 * 
 *     def __parse_field_descriptor(self):             # <<<<<<<<<<<<<<
 *         """Parse the 'Field Descriptor' (Metadata) packet.
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2__parse_field_descriptor(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__parse_field_descriptor", 0);

  /* "cymysql/packetx.pyx":226
 *         This is compatible with MySQL 4.1+ (not compatible with MySQL 4.0).
 *         """
 *         self.catalog = self._read_length_coded_string()             # <<<<<<<<<<<<<<
 *         self.db = self._read_length_coded_string()
 *         self.table_name = self._read_length_coded_string()
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->catalog);
  __Pyx_DECREF(__pyx_v_self->catalog);
  __pyx_v_self->catalog = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":227
 *         """
 *         self.catalog = self._read_length_coded_string()
 *         self.db = self._read_length_coded_string()             # <<<<<<<<<<<<<<
 *         self.table_name = self._read_length_coded_string()
 *         self.org_table = self._read_length_coded_string()
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(__pyx_v_self->db);
  __pyx_v_self->db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":228
 *         self.catalog = self._read_length_coded_string()
 *         self.db = self._read_length_coded_string()
 *         self.table_name = self._read_length_coded_string()             # <<<<<<<<<<<<<<
 *         self.org_table = self._read_length_coded_string()
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->table_name);
  __Pyx_DECREF(__pyx_v_self->table_name);
  __pyx_v_self->table_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":229
 *         self.db = self._read_length_coded_string()
 *         self.table_name = self._read_length_coded_string()
 *         self.org_table = self._read_length_coded_string()             # <<<<<<<<<<<<<<
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)
 *         self.org_name = self._read_length_coded_string()
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->org_table);
  __Pyx_DECREF(__pyx_v_self->org_table);
  __pyx_v_self->org_table = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":230
 *         self.table_name = self._read_length_coded_string()
 *         self.org_table = self._read_length_coded_string()
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)             # <<<<<<<<<<<<<<
 *         self.org_name = self._read_length_coded_string()
 *         self.read(1)  # non-null filler
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __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_v_self->__pyx_base.connection, __pyx_n_s__charset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":231
 *         self.org_table = self._read_length_coded_string()
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)
 *         self.org_name = self._read_length_coded_string()             # <<<<<<<<<<<<<<
 *         self.read(1)  # non-null filler
 *         self.charsetnr = unpack_uint16(self._read(2))
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_length_coded_string(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->org_name);
  __Pyx_DECREF(__pyx_v_self->org_name);
  __pyx_v_self->org_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":232
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)
 *         self.org_name = self._read_length_coded_string()
 *         self.read(1)  # non-null filler             # <<<<<<<<<<<<<<
 *         self.charsetnr = unpack_uint16(self._read(2))
 *         self.length = unpack_uint32(self._read(4))
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __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_3); __pyx_t_3 = 0;

  /* "cymysql/packetx.pyx":233
 *         self.org_name = self._read_length_coded_string()
 *         self.read(1)  # non-null filler
 *         self.charsetnr = unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *         self.length = unpack_uint32(self._read(4))
 *         self.type_code = ord(self._read(1))
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_self->charsetnr = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymysql/packetx.pyx":234
 *         self.read(1)  # non-null filler
 *         self.charsetnr = unpack_uint16(self._read(2))
 *         self.length = unpack_uint32(self._read(4))             # <<<<<<<<<<<<<<
 *         self.type_code = ord(self._read(1))
 *         self.flags = unpack_uint16(self._read(2))
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), 4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_self->length = __pyx_f_7cymysql_7packetx_unpack_uint32(((PyObject*)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymysql/packetx.pyx":235
 *         self.charsetnr = unpack_uint16(self._read(2))
 *         self.length = unpack_uint32(self._read(4))
 *         self.type_code = ord(self._read(1))             # <<<<<<<<<<<<<<
 *         self.flags = unpack_uint16(self._read(2))
 *         self.scale = ord(self._read(1))  # "decimals"
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __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[0]; __pyx_lineno = 235; __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_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->type_code = __pyx_t_4;

  /* "cymysql/packetx.pyx":236
 *         self.length = unpack_uint32(self._read(4))
 *         self.type_code = ord(self._read(1))
 *         self.flags = unpack_uint16(self._read(2))             # <<<<<<<<<<<<<<
 *         self.scale = ord(self._read(1))  # "decimals"
 *         self.read(2)  # filler (always 0x00)
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_self->flags = __pyx_f_7cymysql_7packetx_unpack_uint16(((PyObject*)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymysql/packetx.pyx":237
 *         self.type_code = ord(self._read(1))
 *         self.flags = unpack_uint16(self._read(2))
 *         self.scale = ord(self._read(1))  # "decimals"             # <<<<<<<<<<<<<<
 *         self.read(2)  # filler (always 0x00)
 * 
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read(((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __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[0]; __pyx_lineno = 237; __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_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->scale = __pyx_t_4;

  /* "cymysql/packetx.pyx":238
 *         self.flags = unpack_uint16(self._read(2))
 *         self.scale = ord(self._read(1))  # "decimals"
 *         self.read(2)  # filler (always 0x00)             # <<<<<<<<<<<<<<
 * 
 *         # 'default' is a length coded binary and is still in the buffer?
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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("cymysql.packetx.FieldDescriptorPacket.__parse_field_descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7cymysql_7packetx_21FieldDescriptorPacket_4description[] = "Provides a 7-item tuple compatible with the Python PEP249 DB Spec.";
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("description (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4description(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":243
 *         # not used for normal result sets...
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Provides a 7-item tuple compatible with the Python PEP249 DB Spec."""
 *         desc = (
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4description(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("description", 0);

  /* "cymysql/packetx.pyx":247
 *         desc = (
 *             self.name,
 *             self.type_code,             # <<<<<<<<<<<<<<
 *             None,  # TODO: display_length; should this be self.length?
 *             self.get_column_length(),  # 'internal_size'
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->type_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymysql/packetx.pyx":249
 *             self.type_code,
 *             None,  # TODO: display_length; should this be self.length?
 *             self.get_column_length(),  # 'internal_size'             # <<<<<<<<<<<<<<
 *             self.get_column_length(),  # 'precision'  # TODO: why!?!?
 *             self.scale,
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_column_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __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[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":250
 *             None,  # TODO: display_length; should this be self.length?
 *             self.get_column_length(),  # 'internal_size'
 *             self.get_column_length(),  # 'precision'  # TODO: why!?!?             # <<<<<<<<<<<<<<
 *             self.scale,
 *             # 'null_ok' -- can this be True/False rather than 1/0?
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_column_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":251
 *             self.get_column_length(),  # 'internal_size'
 *             self.get_column_length(),  # 'precision'  # TODO: why!?!?
 *             self.scale,             # <<<<<<<<<<<<<<
 *             # 'null_ok' -- can this be True/False rather than 1/0?
 *             <int>(self.flags % 2 == 0),
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->scale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "cymysql/packetx.pyx":253
 *             self.scale,
 *             # 'null_ok' -- can this be True/False rather than 1/0?
 *             <int>(self.flags % 2 == 0),             # <<<<<<<<<<<<<<
 *         )
 *         return desc
 */
  __pyx_t_5 = PyInt_FromLong(((int)(__Pyx_mod_long(__pyx_v_self->flags, 2) == 0))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_v_desc = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cymysql/packetx.pyx":255
 *             <int>(self.flags % 2 == 0),
 *         )
 *         return desc             # <<<<<<<<<<<<<<
 * 
 *     def get_column_length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_desc));
  __pyx_r = ((PyObject *)__pyx_v_desc);
  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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7get_column_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7get_column_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_column_length (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6get_column_length(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":257
 *         return desc
 * 
 *     def get_column_length(self):             # <<<<<<<<<<<<<<
 *         cdef int mblen
 *         if self.type_code == FIELD_TYPE_VAR_STRING:
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6get_column_length(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_v_mblen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_column_length", 0);

  /* "cymysql/packetx.pyx":259
 *     def get_column_length(self):
 *         cdef int mblen
 *         if self.type_code == FIELD_TYPE_VAR_STRING:             # <<<<<<<<<<<<<<
 *             mblen = MBLENGTH.get(self.charsetnr, 1)
 *             return self.length // mblen
 */
  __pyx_t_1 = (__pyx_v_self->type_code == __pyx_v_7cymysql_7packetx_FIELD_TYPE_VAR_STRING);
  if (__pyx_t_1) {

    /* "cymysql/packetx.pyx":260
 *         cdef int mblen
 *         if self.type_code == FIELD_TYPE_VAR_STRING:
 *             mblen = MBLENGTH.get(self.charsetnr, 1)             # <<<<<<<<<<<<<<
 *             return self.length // mblen
 *         return self.length
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__MBLENGTH); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __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_t_2 = PyInt_FromLong(__pyx_v_self->charsetnr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __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_INCREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_mblen = __pyx_t_5;

    /* "cymysql/packetx.pyx":261
 *         if self.type_code == FIELD_TYPE_VAR_STRING:
 *             mblen = MBLENGTH.get(self.charsetnr, 1)
 *             return self.length // mblen             # <<<<<<<<<<<<<<
 *         return self.length
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_mblen == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_mblen == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->length))) {
      PyErr_Format(PyExc_OverflowError, "value too large to perform division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyInt_FromLong(__Pyx_div_int(__pyx_v_self->length, __pyx_v_mblen)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":262
 *             mblen = MBLENGTH.get(self.charsetnr, 1)
 *             return self.length // mblen
 *         return self.length             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.get_column_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8__str__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":264
 *         return self.length
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return ('%s %s.%s.%s, type=%s'
 *             % (self.__class__, self.db, self.table_name, self.name,
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8__str__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "cymysql/packetx.pyx":265
 * 
 *     def __str__(self):
 *         return ('%s %s.%s.%s, type=%s'             # <<<<<<<<<<<<<<
 *             % (self.__class__, self.db, self.table_name, self.name,
 *                self.type_code))
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cymysql/packetx.pyx":266
 *     def __str__(self):
 *         return ('%s %s.%s.%s, type=%s'
 *             % (self.__class__, self.db, self.table_name, self.name,             # <<<<<<<<<<<<<<
 *                self.type_code))
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymysql/packetx.pyx":267
 *         return ('%s %s.%s.%s, type=%s'
 *             % (self.__class__, self.db, self.table_name, self.name,
 *                self.type_code))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->type_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->db);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->db);
  __Pyx_GIVEREF(__pyx_v_self->db);
  __Pyx_INCREF(__pyx_v_self->table_name);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->table_name);
  __Pyx_GIVEREF(__pyx_v_self->table_name);
  __Pyx_INCREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":214
 *     attributes on the class such as: db, table_name, name, length, type_code.
 *     """
 *     cdef public object catalog, db, table_name, org_table, name, org_name             # <<<<<<<<<<<<<<
 *     cdef public int charsetnr, length, type_code, flags, scale
 * 
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->catalog);
  __pyx_r = __pyx_v_self->catalog;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->catalog);
  __Pyx_DECREF(__pyx_v_self->catalog);
  __pyx_v_self->catalog = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->catalog);
  __Pyx_DECREF(__pyx_v_self->catalog);
  __pyx_v_self->catalog = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->db);
  __pyx_r = __pyx_v_self->db;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(__pyx_v_self->db);
  __pyx_v_self->db = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_2db_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(__pyx_v_self->db);
  __pyx_v_self->db = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->table_name);
  __pyx_r = __pyx_v_self->table_name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->table_name);
  __Pyx_DECREF(__pyx_v_self->table_name);
  __pyx_v_self->table_name = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->table_name);
  __Pyx_DECREF(__pyx_v_self->table_name);
  __pyx_v_self->table_name = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->org_table);
  __pyx_r = __pyx_v_self->org_table;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->org_table);
  __Pyx_DECREF(__pyx_v_self->org_table);
  __pyx_v_self->org_table = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->org_table);
  __Pyx_DECREF(__pyx_v_self->org_table);
  __pyx_v_self->org_table = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_4name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->org_name);
  __pyx_r = __pyx_v_self->org_name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->org_name);
  __Pyx_DECREF(__pyx_v_self->org_name);
  __pyx_v_self->org_name = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_4__del__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_4__del__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->org_name);
  __Pyx_DECREF(__pyx_v_self->org_name);
  __pyx_v_self->org_name = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":215
 *     """
 *     cdef public object catalog, db, table_name, org_table, name, org_name
 *     cdef public int charsetnr, length, type_code, flags, scale             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args):
 */

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->charsetnr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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("cymysql.packetx.FieldDescriptorPacket.charsetnr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->charsetnr = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.charsetnr.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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("cymysql.packetx.FieldDescriptorPacket.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_6length_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->length = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->type_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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("cymysql.packetx.FieldDescriptorPacket.type_code.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->type_code = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.type_code.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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("cymysql.packetx.FieldDescriptorPacket.flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5flags_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->flags = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.flags.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale___get__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale___get__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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("cymysql.packetx.FieldDescriptorPacket.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale_2__set__(((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_21FieldDescriptorPacket_5scale_2__set__(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->scale = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymysql.packetx.FieldDescriptorPacket.scale.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_connection = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__connection,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__connection)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_connection = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymysql.packetx.MySQLResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult___init__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), __pyx_v_connection);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":279
 *     cdef int rest_row_index
 * 
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         from weakref import proxy
 *         self.connection = proxy(connection)
 */

static int __pyx_pf_7cymysql_7packetx_11MySQLResult___init__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_connection) {
  PyObject *__pyx_v_proxy = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymysql/packetx.pyx":280
 * 
 *     def __init__(self, connection):
 *         from weakref import proxy             # <<<<<<<<<<<<<<
 *         self.connection = proxy(connection)
 *         self.affected_rows = None
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__proxy));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__proxy));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__proxy));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__weakref), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__proxy);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__proxy);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_proxy = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":281
 *     def __init__(self, connection):
 *         from weakref import proxy
 *         self.connection = proxy(connection)             # <<<<<<<<<<<<<<
 *         self.affected_rows = None
 *         self.insert_id = None
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_connection);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_connection);
  __Pyx_GIVEREF(__pyx_v_connection);
  __pyx_t_1 = PyObject_Call(__pyx_v_proxy, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->connection);
  __Pyx_DECREF(__pyx_v_self->connection);
  __pyx_v_self->connection = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":282
 *         from weakref import proxy
 *         self.connection = proxy(connection)
 *         self.affected_rows = None             # <<<<<<<<<<<<<<
 *         self.insert_id = None
 *         self.server_status = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->affected_rows);
  __Pyx_DECREF(__pyx_v_self->affected_rows);
  __pyx_v_self->affected_rows = Py_None;

  /* "cymysql/packetx.pyx":283
 *         self.connection = proxy(connection)
 *         self.affected_rows = None
 *         self.insert_id = None             # <<<<<<<<<<<<<<
 *         self.server_status = 0
 *         self.warning_count = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->insert_id);
  __Pyx_DECREF(__pyx_v_self->insert_id);
  __pyx_v_self->insert_id = Py_None;

  /* "cymysql/packetx.pyx":284
 *         self.affected_rows = None
 *         self.insert_id = None
 *         self.server_status = 0             # <<<<<<<<<<<<<<
 *         self.warning_count = 0
 *         self.message = None
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->server_status);
  __Pyx_DECREF(__pyx_v_self->server_status);
  __pyx_v_self->server_status = __pyx_int_0;

  /* "cymysql/packetx.pyx":285
 *         self.insert_id = None
 *         self.server_status = 0
 *         self.warning_count = 0             # <<<<<<<<<<<<<<
 *         self.message = None
 *         self.field_count = 0
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->warning_count);
  __Pyx_DECREF(__pyx_v_self->warning_count);
  __pyx_v_self->warning_count = __pyx_int_0;

  /* "cymysql/packetx.pyx":286
 *         self.server_status = 0
 *         self.warning_count = 0
 *         self.message = None             # <<<<<<<<<<<<<<
 *         self.field_count = 0
 *         self.description = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->message);
  __Pyx_DECREF(__pyx_v_self->message);
  __pyx_v_self->message = Py_None;

  /* "cymysql/packetx.pyx":287
 *         self.warning_count = 0
 *         self.message = None
 *         self.field_count = 0             # <<<<<<<<<<<<<<
 *         self.description = None
 *         self.has_next = None
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->field_count);
  __Pyx_DECREF(__pyx_v_self->field_count);
  __pyx_v_self->field_count = __pyx_int_0;

  /* "cymysql/packetx.pyx":288
 *         self.message = None
 *         self.field_count = 0
 *         self.description = None             # <<<<<<<<<<<<<<
 *         self.has_next = None
 *         self.has_result = False
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->description);
  __Pyx_DECREF(__pyx_v_self->description);
  __pyx_v_self->description = Py_None;

  /* "cymysql/packetx.pyx":289
 *         self.field_count = 0
 *         self.description = None
 *         self.has_next = None             # <<<<<<<<<<<<<<
 *         self.has_result = False
 *         self.rest_rows = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->has_next);
  __Pyx_DECREF(__pyx_v_self->has_next);
  __pyx_v_self->has_next = Py_None;

  /* "cymysql/packetx.pyx":290
 *         self.description = None
 *         self.has_next = None
 *         self.has_result = False             # <<<<<<<<<<<<<<
 *         self.rest_rows = None
 *         self.rest_row_index = 0
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->has_result);
  __Pyx_DECREF(__pyx_v_self->has_result);
  __pyx_v_self->has_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":291
 *         self.has_next = None
 *         self.has_result = False
 *         self.rest_rows = None             # <<<<<<<<<<<<<<
 *         self.rest_row_index = 0
 *         self.first_packet = MysqlPacket(self.connection)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rest_rows);
  __Pyx_DECREF(__pyx_v_self->rest_rows);
  __pyx_v_self->rest_rows = Py_None;

  /* "cymysql/packetx.pyx":292
 *         self.has_result = False
 *         self.rest_rows = None
 *         self.rest_row_index = 0             # <<<<<<<<<<<<<<
 *         self.first_packet = MysqlPacket(self.connection)
 *         if self.first_packet.is_ok_packet():
 */
  __pyx_v_self->rest_row_index = 0;

  /* "cymysql/packetx.pyx":293
 *         self.rest_rows = None
 *         self.rest_row_index = 0
 *         self.first_packet = MysqlPacket(self.connection)             # <<<<<<<<<<<<<<
 *         if self.first_packet.is_ok_packet():
 *             (self.affected_rows, self.insert_id,
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->connection);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->connection);
  __Pyx_GIVEREF(__pyx_v_self->connection);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_MysqlPacket)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->first_packet);
  __Pyx_DECREF(__pyx_v_self->first_packet);
  __pyx_v_self->first_packet = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":294
 *         self.rest_row_index = 0
 *         self.first_packet = MysqlPacket(self.connection)
 *         if self.first_packet.is_ok_packet():             # <<<<<<<<<<<<<<
 *             (self.affected_rows, self.insert_id,
 *                 self.server_status, self.warning_count,
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->first_packet, __pyx_n_s__is_ok_packet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __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[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":297
 *             (self.affected_rows, self.insert_id,
 *                 self.server_status, self.warning_count,
 *                 self.message) = self.first_packet.read_ok_packet()             # <<<<<<<<<<<<<<
 *             self.has_result = False
 *         else:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->first_packet, __pyx_n_s__read_ok_packet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __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[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        *(temps[i]) = item;
      }
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }

    /* "cymysql/packetx.pyx":295
 *         self.first_packet = MysqlPacket(self.connection)
 *         if self.first_packet.is_ok_packet():
 *             (self.affected_rows, self.insert_id,             # <<<<<<<<<<<<<<
 *                 self.server_status, self.warning_count,
 *                 self.message) = self.first_packet.read_ok_packet()
 */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->affected_rows);
    __Pyx_DECREF(__pyx_v_self->affected_rows);
    __pyx_v_self->affected_rows = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->insert_id);
    __Pyx_DECREF(__pyx_v_self->insert_id);
    __pyx_v_self->insert_id = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cymysql/packetx.pyx":296
 *         if self.first_packet.is_ok_packet():
 *             (self.affected_rows, self.insert_id,
 *                 self.server_status, self.warning_count,             # <<<<<<<<<<<<<<
 *                 self.message) = self.first_packet.read_ok_packet()
 *             self.has_result = False
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->server_status);
    __Pyx_DECREF(__pyx_v_self->server_status);
    __pyx_v_self->server_status = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_v_self->warning_count);
    __Pyx_DECREF(__pyx_v_self->warning_count);
    __pyx_v_self->warning_count = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cymysql/packetx.pyx":297
 *             (self.affected_rows, self.insert_id,
 *                 self.server_status, self.warning_count,
 *                 self.message) = self.first_packet.read_ok_packet()             # <<<<<<<<<<<<<<
 *             self.has_result = False
 *         else:
 */
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_v_self->message);
    __Pyx_DECREF(__pyx_v_self->message);
    __pyx_v_self->message = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cymysql/packetx.pyx":298
 *                 self.server_status, self.warning_count,
 *                 self.message) = self.first_packet.read_ok_packet()
 *             self.has_result = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.field_count = ord(self.first_packet.read(1))
 */
    __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->has_result);
    __Pyx_DECREF(__pyx_v_self->has_result);
    __pyx_v_self->has_result = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cymysql/packetx.pyx":300
 *             self.has_result = False
 *         else:
 *             self.field_count = ord(self.first_packet.read(1))             # <<<<<<<<<<<<<<
 *             self._get_descriptions()
 *             self.has_result = True
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->first_packet, __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __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 = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_v_self->field_count);
    __Pyx_DECREF(__pyx_v_self->field_count);
    __pyx_v_self->field_count = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cymysql/packetx.pyx":301
 *         else:
 *             self.field_count = ord(self.first_packet.read(1))
 *             self._get_descriptions()             # <<<<<<<<<<<<<<
 *             self.has_result = True
 *             self.read_rest_rowdata_packet()
 */
    ((struct __pyx_vtabstruct_7cymysql_7packetx_MySQLResult *)__pyx_v_self->__pyx_vtab)->_get_descriptions(__pyx_v_self);

    /* "cymysql/packetx.pyx":302
 *             self.field_count = ord(self.first_packet.read(1))
 *             self._get_descriptions()
 *             self.has_result = True             # <<<<<<<<<<<<<<
 *             self.read_rest_rowdata_packet()
 * 
 */
    __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_v_self->has_result);
    __Pyx_DECREF(__pyx_v_self->has_result);
    __pyx_v_self->has_result = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cymysql/packetx.pyx":303
 *             self._get_descriptions()
 *             self.has_result = True
 *             self.read_rest_rowdata_packet()             # <<<<<<<<<<<<<<
 * 
 *     def read_rest_rowdata_packet(self):
 */
    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_15); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymysql.packetx.MySQLResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_proxy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_3read_rest_rowdata_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7cymysql_7packetx_11MySQLResult_2read_rest_rowdata_packet[] = "Read rest rowdata packets for each data row in the result set.";
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_3read_rest_rowdata_packet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_rest_rowdata_packet (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_2read_rest_rowdata_packet(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":305
 *             self.read_rest_rowdata_packet()
 * 
 *     def read_rest_rowdata_packet(self):             # <<<<<<<<<<<<<<
 *         """Read rest rowdata packets for each data row in the result set."""
 *         cdef int is_eof, warning_count, server_status
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_2read_rest_rowdata_packet(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_v_is_eof;
  int __pyx_v_warning_count;
  int __pyx_v_server_status;
  PyObject *__pyx_v_rest_rows = NULL;
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_packet = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_rest_rowdata_packet", 0);

  /* "cymysql/packetx.pyx":308
 *         """Read rest rowdata packets for each data row in the result set."""
 *         cdef int is_eof, warning_count, server_status
 *         if (not self.has_result) or (self.rest_rows is not None):             # <<<<<<<<<<<<<<
 *             return
 *         rest_rows = []
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->has_result); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (!__pyx_t_2) {
    __pyx_t_1 = (__pyx_v_self->rest_rows != Py_None);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  if (__pyx_t_3) {

    /* "cymysql/packetx.pyx":309
 *         cdef int is_eof, warning_count, server_status
 *         if (not self.has_result) or (self.rest_rows is not None):
 *             return             # <<<<<<<<<<<<<<
 *         rest_rows = []
 *         while True:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":310
 *         if (not self.has_result) or (self.rest_rows is not None):
 *             return
 *         rest_rows = []             # <<<<<<<<<<<<<<
 *         while True:
 *             packet = MysqlPacket(self.connection)
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_rest_rows = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymysql/packetx.pyx":311
 *             return
 *         rest_rows = []
 *         while True:             # <<<<<<<<<<<<<<
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 */
  while (1) {
    if (!1) break;

    /* "cymysql/packetx.pyx":312
 *         rest_rows = []
 *         while True:
 *             packet = MysqlPacket(self.connection)             # <<<<<<<<<<<<<<
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->connection);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->connection);
    __Pyx_GIVEREF(__pyx_v_self->connection);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_MysqlPacket)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_packet));
    __pyx_v_packet = ((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymysql/packetx.pyx":313
 *         while True:
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()             # <<<<<<<<<<<<<<
 *             if is_eof:
 *                 self.warning_count = warning_count
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_packet), __pyx_n_s__is_eof_and_status); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L7_unpacking_done:;
    }
    __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_is_eof = __pyx_t_10;
    __pyx_v_warning_count = __pyx_t_11;
    __pyx_v_server_status = __pyx_t_12;

    /* "cymysql/packetx.pyx":314
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:             # <<<<<<<<<<<<<<
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status
 */
    if (__pyx_v_is_eof) {

      /* "cymysql/packetx.pyx":315
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:
 *                 self.warning_count = warning_count             # <<<<<<<<<<<<<<
 *                 self.server_status = server_status
 *                 self.has_next = (server_status
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_warning_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_self->warning_count);
      __Pyx_DECREF(__pyx_v_self->warning_count);
      __pyx_v_self->warning_count = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cymysql/packetx.pyx":316
 *             if is_eof:
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status             # <<<<<<<<<<<<<<
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_server_status); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_self->server_status);
      __Pyx_DECREF(__pyx_v_self->server_status);
      __pyx_v_self->server_status = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cymysql/packetx.pyx":318
 *                 self.server_status = server_status
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)             # <<<<<<<<<<<<<<
 *                 break
 *             rest_rows.append(packet.read_decode_data(self.fields))
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_server_status); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__SERVER_STATUS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cymysql/packetx.pyx":317
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status
 *                 self.has_next = (server_status             # <<<<<<<<<<<<<<
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 break
 */
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_v_self->has_next);
      __Pyx_DECREF(__pyx_v_self->has_next);
      __pyx_v_self->has_next = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "cymysql/packetx.pyx":319
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 break             # <<<<<<<<<<<<<<
 *             rest_rows.append(packet.read_decode_data(self.fields))
 *         self.rest_rows = rest_rows
 */
      goto __pyx_L5_break;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "cymysql/packetx.pyx":320
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 break
 *             rest_rows.append(packet.read_decode_data(self.fields))             # <<<<<<<<<<<<<<
 *         self.rest_rows = rest_rows
 *         self.rest_row_index = 0
 */
    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_packet), __pyx_n_s__read_decode_data); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_self->fields);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->fields);
    __Pyx_GIVEREF(__pyx_v_self->fields);
    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_13 = PyList_Append(__pyx_v_rest_rows, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L5_break:;

  /* "cymysql/packetx.pyx":321
 *                 break
 *             rest_rows.append(packet.read_decode_data(self.fields))
 *         self.rest_rows = rest_rows             # <<<<<<<<<<<<<<
 *         self.rest_row_index = 0
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_rest_rows));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rest_rows));
  __Pyx_GOTREF(__pyx_v_self->rest_rows);
  __Pyx_DECREF(__pyx_v_self->rest_rows);
  __pyx_v_self->rest_rows = ((PyObject *)__pyx_v_rest_rows);

  /* "cymysql/packetx.pyx":322
 *             rest_rows.append(packet.read_decode_data(self.fields))
 *         self.rest_rows = rest_rows
 *         self.rest_row_index = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef void _get_descriptions(self):
 */
  __pyx_v_self->rest_row_index = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymysql.packetx.MySQLResult.read_rest_rowdata_packet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rest_rows);
  __Pyx_XDECREF((PyObject *)__pyx_v_packet);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":324
 *         self.rest_row_index = 0
 * 
 *     cdef void _get_descriptions(self):             # <<<<<<<<<<<<<<
 *         """Read a column descriptor packet for each column in the result."""
 *         cdef int i
 */

static void __pyx_f_7cymysql_7packetx_11MySQLResult__get_descriptions(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  CYTHON_UNUSED int __pyx_v_i;
  PyObject *__pyx_v_eof_packet = 0;
  PyObject *__pyx_v_description = NULL;
  struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *__pyx_v_field = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_descriptions", 0);

  /* "cymysql/packetx.pyx":328
 *         cdef int i
 *         cdef object eof_packet
 *         self.fields = []             # <<<<<<<<<<<<<<
 *         description = []
 *         for i in range(self.field_count):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->fields);
  __Pyx_DECREF(__pyx_v_self->fields);
  __pyx_v_self->fields = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":329
 *         cdef object eof_packet
 *         self.fields = []
 *         description = []             # <<<<<<<<<<<<<<
 *         for i in range(self.field_count):
 *             field = FieldDescriptorPacket(self.connection)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_description = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":330
 *         self.fields = []
 *         description = []
 *         for i in range(self.field_count):             # <<<<<<<<<<<<<<
 *             field = FieldDescriptorPacket(self.connection)
 *             self.fields.append(field)
 */
  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_self->field_count); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cymysql/packetx.pyx":331
 *         description = []
 *         for i in range(self.field_count):
 *             field = FieldDescriptorPacket(self.connection)             # <<<<<<<<<<<<<<
 *             self.fields.append(field)
 *             description.append(field.description())
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->connection);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->connection);
    __Pyx_GIVEREF(__pyx_v_self->connection);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_FieldDescriptorPacket)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_field));
    __pyx_v_field = ((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymysql/packetx.pyx":332
 *         for i in range(self.field_count):
 *             field = FieldDescriptorPacket(self.connection)
 *             self.fields.append(field)             # <<<<<<<<<<<<<<
 *             description.append(field.description())
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_self->fields, ((PyObject *)__pyx_v_field)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cymysql/packetx.pyx":333
 *             field = FieldDescriptorPacket(self.connection)
 *             self.fields.append(field)
 *             description.append(field.description())             # <<<<<<<<<<<<<<
 * 
 *         eof_packet = MysqlPacket(self.connection)
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_field), __pyx_n_s__description); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __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[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = PyList_Append(__pyx_v_description, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cymysql/packetx.pyx":335
 *             description.append(field.description())
 * 
 *         eof_packet = MysqlPacket(self.connection)             # <<<<<<<<<<<<<<
 *         assert eof_packet.is_eof_packet(), 'Protocol error, expecting EOF'
 *         self.description = tuple(description)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->connection);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->connection);
  __Pyx_GIVEREF(__pyx_v_self->connection);
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_MysqlPacket)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_eof_packet = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymysql/packetx.pyx":336
 * 
 *         eof_packet = MysqlPacket(self.connection)
 *         assert eof_packet.is_eof_packet(), 'Protocol error, expecting EOF'             # <<<<<<<<<<<<<<
 *         self.description = tuple(description)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_eof_packet, __pyx_n_s__is_eof_packet); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_17));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "cymysql/packetx.pyx":337
 *         eof_packet = MysqlPacket(self.connection)
 *         assert eof_packet.is_eof_packet(), 'Protocol error, expecting EOF'
 *         self.description = tuple(description)             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
  __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_description)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->description);
  __Pyx_DECREF(__pyx_v_self->description);
  __pyx_v_self->description = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("cymysql.packetx.MySQLResult._get_descriptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_eof_packet);
  __Pyx_XDECREF(__pyx_v_description);
  __Pyx_XDECREF((PyObject *)__pyx_v_field);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_5fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_5fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fetchone (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_4fetchone(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":339
 *         self.description = tuple(description)
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         cdef int is_eof, warning_count, server_status
 *         if not self.has_result:
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_4fetchone(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_v_is_eof;
  int __pyx_v_warning_count;
  int __pyx_v_server_status;
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *__pyx_v_packet = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  long __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetchone", 0);

  /* "cymysql/packetx.pyx":341
 *     def fetchone(self):
 *         cdef int is_eof, warning_count, server_status
 *         if not self.has_result:             # <<<<<<<<<<<<<<
 *             return None
 *         if self.rest_rows is None:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->has_result); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "cymysql/packetx.pyx":342
 *         cdef int is_eof, warning_count, server_status
 *         if not self.has_result:
 *             return None             # <<<<<<<<<<<<<<
 *         if self.rest_rows is None:
 *             packet = MysqlPacket(self.connection)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cymysql/packetx.pyx":343
 *         if not self.has_result:
 *             return None
 *         if self.rest_rows is None:             # <<<<<<<<<<<<<<
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 */
  __pyx_t_2 = (__pyx_v_self->rest_rows == Py_None);
  if (__pyx_t_2) {

    /* "cymysql/packetx.pyx":344
 *             return None
 *         if self.rest_rows is None:
 *             packet = MysqlPacket(self.connection)             # <<<<<<<<<<<<<<
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->connection);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->connection);
    __Pyx_GIVEREF(__pyx_v_self->connection);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cymysql_7packetx_MysqlPacket)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_packet = ((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymysql/packetx.pyx":345
 *         if self.rest_rows is None:
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()             # <<<<<<<<<<<<<<
 *             if is_eof:
 *                 self.warning_count = warning_count
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_packet), __pyx_n_s__is_eof_and_status); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_is_eof = __pyx_t_9;
    __pyx_v_warning_count = __pyx_t_10;
    __pyx_v_server_status = __pyx_t_11;

    /* "cymysql/packetx.pyx":346
 *             packet = MysqlPacket(self.connection)
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:             # <<<<<<<<<<<<<<
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status
 */
    if (__pyx_v_is_eof) {

      /* "cymysql/packetx.pyx":347
 *             is_eof, warning_count, server_status = packet.is_eof_and_status()
 *             if is_eof:
 *                 self.warning_count = warning_count             # <<<<<<<<<<<<<<
 *                 self.server_status = server_status
 *                 self.has_next = (server_status
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_warning_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->warning_count);
      __Pyx_DECREF(__pyx_v_self->warning_count);
      __pyx_v_self->warning_count = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cymysql/packetx.pyx":348
 *             if is_eof:
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status             # <<<<<<<<<<<<<<
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_server_status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->server_status);
      __Pyx_DECREF(__pyx_v_self->server_status);
      __pyx_v_self->server_status = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cymysql/packetx.pyx":350
 *                 self.server_status = server_status
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)             # <<<<<<<<<<<<<<
 *                 self.rest_rows = []
 *                 return None
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_server_status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__SERVER_STATUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_And(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cymysql/packetx.pyx":349
 *                 self.warning_count = warning_count
 *                 self.server_status = server_status
 *                 self.has_next = (server_status             # <<<<<<<<<<<<<<
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 self.rest_rows = []
 */
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_self->has_next);
      __Pyx_DECREF(__pyx_v_self->has_next);
      __pyx_v_self->has_next = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cymysql/packetx.pyx":351
 *                 self.has_next = (server_status
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 self.rest_rows = []             # <<<<<<<<<<<<<<
 *                 return None
 *             return packet.read_decode_data(self.fields)
 */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __Pyx_GOTREF(__pyx_v_self->rest_rows);
      __Pyx_DECREF(__pyx_v_self->rest_rows);
      __pyx_v_self->rest_rows = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymysql/packetx.pyx":352
 *                              & SERVER_STATUS.SERVER_MORE_RESULTS_EXISTS)
 *                 self.rest_rows = []
 *                 return None             # <<<<<<<<<<<<<<
 *             return packet.read_decode_data(self.fields)
 *         elif len(self.rest_rows) != self.rest_row_index:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "cymysql/packetx.pyx":353
 *                 self.rest_rows = []
 *                 return None
 *             return packet.read_decode_data(self.fields)             # <<<<<<<<<<<<<<
 *         elif len(self.rest_rows) != self.rest_row_index:
 *             self.rest_row_index += 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_packet), __pyx_n_s__read_decode_data); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->fields);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->fields);
    __Pyx_GIVEREF(__pyx_v_self->fields);
    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "cymysql/packetx.pyx":354
 *                 return None
 *             return packet.read_decode_data(self.fields)
 *         elif len(self.rest_rows) != self.rest_row_index:             # <<<<<<<<<<<<<<
 *             self.rest_row_index += 1
 *             return self.rest_rows[self.rest_row_index-1]
 */
  __pyx_t_3 = __pyx_v_self->rest_rows;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_12 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (__pyx_t_12 != __pyx_v_self->rest_row_index);
  if (__pyx_t_2) {

    /* "cymysql/packetx.pyx":355
 *             return packet.read_decode_data(self.fields)
 *         elif len(self.rest_rows) != self.rest_row_index:
 *             self.rest_row_index += 1             # <<<<<<<<<<<<<<
 *             return self.rest_rows[self.rest_row_index-1]
 *         return None
 */
    __pyx_v_self->rest_row_index = (__pyx_v_self->rest_row_index + 1);

    /* "cymysql/packetx.pyx":356
 *         elif len(self.rest_rows) != self.rest_row_index:
 *             self.rest_row_index += 1
 *             return self.rest_rows[self.rest_row_index-1]             # <<<<<<<<<<<<<<
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13 = (__pyx_v_self->rest_row_index - 1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->rest_rows, __pyx_t_13, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "cymysql/packetx.pyx":357
 *             self.rest_row_index += 1
 *             return self.rest_rows[self.rest_row_index-1]
 *         return None             # <<<<<<<<<<<<<<
 */
  __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymysql.packetx.MySQLResult.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_packet);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":273
 * #       of MysqlPacket like has been done with FieldDescriptorPacket.
 * cdef class MySQLResult(object):
 *     cdef public object affected_rows, insert_id, rest_rows, has_next, has_result             # <<<<<<<<<<<<<<
 *     cdef public object message, description
 *     cdef public object server_status, warning_count, field_count
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->affected_rows);
  __pyx_r = __pyx_v_self->affected_rows;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->affected_rows);
  __Pyx_DECREF(__pyx_v_self->affected_rows);
  __pyx_v_self->affected_rows = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13affected_rows_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->affected_rows);
  __Pyx_DECREF(__pyx_v_self->affected_rows);
  __pyx_v_self->affected_rows = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->insert_id);
  __pyx_r = __pyx_v_self->insert_id;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->insert_id);
  __Pyx_DECREF(__pyx_v_self->insert_id);
  __pyx_v_self->insert_id = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9insert_id_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->insert_id);
  __Pyx_DECREF(__pyx_v_self->insert_id);
  __pyx_v_self->insert_id = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->rest_rows);
  __pyx_r = __pyx_v_self->rest_rows;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->rest_rows);
  __Pyx_DECREF(__pyx_v_self->rest_rows);
  __pyx_v_self->rest_rows = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_9rest_rows_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rest_rows);
  __Pyx_DECREF(__pyx_v_self->rest_rows);
  __pyx_v_self->rest_rows = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->has_next);
  __pyx_r = __pyx_v_self->has_next;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->has_next);
  __Pyx_DECREF(__pyx_v_self->has_next);
  __pyx_v_self->has_next = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_8has_next_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->has_next);
  __Pyx_DECREF(__pyx_v_self->has_next);
  __pyx_v_self->has_next = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->has_result);
  __pyx_r = __pyx_v_self->has_result;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->has_result);
  __Pyx_DECREF(__pyx_v_self->has_result);
  __pyx_v_self->has_result = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_10has_result_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->has_result);
  __Pyx_DECREF(__pyx_v_self->has_result);
  __pyx_v_self->has_result = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_7message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_7message_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_7message___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":274
 * cdef class MySQLResult(object):
 *     cdef public object affected_rows, insert_id, rest_rows, has_next, has_result
 *     cdef public object message, description             # <<<<<<<<<<<<<<
 *     cdef public object server_status, warning_count, field_count
 *     cdef object connection, first_packet, fields
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_7message___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->message);
  __pyx_r = __pyx_v_self->message;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->message);
  __Pyx_DECREF(__pyx_v_self->message);
  __pyx_v_self->message = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_7message_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->message);
  __Pyx_DECREF(__pyx_v_self->message);
  __pyx_v_self->message = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_11description_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_11description_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11description___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_11description___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->description);
  __pyx_r = __pyx_v_self->description;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->description);
  __Pyx_DECREF(__pyx_v_self->description);
  __pyx_v_self->description = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11description_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->description);
  __Pyx_DECREF(__pyx_v_self->description);
  __pyx_v_self->description = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymysql/packetx.pyx":275
 *     cdef public object affected_rows, insert_id, rest_rows, has_next, has_result
 *     cdef public object message, description
 *     cdef public object server_status, warning_count, field_count             # <<<<<<<<<<<<<<
 *     cdef object connection, first_packet, fields
 *     cdef int rest_row_index
 */

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->server_status);
  __pyx_r = __pyx_v_self->server_status;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->server_status);
  __Pyx_DECREF(__pyx_v_self->server_status);
  __pyx_v_self->server_status = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13server_status_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->server_status);
  __Pyx_DECREF(__pyx_v_self->server_status);
  __pyx_v_self->server_status = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->warning_count);
  __pyx_r = __pyx_v_self->warning_count;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->warning_count);
  __Pyx_DECREF(__pyx_v_self->warning_count);
  __pyx_v_self->warning_count = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_13warning_count_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->warning_count);
  __Pyx_DECREF(__pyx_v_self->warning_count);
  __pyx_v_self->warning_count = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count___get__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count___get__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->field_count);
  __pyx_r = __pyx_v_self->field_count;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_2__set__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_2__set__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->field_count);
  __Pyx_DECREF(__pyx_v_self->field_count);
  __pyx_v_self->field_count = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_4__del__(((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7cymysql_7packetx_11MySQLResult_11field_count_4__del__(struct __pyx_obj_7cymysql_7packetx_MySQLResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->field_count);
  __Pyx_DECREF(__pyx_v_self->field_count);
  __pyx_v_self->field_count = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket __pyx_vtable_7cymysql_7packetx_MysqlPacket;

static PyObject *__pyx_tp_new_7cymysql_7packetx_MysqlPacket(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)o);
  p->__pyx_vtab = __pyx_vtabptr_7cymysql_7packetx_MysqlPacket;
  p->connection = Py_None; Py_INCREF(Py_None);
  p->__pyx___data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7cymysql_7packetx_MysqlPacket(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *p = (struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)o;
  Py_CLEAR(p->connection);
  Py_CLEAR(p->__pyx___data);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cymysql_7packetx_MysqlPacket(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *p = (struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)o;
  if (p->connection) {
    e = (*v)(p->connection, a); if (e) return e;
  }
  if (p->__pyx___data) {
    e = (*v)(p->__pyx___data, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cymysql_7packetx_MysqlPacket(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_MysqlPacket *p = (struct __pyx_obj_7cymysql_7packetx_MysqlPacket *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->connection);
  p->connection = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx___data);
  p->__pyx___data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cymysql_7packetx_MysqlPacket[] = {
  {__Pyx_NAMESTR("get_all_data"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_3get_all_data, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_5read, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("read_all"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_7read_all, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7cymysql_7packetx_11MysqlPacket_6read_all)},
  {__Pyx_NAMESTR("read_decode_data"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_9read_decode_data, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("is_ok_packet"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_11is_ok_packet, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("is_eof_packet"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_13is_eof_packet, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("is_eof_and_status"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_15is_eof_and_status, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("read_ok_packet"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MysqlPacket_17read_ok_packet, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_MysqlPacket = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_MysqlPacket = {
  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_MysqlPacket = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_MysqlPacket = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7cymysql_7packetx_MysqlPacket = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cymysql.packetx.MysqlPacket"), /*tp_name*/
  sizeof(struct __pyx_obj_7cymysql_7packetx_MysqlPacket), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cymysql_7packetx_MysqlPacket, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_MysqlPacket, /*tp_as_number*/
  &__pyx_tp_as_sequence_MysqlPacket, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_MysqlPacket, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_MysqlPacket, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Representation of a MySQL response packet.  Reads in the packet\n    from the network socket, removes packet header and provides an interface\n    for reading/parsing the packet results."), /*tp_doc*/
  __pyx_tp_traverse_7cymysql_7packetx_MysqlPacket, /*tp_traverse*/
  __pyx_tp_clear_7cymysql_7packetx_MysqlPacket, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7cymysql_7packetx_MysqlPacket, /*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*/
  __pyx_pw_7cymysql_7packetx_11MysqlPacket_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7cymysql_7packetx_MysqlPacket, /*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_7cymysql_7packetx_FieldDescriptorPacket __pyx_vtable_7cymysql_7packetx_FieldDescriptorPacket;

static PyObject *__pyx_tp_new_7cymysql_7packetx_FieldDescriptorPacket(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *p;
  PyObject *o = __pyx_tp_new_7cymysql_7packetx_MysqlPacket(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cymysql_7packetx_MysqlPacket*)__pyx_vtabptr_7cymysql_7packetx_FieldDescriptorPacket;
  p->catalog = Py_None; Py_INCREF(Py_None);
  p->db = Py_None; Py_INCREF(Py_None);
  p->table_name = Py_None; Py_INCREF(Py_None);
  p->org_table = Py_None; Py_INCREF(Py_None);
  p->name = Py_None; Py_INCREF(Py_None);
  p->org_name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7cymysql_7packetx_FieldDescriptorPacket(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *p = (struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)o;
  Py_CLEAR(p->catalog);
  Py_CLEAR(p->db);
  Py_CLEAR(p->table_name);
  Py_CLEAR(p->org_table);
  Py_CLEAR(p->name);
  Py_CLEAR(p->org_name);
  __pyx_tp_dealloc_7cymysql_7packetx_MysqlPacket(o);
}

static int __pyx_tp_traverse_7cymysql_7packetx_FieldDescriptorPacket(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *p = (struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)o;
  e = __pyx_tp_traverse_7cymysql_7packetx_MysqlPacket(o, v, a); if (e) return e;
  if (p->catalog) {
    e = (*v)(p->catalog, a); if (e) return e;
  }
  if (p->db) {
    e = (*v)(p->db, a); if (e) return e;
  }
  if (p->table_name) {
    e = (*v)(p->table_name, a); if (e) return e;
  }
  if (p->org_table) {
    e = (*v)(p->org_table, a); if (e) return e;
  }
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  if (p->org_name) {
    e = (*v)(p->org_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cymysql_7packetx_FieldDescriptorPacket(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *p = (struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket *)o;
  PyObject* tmp;
  __pyx_tp_clear_7cymysql_7packetx_MysqlPacket(o);
  tmp = ((PyObject*)p->catalog);
  p->catalog = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->db);
  p->db = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->table_name);
  p->table_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->org_table);
  p->org_table = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->org_name);
  p->org_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_catalog(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_catalog(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7catalog_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_db(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_db(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_2db_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_table_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_table_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_10table_name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_org_table(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_org_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9org_table_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_org_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_org_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_8org_name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_charsetnr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_charsetnr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9charsetnr_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_6length_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_type_code(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_type_code(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9type_code_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_flags(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5flags_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_scale(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5scale_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7cymysql_7packetx_FieldDescriptorPacket[] = {
  {__Pyx_NAMESTR("__parse_field_descriptor"), (PyCFunction)__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_3__parse_field_descriptor, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7cymysql_7packetx_21FieldDescriptorPacket_2__parse_field_descriptor)},
  {__Pyx_NAMESTR("description"), (PyCFunction)__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_5description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7cymysql_7packetx_21FieldDescriptorPacket_4description)},
  {__Pyx_NAMESTR("get_column_length"), (PyCFunction)__pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_7get_column_length, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7cymysql_7packetx_FieldDescriptorPacket[] = {
  {(char *)"catalog", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_catalog, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_catalog, 0, 0},
  {(char *)"db", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_db, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_db, 0, 0},
  {(char *)"table_name", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_table_name, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_table_name, 0, 0},
  {(char *)"org_table", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_org_table, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_org_table, 0, 0},
  {(char *)"name", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_name, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_name, 0, 0},
  {(char *)"org_name", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_org_name, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_org_name, 0, 0},
  {(char *)"charsetnr", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_charsetnr, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_charsetnr, 0, 0},
  {(char *)"length", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_length, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_length, 0, 0},
  {(char *)"type_code", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_type_code, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_type_code, 0, 0},
  {(char *)"flags", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_flags, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_flags, 0, 0},
  {(char *)"scale", __pyx_getprop_7cymysql_7packetx_21FieldDescriptorPacket_scale, __pyx_setprop_7cymysql_7packetx_21FieldDescriptorPacket_scale, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FieldDescriptorPacket = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FieldDescriptorPacket = {
  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_FieldDescriptorPacket = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FieldDescriptorPacket = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7cymysql_7packetx_FieldDescriptorPacket = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cymysql.packetx.FieldDescriptorPacket"), /*tp_name*/
  sizeof(struct __pyx_obj_7cymysql_7packetx_FieldDescriptorPacket), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cymysql_7packetx_FieldDescriptorPacket, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FieldDescriptorPacket, /*tp_as_number*/
  &__pyx_tp_as_sequence_FieldDescriptorPacket, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FieldDescriptorPacket, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_9__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FieldDescriptorPacket, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("A MysqlPacket that represents a specific column's metadata in the result.\n\n    Parsing is automatically done and the results are exported via public\n    attributes on the class such as: db, table_name, name, length, type_code.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cymysql_7packetx_FieldDescriptorPacket, /*tp_traverse*/
  __pyx_tp_clear_7cymysql_7packetx_FieldDescriptorPacket, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7cymysql_7packetx_FieldDescriptorPacket, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7cymysql_7packetx_FieldDescriptorPacket, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7cymysql_7packetx_21FieldDescriptorPacket_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7cymysql_7packetx_FieldDescriptorPacket, /*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_7cymysql_7packetx_MySQLResult __pyx_vtable_7cymysql_7packetx_MySQLResult;

static PyObject *__pyx_tp_new_7cymysql_7packetx_MySQLResult(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7cymysql_7packetx_MySQLResult *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7cymysql_7packetx_MySQLResult *)o);
  p->__pyx_vtab = __pyx_vtabptr_7cymysql_7packetx_MySQLResult;
  p->affected_rows = Py_None; Py_INCREF(Py_None);
  p->insert_id = Py_None; Py_INCREF(Py_None);
  p->rest_rows = Py_None; Py_INCREF(Py_None);
  p->has_next = Py_None; Py_INCREF(Py_None);
  p->has_result = Py_None; Py_INCREF(Py_None);
  p->message = Py_None; Py_INCREF(Py_None);
  p->description = Py_None; Py_INCREF(Py_None);
  p->server_status = Py_None; Py_INCREF(Py_None);
  p->warning_count = Py_None; Py_INCREF(Py_None);
  p->field_count = Py_None; Py_INCREF(Py_None);
  p->connection = Py_None; Py_INCREF(Py_None);
  p->first_packet = Py_None; Py_INCREF(Py_None);
  p->fields = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7cymysql_7packetx_MySQLResult(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_MySQLResult *p = (struct __pyx_obj_7cymysql_7packetx_MySQLResult *)o;
  Py_CLEAR(p->affected_rows);
  Py_CLEAR(p->insert_id);
  Py_CLEAR(p->rest_rows);
  Py_CLEAR(p->has_next);
  Py_CLEAR(p->has_result);
  Py_CLEAR(p->message);
  Py_CLEAR(p->description);
  Py_CLEAR(p->server_status);
  Py_CLEAR(p->warning_count);
  Py_CLEAR(p->field_count);
  Py_CLEAR(p->connection);
  Py_CLEAR(p->first_packet);
  Py_CLEAR(p->fields);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cymysql_7packetx_MySQLResult(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cymysql_7packetx_MySQLResult *p = (struct __pyx_obj_7cymysql_7packetx_MySQLResult *)o;
  if (p->affected_rows) {
    e = (*v)(p->affected_rows, a); if (e) return e;
  }
  if (p->insert_id) {
    e = (*v)(p->insert_id, a); if (e) return e;
  }
  if (p->rest_rows) {
    e = (*v)(p->rest_rows, a); if (e) return e;
  }
  if (p->has_next) {
    e = (*v)(p->has_next, a); if (e) return e;
  }
  if (p->has_result) {
    e = (*v)(p->has_result, a); if (e) return e;
  }
  if (p->message) {
    e = (*v)(p->message, a); if (e) return e;
  }
  if (p->description) {
    e = (*v)(p->description, a); if (e) return e;
  }
  if (p->server_status) {
    e = (*v)(p->server_status, a); if (e) return e;
  }
  if (p->warning_count) {
    e = (*v)(p->warning_count, a); if (e) return e;
  }
  if (p->field_count) {
    e = (*v)(p->field_count, a); if (e) return e;
  }
  if (p->connection) {
    e = (*v)(p->connection, a); if (e) return e;
  }
  if (p->first_packet) {
    e = (*v)(p->first_packet, a); if (e) return e;
  }
  if (p->fields) {
    e = (*v)(p->fields, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cymysql_7packetx_MySQLResult(PyObject *o) {
  struct __pyx_obj_7cymysql_7packetx_MySQLResult *p = (struct __pyx_obj_7cymysql_7packetx_MySQLResult *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->affected_rows);
  p->affected_rows = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->insert_id);
  p->insert_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rest_rows);
  p->rest_rows = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->has_next);
  p->has_next = 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);
  tmp = ((PyObject*)p->message);
  p->message = 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->server_status);
  p->server_status = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->warning_count);
  p->warning_count = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->field_count);
  p->field_count = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->connection);
  p->connection = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->first_packet);
  p->first_packet = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fields);
  p->fields = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_affected_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_affected_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13affected_rows_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_insert_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_insert_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_9insert_id_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_rest_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_rest_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_9rest_rows_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_has_next(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_has_next(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_8has_next_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_has_result(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_has_result(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_10has_result_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_message(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_7message_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_description(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_description(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_11description_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_server_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_server_status(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13server_status_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_warning_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_warning_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_13warning_count_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7cymysql_7packetx_11MySQLResult_field_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_1__get__(o);
}

static int __pyx_setprop_7cymysql_7packetx_11MySQLResult_field_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_3__set__(o, v);
  }
  else {
    return __pyx_pw_7cymysql_7packetx_11MySQLResult_11field_count_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7cymysql_7packetx_MySQLResult[] = {
  {__Pyx_NAMESTR("read_rest_rowdata_packet"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MySQLResult_3read_rest_rowdata_packet, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7cymysql_7packetx_11MySQLResult_2read_rest_rowdata_packet)},
  {__Pyx_NAMESTR("fetchone"), (PyCFunction)__pyx_pw_7cymysql_7packetx_11MySQLResult_5fetchone, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7cymysql_7packetx_MySQLResult[] = {
  {(char *)"affected_rows", __pyx_getprop_7cymysql_7packetx_11MySQLResult_affected_rows, __pyx_setprop_7cymysql_7packetx_11MySQLResult_affected_rows, 0, 0},
  {(char *)"insert_id", __pyx_getprop_7cymysql_7packetx_11MySQLResult_insert_id, __pyx_setprop_7cymysql_7packetx_11MySQLResult_insert_id, 0, 0},
  {(char *)"rest_rows", __pyx_getprop_7cymysql_7packetx_11MySQLResult_rest_rows, __pyx_setprop_7cymysql_7packetx_11MySQLResult_rest_rows, 0, 0},
  {(char *)"has_next", __pyx_getprop_7cymysql_7packetx_11MySQLResult_has_next, __pyx_setprop_7cymysql_7packetx_11MySQLResult_has_next, 0, 0},
  {(char *)"has_result", __pyx_getprop_7cymysql_7packetx_11MySQLResult_has_result, __pyx_setprop_7cymysql_7packetx_11MySQLResult_has_result, 0, 0},
  {(char *)"message", __pyx_getprop_7cymysql_7packetx_11MySQLResult_message, __pyx_setprop_7cymysql_7packetx_11MySQLResult_message, 0, 0},
  {(char *)"description", __pyx_getprop_7cymysql_7packetx_11MySQLResult_description, __pyx_setprop_7cymysql_7packetx_11MySQLResult_description, 0, 0},
  {(char *)"server_status", __pyx_getprop_7cymysql_7packetx_11MySQLResult_server_status, __pyx_setprop_7cymysql_7packetx_11MySQLResult_server_status, 0, 0},
  {(char *)"warning_count", __pyx_getprop_7cymysql_7packetx_11MySQLResult_warning_count, __pyx_setprop_7cymysql_7packetx_11MySQLResult_warning_count, 0, 0},
  {(char *)"field_count", __pyx_getprop_7cymysql_7packetx_11MySQLResult_field_count, __pyx_setprop_7cymysql_7packetx_11MySQLResult_field_count, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_MySQLResult = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_MySQLResult = {
  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_MySQLResult = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_MySQLResult = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7cymysql_7packetx_MySQLResult = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cymysql.packetx.MySQLResult"), /*tp_name*/
  sizeof(struct __pyx_obj_7cymysql_7packetx_MySQLResult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cymysql_7packetx_MySQLResult, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_MySQLResult, /*tp_as_number*/
  &__pyx_tp_as_sequence_MySQLResult, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_MySQLResult, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_MySQLResult, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7cymysql_7packetx_MySQLResult, /*tp_traverse*/
  __pyx_tp_clear_7cymysql_7packetx_MySQLResult, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7cymysql_7packetx_MySQLResult, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7cymysql_7packetx_MySQLResult, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7cymysql_7packetx_11MySQLResult_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7cymysql_7packetx_MySQLResult, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("packetx"),
    0, /* 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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1},
  {&__pyx_n_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 1},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1},
  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
  {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
  {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1},
  {&__pyx_kp_b_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 0, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s__MBLENGTH, __pyx_k__MBLENGTH, sizeof(__pyx_k__MBLENGTH), 0, 0, 1, 1},
  {&__pyx_n_s__OperationalError, __pyx_k__OperationalError, sizeof(__pyx_k__OperationalError), 0, 0, 1, 1},
  {&__pyx_n_s__SERVER_STATUS, __pyx_k__SERVER_STATUS, sizeof(__pyx_k__SERVER_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 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____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__charset, __pyx_k__charset, sizeof(__pyx_k__charset), 0, 0, 1, 1},
  {&__pyx_n_s__connection, __pyx_k__connection, sizeof(__pyx_k__connection), 0, 0, 1, 1},
  {&__pyx_n_s__conv, __pyx_k__conv, sizeof(__pyx_k__conv), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__decoders, __pyx_k__decoders, sizeof(__pyx_k__decoders), 0, 0, 1, 1},
  {&__pyx_n_s__default_decoders, __pyx_k__default_decoders, sizeof(__pyx_k__default_decoders), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__get_column_length, __pyx_k__get_column_length, sizeof(__pyx_k__get_column_length), 0, 0, 1, 1},
  {&__pyx_n_s__get_decode_values, __pyx_k__get_decode_values, sizeof(__pyx_k__get_decode_values), 0, 0, 1, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__is_eof_and_status, __pyx_k__is_eof_and_status, sizeof(__pyx_k__is_eof_and_status), 0, 0, 1, 1},
  {&__pyx_n_s__is_eof_packet, __pyx_k__is_eof_packet, sizeof(__pyx_k__is_eof_packet), 0, 0, 1, 1},
  {&__pyx_n_s__is_ok_packet, __pyx_k__is_ok_packet, sizeof(__pyx_k__is_ok_packet), 0, 0, 1, 1},
  {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1},
  {&__pyx_n_s__proxy, __pyx_k__proxy, sizeof(__pyx_k__proxy), 0, 0, 1, 1},
  {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__read_all, __pyx_k__read_all, sizeof(__pyx_k__read_all), 0, 0, 1, 1},
  {&__pyx_n_s__read_decode_data, __pyx_k__read_decode_data, sizeof(__pyx_k__read_decode_data), 0, 0, 1, 1},
  {&__pyx_n_s__read_ok_packet, __pyx_k__read_ok_packet, sizeof(__pyx_k__read_ok_packet), 0, 0, 1, 1},
  {&__pyx_n_s__recv, __pyx_k__recv, sizeof(__pyx_k__recv), 0, 0, 1, 1},
  {&__pyx_n_s__socket, __pyx_k__socket, sizeof(__pyx_k__socket), 0, 0, 1, 1},
  {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__type_code, __pyx_k__type_code, sizeof(__pyx_k__type_code), 0, 0, 1, 1},
  {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 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__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__version_info, __pyx_k__version_info, sizeof(__pyx_k__version_info), 0, 0, 1, 1},
  {&__pyx_n_s__weakref, __pyx_k__weakref, sizeof(__pyx_k__weakref), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cymysql/packetx.pyx":97
 *         packet_header = self.__recv_from_socket(4)
 *         if len(packet_header) < 4:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")             # <<<<<<<<<<<<<<
 * 
 *         bytes_to_read = unpack_uint24(packet_header)
 */
  __pyx_k_tuple_6 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_6);
  __Pyx_INCREF(__pyx_int_2013);
  PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, __pyx_int_2013);
  __Pyx_GIVEREF(__pyx_int_2013);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_k_tuple_6, 1, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

  /* "cymysql/packetx.pyx":105
 *         recv_data = self.__recv_from_socket(bytes_to_read)
 *         if len(recv_data) < bytes_to_read:
 *             raise OperationalError(2013, "Lost connection to MySQL server during query")             # <<<<<<<<<<<<<<
 * 
 *         self.__data = recv_data
 */
  __pyx_k_tuple_7 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_INCREF(__pyx_int_2013);
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, __pyx_int_2013);
  __Pyx_GIVEREF(__pyx_int_2013);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 1, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "cymysql/packetx.pyx":197
 *         cdef int affected_rows, insert_id, server_status, warning_count
 *         cdef message
 *         self.read(1)  # field_count (always '0')             # <<<<<<<<<<<<<<
 *         affected_rows = self.read_length_coded_binary()
 *         insert_id = self.read_length_coded_binary()
 */
  __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "cymysql/packetx.pyx":232
 *         self.name = self._read_length_coded_string().decode(self.connection.charset)
 *         self.org_name = self._read_length_coded_string()
 *         self.read(1)  # non-null filler             # <<<<<<<<<<<<<<
 *         self.charsetnr = unpack_uint16(self._read(2))
 *         self.length = unpack_uint32(self._read(4))
 */
  __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_11);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));

  /* "cymysql/packetx.pyx":238
 *         self.flags = unpack_uint16(self._read(2))
 *         self.scale = ord(self._read(1))  # "decimals"
 *         self.read(2)  # filler (always 0x00)             # <<<<<<<<<<<<<<
 * 
 *         # 'default' is a length coded binary and is still in the buffer?
 */
  __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_12);
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));

  /* "cymysql/packetx.pyx":300
 *             self.has_result = False
 *         else:
 *             self.field_count = ord(self.first_packet.read(1))             # <<<<<<<<<<<<<<
 *             self._get_descriptions()
 *             self.has_result = True
 */
  __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_14);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "cymysql/packetx.pyx":42
 *     return struct.unpack('<Q', n)[0]
 * 
 * def get_decode_values(values, charset, fields, use_unicode, decoders=default_decoders):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     r = [None] * len(values)
 */
  __pyx_k_tuple_21 = PyTuple_New(9); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__values));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_n_s__values));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__values));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__charset));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 1, ((PyObject *)__pyx_n_s__charset));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__charset));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fields));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 2, ((PyObject *)__pyx_n_s__fields));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fields));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__use_unicode));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 3, ((PyObject *)__pyx_n_s__use_unicode));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__use_unicode));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__decoders));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 4, ((PyObject *)__pyx_n_s__decoders));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__decoders));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 5, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 6, ((PyObject *)__pyx_n_s__r));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__value));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 7, ((PyObject *)__pyx_n_s__value));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__value));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__type_code));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 8, ((PyObject *)__pyx_n_s__type_code));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type_code));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
  __pyx_k_codeobj_22 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_23, __pyx_n_s__get_decode_values, 42, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __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[0]; __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[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_88 = PyInt_FromLong(88); if (unlikely(!__pyx_int_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2013 = PyInt_FromLong(2013); if (unlikely(!__pyx_int_2013)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initpacketx(void); /*proto*/
PyMODINIT_FUNC initpacketx(void)
#else
PyMODINIT_FUNC PyInit_packetx(void); /*proto*/
PyMODINIT_FUNC PyInit_packetx(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_packetx(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __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("packetx"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "cymysql.packetx")) {
      if (unlikely(PyDict_SetItemString(modules, "cymysql.packetx", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_cymysql__packetx) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7cymysql_7packetx_MysqlPacket = &__pyx_vtable_7cymysql_7packetx_MysqlPacket;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket.__pyx___recv_from_socket = (PyObject *(*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *, int))__pyx_f_7cymysql_7packetx_11MysqlPacket___recv_from_socket;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket.__pyx___recv_packet = (PyObject *(*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *))__pyx_f_7cymysql_7packetx_11MysqlPacket___recv_packet;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket._read = (PyObject *(*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *, int))__pyx_f_7cymysql_7packetx_11MysqlPacket__read;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket.read_length_coded_binary = (int (*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *))__pyx_f_7cymysql_7packetx_11MysqlPacket_read_length_coded_binary;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket.read_length_coded_string = (PyObject *(*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *))__pyx_f_7cymysql_7packetx_11MysqlPacket_read_length_coded_string;
  __pyx_vtable_7cymysql_7packetx_MysqlPacket._read_length_coded_string = (PyObject *(*)(struct __pyx_obj_7cymysql_7packetx_MysqlPacket *))__pyx_f_7cymysql_7packetx_11MysqlPacket__read_length_coded_string;
  if (PyType_Ready(&__pyx_type_7cymysql_7packetx_MysqlPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7cymysql_7packetx_MysqlPacket.tp_dict, __pyx_vtabptr_7cymysql_7packetx_MysqlPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "MysqlPacket", (PyObject *)&__pyx_type_7cymysql_7packetx_MysqlPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cymysql_7packetx_MysqlPacket = &__pyx_type_7cymysql_7packetx_MysqlPacket;
  __pyx_vtabptr_7cymysql_7packetx_FieldDescriptorPacket = &__pyx_vtable_7cymysql_7packetx_FieldDescriptorPacket;
  __pyx_vtable_7cymysql_7packetx_FieldDescriptorPacket.__pyx_base = *__pyx_vtabptr_7cymysql_7packetx_MysqlPacket;
  __pyx_type_7cymysql_7packetx_FieldDescriptorPacket.tp_base = __pyx_ptype_7cymysql_7packetx_MysqlPacket;
  if (PyType_Ready(&__pyx_type_7cymysql_7packetx_FieldDescriptorPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7cymysql_7packetx_FieldDescriptorPacket.tp_dict, __pyx_vtabptr_7cymysql_7packetx_FieldDescriptorPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FieldDescriptorPacket", (PyObject *)&__pyx_type_7cymysql_7packetx_FieldDescriptorPacket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cymysql_7packetx_FieldDescriptorPacket = &__pyx_type_7cymysql_7packetx_FieldDescriptorPacket;
  __pyx_vtabptr_7cymysql_7packetx_MySQLResult = &__pyx_vtable_7cymysql_7packetx_MySQLResult;
  __pyx_vtable_7cymysql_7packetx_MySQLResult._get_descriptions = (void (*)(struct __pyx_obj_7cymysql_7packetx_MySQLResult *))__pyx_f_7cymysql_7packetx_11MySQLResult__get_descriptions;
  if (PyType_Ready(&__pyx_type_7cymysql_7packetx_MySQLResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7cymysql_7packetx_MySQLResult.tp_dict, __pyx_vtabptr_7cymysql_7packetx_MySQLResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "MySQLResult", (PyObject *)&__pyx_type_7cymysql_7packetx_MySQLResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cymysql_7packetx_MySQLResult = &__pyx_type_7cymysql_7packetx_MySQLResult;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "cymysql/packetx.pyx":4
 * #   http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import struct
 * from cymysql.err import raise_mysql_exception, OperationalError
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":5
 * 
 * import sys
 * import struct             # <<<<<<<<<<<<<<
 * from cymysql.err import raise_mysql_exception, OperationalError
 * from cymysql.constants import SERVER_STATUS
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":6
 * import sys
 * import struct
 * from cymysql.err import raise_mysql_exception, OperationalError             # <<<<<<<<<<<<<<
 * from cymysql.constants import SERVER_STATUS
 * from cymysql.converters import decoders as default_decoders
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_3));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__OperationalError));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__OperationalError));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__OperationalError));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_18), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_3);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_3);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__OperationalError);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__OperationalError);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__OperationalError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":7
 * import struct
 * from cymysql.err import raise_mysql_exception, OperationalError
 * from cymysql.constants import SERVER_STATUS             # <<<<<<<<<<<<<<
 * from cymysql.converters import decoders as default_decoders
 * 
 */
  __pyx_t_2 = PyList_New(1); 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_INCREF(((PyObject *)__pyx_n_s__SERVER_STATUS));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__SERVER_STATUS));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SERVER_STATUS));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_19), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__SERVER_STATUS);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__SERVER_STATUS);
    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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SERVER_STATUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":8
 * from cymysql.err import raise_mysql_exception, OperationalError
 * from cymysql.constants import SERVER_STATUS
 * from cymysql.converters import decoders as default_decoders             # <<<<<<<<<<<<<<
 * 
 * from libc.stdint cimport uint16_t, uint32_t
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__decoders));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__decoders));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__decoders));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_20), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decoders);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__decoders);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__default_decoders, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymysql/packetx.pyx":11
 * 
 * from libc.stdint cimport uint16_t, uint32_t
 * cdef int PYTHON3 = sys.version_info[0] > 2             # <<<<<<<<<<<<<<
 * 
 * MBLENGTH = {
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__version_info); 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_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __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_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_7cymysql_7packetx_PYTHON3 = __pyx_t_3;

  /* "cymysql/packetx.pyx":13
 * cdef int PYTHON3 = sys.version_info[0] > 2
 * 
 * MBLENGTH = {             # <<<<<<<<<<<<<<
 *         8:1,
 *         33:3,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_33, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_88, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_91, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__MBLENGTH, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":20
 *         }
 * 
 * cdef int FIELD_TYPE_VAR_STRING=253             # <<<<<<<<<<<<<<
 * 
 * cdef int UNSIGNED_CHAR_COLUMN = 251
 */
  __pyx_v_7cymysql_7packetx_FIELD_TYPE_VAR_STRING = 253;

  /* "cymysql/packetx.pyx":22
 * cdef int FIELD_TYPE_VAR_STRING=253
 * 
 * cdef int UNSIGNED_CHAR_COLUMN = 251             # <<<<<<<<<<<<<<
 * cdef int UNSIGNED_SHORT_COLUMN = 252
 * cdef int UNSIGNED_INT24_COLUMN = 253
 */
  __pyx_v_7cymysql_7packetx_UNSIGNED_CHAR_COLUMN = 251;

  /* "cymysql/packetx.pyx":23
 * 
 * cdef int UNSIGNED_CHAR_COLUMN = 251
 * cdef int UNSIGNED_SHORT_COLUMN = 252             # <<<<<<<<<<<<<<
 * cdef int UNSIGNED_INT24_COLUMN = 253
 * cdef int UNSIGNED_INT64_COLUMN = 254
 */
  __pyx_v_7cymysql_7packetx_UNSIGNED_SHORT_COLUMN = 252;

  /* "cymysql/packetx.pyx":24
 * cdef int UNSIGNED_CHAR_COLUMN = 251
 * cdef int UNSIGNED_SHORT_COLUMN = 252
 * cdef int UNSIGNED_INT24_COLUMN = 253             # <<<<<<<<<<<<<<
 * cdef int UNSIGNED_INT64_COLUMN = 254
 * 
 */
  __pyx_v_7cymysql_7packetx_UNSIGNED_INT24_COLUMN = 253;

  /* "cymysql/packetx.pyx":25
 * cdef int UNSIGNED_SHORT_COLUMN = 252
 * cdef int UNSIGNED_INT24_COLUMN = 253
 * cdef int UNSIGNED_INT64_COLUMN = 254             # <<<<<<<<<<<<<<
 * 
 * cdef uint16_t unpack_uint16(bytes s):
 */
  __pyx_v_7cymysql_7packetx_UNSIGNED_INT64_COLUMN = 254;

  /* "cymysql/packetx.pyx":42
 *     return struct.unpack('<Q', n)[0]
 * 
 * def get_decode_values(values, charset, fields, use_unicode, decoders=default_decoders):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     r = [None] * len(values)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__default_decoders); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_2 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7cymysql_7packetx_1get_decode_values, NULL, __pyx_n_s_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_decode_values, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymysql/packetx.pyx":1
 * # Python implementation of the MySQL client-server protocol             # <<<<<<<<<<<<<<
 * #   http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init cymysql.packetx", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cymysql.packetx");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

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

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    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)) {
        PyObject *args;
        if (!value)
            args = PyTuple_New(0);
        else if (PyTuple_Check(value)) {
            Py_INCREF(value);
            args = value;
        }
        else
            args = PyTuple_Pack(1, value);
        if (!args)
            goto bad;
        owned_instance = PyEval_CallObject(type, args);
        Py_DECREF(args);
        if (!owned_instance)
            goto bad;
        value = owned_instance;
        if (!PyExceptionInstance_Check(value)) {
            PyErr_Format(PyExc_TypeError,
                         "calling %R should have returned an instance of "
                         "BaseException, not %R",
                         type, Py_TYPE(value));
            goto bad;
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause && cause != Py_None) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                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;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
    int q = a / b;
    int r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint16_t(uint16_t val) {
    const uint16_t neg_one = (uint16_t)-1, const_zero = (uint16_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(uint16_t) == sizeof(char))  ||
        (sizeof(uint16_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(uint16_t) == sizeof(int)) ||
               (sizeof(uint16_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(uint16_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #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_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        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,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) 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 = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
