diff --git a/oursqlx/_exceptions.c b/oursqlx/_exceptions.c index 8fd1878..e414d22 100644 --- a/oursqlx/_exceptions.c +++ b/oursqlx/_exceptions.c @@ -617,10 +617,26 @@ enum _oursqlx_exception_type _oursqlx_exc_from_errno(int err) { return _oursqlx_PermissionsError; default: - if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST) - return _oursqlx_ProgrammingError; - else if (err > CR_MIN_ERROR && err < CR_MAX_ERROR) - return _oursqlx_InterfaceError; + #if MYSQL_VERSION_ID >= 50700 && !defined(ER_ERROR_FIRST) + { + unsigned int i; + for(i = 0; i < sizeof(errmsg_section_start)/sizeof(int); ++i) { + int min = errmsg_section_start[i]; + int max = errmsg_section_start[i] + errmsg_section_size[i] - 1; + if ( err >= min && err <= max ) { + return _oursqlx_ProgrammingError; + } + } + if ( err > CR_MIN_ERROR && err < CR_MAX_ERROR) { + return _oursqlx_InterfaceError; + } + } + #else + if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST) + return _oursqlx_ProgrammingError; + else if (err > CR_MIN_ERROR && err < CR_MAX_ERROR) + return _oursqlx_InterfaceError; + #endif } return _oursqlx_UnknownError; } diff --git a/oursqlx/oursql.c b/oursqlx/oursql.c new file mode 100644 index 0000000..36d1d86 --- /dev/null +++ b/oursqlx/oursql.c @@ -0,0 +1,39522 @@ +/* Generated by Cython 0.29.21 */ + +#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_21" +#define CYTHON_HEX_VERSION 0x001D15F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#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 +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#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_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#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 +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif 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 + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #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 + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#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 +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#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 + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__oursql +#define __PYX_HAVE_API__oursql +/* Early includes */ +#include "compat.h" +#include "datetime.h" +#include "string.h" +#include "mysql.h" +#include "mysqld_error.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#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)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +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[] = { + "oursqlx/oursql.pyx", + "oursqlx/util.pyx", + "oursqlx/connection.pyx", + "stringsource", + "oursqlx/statement.pyx", + "oursqlx/conversions.pyx", + "oursqlx/query.pyx", + "oursqlx/cursor.pyx", +}; +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6oursql__DictWhateverMixin; +struct __pyx_obj_6oursql_Connection; +struct __pyx_obj_6oursql__AbstractIterWrapper; +struct __pyx_obj_6oursql__BinaryWhateverMixin; +struct __pyx_obj_6oursql_IterWrapper; +struct __pyx_obj_6oursql_FileWrapper; +struct __pyx_obj_6oursql__Statement; +struct __pyx_obj_6oursql__ResultStringStream; +struct __pyx_obj_6oursql__ResultSet; +struct __pyx_obj_6oursql__Query; +struct __pyx_obj_6oursql__DictQuery; +struct __pyx_obj_6oursql_Cursor; +struct __pyx_obj_6oursql_DictCursor; +struct __pyx_obj_6oursql__DBAPITypeObject; +union __pyx_t_6oursql_column_data; +union __pyx_t_6oursql_bitfield; +struct __pyx_t_6oursql_column_output; +struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding; +struct __pyx_opt_args_6oursql_6Cursor__update_fields; + +/* "oursql.pyx":18 + * cdef unsigned int UNSIGNED_NUM_FLAG = UNSIGNED_FLAG | NUM_FLAG + * + * cdef union column_data: # <<<<<<<<<<<<<< + * MYSQL_TIME t + * long long ll + */ +union __pyx_t_6oursql_column_data { + MYSQL_TIME t; + PY_LONG_LONG ll; + unsigned PY_LONG_LONG ull; + unsigned long ul; + Py_ssize_t st; + long l; + float f; + double d; + char c; + char dec[65]; + int8_t s8; + int16_t s16; + int32_t s32; + int64_t s64; + uint8_t u8; + uint16_t u16; + uint32_t u32; + uint64_t u64; +}; + +/* "oursql.pyx":40 + * uint64_t u64 + * + * cdef union bitfield: # <<<<<<<<<<<<<< + * char c[8] + * uint64_t u64 + */ +union __pyx_t_6oursql_bitfield { + char c[8]; + uint64_t u64; +}; + +/* "oursql.pyx":44 + * uint64_t u64 + * + * cdef struct column_output: # <<<<<<<<<<<<<< + * enum_field_types type + * unsigned int flags + */ +struct __pyx_t_6oursql_column_output { + enum enum_field_types type; + unsigned int flags; + int is_binary; + unsigned long length; + my_bool is_null; + my_bool error; + union __pyx_t_6oursql_column_data buf; +}; + +/* "oursqlx/util.pyx":1 + * cdef object bytes_maybe_from_encoding(object s, object encoding, # <<<<<<<<<<<<<< + * bint allow_none=True): + * if s is None and allow_none: + */ +struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding { + int __pyx_n; + int allow_none; +}; + +/* "oursqlx/cursor.pyx":147 + * self._update_fields(stmt, rowcount) + * + * cdef int _update_fields(self, stmt, rowcount=None) except -1: # <<<<<<<<<<<<<< + * self.messages.extend(stmt.warnings) + * if rowcount is None: + */ +struct __pyx_opt_args_6oursql_6Cursor__update_fields { + int __pyx_n; + PyObject *rowcount; +}; + +/* "oursqlx/util.pyx":59 + * return ret + * + * cdef class _DictWhateverMixin: # <<<<<<<<<<<<<< + * def fetchone(self): + * row = super(_DictWhateverMixin, self).fetchone() + */ +struct __pyx_obj_6oursql__DictWhateverMixin { + PyObject_HEAD +}; + + +/* "oursql.pyx":80 + * class UnknownError(Error): pass + * + * cdef class Connection # <<<<<<<<<<<<<< + * + * include "util.pyx" + */ +struct __pyx_obj_6oursql_Connection { + PyObject_HEAD + struct __pyx_vtabstruct_6oursql_Connection *__pyx_vtab; + PyObject *__weakref__; + MYSQL *conn; + PyObject *_charset; + PyObject *_charset_bytes; + PyObject *_context_cursors; + int use_unicode; + int autoping; + int raise_on_warnings; + PyObject *default_cursor; +}; + + +/* "oursqlx/statement.pyx":8 + * cdef my_ulonglong ull_negone = -1 + * + * cdef class _AbstractIterWrapper: # <<<<<<<<<<<<<< + * def __iter__(self): + * return self + */ +struct __pyx_obj_6oursql__AbstractIterWrapper { + PyObject_HEAD +}; + + +/* "oursqlx/statement.pyx":12 + * return self + * + * cdef class _BinaryWhateverMixin: # <<<<<<<<<<<<<< + * def __next__(self): + * ret = super(BinaryFileWrapper, self).next() + */ +struct __pyx_obj_6oursql__BinaryWhateverMixin { + PyObject_HEAD +}; + + +/* "oursqlx/statement.pyx":17 + * return ret + * + * cdef class IterWrapper(_AbstractIterWrapper): # <<<<<<<<<<<<<< + * """IterWrapper(iterobj) + * + */ +struct __pyx_obj_6oursql_IterWrapper { + struct __pyx_obj_6oursql__AbstractIterWrapper __pyx_base; + PyObject *iterobj; + PyObject *nextfunc; +}; + + +/* "oursqlx/statement.pyx":43 + * """}) + * + * cdef class FileWrapper(_AbstractIterWrapper): # <<<<<<<<<<<<<< + * """FileWrapper(fileobj, chunksize=8192, doclose=False) + * + */ +struct __pyx_obj_6oursql_FileWrapper { + struct __pyx_obj_6oursql__AbstractIterWrapper __pyx_base; + PyObject *fileobj; + PyObject *chunksize; + PyObject *readfunc; + int doclose; + int done; +}; + + +/* "oursqlx/statement.pyx":85 + * """}) + * + * cdef class _Statement: # <<<<<<<<<<<<<< + * """_Statement(...) + * + */ +struct __pyx_obj_6oursql__Statement { + PyObject_HEAD + struct __pyx_vtabstruct_6oursql__Statement *__pyx_vtab; + PyObject *__weakref__; + MYSQL_STMT *stmt; + MYSQL_BIND *bind; + struct __pyx_t_6oursql_column_output *result_data; + unsigned int result_fields; + unsigned int fetched; + unsigned long cursor_type; + unsigned long string_limit; + unsigned long _prefetch_rows; + int buffered; + int data_waiting; + int show_table; + int exhausted; + struct __pyx_obj_6oursql_Connection *conn; + PyObject *warnings; +}; + + +/* "oursqlx/statement.pyx":604 + * {'__module__': __name__}) + * + * cdef class _ResultStringStream: # <<<<<<<<<<<<<< + * """_ResultStringStream(...) + * + */ +struct __pyx_obj_6oursql__ResultStringStream { + PyObject_HEAD + MYSQL_BIND bind; + struct __pyx_obj_6oursql__Statement *stmt; + unsigned int index; + unsigned int stmt_fetched; + unsigned long offset; + unsigned long length; + int done; +}; + + +/* "oursqlx/query.pyx":4 + * # MySQL, I really do. + * + * cdef class _ResultSet: # <<<<<<<<<<<<<< + * """_ResultSet(...) + * + */ +struct __pyx_obj_6oursql__ResultSet { + PyObject_HEAD + struct __pyx_vtabstruct_6oursql__ResultSet *__pyx_vtab; + struct __pyx_obj_6oursql_Connection *conn; + MYSQL_RES *res; + unsigned int fields; + PyObject *conversion_info; + PyObject *rowcount; + PyObject *lastrowid; + PyObject *description; + PyObject *column_names; + PyObject *warnings; + int show_table; +}; + + +/* "oursqlx/query.pyx":116 + * return PyCallIter_New(self.fetchone, None) + * + * cdef class _Query: # <<<<<<<<<<<<<< + * """_Query(...) + * + */ +struct __pyx_obj_6oursql__Query { + PyObject_HEAD + struct __pyx_vtabstruct_6oursql__Query *__pyx_vtab; + struct __pyx_obj_6oursql_Connection *conn; + PyObject *result; + PyObject *res_a; + PyObject *res_kw; + PyObject *rowcount; + PyObject *lastrowid; + PyObject *description; + PyObject *warnings; + PyObject *has_result; +}; + + +/* "oursqlx/query.pyx":193 + * {'__module__': __name__}) + * + * cdef class _DictQuery(_Query): # <<<<<<<<<<<<<< + * _result_class = _DictResultSet + */ +struct __pyx_obj_6oursql__DictQuery { + struct __pyx_obj_6oursql__Query __pyx_base; +}; + + +/* "oursqlx/cursor.pyx":3 + * import collections, itertools + * + * cdef class Cursor: # <<<<<<<<<<<<<< + * """Cursor(...) + * + */ +struct __pyx_obj_6oursql_Cursor { + PyObject_HEAD + struct __pyx_vtabstruct_6oursql_Cursor *__pyx_vtab; + PyObject *_statements; + PyObject *_stmt_kwargs; + struct __pyx_obj_6oursql_Connection *conn; + int closed; + int try_plain_query; + PyObject *rowcount; + PyObject *lastrowid; + PyObject *description; + PyObject *messages; + unsigned long arraysize; +}; + + +/* "oursqlx/cursor.pyx":265 + * self.close() + * + * cdef class DictCursor(Cursor): # <<<<<<<<<<<<<< + * """DictCursor(...) + * + */ +struct __pyx_obj_6oursql_DictCursor { + struct __pyx_obj_6oursql_Cursor __pyx_base; +}; + + +/* "oursql.pyx":99 + * connect = Connection + * + * cdef class _DBAPITypeObject: # <<<<<<<<<<<<<< + * cdef readonly object values + * + */ +struct __pyx_obj_6oursql__DBAPITypeObject { + PyObject_HEAD + PyObject *values; +}; + + + +/* "oursqlx/connection.pyx":9 + * } + * + * cdef class Connection: # <<<<<<<<<<<<<< + * """Connection([host, user, passwd,] db=None, port=0, unix_socket=None, + * connect_timeout=None, read_timeout=None, write_timeout=None, + */ + +struct __pyx_vtabstruct_6oursql_Connection { + int (*_raise_error)(struct __pyx_obj_6oursql_Connection *); + int (*_check_closed)(struct __pyx_obj_6oursql_Connection *); + PyObject *(*_decode_char_p)(struct __pyx_obj_6oursql_Connection *, const char *); +}; +static struct __pyx_vtabstruct_6oursql_Connection *__pyx_vtabptr_6oursql_Connection; + + +/* "oursqlx/statement.pyx":85 + * """}) + * + * cdef class _Statement: # <<<<<<<<<<<<<< + * """_Statement(...) + * + */ + +struct __pyx_vtabstruct_6oursql__Statement { + int (*_raise_error)(struct __pyx_obj_6oursql__Statement *); + int (*_check_closed)(struct __pyx_obj_6oursql__Statement *); + int (*_alloc_buffer)(struct __pyx_obj_6oursql__Statement *); + int (*_bind_buffer)(struct __pyx_obj_6oursql__Statement *); +}; +static struct __pyx_vtabstruct_6oursql__Statement *__pyx_vtabptr_6oursql__Statement; + + +/* "oursqlx/query.pyx":4 + * # MySQL, I really do. + * + * cdef class _ResultSet: # <<<<<<<<<<<<<< + * """_ResultSet(...) + * + */ + +struct __pyx_vtabstruct_6oursql__ResultSet { + int (*_raise_error)(struct __pyx_obj_6oursql__ResultSet *); + int (*_check_closed)(struct __pyx_obj_6oursql__ResultSet *); +}; +static struct __pyx_vtabstruct_6oursql__ResultSet *__pyx_vtabptr_6oursql__ResultSet; + + +/* "oursqlx/query.pyx":116 + * return PyCallIter_New(self.fetchone, None) + * + * cdef class _Query: # <<<<<<<<<<<<<< + * """_Query(...) + * + */ + +struct __pyx_vtabstruct_6oursql__Query { + int (*_raise_error)(struct __pyx_obj_6oursql__Query *); +}; +static struct __pyx_vtabstruct_6oursql__Query *__pyx_vtabptr_6oursql__Query; + + +/* "oursqlx/query.pyx":193 + * {'__module__': __name__}) + * + * cdef class _DictQuery(_Query): # <<<<<<<<<<<<<< + * _result_class = _DictResultSet + */ + +struct __pyx_vtabstruct_6oursql__DictQuery { + struct __pyx_vtabstruct_6oursql__Query __pyx_base; +}; +static struct __pyx_vtabstruct_6oursql__DictQuery *__pyx_vtabptr_6oursql__DictQuery; + + +/* "oursqlx/cursor.pyx":3 + * import collections, itertools + * + * cdef class Cursor: # <<<<<<<<<<<<<< + * """Cursor(...) + * + */ + +struct __pyx_vtabstruct_6oursql_Cursor { + int (*_check_closed)(struct __pyx_obj_6oursql_Cursor *); + int (*_update_fields)(struct __pyx_obj_6oursql_Cursor *, PyObject *, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args); + int (*_check_statements)(struct __pyx_obj_6oursql_Cursor *); +}; +static struct __pyx_vtabstruct_6oursql_Cursor *__pyx_vtabptr_6oursql_Cursor; + + +/* "oursqlx/cursor.pyx":265 + * self.close() + * + * cdef class DictCursor(Cursor): # <<<<<<<<<<<<<< + * """DictCursor(...) + * + */ + +struct __pyx_vtabstruct_6oursql_DictCursor { + struct __pyx_vtabstruct_6oursql_Cursor __pyx_base; +}; +static struct __pyx_vtabstruct_6oursql_DictCursor *__pyx_vtabptr_6oursql_DictCursor; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#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); + #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 +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#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) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* IncludeStringH.proto */ +#include + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +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) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* SliceObject.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* append.proto */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* pop.proto */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); +#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ + __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) +#else +#define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) +#define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) +#endif + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_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); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_unsigned_int(unsigned int value, Py_ssize_t width, char padding_char, char format_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_enum__enum_field_types(enum enum_field_types value, Py_ssize_t width, char padding_char, char format_char); + +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __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); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum___oursqlx_exception_type(enum _oursqlx_exception_type value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__enum_field_types(enum enum_field_types value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__mysql_protocol_type(enum mysql_protocol_type value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_my_ulonglong(my_ulonglong value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6oursql_10Connection__raise_error(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10Connection__check_closed(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6oursql_10Connection__decode_char_p(struct __pyx_obj_6oursql_Connection *__pyx_v_self, const char *__pyx_v_value); /* proto*/ +static int __pyx_f_6oursql_10_Statement__raise_error(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10_Statement__check_closed(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10_Statement__alloc_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10_Statement__bind_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10_ResultSet__raise_error(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_10_ResultSet__check_closed(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_6_Query__raise_error(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_6Cursor__check_closed(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto*/ +static int __pyx_f_6oursql_6Cursor__update_fields(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_stmt, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args); /* proto*/ +static int __pyx_f_6oursql_6Cursor__check_statements(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto*/ + +/* Module declarations from 'oursql' */ +static PyTypeObject *__pyx_ptype_6oursql_Connection = 0; +static PyTypeObject *__pyx_ptype_6oursql__DictWhateverMixin = 0; +static PyTypeObject *__pyx_ptype_6oursql__AbstractIterWrapper = 0; +static PyTypeObject *__pyx_ptype_6oursql__BinaryWhateverMixin = 0; +static PyTypeObject *__pyx_ptype_6oursql_IterWrapper = 0; +static PyTypeObject *__pyx_ptype_6oursql_FileWrapper = 0; +static PyTypeObject *__pyx_ptype_6oursql__Statement = 0; +static PyTypeObject *__pyx_ptype_6oursql__ResultStringStream = 0; +static PyTypeObject *__pyx_ptype_6oursql__ResultSet = 0; +static PyTypeObject *__pyx_ptype_6oursql__Query = 0; +static PyTypeObject *__pyx_ptype_6oursql__DictQuery = 0; +static PyTypeObject *__pyx_ptype_6oursql_Cursor = 0; +static PyTypeObject *__pyx_ptype_6oursql_DictCursor = 0; +static PyTypeObject *__pyx_ptype_6oursql__DBAPITypeObject = 0; +static unsigned int __pyx_v_6oursql_UNSIGNED_NUM_FLAG; +static my_ulonglong __pyx_v_6oursql_ull_negone; +static CYTHON_INLINE MYSQL *__pyx_f_6oursql_mysql_real_connect(MYSQL *, char *, char *, char *, char *, unsigned int, char *, unsigned long); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_ping(MYSQL *); /*proto*/ +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_commit(MYSQL *); /*proto*/ +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_rollback(MYSQL *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_prepare(MYSQL_STMT *, char *, unsigned long); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch(MYSQL_STMT *); /*proto*/ +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_stmt_send_long_data(MYSQL_STMT *, unsigned int, char *, unsigned long); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch_column(MYSQL_STMT *, MYSQL_BIND *, unsigned int, unsigned long); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6oursql_mysql_real_query(MYSQL *, char *, unsigned long); /*proto*/ +static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_store_result(MYSQL *); /*proto*/ +static CYTHON_INLINE MYSQL_ROW __pyx_f_6oursql_mysql_fetch_row(MYSQL_RES *); /*proto*/ +static PyObject *__pyx_f_6oursql_bytes_maybe_from_encoding(PyObject *, PyObject *, struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding *__pyx_optional_args); /*proto*/ +static char *__pyx_f_6oursql_bytes_or_null(PyObject *); /*proto*/ +static unsigned long __pyx_f_6oursql_bitval_from_char_p(unsigned char *, Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6oursql_conversion_info_from_res(MYSQL_RES *, int); /*proto*/ +static PyObject *__pyx_f_6oursql_description_from_res(struct __pyx_obj_6oursql_Connection *, MYSQL_RES *, int, int); /*proto*/ +static PyObject *__pyx_f_6oursql___pyx_unpickle__DictWhateverMixin__set_state(struct __pyx_obj_6oursql__DictWhateverMixin *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6oursql___pyx_unpickle__AbstractIterWrapper__set_state(struct __pyx_obj_6oursql__AbstractIterWrapper *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6oursql___pyx_unpickle__BinaryWhateverMixin__set_state(struct __pyx_obj_6oursql__BinaryWhateverMixin *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6oursql___pyx_unpickle__DBAPITypeObject__set_state(struct __pyx_obj_6oursql__DBAPITypeObject *, PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "oursql" +extern int __pyx_module_is_main_oursql; +int __pyx_module_is_main_oursql = 0; + +/* Implementation of 'oursql' */ +static PyObject *__pyx_builtin_super; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_id; +static const char __pyx_k_[] = "."; +static const char __pyx_k_d[] = "d"; +static const char __pyx_k_q[] = "q"; +static const char __pyx_k_s[] = "s"; +static const char __pyx_k_ca[] = "ca"; +static const char __pyx_k_db[] = "db"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_ss[] = "ss"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_tt[] = "tt"; +static const char __pyx_k_2_0[] = "2.0"; +static const char __pyx_k__21[] = ""; +static const char __pyx_k_and[] = " and "; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_err[] = "err"; +static const char __pyx_k_exc[] = "exc"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ret[] = "ret"; +static const char __pyx_k_ssl[] = "ssl"; +static const char __pyx_k_tcp[] = "tcp"; +static const char __pyx_k_zip[] = "zip"; +static const char __pyx_k_DATE[] = "DATE"; +static const char __pyx_k_Date[] = "Date"; +static const char __pyx_k_Note[] = "Note"; +static const char __pyx_k_TIME[] = "TIME"; +static const char __pyx_k_Time[] = "Time"; +static const char __pyx_k_cert[] = "cert"; +static const char __pyx_k_conn[] = "conn"; +static const char __pyx_k_date[] = "date"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_host[] = "host"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_kind[] = "kind"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; +static const char __pyx_k_ping[] = "ping"; +static const char __pyx_k_pipe[] = "pipe"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_read[] = "read"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_stmt[] = "stmt"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_time[] = "time"; +static const char __pyx_k_type[] = ", type "; +static const char __pyx_k_user[] = "user"; +static const char __pyx_k_utf8[] = "utf8"; +static const char __pyx_k_0_9_4[] = "0.9.4"; +static const char __pyx_k_Error[] = "Error"; +static const char __pyx_k_H_M_S[] = "%H:%M:%S"; +static const char __pyx_k_Query[] = "_Query"; +static const char __pyx_k_ROWID[] = "ROWID"; +static const char __pyx_k_Y_m_d[] = "%Y-%m-%d"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_deque[] = "deque"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_errno[] = "errno"; +static const char __pyx_k_extra[] = "extra"; +static const char __pyx_k_given[] = " given"; +static const char __pyx_k_index[] = "index"; +static const char __pyx_k_qmark[] = "qmark"; +static const char __pyx_k_query[] = "query"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_ticks[] = "ticks"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_BINARY[] = "BINARY"; +static const char __pyx_k_Binary[] = "Binary"; +static const char __pyx_k_Cursor[] = "Cursor"; +static const char __pyx_k_NUMBER[] = "NUMBER"; +static const char __pyx_k_STRING[] = "STRING"; +static const char __pyx_k_append[] = "append"; +static const char __pyx_k_author[] = "__author__"; +static const char __pyx_k_capath[] = "capath"; +static const char __pyx_k_cipher[] = "cipher"; +static const char __pyx_k_codecs[] = "codecs"; +static const char __pyx_k_column[] = "column"; +static const char __pyx_k_commit[] = "commit"; +static const char __pyx_k_cursor[] = "cursor"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_errnos[] = "errnos"; +static const char __pyx_k_extend[] = "extend"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_length[] = "length"; +static const char __pyx_k_memory[] = "memory"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_oursql[] = "oursql"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_passwd[] = "passwd"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_socket[] = "socket"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_BytesIO[] = "BytesIO"; +static const char __pyx_k_Decimal[] = "Decimal"; +static const char __pyx_k_Warning[] = "Warning"; +static const char __pyx_k_charset[] = "charset"; +static const char __pyx_k_connect[] = "connect"; +static const char __pyx_k_decimal[] = "decimal"; +static const char __pyx_k_doclose[] = "doclose"; +static const char __pyx_k_execute[] = "execute"; +static const char __pyx_k_fileobj[] = "fileobj"; +static const char __pyx_k_iterobj[] = "iterobj"; +static const char __pyx_k_message[] = "message"; +static const char __pyx_k_nextset[] = "nextset"; +static const char __pyx_k_popleft[] = "popleft"; +static const char __pyx_k_prepare[] = "prepare"; +static const char __pyx_k_version[] = "__version__"; +static const char __pyx_k_DATETIME[] = "DATETIME"; +static const char __pyx_k_apilevel[] = "apilevel"; +static const char __pyx_k_autoping[] = "autoping"; +static const char __pyx_k_builtins[] = "builtins"; +static const char __pyx_k_compress[] = "compress"; +static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_fetchall[] = "fetchall"; +static const char __pyx_k_fetchone[] = "fetchone"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_procname[] = "procname"; +static const char __pyx_k_protocol[] = "protocol"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_rollback[] = "rollback"; +static const char __pyx_k_rowcount[] = "rowcount"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_strptime[] = "strptime"; +static const char __pyx_k_warnings[] = "warnings"; +static const char __pyx_k_DataError[] = "DataError"; +static const char __pyx_k_DictQuery[] = "_DictQuery"; +static const char __pyx_k_Exception[] = "Exception"; +static const char __pyx_k_ResultSet[] = "_ResultSet"; +static const char __pyx_k_Statement[] = "_Statement"; +static const char __pyx_k_TIMESTAMP[] = "TIMESTAMP"; +static const char __pyx_k_Timestamp[] = "Timestamp"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_chunksize[] = "chunksize"; +static const char __pyx_k_getreader[] = "getreader"; +static const char __pyx_k_itertools[] = "itertools"; +static const char __pyx_k_lastrowid[] = "lastrowid"; +static const char __pyx_k_localtime[] = "localtime"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_new_query[] = "_new_query"; +static const char __pyx_k_prepare_2[] = "__prepare__"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_Connection[] = "Connection"; +static const char __pyx_k_DictCursor[] = "DictCursor"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_connection[] = "connection"; +static const char __pyx_k_found_rows[] = "found_rows"; +static const char __pyx_k_has_result[] = "has_result"; +static const char __pyx_k_new_result[] = "new_result"; +static const char __pyx_k_parambatch[] = "parambatch"; +static const char __pyx_k_paramstyle[] = "paramstyle"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_show_table[] = "show_table"; +static const char __pyx_k_FileWrapper[] = "FileWrapper"; +static const char __pyx_k_IterWrapper[] = "IterWrapper"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S"; +static const char __pyx_k_charset_dir[] = "charset_dir"; +static const char __pyx_k_client_info[] = "client_info"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_conversions[] = "_conversions"; +static const char __pyx_k_description[] = "description"; +static const char __pyx_k_do_autoping[] = "_do_autoping"; +static const char __pyx_k_plain_query[] = "plain_query"; +static const char __pyx_k_query_class[] = "_query_class"; +static const char __pyx_k_unix_socket[] = "unix_socket"; +static const char __pyx_k_use_unicode[] = "use_unicode"; +static const char __pyx_k_Error___init[] = "Error.__init__"; +static const char __pyx_k_UnknownError[] = "UnknownError"; +static const char __pyx_k_column_names[] = "column_names"; +static const char __pyx_k_cursor_class[] = "cursor_class"; +static const char __pyx_k_init_command[] = "init_command"; +static const char __pyx_k_local_infile[] = "local_infile"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_query_closed[] = "query closed"; +static const char __pyx_k_read_timeout[] = "read_timeout"; +static const char __pyx_k_result_class[] = "_result_class"; +static const char __pyx_k_should_raise[] = "should_raise"; +static const char __pyx_k_string_limit[] = "string_limit"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_threadsafety[] = "threadsafety"; +static const char __pyx_k_DatabaseError[] = "DatabaseError"; +static const char __pyx_k_DateFromTicks[] = "DateFromTicks"; +static const char __pyx_k_DictResultSet[] = "_DictResultSet"; +static const char __pyx_k_DictStatement[] = "_DictStatement"; +static const char __pyx_k_InternalError[] = "InternalError"; +static const char __pyx_k_SHOW_WARNINGS[] = "SHOW WARNINGS"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_TimeFromTicks[] = "TimeFromTicks"; +static const char __pyx_k_autoreconnect[] = "autoreconnect"; +static const char __pyx_k_cursor_closed[] = "cursor closed"; +static const char __pyx_k_escape_string[] = "_escape_string"; +static const char __pyx_k_multi_results[] = "multi_results"; +static const char __pyx_k_new_statement[] = "_new_statement"; +static const char __pyx_k_prefetch_rows[] = "prefetch_rows"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_warning_count[] = "warning_count"; +static const char __pyx_k_write_timeout[] = "write_timeout"; +static const char __pyx_k_IntegrityError[] = "IntegrityError"; +static const char __pyx_k_InterfaceError[] = "InterfaceError"; +static const char __pyx_k_buffer_results[] = "buffer_results"; +static const char __pyx_k_default_cursor[] = "default_cursor"; +static const char __pyx_k_DBAPITypeObject[] = "_DBAPITypeObject"; +static const char __pyx_k_connect_timeout[] = "connect_timeout"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_statement_class[] = "_statement_class"; +static const char __pyx_k_try_plain_query[] = "try_plain_query"; +static const char __pyx_k_OperationalError[] = "OperationalError"; +static const char __pyx_k_PermissionsError[] = "PermissionsError"; +static const char __pyx_k_ProgrammingError[] = "ProgrammingError"; +static const char __pyx_k_conversions_dict[] = "conversions_dict"; +static const char __pyx_k_date_from_string[] = "_date_from_string"; +static const char __pyx_k_multi_statements[] = "multi_statements"; +static const char __pyx_k_oursqlx_util_pyx[] = "oursqlx/util.pyx"; +static const char __pyx_k_statement_closed[] = "statement closed"; +static const char __pyx_k_time_from_string[] = "_time_from_string"; +static const char __pyx_k_truncated_column[] = "truncated column "; +static const char __pyx_k_unknown_protocol[] = "unknown protocol "; +static const char __pyx_k_BinaryFileWrapper[] = "BinaryFileWrapper"; +static const char __pyx_k_BinaryIterWrapper[] = "BinaryIterWrapper"; +static const char __pyx_k_DictWhateverMixin[] = "_DictWhateverMixin"; +static const char __pyx_k_NotSupportedError[] = "NotSupportedError"; +static const char __pyx_k_connection_closed[] = "connection closed"; +static const char __pyx_k_do_warnings_query[] = "_do_warnings_query"; +static const char __pyx_k_protocol_enum_map[] = "_protocol_enum_map"; +static const char __pyx_k_raise_on_warnings[] = "raise_on_warnings"; +static const char __pyx_k_read_default_file[] = "read_default_file"; +static const char __pyx_k_report_truncation[] = "report_truncation"; +static const char __pyx_k_setup_ssl_options[] = "_setup_ssl_options"; +static const char __pyx_k_unorderable_types[] = "unorderable types: "; +static const char __pyx_k_ResultStringStream[] = "_ResultStringStream"; +static const char __pyx_k_TimestampFromTicks[] = "TimestampFromTicks"; +static const char __pyx_k_bitval_from_string[] = "_bitval_from_string"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_exception_enum_map[] = "_exception_enum_map"; +static const char __pyx_k_oursqlx_oursql_pyx[] = "oursqlx/oursql.pyx"; +static const char __pyx_k_read_default_group[] = "read_default_group"; +static const char __pyx_k_AbstractIterWrapper[] = "_AbstractIterWrapper"; +static const char __pyx_k_BinaryWhateverMixin[] = "_BinaryWhateverMixin"; +static const char __pyx_k_parameters_expected[] = " parameters expected, "; +static const char __pyx_k_require_secure_auth[] = "require_secure_auth"; +static const char __pyx_k_cannot_bind_r_object[] = "cannot bind %r object"; +static const char __pyx_k_datetime_from_string[] = "_datetime_from_string"; +static const char __pyx_k_exception_from_errno[] = "_exception_from_errno"; +static const char __pyx_k_no_results_available[] = "no results available"; +static const char __pyx_k_CollatedWarningsError[] = "CollatedWarningsError"; +static const char __pyx_k_query_caused_warnings[] = "query caused warnings"; +static const char __pyx_k_string_limit_must_be_0[] = "string limit must be >= 0"; +static const char __pyx_k_oursqlx_conversions_pyx[] = "oursqlx/conversions.pyx"; +static const char __pyx_k_shared_memory_base_name[] = "shared_memory_base_name"; +static const char __pyx_k_alloc_of_statement_failed[] = "alloc of statement failed"; +static const char __pyx_k_can_t_read_negative_bytes[] = "can't read negative bytes"; +static const char __pyx_k_unknown_kind_of_warning_r[] = "unknown kind of warning: %r"; +static const char __pyx_k_could_not_initialize_mysql[] = "could not initialize mysql"; +static const char __pyx_k_size_remaining_should_be_0[] = "size remaining should be >= 0"; +static const char __pyx_k_alloc_of_conn_object_failed[] = "alloc of conn object failed"; +static const char __pyx_k_must_prefetch_at_least_1_row[] = "must prefetch at least 1 row"; +static const char __pyx_k_pyx_unpickle__DBAPITypeObject[] = "__pyx_unpickle__DBAPITypeObject"; +static const char __pyx_k_DBAPITypeObject_representing_r[] = "<_DBAPITypeObject representing %r at %#x>"; +static const char __pyx_k_alloc_of_result_buffers_failed[] = "alloc of result buffers failed"; +static const char __pyx_k_pyx_unpickle__AbstractIterWrap[] = "__pyx_unpickle__AbstractIterWrapper"; +static const char __pyx_k_pyx_unpickle__BinaryWhateverMi[] = "__pyx_unpickle__BinaryWhateverMixin"; +static const char __pyx_k_pyx_unpickle__DictWhateverMixi[] = "__pyx_unpickle__DictWhateverMixin"; +static const char __pyx_k_alloc_of_bind_parameters_failed[] = "alloc of bind parameters failed"; +static const char __pyx_k_column_s_appears_more_than_once[] = "column \"%s\" appears more than once in output"; +static const char __pyx_k_use_the_CALL_statement_with_the[] = "use the CALL statement with the execute method to call stored procedures"; +static const char __pyx_k_Aaron_Gallagher_habnabit_gmail_c[] = "Aaron Gallagher "; +static const char __pyx_k_BinaryFileWrapper_fileobj_chunks[] = "BinaryFileWrapper(fileobj, chunksize=8192, doclose=False)\n \n BinaryFileWrapper behaves exactly like FileWrapper, except the strings \n yielded from the file object are treated as bytes instead of text strings.\n "; +static const char __pyx_k_BinaryIterWrapper_iterobj_Binary[] = "BinaryIterWrapper(iterobj)\n \n BinaryIterWrapper behaves like IterWrapper, except the strings yielded from\n the iterable are treated as bytes instead of text strings.\n "; +static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xf0[] = "Incompatible checksums (%s vs 0xf09cc7e = (values))"; +static const char __pyx_k_alloc_of_result_bind_structure_f[] = "alloc of result bind structure failed"; +static const char __pyx_k_binding_this_query_would_cause_r[] = "binding this query would cause rows to become unfetchable"; +static const char __pyx_k_can_t_call_execute_with_both_par[] = "can't call execute with both parameters and a plain query"; +static const char __pyx_k_executing_this_query_would_cause[] = "executing this query would cause rows to become unfetchable"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_oursql_python_bindings_for_MySQL[] = "oursql python bindings for MySQL.\n\nThis module is a new, better set of MySQL bindings for python, supporting novel\nfeatures like parameterization!\n"; +static const char __pyx_k_row_no_longer_available_from_dat[] = "row no longer available from database"; +static PyObject *__pyx_kp_u_; +static PyObject *__pyx_kp_u_0_9_4; +static PyObject *__pyx_kp_u_2_0; +static PyObject *__pyx_kp_u_Aaron_Gallagher_habnabit_gmail_c; +static PyObject *__pyx_n_s_AbstractIterWrapper; +static PyObject *__pyx_n_s_BINARY; +static PyObject *__pyx_n_s_Binary; +static PyObject *__pyx_n_s_BinaryFileWrapper; +static PyObject *__pyx_n_u_BinaryFileWrapper; +static PyObject *__pyx_kp_u_BinaryFileWrapper_fileobj_chunks; +static PyObject *__pyx_n_s_BinaryIterWrapper; +static PyObject *__pyx_n_u_BinaryIterWrapper; +static PyObject *__pyx_kp_u_BinaryIterWrapper_iterobj_Binary; +static PyObject *__pyx_n_s_BinaryWhateverMixin; +static PyObject *__pyx_n_s_BytesIO; +static PyObject *__pyx_n_s_CollatedWarningsError; +static PyObject *__pyx_n_s_Connection; +static PyObject *__pyx_n_s_Cursor; +static PyObject *__pyx_n_s_DATE; +static PyObject *__pyx_n_s_DATETIME; +static PyObject *__pyx_n_s_DBAPITypeObject; +static PyObject *__pyx_kp_u_DBAPITypeObject_representing_r; +static PyObject *__pyx_n_s_DataError; +static PyObject *__pyx_n_s_DatabaseError; +static PyObject *__pyx_n_s_Date; +static PyObject *__pyx_n_s_DateFromTicks; +static PyObject *__pyx_n_s_Decimal; +static PyObject *__pyx_n_s_DictCursor; +static PyObject *__pyx_n_s_DictQuery; +static PyObject *__pyx_n_s_DictResultSet; +static PyObject *__pyx_n_u_DictResultSet; +static PyObject *__pyx_n_s_DictStatement; +static PyObject *__pyx_n_u_DictStatement; +static PyObject *__pyx_n_s_DictWhateverMixin; +static PyObject *__pyx_n_s_Error; +static PyObject *__pyx_n_u_Error; +static PyObject *__pyx_n_s_Error___init; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_FileWrapper; +static PyObject *__pyx_kp_u_H_M_S; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf0; +static PyObject *__pyx_n_s_IntegrityError; +static PyObject *__pyx_n_s_InterfaceError; +static PyObject *__pyx_n_s_InternalError; +static PyObject *__pyx_n_s_IterWrapper; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_n_s_NUMBER; +static PyObject *__pyx_n_s_NotSupportedError; +static PyObject *__pyx_n_s_Note; +static PyObject *__pyx_n_u_Note; +static PyObject *__pyx_n_s_OperationalError; +static PyObject *__pyx_n_s_PermissionsError; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_ProgrammingError; +static PyObject *__pyx_n_s_Query; +static PyObject *__pyx_n_s_ROWID; +static PyObject *__pyx_n_s_ResultSet; +static PyObject *__pyx_n_s_ResultStringStream; +static PyObject *__pyx_kp_u_SHOW_WARNINGS; +static PyObject *__pyx_n_s_STRING; +static PyObject *__pyx_n_s_Statement; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_TIME; +static PyObject *__pyx_n_s_TIMESTAMP; +static PyObject *__pyx_n_s_Time; +static PyObject *__pyx_n_s_TimeFromTicks; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_TimestampFromTicks; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UnknownError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_Warning; +static PyObject *__pyx_n_u_Warning; +static PyObject *__pyx_kp_u_Y_m_d; +static PyObject *__pyx_kp_u_Y_m_d_H_M_S; +static PyObject *__pyx_kp_u__21; +static PyObject *__pyx_kp_u_alloc_of_bind_parameters_failed; +static PyObject *__pyx_kp_u_alloc_of_conn_object_failed; +static PyObject *__pyx_kp_u_alloc_of_result_bind_structure_f; +static PyObject *__pyx_kp_u_alloc_of_result_buffers_failed; +static PyObject *__pyx_kp_u_alloc_of_statement_failed; +static PyObject *__pyx_kp_u_and; +static PyObject *__pyx_n_s_apilevel; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_author; +static PyObject *__pyx_n_s_autoping; +static PyObject *__pyx_n_s_autoreconnect; +static PyObject *__pyx_kp_u_binding_this_query_would_cause_r; +static PyObject *__pyx_n_s_bitval_from_string; +static PyObject *__pyx_n_s_buffer_results; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_ca; +static PyObject *__pyx_kp_u_can_t_call_execute_with_both_par; +static PyObject *__pyx_kp_u_can_t_read_negative_bytes; +static PyObject *__pyx_kp_u_cannot_bind_r_object; +static PyObject *__pyx_n_s_capath; +static PyObject *__pyx_n_s_cert; +static PyObject *__pyx_n_s_charset; +static PyObject *__pyx_n_s_charset_dir; +static PyObject *__pyx_n_s_chunksize; +static PyObject *__pyx_n_s_cipher; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_client_info; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_codecs; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_column; +static PyObject *__pyx_n_s_column_names; +static PyObject *__pyx_kp_u_column_s_appears_more_than_once; +static PyObject *__pyx_n_s_commit; +static PyObject *__pyx_n_s_compress; +static PyObject *__pyx_n_s_conn; +static PyObject *__pyx_n_s_connect; +static PyObject *__pyx_n_s_connect_timeout; +static PyObject *__pyx_n_s_connection; +static PyObject *__pyx_kp_u_connection_closed; +static PyObject *__pyx_n_s_conversions; +static PyObject *__pyx_n_s_conversions_dict; +static PyObject *__pyx_kp_u_could_not_initialize_mysql; +static PyObject *__pyx_n_s_cursor; +static PyObject *__pyx_n_s_cursor_class; +static PyObject *__pyx_kp_u_cursor_closed; +static PyObject *__pyx_n_u_d; +static PyObject *__pyx_n_s_date; +static PyObject *__pyx_n_s_date_from_string; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_datetime_from_string; +static PyObject *__pyx_n_s_db; +static PyObject *__pyx_n_s_decimal; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_default_cursor; +static PyObject *__pyx_n_s_deque; +static PyObject *__pyx_n_s_description; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_do_autoping; +static PyObject *__pyx_n_s_do_warnings_query; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_u_doc; +static PyObject *__pyx_n_s_doclose; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_err; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_n_s_errnos; +static PyObject *__pyx_n_s_escape_string; +static PyObject *__pyx_n_s_exc; +static PyObject *__pyx_n_s_exception_enum_map; +static PyObject *__pyx_n_s_exception_from_errno; +static PyObject *__pyx_n_s_execute; +static PyObject *__pyx_kp_u_executing_this_query_would_cause; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_extra; +static PyObject *__pyx_n_s_fetchall; +static PyObject *__pyx_n_s_fetchone; +static PyObject *__pyx_n_s_fileobj; +static PyObject *__pyx_n_s_found_rows; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_getreader; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_kp_u_given; +static PyObject *__pyx_n_s_has_result; +static PyObject *__pyx_n_s_host; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_init_command; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_n_s_iterobj; +static PyObject *__pyx_n_s_itertools; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_lastrowid; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_local_infile; +static PyObject *__pyx_n_s_localtime; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_u_memory; +static PyObject *__pyx_n_s_message; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_u_module; +static PyObject *__pyx_n_s_multi_results; +static PyObject *__pyx_n_s_multi_statements; +static PyObject *__pyx_kp_u_must_prefetch_at_least_1_row; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_new_query; +static PyObject *__pyx_n_s_new_result; +static PyObject *__pyx_n_s_new_statement; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_nextset; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_kp_u_no_results_available; +static PyObject *__pyx_n_s_oursql; +static PyObject *__pyx_kp_s_oursqlx_conversions_pyx; +static PyObject *__pyx_kp_s_oursqlx_oursql_pyx; +static PyObject *__pyx_kp_s_oursqlx_util_pyx; +static PyObject *__pyx_n_s_parambatch; +static PyObject *__pyx_kp_u_parameters_expected; +static PyObject *__pyx_n_s_params; +static PyObject *__pyx_n_s_paramstyle; +static PyObject *__pyx_n_s_passwd; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_ping; +static PyObject *__pyx_n_u_pipe; +static PyObject *__pyx_n_s_plain_query; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_popleft; +static PyObject *__pyx_n_s_port; +static PyObject *__pyx_n_s_prefetch_rows; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_prepare_2; +static PyObject *__pyx_n_s_procname; +static PyObject *__pyx_n_s_protocol; +static PyObject *__pyx_n_s_protocol_enum_map; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle__AbstractIterWrap; +static PyObject *__pyx_n_s_pyx_unpickle__BinaryWhateverMi; +static PyObject *__pyx_n_s_pyx_unpickle__DBAPITypeObject; +static PyObject *__pyx_n_s_pyx_unpickle__DictWhateverMixi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_n_u_qmark; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_query; +static PyObject *__pyx_kp_u_query_caused_warnings; +static PyObject *__pyx_n_s_query_class; +static PyObject *__pyx_kp_u_query_closed; +static PyObject *__pyx_n_s_raise_on_warnings; +static PyObject *__pyx_n_s_read; +static PyObject *__pyx_n_s_read_default_file; +static PyObject *__pyx_n_s_read_default_group; +static PyObject *__pyx_n_s_read_timeout; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_report_truncation; +static PyObject *__pyx_n_s_require_secure_auth; +static PyObject *__pyx_n_s_result_class; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_rollback; +static PyObject *__pyx_kp_u_row_no_longer_available_from_dat; +static PyObject *__pyx_n_s_rowcount; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_setup_ssl_options; +static PyObject *__pyx_n_s_shared_memory_base_name; +static PyObject *__pyx_n_s_should_raise; +static PyObject *__pyx_n_s_show_table; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_kp_u_size_remaining_should_be_0; +static PyObject *__pyx_n_u_socket; +static PyObject *__pyx_n_s_ss; +static PyObject *__pyx_n_s_ssl; +static PyObject *__pyx_n_s_statement_class; +static PyObject *__pyx_kp_u_statement_closed; +static PyObject *__pyx_n_s_stmt; +static PyObject *__pyx_n_s_string_limit; +static PyObject *__pyx_kp_u_string_limit_must_be_0; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_strptime; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_u_tcp; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_threadsafety; +static PyObject *__pyx_n_s_ticks; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_time_from_string; +static PyObject *__pyx_kp_u_truncated_column; +static PyObject *__pyx_n_s_try_plain_query; +static PyObject *__pyx_n_s_tt; +static PyObject *__pyx_kp_u_type; +static PyObject *__pyx_n_s_unix_socket; +static PyObject *__pyx_kp_u_unknown_kind_of_warning_r; +static PyObject *__pyx_kp_u_unknown_protocol; +static PyObject *__pyx_kp_u_unorderable_types; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_u_use_the_CALL_statement_with_the; +static PyObject *__pyx_n_s_use_unicode; +static PyObject *__pyx_n_s_user; +static PyObject *__pyx_n_u_utf8; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_warning_count; +static PyObject *__pyx_n_s_warnings; +static PyObject *__pyx_n_s_write_timeout; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_pf_6oursql_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno, PyObject *__pyx_v_extra); /* proto */ +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_fetchone(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_2__reduce_cython__(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_4__setstate_cython__(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql__exception_from_errno(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_err); /* proto */ +static PyObject *__pyx_pf_6oursql_2_do_warnings_query(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn); /* proto */ +static PyObject *__pyx_pf_6oursql_4_bitval_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6oursql_6_datetime_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6oursql_8_date_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6oursql_10_time_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6oursql_12TimestampFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks); /* proto */ +static PyObject *__pyx_pf_6oursql_14DateFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks); /* proto */ +static PyObject *__pyx_pf_6oursql_16TimeFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks); /* proto */ +static int __pyx_pf_6oursql_10Connection___cinit__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_passwd, PyObject *__pyx_v_db, unsigned int __pyx_v_port, PyObject *__pyx_v_unix_socket, PyObject *__pyx_v_connect_timeout, PyObject *__pyx_v_read_timeout, PyObject *__pyx_v_write_timeout, PyObject *__pyx_v_protocol, PyObject *__pyx_v_ssl, PyObject *__pyx_v_read_default_file, PyObject *__pyx_v_read_default_group, PyObject *__pyx_v_init_command, PyObject *__pyx_v_charset_dir, PyObject *__pyx_v_shared_memory_base_name, int __pyx_v_local_infile, int __pyx_v_require_secure_auth, int __pyx_v_compress, int __pyx_v_report_truncation, int __pyx_v_found_rows, int __pyx_v_use_unicode, PyObject *__pyx_v_charset, int __pyx_v_autoping, PyObject *__pyx_v_default_cursor, int __pyx_v_raise_on_warnings, CYTHON_UNUSED int __pyx_v_multi_results, CYTHON_UNUSED int __pyx_v_multi_statements, int __pyx_v_autoreconnect); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_2_setup_ssl_options(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_charset, PyObject *__pyx_v_key, PyObject *__pyx_v_cert, PyObject *__pyx_v_ca, PyObject *__pyx_v_capath, PyObject *__pyx_v_cipher); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_4close(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static void __pyx_pf_6oursql_10Connection_6__dealloc__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_8ping(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_10commit(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_12rollback(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_7charset___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10Connection_7charset_2__set__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_14warning_count(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_16cursor(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_cursor_class, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_11server_info___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_10ssl_cipher___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_18__enter__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_20__exit__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_22_escape_string(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_24_escape_unicode_string(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_11use_unicode___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_8autoping___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_14default_cursor___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10Connection_14default_cursor_2__set__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6oursql_10Connection_14default_cursor_4__del__(struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Connection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10Connection_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Connection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper___iter__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper_2__reduce_cython__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper_4__setstate_cython__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin___next__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin_2__reduce_cython__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin_4__setstate_cython__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_11IterWrapper___cinit__(struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self, PyObject *__pyx_v_iterobj); /* proto */ +static PyObject *__pyx_pf_6oursql_11IterWrapper_2__next__(struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_11IterWrapper_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_11IterWrapper_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_11FileWrapper___cinit__(struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self, PyObject *__pyx_v_fileobj, PyObject *__pyx_v_chunksize, int __pyx_v_doclose); /* proto */ +static PyObject *__pyx_pf_6oursql_11FileWrapper_2__next__(struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_11FileWrapper_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_11FileWrapper_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_10_Statement___cinit__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_connection, unsigned long __pyx_v_string_limit, int __pyx_v_show_table, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ +static void __pyx_pf_6oursql_10_Statement_2__dealloc__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_4close(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_12string_limit___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10_Statement_12string_limit_2__set__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, unsigned long __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_6prepare(struct __pyx_obj_6oursql__Statement *__pyx_v_self, PyObject *__pyx_v_statement); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_10has_result___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_11description___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_12column_names___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_8execute(struct __pyx_obj_6oursql__Statement *__pyx_v_self, PyObject *__pyx_v_parameters); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_10fetchone(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_12fetchall(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_14buffer_results(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_16nextset(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_18__iter__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_8rowcount___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_9lastrowid___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10_Statement_13prefetch_rows_2__set__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, unsigned long __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_8warnings___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10_Statement_8warnings_2__set__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6oursql_10_Statement_8warnings_4__del__(struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_Statement_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_19_ResultStringStream___cinit__(struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, struct __pyx_obj_6oursql__Statement *__pyx_v_stmt, unsigned int __pyx_v_index, unsigned int __pyx_v_length); /* proto */ +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_2read(struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, Py_ssize_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_10_ResultSet___cinit__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, CYTHON_UNUSED int __pyx_v_show_table, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ +static void __pyx_pf_6oursql_10_ResultSet_2__dealloc__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_4close(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_10has_result___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_6fetchone(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_8fetchall(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_10__iter__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_8rowcount___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_11description___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_12column_names___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_8warnings___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_10_ResultSet_8warnings_2__set__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6oursql_10_ResultSet_8warnings_4__del__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_ResultSet_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_6_Query___cinit__(struct __pyx_obj_6oursql__Query *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, PyObject *__pyx_v_query, PyObject *__pyx_v_a, PyObject *__pyx_v_kw); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_2new_result(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_4nextset(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_6fetchone(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_8__iter__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_10fetchall(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_8rowcount___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_9lastrowid___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_11description___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_8warnings___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_10has_result___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Query *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6_Query_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Query *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_10_DictQuery___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__DictQuery *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10_DictQuery_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__DictQuery *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_6Cursor___cinit__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, int __pyx_v_try_plain_query, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_2close(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_4_new_statement(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_6_new_query(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_8callproc(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_params); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_10_do_autoping(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_12execute(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_params, PyObject *__pyx_v_plain_query); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_14executemany(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_parambatch); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_16nextset(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_18fetchone(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_20fetchmany(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_22fetchall(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_24__iter__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_10connection___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_26setinputsizes(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_sizes); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_28setoutputsize(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_column); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_30__enter__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_32__exit__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_11_statements___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_8rowcount___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_9lastrowid___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_11description___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_8messages___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_9arraysize___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static int __pyx_pf_6oursql_6Cursor_9arraysize_2__set__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_34__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_6Cursor_36__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_10DictCursor___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_DictCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_10DictCursor_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_DictCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_6oursql_16_DBAPITypeObject___init__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_2__richcmp__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_4__repr__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6__reduce_cython__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_8__setstate_cython__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_18__pyx_unpickle__DictWhateverMixin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_20__pyx_unpickle__AbstractIterWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_22__pyx_unpickle__BinaryWhateverMixin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6oursql_24__pyx_unpickle__DBAPITypeObject(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_6oursql_Connection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__DictWhateverMixin(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__AbstractIterWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__BinaryWhateverMixin(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql_IterWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql_FileWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__Statement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__ResultStringStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__ResultSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__Query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__DictQuery(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql_Cursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql_DictCursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6oursql__DBAPITypeObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_6; +static PyObject *__pyx_int_63; +static PyObject *__pyx_int_8192; +static PyObject *__pyx_int_222419149; +static PyObject *__pyx_int_252300414; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_slice__3; +static PyObject *__pyx_slice__4; +static PyObject *__pyx_slice__5; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +/* Late includes */ + +/* "oursqlx/nogil.pyx":5 + * # duplication of functions. + * + * cdef inline MYSQL *mysql_real_connect( # <<<<<<<<<<<<<< + * MYSQL *conn, char *host, char *user, char *passwd, char *db, + * unsigned int port, char *unix_socket, unsigned long client_flag): + */ + +static CYTHON_INLINE MYSQL *__pyx_f_6oursql_mysql_real_connect(MYSQL *__pyx_v_conn, char *__pyx_v_host, char *__pyx_v_user, char *__pyx_v_passwd, char *__pyx_v_db, unsigned int __pyx_v_port, char *__pyx_v_unix_socket, unsigned long __pyx_v_client_flag) { + MYSQL *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_real_connect", 0); + + /* "oursqlx/nogil.pyx":8 + * MYSQL *conn, char *host, char *user, char *passwd, char *db, + * unsigned int port, char *unix_socket, unsigned long client_flag): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_real_connect(conn, host, user, passwd, db, port, + * unix_socket, client_flag) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":9 + * unsigned int port, char *unix_socket, unsigned long client_flag): + * with nogil: + * return _mysql_real_connect(conn, host, user, passwd, db, port, # <<<<<<<<<<<<<< + * unix_socket, client_flag) + * + */ + __pyx_r = mysql_real_connect(__pyx_v_conn, __pyx_v_host, __pyx_v_user, __pyx_v_passwd, __pyx_v_db, __pyx_v_port, __pyx_v_unix_socket, __pyx_v_client_flag); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":8 + * MYSQL *conn, char *host, char *user, char *passwd, char *db, + * unsigned int port, char *unix_socket, unsigned long client_flag): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_real_connect(conn, host, user, passwd, db, port, + * unix_socket, client_flag) + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":5 + * # duplication of functions. + * + * cdef inline MYSQL *mysql_real_connect( # <<<<<<<<<<<<<< + * MYSQL *conn, char *host, char *user, char *passwd, char *db, + * unsigned int port, char *unix_socket, unsigned long client_flag): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":12 + * unix_socket, client_flag) + * + * cdef inline int mysql_ping(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_ping(conn) + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_ping(MYSQL *__pyx_v_conn) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_ping", 0); + + /* "oursqlx/nogil.pyx":13 + * + * cdef inline int mysql_ping(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_ping(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":14 + * cdef inline int mysql_ping(MYSQL *conn): + * with nogil: + * return _mysql_ping(conn) # <<<<<<<<<<<<<< + * + * cdef inline my_bool mysql_commit(MYSQL *conn): + */ + __pyx_r = mysql_ping(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":13 + * + * cdef inline int mysql_ping(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_ping(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":12 + * unix_socket, client_flag) + * + * cdef inline int mysql_ping(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_ping(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":16 + * return _mysql_ping(conn) + * + * cdef inline my_bool mysql_commit(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_commit(conn) + */ + +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_commit(MYSQL *__pyx_v_conn) { + my_bool __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_commit", 0); + + /* "oursqlx/nogil.pyx":17 + * + * cdef inline my_bool mysql_commit(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_commit(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":18 + * cdef inline my_bool mysql_commit(MYSQL *conn): + * with nogil: + * return _mysql_commit(conn) # <<<<<<<<<<<<<< + * + * cdef inline my_bool mysql_rollback(MYSQL *conn): + */ + __pyx_r = mysql_commit(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":17 + * + * cdef inline my_bool mysql_commit(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_commit(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":16 + * return _mysql_ping(conn) + * + * cdef inline my_bool mysql_commit(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_commit(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":20 + * return _mysql_commit(conn) + * + * cdef inline my_bool mysql_rollback(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_rollback(conn) + */ + +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_rollback(MYSQL *__pyx_v_conn) { + my_bool __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_rollback", 0); + + /* "oursqlx/nogil.pyx":21 + * + * cdef inline my_bool mysql_rollback(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_rollback(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":22 + * cdef inline my_bool mysql_rollback(MYSQL *conn): + * with nogil: + * return _mysql_rollback(conn) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt, + */ + __pyx_r = mysql_rollback(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":21 + * + * cdef inline my_bool mysql_rollback(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_rollback(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":20 + * return _mysql_commit(conn) + * + * cdef inline my_bool mysql_rollback(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_rollback(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":24 + * return _mysql_rollback(conn) + * + * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * char *stmt_str, unsigned long length): + * with nogil: + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_prepare(MYSQL_STMT *__pyx_v_stmt, char *__pyx_v_stmt_str, unsigned long __pyx_v_length) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_prepare", 0); + + /* "oursqlx/nogil.pyx":26 + * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt, + * char *stmt_str, unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_prepare(stmt, stmt_str, length) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":27 + * char *stmt_str, unsigned long length): + * with nogil: + * return _mysql_stmt_prepare(stmt, stmt_str, length) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): + */ + __pyx_r = mysql_stmt_prepare(__pyx_v_stmt, __pyx_v_stmt_str, __pyx_v_length); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":26 + * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt, + * char *stmt_str, unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_prepare(stmt, stmt_str, length) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":24 + * return _mysql_rollback(conn) + * + * cdef inline int mysql_stmt_prepare(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * char *stmt_str, unsigned long length): + * with nogil: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":29 + * return _mysql_stmt_prepare(stmt, stmt_str, length) + * + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_execute(stmt) + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_execute(MYSQL_STMT *__pyx_v_stmt) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_execute", 0); + + /* "oursqlx/nogil.pyx":30 + * + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_execute(stmt) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":31 + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): + * with nogil: + * return _mysql_stmt_execute(stmt) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): + */ + __pyx_r = mysql_stmt_execute(__pyx_v_stmt); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":30 + * + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_execute(stmt) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":29 + * return _mysql_stmt_prepare(stmt, stmt_str, length) + * + * cdef inline int mysql_stmt_execute(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_execute(stmt) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":33 + * return _mysql_stmt_execute(stmt) + * + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_fetch(stmt) + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch(MYSQL_STMT *__pyx_v_stmt) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_fetch", 0); + + /* "oursqlx/nogil.pyx":34 + * + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_fetch(stmt) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":35 + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): + * with nogil: + * return _mysql_stmt_fetch(stmt) # <<<<<<<<<<<<<< + * + * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + */ + __pyx_r = mysql_stmt_fetch(__pyx_v_stmt); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":34 + * + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_fetch(stmt) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":33 + * return _mysql_stmt_execute(stmt) + * + * cdef inline int mysql_stmt_fetch(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_fetch(stmt) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":37 + * return _mysql_stmt_fetch(stmt) + * + * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * unsigned int index, char *data, unsigned long length): + * with nogil: + */ + +static CYTHON_INLINE my_bool __pyx_f_6oursql_mysql_stmt_send_long_data(MYSQL_STMT *__pyx_v_stmt, unsigned int __pyx_v_index, char *__pyx_v_data, unsigned long __pyx_v_length) { + my_bool __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_send_long_data", 0); + + /* "oursqlx/nogil.pyx":39 + * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + * unsigned int index, char *data, unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_send_long_data(stmt, index, data, length) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":40 + * unsigned int index, char *data, unsigned long length): + * with nogil: + * return _mysql_stmt_send_long_data(stmt, index, data, length) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt, + */ + __pyx_r = mysql_stmt_send_long_data(__pyx_v_stmt, __pyx_v_index, __pyx_v_data, __pyx_v_length); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":39 + * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + * unsigned int index, char *data, unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_send_long_data(stmt, index, data, length) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":37 + * return _mysql_stmt_fetch(stmt) + * + * cdef inline my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * unsigned int index, char *data, unsigned long length): + * with nogil: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":42 + * return _mysql_stmt_send_long_data(stmt, index, data, length) + * + * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * MYSQL_BIND *bind, unsigned int column, unsigned long offset): + * with nogil: + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_fetch_column(MYSQL_STMT *__pyx_v_stmt, MYSQL_BIND *__pyx_v_bind, unsigned int __pyx_v_column, unsigned long __pyx_v_offset) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_fetch_column", 0); + + /* "oursqlx/nogil.pyx":44 + * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt, + * MYSQL_BIND *bind, unsigned int column, unsigned long offset): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_fetch_column(stmt, bind, column, offset) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":45 + * MYSQL_BIND *bind, unsigned int column, unsigned long offset): + * with nogil: + * return _mysql_stmt_fetch_column(stmt, bind, column, offset) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): + */ + __pyx_r = mysql_stmt_fetch_column(__pyx_v_stmt, __pyx_v_bind, __pyx_v_column, __pyx_v_offset); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":44 + * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt, + * MYSQL_BIND *bind, unsigned int column, unsigned long offset): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_fetch_column(stmt, bind, column, offset) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":42 + * return _mysql_stmt_send_long_data(stmt, index, data, length) + * + * cdef inline int mysql_stmt_fetch_column(MYSQL_STMT *stmt, # <<<<<<<<<<<<<< + * MYSQL_BIND *bind, unsigned int column, unsigned long offset): + * with nogil: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":47 + * return _mysql_stmt_fetch_column(stmt, bind, column, offset) + * + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_store_result(stmt) + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_stmt_store_result(MYSQL_STMT *__pyx_v_stmt) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_stmt_store_result", 0); + + /* "oursqlx/nogil.pyx":48 + * + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_store_result(stmt) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":49 + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): + * with nogil: + * return _mysql_stmt_store_result(stmt) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str, + */ + __pyx_r = mysql_stmt_store_result(__pyx_v_stmt); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":48 + * + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_stmt_store_result(stmt) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":47 + * return _mysql_stmt_fetch_column(stmt, bind, column, offset) + * + * cdef inline int mysql_stmt_store_result(MYSQL_STMT *stmt): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_stmt_store_result(stmt) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":51 + * return _mysql_stmt_store_result(stmt) + * + * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str, # <<<<<<<<<<<<<< + * unsigned long length): + * with nogil: + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_real_query(MYSQL *__pyx_v_conn, char *__pyx_v_stmt_str, unsigned long __pyx_v_length) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_real_query", 0); + + /* "oursqlx/nogil.pyx":53 + * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str, + * unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_real_query(conn, stmt_str, length) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":54 + * unsigned long length): + * with nogil: + * return _mysql_real_query(conn, stmt_str, length) # <<<<<<<<<<<<<< + * + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): + */ + __pyx_r = mysql_real_query(__pyx_v_conn, __pyx_v_stmt_str, __pyx_v_length); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":53 + * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str, + * unsigned long length): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_real_query(conn, stmt_str, length) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":51 + * return _mysql_stmt_store_result(stmt) + * + * cdef inline int mysql_real_query(MYSQL *conn, char *stmt_str, # <<<<<<<<<<<<<< + * unsigned long length): + * with nogil: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":56 + * return _mysql_real_query(conn, stmt_str, length) + * + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_use_result(conn) + */ + +static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_use_result(MYSQL *__pyx_v_conn) { + MYSQL_RES *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_use_result", 0); + + /* "oursqlx/nogil.pyx":57 + * + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_use_result(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":58 + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): + * with nogil: + * return _mysql_use_result(conn) # <<<<<<<<<<<<<< + * + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): + */ + __pyx_r = mysql_use_result(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":57 + * + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_use_result(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":56 + * return _mysql_real_query(conn, stmt_str, length) + * + * cdef inline MYSQL_RES *mysql_use_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_use_result(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":60 + * return _mysql_use_result(conn) + * + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_store_result(conn) + */ + +static CYTHON_INLINE MYSQL_RES *__pyx_f_6oursql_mysql_store_result(MYSQL *__pyx_v_conn) { + MYSQL_RES *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_store_result", 0); + + /* "oursqlx/nogil.pyx":61 + * + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_store_result(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":62 + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): + * with nogil: + * return _mysql_store_result(conn) # <<<<<<<<<<<<<< + * + * cdef inline int mysql_next_result(MYSQL *conn): + */ + __pyx_r = mysql_store_result(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":61 + * + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_store_result(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":60 + * return _mysql_use_result(conn) + * + * cdef inline MYSQL_RES *mysql_store_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_store_result(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":64 + * return _mysql_store_result(conn) + * + * cdef inline int mysql_next_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_next_result(conn) + */ + +static CYTHON_INLINE int __pyx_f_6oursql_mysql_next_result(MYSQL *__pyx_v_conn) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_next_result", 0); + + /* "oursqlx/nogil.pyx":65 + * + * cdef inline int mysql_next_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_next_result(conn) + * + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":66 + * cdef inline int mysql_next_result(MYSQL *conn): + * with nogil: + * return _mysql_next_result(conn) # <<<<<<<<<<<<<< + * + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): + */ + __pyx_r = mysql_next_result(__pyx_v_conn); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":65 + * + * cdef inline int mysql_next_result(MYSQL *conn): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_next_result(conn) + * + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":64 + * return _mysql_store_result(conn) + * + * cdef inline int mysql_next_result(MYSQL *conn): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_next_result(conn) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/nogil.pyx":68 + * return _mysql_next_result(conn) + * + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_fetch_row(result) + */ + +static CYTHON_INLINE MYSQL_ROW __pyx_f_6oursql_mysql_fetch_row(MYSQL_RES *__pyx_v_result) { + MYSQL_ROW __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mysql_fetch_row", 0); + + /* "oursqlx/nogil.pyx":69 + * + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_fetch_row(result) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "oursqlx/nogil.pyx":70 + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): + * with nogil: + * return _mysql_fetch_row(result) # <<<<<<<<<<<<<< + */ + __pyx_r = mysql_fetch_row(__pyx_v_result); + goto __pyx_L3_return; + } + + /* "oursqlx/nogil.pyx":69 + * + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): + * with nogil: # <<<<<<<<<<<<<< + * return _mysql_fetch_row(result) + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L0; + } + } + } + + /* "oursqlx/nogil.pyx":68 + * return _mysql_next_result(conn) + * + * cdef inline MYSQL_ROW mysql_fetch_row(MYSQL_RES *result): # <<<<<<<<<<<<<< + * with nogil: + * return _mysql_fetch_row(result) + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursql.pyx":59 + * + * class Error(builtins.Exception): + * def __init__(self, message, errno=None, extra=None): # <<<<<<<<<<<<<< + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_5Error_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_5Error_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6oursql_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_message = 0; + PyObject *__pyx_v_errno = 0; + PyObject *__pyx_v_extra = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_errno,&__pyx_n_s_extra,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_message = values[1]; + __pyx_v_errno = values[2]; + __pyx_v_extra = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_5Error___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_errno, __pyx_v_extra); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno, PyObject *__pyx_v_extra) { + 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; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "oursql.pyx":60 + * class Error(builtins.Exception): + * def __init__(self, message, errno=None, extra=None): + * super(Error, self).__init__(errno, message, extra) # <<<<<<<<<<<<<< + * self.errno = errno + * self.extra = extra + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_errno, __pyx_v_message, __pyx_v_extra}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_errno, __pyx_v_message, __pyx_v_extra}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_errno); + __Pyx_GIVEREF(__pyx_v_errno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_errno); + __Pyx_INCREF(__pyx_v_message); + __Pyx_GIVEREF(__pyx_v_message); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message); + __Pyx_INCREF(__pyx_v_extra); + __Pyx_GIVEREF(__pyx_v_extra); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_extra); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":61 + * def __init__(self, message, errno=None, extra=None): + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno # <<<<<<<<<<<<<< + * self.extra = extra + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_errno, __pyx_v_errno) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + + /* "oursql.pyx":62 + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno + * self.extra = extra # <<<<<<<<<<<<<< + * + * class InterfaceError(Error): pass + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extra, __pyx_v_extra) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + + /* "oursql.pyx":59 + * + * class Error(builtins.Exception): + * def __init__(self, message, errno=None, extra=None): # <<<<<<<<<<<<<< + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno + */ + + /* function exit code */ + __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_5); + __Pyx_AddTraceback("oursql.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":1 + * cdef object bytes_maybe_from_encoding(object s, object encoding, # <<<<<<<<<<<<<< + * bint allow_none=True): + * if s is None and allow_none: + */ + +static PyObject *__pyx_f_6oursql_bytes_maybe_from_encoding(PyObject *__pyx_v_s, PyObject *__pyx_v_encoding, struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding *__pyx_optional_args) { + + /* "oursqlx/util.pyx":2 + * cdef object bytes_maybe_from_encoding(object s, object encoding, + * bint allow_none=True): # <<<<<<<<<<<<<< + * if s is None and allow_none: + * return None + */ + int __pyx_v_allow_none = ((int)1); + 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("bytes_maybe_from_encoding", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_allow_none = __pyx_optional_args->allow_none; + } + } + __Pyx_INCREF(__pyx_v_s); + + /* "oursqlx/util.pyx":3 + * cdef object bytes_maybe_from_encoding(object s, object encoding, + * bint allow_none=True): + * if s is None and allow_none: # <<<<<<<<<<<<<< + * return None + * elif PyUnicode_Check(s): + */ + __pyx_t_2 = (__pyx_v_s == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_allow_none != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "oursqlx/util.pyx":4 + * bint allow_none=True): + * if s is None and allow_none: + * return None # <<<<<<<<<<<<<< + * elif PyUnicode_Check(s): + * s = s.encode(encoding) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/util.pyx":3 + * cdef object bytes_maybe_from_encoding(object s, object encoding, + * bint allow_none=True): + * if s is None and allow_none: # <<<<<<<<<<<<<< + * return None + * elif PyUnicode_Check(s): + */ + } + + /* "oursqlx/util.pyx":5 + * if s is None and allow_none: + * return None + * elif PyUnicode_Check(s): # <<<<<<<<<<<<<< + * s = s.encode(encoding) + * return PyBytes_FromObject(s) + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_s) != 0); + if (__pyx_t_1) { + + /* "oursqlx/util.pyx":6 + * return None + * elif PyUnicode_Check(s): + * s = s.encode(encoding) # <<<<<<<<<<<<<< + * return PyBytes_FromObject(s) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/util.pyx":5 + * if s is None and allow_none: + * return None + * elif PyUnicode_Check(s): # <<<<<<<<<<<<<< + * s = s.encode(encoding) + * return PyBytes_FromObject(s) + */ + } + + /* "oursqlx/util.pyx":7 + * elif PyUnicode_Check(s): + * s = s.encode(encoding) + * return PyBytes_FromObject(s) # <<<<<<<<<<<<<< + * + * cdef char *bytes_or_null(object s): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyBytes_FromObject(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "oursqlx/util.pyx":1 + * cdef object bytes_maybe_from_encoding(object s, object encoding, # <<<<<<<<<<<<<< + * bint allow_none=True): + * if s is None and allow_none: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("oursql.bytes_maybe_from_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":9 + * return PyBytes_FromObject(s) + * + * cdef char *bytes_or_null(object s): # <<<<<<<<<<<<<< + * if s is None: + * return NULL + */ + +static char *__pyx_f_6oursql_bytes_or_null(PyObject *__pyx_v_s) { + char *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("bytes_or_null", 0); + + /* "oursqlx/util.pyx":10 + * + * cdef char *bytes_or_null(object s): + * if s is None: # <<<<<<<<<<<<<< + * return NULL + * return PyBytes_AS_STRING(s) + */ + __pyx_t_1 = (__pyx_v_s == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "oursqlx/util.pyx":11 + * cdef char *bytes_or_null(object s): + * if s is None: + * return NULL # <<<<<<<<<<<<<< + * return PyBytes_AS_STRING(s) + * + */ + __pyx_r = NULL; + goto __pyx_L0; + + /* "oursqlx/util.pyx":10 + * + * cdef char *bytes_or_null(object s): + * if s is None: # <<<<<<<<<<<<<< + * return NULL + * return PyBytes_AS_STRING(s) + */ + } + + /* "oursqlx/util.pyx":12 + * if s is None: + * return NULL + * return PyBytes_AS_STRING(s) # <<<<<<<<<<<<<< + * + * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length): + */ + __pyx_r = PyBytes_AS_STRING(__pyx_v_s); + goto __pyx_L0; + + /* "oursqlx/util.pyx":9 + * return PyBytes_FromObject(s) + * + * cdef char *bytes_or_null(object s): # <<<<<<<<<<<<<< + * if s is None: + * return NULL + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":14 + * return PyBytes_AS_STRING(s) + * + * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef unsigned long ret = 0 + */ + +static unsigned long __pyx_f_6oursql_bitval_from_char_p(unsigned char *__pyx_v_s, Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + unsigned long __pyx_v_ret; + unsigned long __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __Pyx_RefNannySetupContext("bitval_from_char_p", 0); + + /* "oursqlx/util.pyx":16 + * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length): + * cdef Py_ssize_t i + * cdef unsigned long ret = 0 # <<<<<<<<<<<<<< + * for 0 <= i < length: + * ret = (ret << 8) | s[i] + */ + __pyx_v_ret = 0; + + /* "oursqlx/util.pyx":17 + * cdef Py_ssize_t i + * cdef unsigned long ret = 0 + * for 0 <= i < length: # <<<<<<<<<<<<<< + * ret = (ret << 8) | s[i] + * return ret + */ + __pyx_t_1 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "oursqlx/util.pyx":18 + * cdef unsigned long ret = 0 + * for 0 <= i < length: + * ret = (ret << 8) | s[i] # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_v_ret = ((__pyx_v_ret << 8) | (__pyx_v_s[__pyx_v_i])); + } + + /* "oursqlx/util.pyx":19 + * for 0 <= i < length: + * ret = (ret << 8) | s[i] + * return ret # <<<<<<<<<<<<<< + * + * cdef object conversion_info_from_res(MYSQL_RES *res, int fields): + */ + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/util.pyx":14 + * return PyBytes_AS_STRING(s) + * + * cdef unsigned long bitval_from_char_p(unsigned char *s, Py_ssize_t length): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef unsigned long ret = 0 + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":21 + * return ret + * + * cdef object conversion_info_from_res(MYSQL_RES *res, int fields): # <<<<<<<<<<<<<< + * cdef int i + * cdef MYSQL_FIELD *field + */ + +static PyObject *__pyx_f_6oursql_conversion_info_from_res(MYSQL_RES *__pyx_v_res, int __pyx_v_fields) { + int __pyx_v_i; + MYSQL_FIELD *__pyx_v_field; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("conversion_info_from_res", 0); + + /* "oursqlx/util.pyx":24 + * cdef int i + * cdef MYSQL_FIELD *field + * ret = PyList_New(fields) # <<<<<<<<<<<<<< + * for 0 <= i < fields: + * field = mysql_fetch_field_direct(res, i) + */ + __pyx_t_1 = PyList_New(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":25 + * cdef MYSQL_FIELD *field + * ret = PyList_New(fields) + * for 0 <= i < fields: # <<<<<<<<<<<<<< + * field = mysql_fetch_field_direct(res, i) + * data = ( + */ + __pyx_t_2 = __pyx_v_fields; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "oursqlx/util.pyx":26 + * ret = PyList_New(fields) + * for 0 <= i < fields: + * field = mysql_fetch_field_direct(res, i) # <<<<<<<<<<<<<< + * data = ( + * field.type, + */ + __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i); + + /* "oursqlx/util.pyx":28 + * field = mysql_fetch_field_direct(res, i) + * data = ( + * field.type, # <<<<<<<<<<<<<< + * field.flags, + * field.charsetnr) + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__enum_field_types(__pyx_v_field->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "oursqlx/util.pyx":29 + * data = ( + * field.type, + * field.flags, # <<<<<<<<<<<<<< + * field.charsetnr) + * Py_INCREF(data) + */ + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "oursqlx/util.pyx":30 + * field.type, + * field.flags, + * field.charsetnr) # <<<<<<<<<<<<<< + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->charsetnr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "oursqlx/util.pyx":28 + * field = mysql_fetch_field_direct(res, i) + * data = ( + * field.type, # <<<<<<<<<<<<<< + * field.flags, + * field.charsetnr) + */ + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursqlx/util.pyx":31 + * field.flags, + * field.charsetnr) + * Py_INCREF(data) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(ret, i, data) + * return ret + */ + Py_INCREF(__pyx_v_data); + + /* "oursqlx/util.pyx":32 + * field.charsetnr) + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) # <<<<<<<<<<<<<< + * return ret + * + */ + PyList_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_data); + } + + /* "oursqlx/util.pyx":33 + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) + * return ret # <<<<<<<<<<<<<< + * + * cdef object description_from_res(Connection conn, MYSQL_RES *res, int fields, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/util.pyx":21 + * return ret + * + * cdef object conversion_info_from_res(MYSQL_RES *res, int fields): # <<<<<<<<<<<<<< + * cdef int i + * cdef MYSQL_FIELD *field + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.conversion_info_from_res", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":35 + * return ret + * + * cdef object description_from_res(Connection conn, MYSQL_RES *res, int fields, # <<<<<<<<<<<<<< + * bint show_table): + * cdef int i + */ + +static PyObject *__pyx_f_6oursql_description_from_res(struct __pyx_obj_6oursql_Connection *__pyx_v_conn, MYSQL_RES *__pyx_v_res, int __pyx_v_fields, int __pyx_v_show_table) { + int __pyx_v_i; + MYSQL_FIELD *__pyx_v_field; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_UCS4 __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("description_from_res", 0); + + /* "oursqlx/util.pyx":39 + * cdef int i + * cdef MYSQL_FIELD *field + * ret = PyList_New(fields) # <<<<<<<<<<<<<< + * # Cache the charset. + * conn.charset + */ + __pyx_t_1 = PyList_New(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":41 + * ret = PyList_New(fields) + * # Cache the charset. + * conn.charset # <<<<<<<<<<<<<< + * for 0 <= i < fields: + * field = mysql_fetch_field_direct(res, i) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":42 + * # Cache the charset. + * conn.charset + * for 0 <= i < fields: # <<<<<<<<<<<<<< + * field = mysql_fetch_field_direct(res, i) + * name = conn._decode_char_p(field.name) + */ + __pyx_t_2 = __pyx_v_fields; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "oursqlx/util.pyx":43 + * conn.charset + * for 0 <= i < fields: + * field = mysql_fetch_field_direct(res, i) # <<<<<<<<<<<<<< + * name = conn._decode_char_p(field.name) + * if show_table and field.table[0] != 0: + */ + __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i); + + /* "oursqlx/util.pyx":44 + * for 0 <= i < fields: + * field = mysql_fetch_field_direct(res, i) + * name = conn._decode_char_p(field.name) # <<<<<<<<<<<<<< + * if show_table and field.table[0] != 0: + * name = u'%s.%s' % (conn._decode_char_p(field.table), name) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_decode_char_p(__pyx_v_conn, __pyx_v_field->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":45 + * field = mysql_fetch_field_direct(res, i) + * name = conn._decode_char_p(field.name) + * if show_table and field.table[0] != 0: # <<<<<<<<<<<<<< + * name = u'%s.%s' % (conn._decode_char_p(field.table), name) + * data = ( + */ + __pyx_t_4 = (__pyx_v_show_table != 0); + if (__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_4 = (((__pyx_v_field->table[0]) != 0) != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L6_bool_binop_done:; + if (__pyx_t_3) { + + /* "oursqlx/util.pyx":46 + * name = conn._decode_char_p(field.name) + * if show_table and field.table[0] != 0: + * name = u'%s.%s' % (conn._decode_char_p(field.table), name) # <<<<<<<<<<<<<< + * data = ( + * name, + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_6 = 127; + __pyx_t_7 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_decode_char_p(__pyx_v_conn, __pyx_v_field->table); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6; + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_t_5 += 1; + __Pyx_GIVEREF(__pyx_kp_u_); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_); + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6; + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_8); + __pyx_t_8 = 0; + + /* "oursqlx/util.pyx":45 + * field = mysql_fetch_field_direct(res, i) + * name = conn._decode_char_p(field.name) + * if show_table and field.table[0] != 0: # <<<<<<<<<<<<<< + * name = u'%s.%s' % (conn._decode_char_p(field.table), name) + * data = ( + */ + } + + /* "oursqlx/util.pyx":49 + * data = ( + * name, + * field.type, # <<<<<<<<<<<<<< + * field.max_length, + * field.length, + */ + __pyx_t_8 = __Pyx_PyInt_From_enum__enum_field_types(__pyx_v_field->type); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "oursqlx/util.pyx":50 + * name, + * field.type, + * field.max_length, # <<<<<<<<<<<<<< + * field.length, + * field.length, + */ + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->max_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "oursqlx/util.pyx":51 + * field.type, + * field.max_length, + * field.length, # <<<<<<<<<<<<<< + * field.length, + * field.decimals, + */ + __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->length); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "oursqlx/util.pyx":52 + * field.max_length, + * field.length, + * field.length, # <<<<<<<<<<<<<< + * field.decimals, + * field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG) + */ + __pyx_t_9 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->length); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + + /* "oursqlx/util.pyx":53 + * field.length, + * field.length, + * field.decimals, # <<<<<<<<<<<<<< + * field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG) + * Py_INCREF(data) + */ + __pyx_t_10 = __Pyx_PyInt_From_unsigned_int(__pyx_v_field->decimals); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "oursqlx/util.pyx":54 + * field.length, + * field.decimals, + * field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG) # <<<<<<<<<<<<<< + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) + */ + __pyx_t_11 = __Pyx_PyBool_FromLong(((__pyx_v_field->flags & NOT_NULL_FLAG) != NOT_NULL_FLAG)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + + /* "oursqlx/util.pyx":48 + * name = u'%s.%s' % (conn._decode_char_p(field.table), name) + * data = ( + * name, # <<<<<<<<<<<<<< + * field.type, + * field.max_length, + */ + __pyx_t_12 = PyTuple_New(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_11); + __pyx_t_8 = 0; + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject*)__pyx_t_12)); + __pyx_t_12 = 0; + + /* "oursqlx/util.pyx":55 + * field.decimals, + * field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG) + * Py_INCREF(data) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(ret, i, data) + * return ret + */ + Py_INCREF(__pyx_v_data); + + /* "oursqlx/util.pyx":56 + * field.flags & NOT_NULL_FLAG != NOT_NULL_FLAG) + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) # <<<<<<<<<<<<<< + * return ret + * + */ + PyList_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_data); + } + + /* "oursqlx/util.pyx":57 + * Py_INCREF(data) + * PyList_SET_ITEM(ret, i, data) + * return ret # <<<<<<<<<<<<<< + * + * cdef class _DictWhateverMixin: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/util.pyx":35 + * return ret + * + * cdef object description_from_res(Connection conn, MYSQL_RES *res, int fields, # <<<<<<<<<<<<<< + * bint show_table): + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("oursql.description_from_res", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":60 + * + * cdef class _DictWhateverMixin: + * def fetchone(self): # <<<<<<<<<<<<<< + * row = super(_DictWhateverMixin, self).fetchone() + * if row is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_1fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_1fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_18_DictWhateverMixin_fetchone(((struct __pyx_obj_6oursql__DictWhateverMixin *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_fetchone(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self) { + PyObject *__pyx_v_row = NULL; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchone", 0); + + /* "oursqlx/util.pyx":61 + * cdef class _DictWhateverMixin: + * def fetchone(self): + * row = super(_DictWhateverMixin, self).fetchone() # <<<<<<<<<<<<<< + * if row is None: + * return None + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_row = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":62 + * def fetchone(self): + * row = super(_DictWhateverMixin, self).fetchone() + * if row is None: # <<<<<<<<<<<<<< + * return None + * ret = {} + */ + __pyx_t_4 = (__pyx_v_row == Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "oursqlx/util.pyx":63 + * row = super(_DictWhateverMixin, self).fetchone() + * if row is None: + * return None # <<<<<<<<<<<<<< + * ret = {} + * for name, value in zip(self.column_names, row): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/util.pyx":62 + * def fetchone(self): + * row = super(_DictWhateverMixin, self).fetchone() + * if row is None: # <<<<<<<<<<<<<< + * return None + * ret = {} + */ + } + + /* "oursqlx/util.pyx":64 + * if row is None: + * return None + * ret = {} # <<<<<<<<<<<<<< + * for name, value in zip(self.column_names, row): + * if name in ret: + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_ret = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":65 + * return None + * ret = {} + * for name, value in zip(self.column_names, row): # <<<<<<<<<<<<<< + * if name in ret: + * if ret[name] != value: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_v_row); + __Pyx_GIVEREF(__pyx_v_row); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_row); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 65, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 65, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 65, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 65, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 65, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; + + /* "oursqlx/util.pyx":66 + * ret = {} + * for name, value in zip(self.column_names, row): + * if name in ret: # <<<<<<<<<<<<<< + * if ret[name] != value: + * raise ProgrammingError('column "%s" appears more than once' + */ + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_ret, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 66, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_5 != 0); + if (__pyx_t_4) { + + /* "oursqlx/util.pyx":67 + * for name, value in zip(self.column_names, row): + * if name in ret: + * if ret[name] != value: # <<<<<<<<<<<<<< + * raise ProgrammingError('column "%s" appears more than once' + * ' in output' % name) + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_ret, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_value, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__pyx_t_4)) { + + /* "oursqlx/util.pyx":68 + * if name in ret: + * if ret[name] != value: + * raise ProgrammingError('column "%s" appears more than once' # <<<<<<<<<<<<<< + * ' in output' % name) + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "oursqlx/util.pyx":69 + * if ret[name] != value: + * raise ProgrammingError('column "%s" appears more than once' + * ' in output' % name) # <<<<<<<<<<<<<< + * else: + * ret[name] = value + */ + __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_column_s_appears_more_than_once, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 68, __pyx_L1_error) + + /* "oursqlx/util.pyx":67 + * for name, value in zip(self.column_names, row): + * if name in ret: + * if ret[name] != value: # <<<<<<<<<<<<<< + * raise ProgrammingError('column "%s" appears more than once' + * ' in output' % name) + */ + } + + /* "oursqlx/util.pyx":66 + * ret = {} + * for name, value in zip(self.column_names, row): + * if name in ret: # <<<<<<<<<<<<<< + * if ret[name] != value: + * raise ProgrammingError('column "%s" appears more than once' + */ + goto __pyx_L8; + } + + /* "oursqlx/util.pyx":71 + * ' in output' % name) + * else: + * ret[name] = value # <<<<<<<<<<<<<< + * return ret + * + */ + /*else*/ { + if (unlikely(PyDict_SetItem(__pyx_v_ret, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(1, 71, __pyx_L1_error) + } + __pyx_L8:; + + /* "oursqlx/util.pyx":65 + * return None + * ret = {} + * for name, value in zip(self.column_names, row): # <<<<<<<<<<<<<< + * if name in ret: + * if ret[name] != value: + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":72 + * else: + * ret[name] = value + * return ret # <<<<<<<<<<<<<< + * + * _exception_enum_map = { + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/util.pyx":60 + * + * cdef class _DictWhateverMixin: + * def fetchone(self): # <<<<<<<<<<<<<< + * row = super(_DictWhateverMixin, self).fetchone() + * if row is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("oursql._DictWhateverMixin.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_18_DictWhateverMixin_2__reduce_cython__(((struct __pyx_obj_6oursql__DictWhateverMixin *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_2__reduce_cython__(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = () # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_v_state = __pyx_empty_tuple; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = () + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__DictWhateverMixi); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__DictWhateverMixin__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__DictWhateverMixi); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._DictWhateverMixin.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__DictWhateverMixin__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_18_DictWhateverMixin_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_18_DictWhateverMixin_4__setstate_cython__(((struct __pyx_obj_6oursql__DictWhateverMixin *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_18_DictWhateverMixin_4__setstate_cython__(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__DictWhateverMixin__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6oursql___pyx_unpickle__DictWhateverMixin__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle__DictWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__DictWhateverMixin__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._DictWhateverMixin.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":85 + * _oursqlx_UnknownError: UnknownError, + * } + * def _exception_from_errno(int err): # <<<<<<<<<<<<<< + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_1_exception_from_errno(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_1_exception_from_errno = {"_exception_from_errno", (PyCFunction)__pyx_pw_6oursql_1_exception_from_errno, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_1_exception_from_errno(PyObject *__pyx_self, PyObject *__pyx_arg_err) { + int __pyx_v_err; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_exception_from_errno (wrapper)", 0); + assert(__pyx_arg_err); { + __pyx_v_err = __Pyx_PyInt_As_int(__pyx_arg_err); if (unlikely((__pyx_v_err == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 85, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("oursql._exception_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql__exception_from_errno(__pyx_self, ((int)__pyx_v_err)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql__exception_from_errno(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_err) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_exception_from_errno", 0); + + /* "oursqlx/util.pyx":86 + * } + * def _exception_from_errno(int err): + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] # <<<<<<<<<<<<<< + * + * def _do_warnings_query(Connection conn not None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_exception_enum_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_exc_from_errno(__pyx_v_err)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "oursqlx/util.pyx":85 + * _oursqlx_UnknownError: UnknownError, + * } + * def _exception_from_errno(int err): # <<<<<<<<<<<<<< + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._exception_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/util.pyx":88 + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + * def _do_warnings_query(Connection conn not None): # <<<<<<<<<<<<<< + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_3_do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_3_do_warnings_query = {"_do_warnings_query", (PyCFunction)__pyx_pw_6oursql_3_do_warnings_query, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_3_do_warnings_query(PyObject *__pyx_self, PyObject *__pyx_v_conn) { + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_do_warnings_query (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) __PYX_ERR(1, 88, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_2_do_warnings_query(__pyx_self, ((struct __pyx_obj_6oursql_Connection *)__pyx_v_conn)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_2_do_warnings_query(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn) { + int __pyx_v_should_raise; + struct __pyx_obj_6oursql__Query *__pyx_v_q = NULL; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_kind = NULL; + PyObject *__pyx_v_err = NULL; + PyObject *__pyx_v_message = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_warnings_query", 0); + + /* "oursqlx/util.pyx":89 + * + * def _do_warnings_query(Connection conn not None): + * cdef int should_raise = False # <<<<<<<<<<<<<< + * q = _Query(conn, 'SHOW WARNINGS') + * ret = [] + */ + __pyx_v_should_raise = 0; + + /* "oursqlx/util.pyx":90 + * def _do_warnings_query(Connection conn not None): + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') # <<<<<<<<<<<<<< + * ret = [] + * for kind, err, message in q: + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_conn)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_conn)); + __Pyx_INCREF(__pyx_kp_u_SHOW_WARNINGS); + __Pyx_GIVEREF(__pyx_kp_u_SHOW_WARNINGS); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_SHOW_WARNINGS); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__Query), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_q = ((struct __pyx_obj_6oursql__Query *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":91 + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') + * ret = [] # <<<<<<<<<<<<<< + * for kind, err, message in q: + * if kind == 'Note': + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_ret = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":92 + * q = _Query(conn, 'SHOW WARNINGS') + * ret = [] + * for kind, err, message in q: # <<<<<<<<<<<<<< + * if kind == 'Note': + * kind = Note + */ + if (likely(PyList_CheckExact(((PyObject *)__pyx_v_q))) || PyTuple_CheckExact(((PyObject *)__pyx_v_q))) { + __pyx_t_2 = ((PyObject *)__pyx_v_q); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_q)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 92, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 92, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 92, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 92, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 92, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_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_L5_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_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(1, 92, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(1, 92, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_kind, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_message, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/util.pyx":93 + * ret = [] + * for kind, err, message in q: + * if kind == 'Note': # <<<<<<<<<<<<<< + * kind = Note + * elif kind == 'Warning': + */ + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Note, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 93, __pyx_L1_error) + if (__pyx_t_10) { + + /* "oursqlx/util.pyx":94 + * for kind, err, message in q: + * if kind == 'Note': + * kind = Note # <<<<<<<<<<<<<< + * elif kind == 'Warning': + * kind = Warning + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Note); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":93 + * ret = [] + * for kind, err, message in q: + * if kind == 'Note': # <<<<<<<<<<<<<< + * kind = Note + * elif kind == 'Warning': + */ + goto __pyx_L7; + } + + /* "oursqlx/util.pyx":95 + * if kind == 'Note': + * kind = Note + * elif kind == 'Warning': # <<<<<<<<<<<<<< + * kind = Warning + * should_raise = True + */ + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Warning, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 95, __pyx_L1_error) + if (__pyx_t_10) { + + /* "oursqlx/util.pyx":96 + * kind = Note + * elif kind == 'Warning': + * kind = Warning # <<<<<<<<<<<<<< + * should_raise = True + * elif kind == 'Error': + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Warning); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":97 + * elif kind == 'Warning': + * kind = Warning + * should_raise = True # <<<<<<<<<<<<<< + * elif kind == 'Error': + * kind = _exception_from_errno(err) + */ + __pyx_v_should_raise = 1; + + /* "oursqlx/util.pyx":95 + * if kind == 'Note': + * kind = Note + * elif kind == 'Warning': # <<<<<<<<<<<<<< + * kind = Warning + * should_raise = True + */ + goto __pyx_L7; + } + + /* "oursqlx/util.pyx":98 + * kind = Warning + * should_raise = True + * elif kind == 'Error': # <<<<<<<<<<<<<< + * kind = _exception_from_errno(err) + * should_raise = True + */ + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Error, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 98, __pyx_L1_error) + if (likely(__pyx_t_10)) { + + /* "oursqlx/util.pyx":99 + * should_raise = True + * elif kind == 'Error': + * kind = _exception_from_errno(err) # <<<<<<<<<<<<<< + * should_raise = True + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_exception_from_errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_err) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_err); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":100 + * elif kind == 'Error': + * kind = _exception_from_errno(err) + * should_raise = True # <<<<<<<<<<<<<< + * else: + * raise InterfaceError('unknown kind of warning: %r' % kind) + */ + __pyx_v_should_raise = 1; + + /* "oursqlx/util.pyx":98 + * kind = Warning + * should_raise = True + * elif kind == 'Error': # <<<<<<<<<<<<<< + * kind = _exception_from_errno(err) + * should_raise = True + */ + goto __pyx_L7; + } + + /* "oursqlx/util.pyx":102 + * should_raise = True + * else: + * raise InterfaceError('unknown kind of warning: %r' % kind) # <<<<<<<<<<<<<< + * ret.append((kind, (message, err))) + * if should_raise and conn.raise_on_warnings: + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_kind_of_warning_r, __pyx_v_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 102, __pyx_L1_error) + } + __pyx_L7:; + + /* "oursqlx/util.pyx":103 + * else: + * raise InterfaceError('unknown kind of warning: %r' % kind) + * ret.append((kind, (message, err))) # <<<<<<<<<<<<<< + * if should_raise and conn.raise_on_warnings: + * raise CollatedWarningsError('query caused warnings', extra=ret) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_message); + __Pyx_GIVEREF(__pyx_v_message); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message); + __Pyx_INCREF(__pyx_v_err); + __Pyx_GIVEREF(__pyx_v_err); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_err); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_kind); + __Pyx_GIVEREF(__pyx_v_kind); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kind); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "oursqlx/util.pyx":92 + * q = _Query(conn, 'SHOW WARNINGS') + * ret = [] + * for kind, err, message in q: # <<<<<<<<<<<<<< + * if kind == 'Note': + * kind = Note + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":104 + * raise InterfaceError('unknown kind of warning: %r' % kind) + * ret.append((kind, (message, err))) + * if should_raise and conn.raise_on_warnings: # <<<<<<<<<<<<<< + * raise CollatedWarningsError('query caused warnings', extra=ret) + * return ret + */ + __pyx_t_12 = (__pyx_v_should_raise != 0); + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_12 = (__pyx_v_conn->raise_on_warnings != 0); + __pyx_t_10 = __pyx_t_12; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_10)) { + + /* "oursqlx/util.pyx":105 + * ret.append((kind, (message, err))) + * if should_raise and conn.raise_on_warnings: + * raise CollatedWarningsError('query caused warnings', extra=ret) # <<<<<<<<<<<<<< + * return ret + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CollatedWarningsError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_extra, __pyx_v_ret) < 0) __PYX_ERR(1, 105, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 105, __pyx_L1_error) + + /* "oursqlx/util.pyx":104 + * raise InterfaceError('unknown kind of warning: %r' % kind) + * ret.append((kind, (message, err))) + * if should_raise and conn.raise_on_warnings: # <<<<<<<<<<<<<< + * raise CollatedWarningsError('query caused warnings', extra=ret) + * return ret + */ + } + + /* "oursqlx/util.pyx":106 + * if should_raise and conn.raise_on_warnings: + * raise CollatedWarningsError('query caused warnings', extra=ret) + * return ret # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/util.pyx":88 + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + * def _do_warnings_query(Connection conn not None): # <<<<<<<<<<<<<< + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql._do_warnings_query", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_q); + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_kind); + __Pyx_XDECREF(__pyx_v_err); + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":3 + * import decimal, datetime, time + * + * def _bitval_from_string(s): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length + * cdef unsigned char *ss + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_5_bitval_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_5_bitval_from_string = {"_bitval_from_string", (PyCFunction)__pyx_pw_6oursql_5_bitval_from_string, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_5_bitval_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_bitval_from_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_4_bitval_from_string(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_4_bitval_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + Py_ssize_t __pyx_v_length; + unsigned char *__pyx_v_ss; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_bitval_from_string", 0); + + /* "oursqlx/conversions.pyx":6 + * cdef Py_ssize_t length + * cdef unsigned char *ss + * PyBytes_AsStringAndSize(s, &ss, &length) # <<<<<<<<<<<<<< + * return bitval_from_char_p(ss, length) + * + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_s, ((char **)(&__pyx_v_ss)), (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 6, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":7 + * cdef unsigned char *ss + * PyBytes_AsStringAndSize(s, &ss, &length) + * return bitval_from_char_p(ss, length) # <<<<<<<<<<<<<< + * + * def _datetime_from_string(s): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_f_6oursql_bitval_from_char_p(__pyx_v_ss, __pyx_v_length)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":3 + * import decimal, datetime, time + * + * def _bitval_from_string(s): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length + * cdef unsigned char *ss + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._bitval_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":9 + * return bitval_from_char_p(ss, length) + * + * def _datetime_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_7_datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_7_datetime_from_string = {"_datetime_from_string", (PyCFunction)__pyx_pw_6oursql_7_datetime_from_string, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_7_datetime_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_datetime_from_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_datetime_from_string(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_datetime_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_v_tt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime_from_string", 0); + + /* "oursqlx/conversions.pyx":10 + * + * def _datetime_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') # <<<<<<<<<<<<<< + * return datetime.datetime(*tt[:6]) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strptime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_Y_m_d_H_M_S}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_Y_m_d_H_M_S}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_s); + __Pyx_INCREF(__pyx_kp_u_Y_m_d_H_M_S); + __Pyx_GIVEREF(__pyx_kp_u_Y_m_d_H_M_S); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_u_Y_m_d_H_M_S); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_tt = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":11 + * def _datetime_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) # <<<<<<<<<<<<<< + * + * def _date_from_string(s): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tt, 0, 6, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":9 + * return bitval_from_char_p(ss, length) + * + * def _datetime_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._datetime_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":13 + * return datetime.datetime(*tt[:6]) + * + * def _date_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_9_date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_9_date_from_string = {"_date_from_string", (PyCFunction)__pyx_pw_6oursql_9_date_from_string, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_9_date_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_date_from_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_8_date_from_string(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_8_date_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_v_tt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_from_string", 0); + + /* "oursqlx/conversions.pyx":14 + * + * def _date_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d') # <<<<<<<<<<<<<< + * return datetime.date(*tt[:3]) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strptime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_Y_m_d}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_Y_m_d}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_s); + __Pyx_INCREF(__pyx_kp_u_Y_m_d); + __Pyx_GIVEREF(__pyx_kp_u_Y_m_d); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_u_Y_m_d); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_tt = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":15 + * def _date_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) # <<<<<<<<<<<<<< + * + * def _time_from_string(s): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tt, 0, 3, NULL, NULL, &__pyx_slice__4, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":13 + * return datetime.datetime(*tt[:6]) + * + * def _date_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._date_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":17 + * return datetime.date(*tt[:3]) + * + * def _time_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11_time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_11_time_from_string = {"_time_from_string", (PyCFunction)__pyx_pw_6oursql_11_time_from_string, METH_O, 0}; +static PyObject *__pyx_pw_6oursql_11_time_from_string(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_time_from_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_time_from_string(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_time_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_v_tt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_time_from_string", 0); + + /* "oursqlx/conversions.pyx":18 + * + * def _time_from_string(s): + * tt = time.strptime(s, '%H:%M:%S') # <<<<<<<<<<<<<< + * return datetime.time(*tt[3:6]) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strptime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_H_M_S}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_s, __pyx_kp_u_H_M_S}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_s); + __Pyx_INCREF(__pyx_kp_u_H_M_S); + __Pyx_GIVEREF(__pyx_kp_u_H_M_S); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_u_H_M_S); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_tt = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":19 + * def _time_from_string(s): + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) # <<<<<<<<<<<<<< + * + * _conversions = { + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tt, 3, 6, NULL, NULL, &__pyx_slice__5, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":17 + * return datetime.date(*tt[:3]) + * + * def _time_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._time_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":55 + * Binary = bytes + * + * def TimestampFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimestampFromTicks(ticks) -> Timestamp. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_13TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/ +static char __pyx_doc_6oursql_12TimestampFromTicks[] = "TimestampFromTicks(ticks) -> Timestamp.\n \n Convert a time in seconds since the epoch into a Timestamp.\n "; +static PyMethodDef __pyx_mdef_6oursql_13TimestampFromTicks = {"TimestampFromTicks", (PyCFunction)__pyx_pw_6oursql_13TimestampFromTicks, METH_O, __pyx_doc_6oursql_12TimestampFromTicks}; +static PyObject *__pyx_pw_6oursql_13TimestampFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TimestampFromTicks (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_12TimestampFromTicks(__pyx_self, ((PyObject *)__pyx_v_ticks)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_12TimestampFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("TimestampFromTicks", 0); + + /* "oursqlx/conversions.pyx":60 + * Convert a time in seconds since the epoch into a Timestamp. + * """ + * return Timestamp(*time.localtime(ticks)[:6]) # <<<<<<<<<<<<<< + * + * def DateFromTicks(ticks): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_localtime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_ticks) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ticks); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 6, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":55 + * Binary = bytes + * + * def TimestampFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimestampFromTicks(ticks) -> Timestamp. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.TimestampFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":62 + * return Timestamp(*time.localtime(ticks)[:6]) + * + * def DateFromTicks(ticks): # <<<<<<<<<<<<<< + * """DateFromTicks(ticks) -> Date. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_15DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/ +static char __pyx_doc_6oursql_14DateFromTicks[] = "DateFromTicks(ticks) -> Date.\n \n Convert a time in seconds since the epoch into a Date.\n "; +static PyMethodDef __pyx_mdef_6oursql_15DateFromTicks = {"DateFromTicks", (PyCFunction)__pyx_pw_6oursql_15DateFromTicks, METH_O, __pyx_doc_6oursql_14DateFromTicks}; +static PyObject *__pyx_pw_6oursql_15DateFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DateFromTicks (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_14DateFromTicks(__pyx_self, ((PyObject *)__pyx_v_ticks)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_14DateFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("DateFromTicks", 0); + + /* "oursqlx/conversions.pyx":67 + * Convert a time in seconds since the epoch into a Date. + * """ + * return Date(*time.localtime(ticks)[:3]) # <<<<<<<<<<<<<< + * + * def TimeFromTicks(ticks): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Date); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_localtime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_ticks) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ticks); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 3, NULL, NULL, &__pyx_slice__4, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":62 + * return Timestamp(*time.localtime(ticks)[:6]) + * + * def DateFromTicks(ticks): # <<<<<<<<<<<<<< + * """DateFromTicks(ticks) -> Date. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.DateFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/conversions.pyx":69 + * return Date(*time.localtime(ticks)[:3]) + * + * def TimeFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimeFromTicks(ticks) -> Time. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_17TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks); /*proto*/ +static char __pyx_doc_6oursql_16TimeFromTicks[] = "TimeFromTicks(ticks) -> Time.\n \n Convert a time in seconds since the epoch into a Time.\n "; +static PyMethodDef __pyx_mdef_6oursql_17TimeFromTicks = {"TimeFromTicks", (PyCFunction)__pyx_pw_6oursql_17TimeFromTicks, METH_O, __pyx_doc_6oursql_16TimeFromTicks}; +static PyObject *__pyx_pw_6oursql_17TimeFromTicks(PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("TimeFromTicks (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16TimeFromTicks(__pyx_self, ((PyObject *)__pyx_v_ticks)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16TimeFromTicks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ticks) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("TimeFromTicks", 0); + + /* "oursqlx/conversions.pyx":74 + * Convert a time in seconds since the epoch into a Time. + * """ + * return Time(*time.localtime(ticks)[3:6]) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_localtime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_ticks) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ticks); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 3, 6, NULL, NULL, &__pyx_slice__5, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "oursqlx/conversions.pyx":69 + * return Date(*time.localtime(ticks)[:3]) + * + * def TimeFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimeFromTicks(ticks) -> Time. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.TimeFromTicks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":76 + * cdef public object default_cursor + * + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, # <<<<<<<<<<<<<< + * unsigned int port=0, unix_socket=None, connect_timeout=None, + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10Connection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_10Connection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_host = 0; + PyObject *__pyx_v_user = 0; + PyObject *__pyx_v_passwd = 0; + PyObject *__pyx_v_db = 0; + unsigned int __pyx_v_port; + PyObject *__pyx_v_unix_socket = 0; + PyObject *__pyx_v_connect_timeout = 0; + PyObject *__pyx_v_read_timeout = 0; + PyObject *__pyx_v_write_timeout = 0; + PyObject *__pyx_v_protocol = 0; + PyObject *__pyx_v_ssl = 0; + PyObject *__pyx_v_read_default_file = 0; + PyObject *__pyx_v_read_default_group = 0; + PyObject *__pyx_v_init_command = 0; + PyObject *__pyx_v_charset_dir = 0; + PyObject *__pyx_v_shared_memory_base_name = 0; + int __pyx_v_local_infile; + int __pyx_v_require_secure_auth; + int __pyx_v_compress; + int __pyx_v_report_truncation; + int __pyx_v_found_rows; + int __pyx_v_use_unicode; + PyObject *__pyx_v_charset = 0; + int __pyx_v_autoping; + PyObject *__pyx_v_default_cursor = 0; + int __pyx_v_raise_on_warnings; + CYTHON_UNUSED int __pyx_v_multi_results; + CYTHON_UNUSED int __pyx_v_multi_statements; + int __pyx_v_autoreconnect; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_user,&__pyx_n_s_passwd,&__pyx_n_s_db,&__pyx_n_s_port,&__pyx_n_s_unix_socket,&__pyx_n_s_connect_timeout,&__pyx_n_s_read_timeout,&__pyx_n_s_write_timeout,&__pyx_n_s_protocol,&__pyx_n_s_ssl,&__pyx_n_s_read_default_file,&__pyx_n_s_read_default_group,&__pyx_n_s_init_command,&__pyx_n_s_charset_dir,&__pyx_n_s_shared_memory_base_name,&__pyx_n_s_local_infile,&__pyx_n_s_require_secure_auth,&__pyx_n_s_compress,&__pyx_n_s_report_truncation,&__pyx_n_s_found_rows,&__pyx_n_s_use_unicode,&__pyx_n_s_charset,&__pyx_n_s_autoping,&__pyx_n_s_default_cursor,&__pyx_n_s_raise_on_warnings,&__pyx_n_s_multi_results,&__pyx_n_s_multi_statements,&__pyx_n_s_autoreconnect,0}; + PyObject* values[29] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + + /* "oursqlx/connection.pyx":77 + * + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, + * unsigned int port=0, unix_socket=None, connect_timeout=None, # <<<<<<<<<<<<<< + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + * read_default_file=None, read_default_group=None, init_command=None, + */ + values[5] = ((PyObject *)Py_None); + values[6] = ((PyObject *)Py_None); + + /* "oursqlx/connection.pyx":78 + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, + * unsigned int port=0, unix_socket=None, connect_timeout=None, + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, # <<<<<<<<<<<<<< + * read_default_file=None, read_default_group=None, init_command=None, + * charset_dir=None, shared_memory_base_name=None, + */ + values[7] = ((PyObject *)Py_None); + values[8] = ((PyObject *)Py_None); + values[9] = ((PyObject *)Py_None); + values[10] = ((PyObject *)Py_None); + + /* "oursqlx/connection.pyx":79 + * unsigned int port=0, unix_socket=None, connect_timeout=None, + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + * read_default_file=None, read_default_group=None, init_command=None, # <<<<<<<<<<<<<< + * charset_dir=None, shared_memory_base_name=None, + * bint local_infile=False, bint require_secure_auth=False, + */ + values[11] = ((PyObject *)Py_None); + values[12] = ((PyObject *)Py_None); + values[13] = ((PyObject *)Py_None); + + /* "oursqlx/connection.pyx":80 + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + * read_default_file=None, read_default_group=None, init_command=None, + * charset_dir=None, shared_memory_base_name=None, # <<<<<<<<<<<<<< + * bint local_infile=False, bint require_secure_auth=False, + * bint compress=False, bint report_truncation=True, + */ + values[14] = ((PyObject *)Py_None); + values[15] = ((PyObject *)Py_None); + values[22] = ((PyObject *)__pyx_n_u_utf8); + + /* "oursqlx/connection.pyx":84 + * bint compress=False, bint report_truncation=True, + * bint found_rows=True, bint use_unicode=True, charset='utf8', + * bint autoping=False, default_cursor=None, # <<<<<<<<<<<<<< + * bint raise_on_warnings=True, bint multi_results=True, + * bint multi_statements=True, bint autoreconnect=False): + */ + values[24] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_passwd); + if (value) { values[2] = value; kw_args--; } + } + } + if (kw_args > 0 && likely(kw_args <= 26)) { + Py_ssize_t index; + for (index = 3; index < 29 && kw_args > 0; index++) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 76, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_host = values[0]; + __pyx_v_user = values[1]; + __pyx_v_passwd = values[2]; + __pyx_v_db = values[3]; + if (values[4]) { + __pyx_v_port = __Pyx_PyInt_As_unsigned_int(values[4]); if (unlikely((__pyx_v_port == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 77, __pyx_L3_error) + } else { + __pyx_v_port = ((unsigned int)0); + } + __pyx_v_unix_socket = values[5]; + __pyx_v_connect_timeout = values[6]; + __pyx_v_read_timeout = values[7]; + __pyx_v_write_timeout = values[8]; + __pyx_v_protocol = values[9]; + __pyx_v_ssl = values[10]; + __pyx_v_read_default_file = values[11]; + __pyx_v_read_default_group = values[12]; + __pyx_v_init_command = values[13]; + __pyx_v_charset_dir = values[14]; + __pyx_v_shared_memory_base_name = values[15]; + if (values[16]) { + __pyx_v_local_infile = __Pyx_PyObject_IsTrue(values[16]); if (unlikely((__pyx_v_local_infile == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 81, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":81 + * read_default_file=None, read_default_group=None, init_command=None, + * charset_dir=None, shared_memory_base_name=None, + * bint local_infile=False, bint require_secure_auth=False, # <<<<<<<<<<<<<< + * bint compress=False, bint report_truncation=True, + * bint found_rows=True, bint use_unicode=True, charset='utf8', + */ + __pyx_v_local_infile = ((int)0); + } + if (values[17]) { + __pyx_v_require_secure_auth = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_require_secure_auth == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 81, __pyx_L3_error) + } else { + __pyx_v_require_secure_auth = ((int)0); + } + if (values[18]) { + __pyx_v_compress = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_compress == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 82, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":82 + * charset_dir=None, shared_memory_base_name=None, + * bint local_infile=False, bint require_secure_auth=False, + * bint compress=False, bint report_truncation=True, # <<<<<<<<<<<<<< + * bint found_rows=True, bint use_unicode=True, charset='utf8', + * bint autoping=False, default_cursor=None, + */ + __pyx_v_compress = ((int)0); + } + if (values[19]) { + __pyx_v_report_truncation = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_report_truncation == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 82, __pyx_L3_error) + } else { + __pyx_v_report_truncation = ((int)1); + } + if (values[20]) { + __pyx_v_found_rows = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_found_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 83, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":83 + * bint local_infile=False, bint require_secure_auth=False, + * bint compress=False, bint report_truncation=True, + * bint found_rows=True, bint use_unicode=True, charset='utf8', # <<<<<<<<<<<<<< + * bint autoping=False, default_cursor=None, + * bint raise_on_warnings=True, bint multi_results=True, + */ + __pyx_v_found_rows = ((int)1); + } + if (values[21]) { + __pyx_v_use_unicode = __Pyx_PyObject_IsTrue(values[21]); if (unlikely((__pyx_v_use_unicode == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 83, __pyx_L3_error) + } else { + __pyx_v_use_unicode = ((int)1); + } + __pyx_v_charset = values[22]; + if (values[23]) { + __pyx_v_autoping = __Pyx_PyObject_IsTrue(values[23]); if (unlikely((__pyx_v_autoping == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 84, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":84 + * bint compress=False, bint report_truncation=True, + * bint found_rows=True, bint use_unicode=True, charset='utf8', + * bint autoping=False, default_cursor=None, # <<<<<<<<<<<<<< + * bint raise_on_warnings=True, bint multi_results=True, + * bint multi_statements=True, bint autoreconnect=False): + */ + __pyx_v_autoping = ((int)0); + } + __pyx_v_default_cursor = values[24]; + if (values[25]) { + __pyx_v_raise_on_warnings = __Pyx_PyObject_IsTrue(values[25]); if (unlikely((__pyx_v_raise_on_warnings == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 85, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":85 + * bint found_rows=True, bint use_unicode=True, charset='utf8', + * bint autoping=False, default_cursor=None, + * bint raise_on_warnings=True, bint multi_results=True, # <<<<<<<<<<<<<< + * bint multi_statements=True, bint autoreconnect=False): + * cdef unsigned long flags = 0 + */ + __pyx_v_raise_on_warnings = ((int)1); + } + if (values[26]) { + __pyx_v_multi_results = __Pyx_PyObject_IsTrue(values[26]); if (unlikely((__pyx_v_multi_results == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 85, __pyx_L3_error) + } else { + __pyx_v_multi_results = ((int)1); + } + if (values[27]) { + __pyx_v_multi_statements = __Pyx_PyObject_IsTrue(values[27]); if (unlikely((__pyx_v_multi_statements == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 86, __pyx_L3_error) + } else { + + /* "oursqlx/connection.pyx":86 + * bint autoping=False, default_cursor=None, + * bint raise_on_warnings=True, bint multi_results=True, + * bint multi_statements=True, bint autoreconnect=False): # <<<<<<<<<<<<<< + * cdef unsigned long flags = 0 + * cdef unsigned int uint_tmp + */ + __pyx_v_multi_statements = ((int)1); + } + if (values[28]) { + __pyx_v_autoreconnect = __Pyx_PyObject_IsTrue(values[28]); if (unlikely((__pyx_v_autoreconnect == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 86, __pyx_L3_error) + } else { + __pyx_v_autoreconnect = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 76, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Connection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10Connection___cinit__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), __pyx_v_host, __pyx_v_user, __pyx_v_passwd, __pyx_v_db, __pyx_v_port, __pyx_v_unix_socket, __pyx_v_connect_timeout, __pyx_v_read_timeout, __pyx_v_write_timeout, __pyx_v_protocol, __pyx_v_ssl, __pyx_v_read_default_file, __pyx_v_read_default_group, __pyx_v_init_command, __pyx_v_charset_dir, __pyx_v_shared_memory_base_name, __pyx_v_local_infile, __pyx_v_require_secure_auth, __pyx_v_compress, __pyx_v_report_truncation, __pyx_v_found_rows, __pyx_v_use_unicode, __pyx_v_charset, __pyx_v_autoping, __pyx_v_default_cursor, __pyx_v_raise_on_warnings, __pyx_v_multi_results, __pyx_v_multi_statements, __pyx_v_autoreconnect); + + /* "oursqlx/connection.pyx":76 + * cdef public object default_cursor + * + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, # <<<<<<<<<<<<<< + * unsigned int port=0, unix_socket=None, connect_timeout=None, + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10Connection___cinit__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_passwd, PyObject *__pyx_v_db, unsigned int __pyx_v_port, PyObject *__pyx_v_unix_socket, PyObject *__pyx_v_connect_timeout, PyObject *__pyx_v_read_timeout, PyObject *__pyx_v_write_timeout, PyObject *__pyx_v_protocol, PyObject *__pyx_v_ssl, PyObject *__pyx_v_read_default_file, PyObject *__pyx_v_read_default_group, PyObject *__pyx_v_init_command, PyObject *__pyx_v_charset_dir, PyObject *__pyx_v_shared_memory_base_name, int __pyx_v_local_infile, int __pyx_v_require_secure_auth, int __pyx_v_compress, int __pyx_v_report_truncation, int __pyx_v_found_rows, int __pyx_v_use_unicode, PyObject *__pyx_v_charset, int __pyx_v_autoping, PyObject *__pyx_v_default_cursor, int __pyx_v_raise_on_warnings, CYTHON_UNUSED int __pyx_v_multi_results, CYTHON_UNUSED int __pyx_v_multi_statements, int __pyx_v_autoreconnect) { + unsigned long __pyx_v_flags; + unsigned int __pyx_v_uint_tmp; + my_bool __pyx_v_bool_tmp; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_host); + __Pyx_INCREF(__pyx_v_user); + __Pyx_INCREF(__pyx_v_passwd); + __Pyx_INCREF(__pyx_v_db); + __Pyx_INCREF(__pyx_v_unix_socket); + __Pyx_INCREF(__pyx_v_read_default_file); + __Pyx_INCREF(__pyx_v_read_default_group); + __Pyx_INCREF(__pyx_v_init_command); + __Pyx_INCREF(__pyx_v_charset_dir); + __Pyx_INCREF(__pyx_v_shared_memory_base_name); + __Pyx_INCREF(__pyx_v_charset); + __Pyx_INCREF(__pyx_v_default_cursor); + + /* "oursqlx/connection.pyx":87 + * bint raise_on_warnings=True, bint multi_results=True, + * bint multi_statements=True, bint autoreconnect=False): + * cdef unsigned long flags = 0 # <<<<<<<<<<<<<< + * cdef unsigned int uint_tmp + * cdef my_bool bool_tmp + */ + __pyx_v_flags = 0; + + /* "oursqlx/connection.pyx":90 + * cdef unsigned int uint_tmp + * cdef my_bool bool_tmp + * if compress: # <<<<<<<<<<<<<< + * flags |= CLIENT_COMPRESS + * if found_rows: + */ + __pyx_t_1 = (__pyx_v_compress != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":91 + * cdef my_bool bool_tmp + * if compress: + * flags |= CLIENT_COMPRESS # <<<<<<<<<<<<<< + * if found_rows: + * flags |= CLIENT_FOUND_ROWS + */ + __pyx_v_flags = (__pyx_v_flags | CLIENT_COMPRESS); + + /* "oursqlx/connection.pyx":90 + * cdef unsigned int uint_tmp + * cdef my_bool bool_tmp + * if compress: # <<<<<<<<<<<<<< + * flags |= CLIENT_COMPRESS + * if found_rows: + */ + } + + /* "oursqlx/connection.pyx":92 + * if compress: + * flags |= CLIENT_COMPRESS + * if found_rows: # <<<<<<<<<<<<<< + * flags |= CLIENT_FOUND_ROWS + * # I'll come back to this later. Dealing with multiple result sets is + */ + __pyx_t_1 = (__pyx_v_found_rows != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":93 + * flags |= CLIENT_COMPRESS + * if found_rows: + * flags |= CLIENT_FOUND_ROWS # <<<<<<<<<<<<<< + * # I'll come back to this later. Dealing with multiple result sets is + * # such a pain. + */ + __pyx_v_flags = (__pyx_v_flags | CLIENT_FOUND_ROWS); + + /* "oursqlx/connection.pyx":92 + * if compress: + * flags |= CLIENT_COMPRESS + * if found_rows: # <<<<<<<<<<<<<< + * flags |= CLIENT_FOUND_ROWS + * # I'll come back to this later. Dealing with multiple result sets is + */ + } + + /* "oursqlx/connection.pyx":100 + * #if multi_statements: + * # flags |= CLIENT_MULTI_STATEMENTS + * self.conn = mysql_init(NULL) # <<<<<<<<<<<<<< + * if not self.conn: + * raise MemoryError('alloc of conn object failed') + */ + __pyx_v_self->conn = mysql_init(NULL); + + /* "oursqlx/connection.pyx":101 + * # flags |= CLIENT_MULTI_STATEMENTS + * self.conn = mysql_init(NULL) + * if not self.conn: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of conn object failed') + * if protocol not in _protocol_enum_map: + */ + __pyx_t_1 = ((!(__pyx_v_self->conn != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/connection.pyx":102 + * self.conn = mysql_init(NULL) + * if not self.conn: + * raise MemoryError('alloc of conn object failed') # <<<<<<<<<<<<<< + * if protocol not in _protocol_enum_map: + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 102, __pyx_L1_error) + + /* "oursqlx/connection.pyx":101 + * # flags |= CLIENT_MULTI_STATEMENTS + * self.conn = mysql_init(NULL) + * if not self.conn: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of conn object failed') + * if protocol not in _protocol_enum_map: + */ + } + + /* "oursqlx/connection.pyx":103 + * if not self.conn: + * raise MemoryError('alloc of conn object failed') + * if protocol not in _protocol_enum_map: # <<<<<<<<<<<<<< + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + * host = bytes_maybe_from_encoding(host, charset) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_protocol_enum_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_protocol, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_3)) { + + /* "oursqlx/connection.pyx":104 + * raise MemoryError('alloc of conn object failed') + * if protocol not in _protocol_enum_map: + * raise ProgrammingError('unknown protocol %r' % (protocol,)) # <<<<<<<<<<<<<< + * host = bytes_maybe_from_encoding(host, charset) + * user = bytes_maybe_from_encoding(user, charset) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_protocol), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unknown_protocol, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 104, __pyx_L1_error) + + /* "oursqlx/connection.pyx":103 + * if not self.conn: + * raise MemoryError('alloc of conn object failed') + * if protocol not in _protocol_enum_map: # <<<<<<<<<<<<<< + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + * host = bytes_maybe_from_encoding(host, charset) + */ + } + + /* "oursqlx/connection.pyx":105 + * if protocol not in _protocol_enum_map: + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + * host = bytes_maybe_from_encoding(host, charset) # <<<<<<<<<<<<<< + * user = bytes_maybe_from_encoding(user, charset) + * passwd = bytes_maybe_from_encoding(passwd, charset) + */ + __pyx_t_2 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_host, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_host, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":106 + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + * host = bytes_maybe_from_encoding(host, charset) + * user = bytes_maybe_from_encoding(user, charset) # <<<<<<<<<<<<<< + * passwd = bytes_maybe_from_encoding(passwd, charset) + * db = bytes_maybe_from_encoding(db, charset) + */ + __pyx_t_2 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_user, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_user, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":107 + * host = bytes_maybe_from_encoding(host, charset) + * user = bytes_maybe_from_encoding(user, charset) + * passwd = bytes_maybe_from_encoding(passwd, charset) # <<<<<<<<<<<<<< + * db = bytes_maybe_from_encoding(db, charset) + * unix_socket = bytes_maybe_from_encoding(unix_socket, charset) + */ + __pyx_t_2 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_passwd, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_passwd, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":108 + * user = bytes_maybe_from_encoding(user, charset) + * passwd = bytes_maybe_from_encoding(passwd, charset) + * db = bytes_maybe_from_encoding(db, charset) # <<<<<<<<<<<<<< + * unix_socket = bytes_maybe_from_encoding(unix_socket, charset) + * uint_tmp = _protocol_enum_map[protocol] + */ + __pyx_t_2 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_db, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_db, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":109 + * passwd = bytes_maybe_from_encoding(passwd, charset) + * db = bytes_maybe_from_encoding(db, charset) + * unix_socket = bytes_maybe_from_encoding(unix_socket, charset) # <<<<<<<<<<<<<< + * uint_tmp = _protocol_enum_map[protocol] + * mysql_options(self.conn, MYSQL_OPT_PROTOCOL, &uint_tmp) + */ + __pyx_t_2 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_unix_socket, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_unix_socket, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":110 + * db = bytes_maybe_from_encoding(db, charset) + * unix_socket = bytes_maybe_from_encoding(unix_socket, charset) + * uint_tmp = _protocol_enum_map[protocol] # <<<<<<<<<<<<<< + * mysql_options(self.conn, MYSQL_OPT_PROTOCOL, &uint_tmp) + * bool_tmp = report_truncation + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_protocol_enum_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_protocol); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_uint_tmp = __pyx_t_7; + + /* "oursqlx/connection.pyx":111 + * unix_socket = bytes_maybe_from_encoding(unix_socket, charset) + * uint_tmp = _protocol_enum_map[protocol] + * mysql_options(self.conn, MYSQL_OPT_PROTOCOL, &uint_tmp) # <<<<<<<<<<<<<< + * bool_tmp = report_truncation + * mysql_options(self.conn, + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_PROTOCOL, ((char *)(&__pyx_v_uint_tmp)))); + + /* "oursqlx/connection.pyx":112 + * uint_tmp = _protocol_enum_map[protocol] + * mysql_options(self.conn, MYSQL_OPT_PROTOCOL, &uint_tmp) + * bool_tmp = report_truncation # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_REPORT_DATA_TRUNCATION, &bool_tmp) + */ + __pyx_v_bool_tmp = __pyx_v_report_truncation; + + /* "oursqlx/connection.pyx":113 + * mysql_options(self.conn, MYSQL_OPT_PROTOCOL, &uint_tmp) + * bool_tmp = report_truncation + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_REPORT_DATA_TRUNCATION, &bool_tmp) + * bool_tmp = require_secure_auth + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_REPORT_DATA_TRUNCATION, ((char *)(&__pyx_v_bool_tmp)))); + + /* "oursqlx/connection.pyx":115 + * mysql_options(self.conn, + * MYSQL_REPORT_DATA_TRUNCATION, &bool_tmp) + * bool_tmp = require_secure_auth # <<<<<<<<<<<<<< + * mysql_options(self.conn, MYSQL_SECURE_AUTH, &bool_tmp) + * if connect_timeout is not None: + */ + __pyx_v_bool_tmp = __pyx_v_require_secure_auth; + + /* "oursqlx/connection.pyx":116 + * MYSQL_REPORT_DATA_TRUNCATION, &bool_tmp) + * bool_tmp = require_secure_auth + * mysql_options(self.conn, MYSQL_SECURE_AUTH, &bool_tmp) # <<<<<<<<<<<<<< + * if connect_timeout is not None: + * uint_tmp = connect_timeout + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_SECURE_AUTH, ((char *)(&__pyx_v_bool_tmp)))); + + /* "oursqlx/connection.pyx":117 + * bool_tmp = require_secure_auth + * mysql_options(self.conn, MYSQL_SECURE_AUTH, &bool_tmp) + * if connect_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = connect_timeout + * mysql_options(self.conn, + */ + __pyx_t_3 = (__pyx_v_connect_timeout != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":118 + * mysql_options(self.conn, MYSQL_SECURE_AUTH, &bool_tmp) + * if connect_timeout is not None: + * uint_tmp = connect_timeout # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_OPT_CONNECT_TIMEOUT, &uint_tmp) + */ + __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_connect_timeout); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 118, __pyx_L1_error) + __pyx_v_uint_tmp = __pyx_t_7; + + /* "oursqlx/connection.pyx":119 + * if connect_timeout is not None: + * uint_tmp = connect_timeout + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_OPT_CONNECT_TIMEOUT, &uint_tmp) + * if read_timeout is not None: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_CONNECT_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)))); + + /* "oursqlx/connection.pyx":117 + * bool_tmp = require_secure_auth + * mysql_options(self.conn, MYSQL_SECURE_AUTH, &bool_tmp) + * if connect_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = connect_timeout + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":121 + * mysql_options(self.conn, + * MYSQL_OPT_CONNECT_TIMEOUT, &uint_tmp) + * if read_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = read_timeout + * mysql_options(self.conn, + */ + __pyx_t_1 = (__pyx_v_read_timeout != Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "oursqlx/connection.pyx":122 + * MYSQL_OPT_CONNECT_TIMEOUT, &uint_tmp) + * if read_timeout is not None: + * uint_tmp = read_timeout # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_OPT_READ_TIMEOUT, &uint_tmp) + */ + __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_read_timeout); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L1_error) + __pyx_v_uint_tmp = __pyx_t_7; + + /* "oursqlx/connection.pyx":123 + * if read_timeout is not None: + * uint_tmp = read_timeout + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_OPT_READ_TIMEOUT, &uint_tmp) + * if write_timeout is not None: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_READ_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)))); + + /* "oursqlx/connection.pyx":121 + * mysql_options(self.conn, + * MYSQL_OPT_CONNECT_TIMEOUT, &uint_tmp) + * if read_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = read_timeout + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":125 + * mysql_options(self.conn, + * MYSQL_OPT_READ_TIMEOUT, &uint_tmp) + * if write_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = write_timeout + * mysql_options(self.conn, + */ + __pyx_t_3 = (__pyx_v_write_timeout != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":126 + * MYSQL_OPT_READ_TIMEOUT, &uint_tmp) + * if write_timeout is not None: + * uint_tmp = write_timeout # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_OPT_WRITE_TIMEOUT, &uint_tmp) + */ + __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_write_timeout); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 126, __pyx_L1_error) + __pyx_v_uint_tmp = __pyx_t_7; + + /* "oursqlx/connection.pyx":127 + * if write_timeout is not None: + * uint_tmp = write_timeout + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_OPT_WRITE_TIMEOUT, &uint_tmp) + * if read_default_file: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_WRITE_TIMEOUT, ((char *)(&__pyx_v_uint_tmp)))); + + /* "oursqlx/connection.pyx":125 + * mysql_options(self.conn, + * MYSQL_OPT_READ_TIMEOUT, &uint_tmp) + * if write_timeout is not None: # <<<<<<<<<<<<<< + * uint_tmp = write_timeout + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":129 + * mysql_options(self.conn, + * MYSQL_OPT_WRITE_TIMEOUT, &uint_tmp) + * if read_default_file: # <<<<<<<<<<<<<< + * read_default_file = bytes_maybe_from_encoding( + * read_default_file, charset) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_read_default_file); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 129, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":130 + * MYSQL_OPT_WRITE_TIMEOUT, &uint_tmp) + * if read_default_file: + * read_default_file = bytes_maybe_from_encoding( # <<<<<<<<<<<<<< + * read_default_file, charset) + * mysql_options(self.conn, + */ + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_read_default_file, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_read_default_file, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":132 + * read_default_file = bytes_maybe_from_encoding( + * read_default_file, charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_READ_DEFAULT_FILE, bytes_or_null(read_default_file)) + * if read_default_group: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_READ_DEFAULT_FILE, __pyx_f_6oursql_bytes_or_null(__pyx_v_read_default_file))); + + /* "oursqlx/connection.pyx":129 + * mysql_options(self.conn, + * MYSQL_OPT_WRITE_TIMEOUT, &uint_tmp) + * if read_default_file: # <<<<<<<<<<<<<< + * read_default_file = bytes_maybe_from_encoding( + * read_default_file, charset) + */ + } + + /* "oursqlx/connection.pyx":134 + * mysql_options(self.conn, + * MYSQL_READ_DEFAULT_FILE, bytes_or_null(read_default_file)) + * if read_default_group: # <<<<<<<<<<<<<< + * read_default_group = bytes_maybe_from_encoding( + * read_default_group, charset) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_read_default_group); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 134, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":135 + * MYSQL_READ_DEFAULT_FILE, bytes_or_null(read_default_file)) + * if read_default_group: + * read_default_group = bytes_maybe_from_encoding( # <<<<<<<<<<<<<< + * read_default_group, charset) + * mysql_options(self.conn, + */ + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_read_default_group, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_read_default_group, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":137 + * read_default_group = bytes_maybe_from_encoding( + * read_default_group, charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_READ_DEFAULT_GROUP, bytes_or_null(read_default_group)) + * if init_command: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_READ_DEFAULT_GROUP, __pyx_f_6oursql_bytes_or_null(__pyx_v_read_default_group))); + + /* "oursqlx/connection.pyx":134 + * mysql_options(self.conn, + * MYSQL_READ_DEFAULT_FILE, bytes_or_null(read_default_file)) + * if read_default_group: # <<<<<<<<<<<<<< + * read_default_group = bytes_maybe_from_encoding( + * read_default_group, charset) + */ + } + + /* "oursqlx/connection.pyx":139 + * mysql_options(self.conn, + * MYSQL_READ_DEFAULT_GROUP, bytes_or_null(read_default_group)) + * if init_command: # <<<<<<<<<<<<<< + * init_command = bytes_maybe_from_encoding(init_command, charset) + * mysql_options(self.conn, + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_init_command); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 139, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":140 + * MYSQL_READ_DEFAULT_GROUP, bytes_or_null(read_default_group)) + * if init_command: + * init_command = bytes_maybe_from_encoding(init_command, charset) # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(init_command)) + */ + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_init_command, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_init_command, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":141 + * if init_command: + * init_command = bytes_maybe_from_encoding(init_command, charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_INIT_COMMAND, bytes_or_null(init_command)) + * if charset_dir: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_INIT_COMMAND, __pyx_f_6oursql_bytes_or_null(__pyx_v_init_command))); + + /* "oursqlx/connection.pyx":139 + * mysql_options(self.conn, + * MYSQL_READ_DEFAULT_GROUP, bytes_or_null(read_default_group)) + * if init_command: # <<<<<<<<<<<<<< + * init_command = bytes_maybe_from_encoding(init_command, charset) + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":143 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(init_command)) + * if charset_dir: # <<<<<<<<<<<<<< + * charset_dir = bytes_maybe_from_encoding(charset_dir, charset) + * mysql_options(self.conn, + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_charset_dir); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 143, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":144 + * MYSQL_INIT_COMMAND, bytes_or_null(init_command)) + * if charset_dir: + * charset_dir = bytes_maybe_from_encoding(charset_dir, charset) # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(charset_dir)) + */ + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_charset_dir, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_charset_dir, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":145 + * if charset_dir: + * charset_dir = bytes_maybe_from_encoding(charset_dir, charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_INIT_COMMAND, bytes_or_null(charset_dir)) + * if shared_memory_base_name: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_INIT_COMMAND, __pyx_f_6oursql_bytes_or_null(__pyx_v_charset_dir))); + + /* "oursqlx/connection.pyx":143 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(init_command)) + * if charset_dir: # <<<<<<<<<<<<<< + * charset_dir = bytes_maybe_from_encoding(charset_dir, charset) + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":147 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(charset_dir)) + * if shared_memory_base_name: # <<<<<<<<<<<<<< + * shared_memory_base_name = bytes_maybe_from_encoding( + * shared_memory_base_name, charset) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shared_memory_base_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 147, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":148 + * MYSQL_INIT_COMMAND, bytes_or_null(charset_dir)) + * if shared_memory_base_name: + * shared_memory_base_name = bytes_maybe_from_encoding( # <<<<<<<<<<<<<< + * shared_memory_base_name, charset) + * mysql_options(self.conn, + */ + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_shared_memory_base_name, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_shared_memory_base_name, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":150 + * shared_memory_base_name = bytes_maybe_from_encoding( + * shared_memory_base_name, charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_INIT_COMMAND, bytes_or_null(shared_memory_base_name)) + * if local_infile: + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_INIT_COMMAND, __pyx_f_6oursql_bytes_or_null(__pyx_v_shared_memory_base_name))); + + /* "oursqlx/connection.pyx":147 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(charset_dir)) + * if shared_memory_base_name: # <<<<<<<<<<<<<< + * shared_memory_base_name = bytes_maybe_from_encoding( + * shared_memory_base_name, charset) + */ + } + + /* "oursqlx/connection.pyx":152 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(shared_memory_base_name)) + * if local_infile: # <<<<<<<<<<<<<< + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) + * if ssl is not None: + */ + __pyx_t_1 = (__pyx_v_local_infile != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":153 + * MYSQL_INIT_COMMAND, bytes_or_null(shared_memory_base_name)) + * if local_infile: + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) # <<<<<<<<<<<<<< + * if ssl is not None: + * self._setup_ssl_options(charset, **ssl) + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_LOCAL_INFILE, NULL)); + + /* "oursqlx/connection.pyx":152 + * mysql_options(self.conn, + * MYSQL_INIT_COMMAND, bytes_or_null(shared_memory_base_name)) + * if local_infile: # <<<<<<<<<<<<<< + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) + * if ssl is not None: + */ + } + + /* "oursqlx/connection.pyx":154 + * if local_infile: + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) + * if ssl is not None: # <<<<<<<<<<<<<< + * self._setup_ssl_options(charset, **ssl) + * if charset is not None: + */ + __pyx_t_1 = (__pyx_v_ssl != Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "oursqlx/connection.pyx":155 + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) + * if ssl is not None: + * self._setup_ssl_options(charset, **ssl) # <<<<<<<<<<<<<< + * if charset is not None: + * charset = PyUnicode_AsUTF8String(charset) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setup_ssl_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_charset); + __Pyx_GIVEREF(__pyx_v_charset); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_charset); + if (unlikely(__pyx_v_ssl == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(2, 155, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_ssl))) { + __pyx_t_6 = PyDict_Copy(__pyx_v_ssl); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } else { + __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_ssl, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "oursqlx/connection.pyx":154 + * if local_infile: + * mysql_options(self.conn, MYSQL_OPT_LOCAL_INFILE, NULL) + * if ssl is not None: # <<<<<<<<<<<<<< + * self._setup_ssl_options(charset, **ssl) + * if charset is not None: + */ + } + + /* "oursqlx/connection.pyx":156 + * if ssl is not None: + * self._setup_ssl_options(charset, **ssl) + * if charset is not None: # <<<<<<<<<<<<<< + * charset = PyUnicode_AsUTF8String(charset) + * mysql_options(self.conn, + */ + __pyx_t_3 = (__pyx_v_charset != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":157 + * self._setup_ssl_options(charset, **ssl) + * if charset is not None: + * charset = PyUnicode_AsUTF8String(charset) # <<<<<<<<<<<<<< + * mysql_options(self.conn, + * MYSQL_SET_CHARSET_NAME, PyBytes_AS_STRING(charset)) + */ + __pyx_t_5 = PyUnicode_AsUTF8String(__pyx_v_charset); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_charset, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursqlx/connection.pyx":158 + * if charset is not None: + * charset = PyUnicode_AsUTF8String(charset) + * mysql_options(self.conn, # <<<<<<<<<<<<<< + * MYSQL_SET_CHARSET_NAME, PyBytes_AS_STRING(charset)) + * if not mysql_real_connect(self.conn, bytes_or_null(host), + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_SET_CHARSET_NAME, PyBytes_AS_STRING(__pyx_v_charset))); + + /* "oursqlx/connection.pyx":156 + * if ssl is not None: + * self._setup_ssl_options(charset, **ssl) + * if charset is not None: # <<<<<<<<<<<<<< + * charset = PyUnicode_AsUTF8String(charset) + * mysql_options(self.conn, + */ + } + + /* "oursqlx/connection.pyx":160 + * mysql_options(self.conn, + * MYSQL_SET_CHARSET_NAME, PyBytes_AS_STRING(charset)) + * if not mysql_real_connect(self.conn, bytes_or_null(host), # <<<<<<<<<<<<<< + * bytes_or_null(user), bytes_or_null(passwd), bytes_or_null(db), + * port, bytes_or_null(unix_socket), flags): + */ + __pyx_t_1 = ((!(__pyx_f_6oursql_mysql_real_connect(__pyx_v_self->conn, __pyx_f_6oursql_bytes_or_null(__pyx_v_host), __pyx_f_6oursql_bytes_or_null(__pyx_v_user), __pyx_f_6oursql_bytes_or_null(__pyx_v_passwd), __pyx_f_6oursql_bytes_or_null(__pyx_v_db), __pyx_v_port, __pyx_f_6oursql_bytes_or_null(__pyx_v_unix_socket), __pyx_v_flags) != 0)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":163 + * bytes_or_null(user), bytes_or_null(passwd), bytes_or_null(db), + * port, bytes_or_null(unix_socket), flags): + * self._raise_error() # <<<<<<<<<<<<<< + * if autoreconnect: + * bool_tmp = True + */ + __pyx_t_8 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 163, __pyx_L1_error) + + /* "oursqlx/connection.pyx":160 + * mysql_options(self.conn, + * MYSQL_SET_CHARSET_NAME, PyBytes_AS_STRING(charset)) + * if not mysql_real_connect(self.conn, bytes_or_null(host), # <<<<<<<<<<<<<< + * bytes_or_null(user), bytes_or_null(passwd), bytes_or_null(db), + * port, bytes_or_null(unix_socket), flags): + */ + } + + /* "oursqlx/connection.pyx":164 + * port, bytes_or_null(unix_socket), flags): + * self._raise_error() + * if autoreconnect: # <<<<<<<<<<<<<< + * bool_tmp = True + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) + */ + __pyx_t_1 = (__pyx_v_autoreconnect != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":165 + * self._raise_error() + * if autoreconnect: + * bool_tmp = True # <<<<<<<<<<<<<< + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) + * self.charset + */ + __pyx_v_bool_tmp = 1; + + /* "oursqlx/connection.pyx":166 + * if autoreconnect: + * bool_tmp = True + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) # <<<<<<<<<<<<<< + * self.charset + * self.use_unicode = use_unicode + */ + (void)(mysql_options(__pyx_v_self->conn, MYSQL_OPT_RECONNECT, ((char *)(&__pyx_v_bool_tmp)))); + + /* "oursqlx/connection.pyx":164 + * port, bytes_or_null(unix_socket), flags): + * self._raise_error() + * if autoreconnect: # <<<<<<<<<<<<<< + * bool_tmp = True + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) + */ + } + + /* "oursqlx/connection.pyx":167 + * bool_tmp = True + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) + * self.charset # <<<<<<<<<<<<<< + * self.use_unicode = use_unicode + * self.autoping = autoping + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "oursqlx/connection.pyx":168 + * mysql_options(self.conn, MYSQL_OPT_RECONNECT, &bool_tmp) + * self.charset + * self.use_unicode = use_unicode # <<<<<<<<<<<<<< + * self.autoping = autoping + * if default_cursor is None: + */ + __pyx_v_self->use_unicode = __pyx_v_use_unicode; + + /* "oursqlx/connection.pyx":169 + * self.charset + * self.use_unicode = use_unicode + * self.autoping = autoping # <<<<<<<<<<<<<< + * if default_cursor is None: + * default_cursor = Cursor + */ + __pyx_v_self->autoping = __pyx_v_autoping; + + /* "oursqlx/connection.pyx":170 + * self.use_unicode = use_unicode + * self.autoping = autoping + * if default_cursor is None: # <<<<<<<<<<<<<< + * default_cursor = Cursor + * self.default_cursor = default_cursor + */ + __pyx_t_1 = (__pyx_v_default_cursor == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "oursqlx/connection.pyx":171 + * self.autoping = autoping + * if default_cursor is None: + * default_cursor = Cursor # <<<<<<<<<<<<<< + * self.default_cursor = default_cursor + * self.raise_on_warnings = raise_on_warnings + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql_Cursor)); + __Pyx_DECREF_SET(__pyx_v_default_cursor, ((PyObject *)__pyx_ptype_6oursql_Cursor)); + + /* "oursqlx/connection.pyx":170 + * self.use_unicode = use_unicode + * self.autoping = autoping + * if default_cursor is None: # <<<<<<<<<<<<<< + * default_cursor = Cursor + * self.default_cursor = default_cursor + */ + } + + /* "oursqlx/connection.pyx":172 + * if default_cursor is None: + * default_cursor = Cursor + * self.default_cursor = default_cursor # <<<<<<<<<<<<<< + * self.raise_on_warnings = raise_on_warnings + * self._context_cursors = [] + */ + __Pyx_INCREF(__pyx_v_default_cursor); + __Pyx_GIVEREF(__pyx_v_default_cursor); + __Pyx_GOTREF(__pyx_v_self->default_cursor); + __Pyx_DECREF(__pyx_v_self->default_cursor); + __pyx_v_self->default_cursor = __pyx_v_default_cursor; + + /* "oursqlx/connection.pyx":173 + * default_cursor = Cursor + * self.default_cursor = default_cursor + * self.raise_on_warnings = raise_on_warnings # <<<<<<<<<<<<<< + * self._context_cursors = [] + * + */ + __pyx_v_self->raise_on_warnings = __pyx_v_raise_on_warnings; + + /* "oursqlx/connection.pyx":174 + * self.default_cursor = default_cursor + * self.raise_on_warnings = raise_on_warnings + * self._context_cursors = [] # <<<<<<<<<<<<<< + * + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_context_cursors); + __Pyx_DECREF(__pyx_v_self->_context_cursors); + __pyx_v_self->_context_cursors = __pyx_t_5; + __pyx_t_5 = 0; + + /* "oursqlx/connection.pyx":76 + * cdef public object default_cursor + * + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, # <<<<<<<<<<<<<< + * unsigned int port=0, unix_socket=None, connect_timeout=None, + * read_timeout=None, write_timeout=None, protocol=None, ssl=None, + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("oursql.Connection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_host); + __Pyx_XDECREF(__pyx_v_user); + __Pyx_XDECREF(__pyx_v_passwd); + __Pyx_XDECREF(__pyx_v_db); + __Pyx_XDECREF(__pyx_v_unix_socket); + __Pyx_XDECREF(__pyx_v_read_default_file); + __Pyx_XDECREF(__pyx_v_read_default_group); + __Pyx_XDECREF(__pyx_v_init_command); + __Pyx_XDECREF(__pyx_v_charset_dir); + __Pyx_XDECREF(__pyx_v_shared_memory_base_name); + __Pyx_XDECREF(__pyx_v_charset); + __Pyx_XDECREF(__pyx_v_default_cursor); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":176 + * self._context_cursors = [] + * + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, # <<<<<<<<<<<<<< + * capath=None, cipher=None): + * key = bytes_maybe_from_encoding(key, charset) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_3_setup_ssl_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_3_setup_ssl_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_charset = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cert = 0; + PyObject *__pyx_v_ca = 0; + PyObject *__pyx_v_capath = 0; + PyObject *__pyx_v_cipher = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_setup_ssl_options (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_charset,&__pyx_n_s_key,&__pyx_n_s_cert,&__pyx_n_s_ca,&__pyx_n_s_capath,&__pyx_n_s_cipher,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + + /* "oursqlx/connection.pyx":177 + * + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, + * capath=None, cipher=None): # <<<<<<<<<<<<<< + * key = bytes_maybe_from_encoding(key, charset) + * cert = bytes_maybe_from_encoding(cert, charset) + */ + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_None); + 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); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_charset)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 5)) { + Py_ssize_t index; + for (index = 1; index < 6 && kw_args > 0; index++) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setup_ssl_options") < 0)) __PYX_ERR(2, 176, __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_charset = values[0]; + __pyx_v_key = values[1]; + __pyx_v_cert = values[2]; + __pyx_v_ca = values[3]; + __pyx_v_capath = values[4]; + __pyx_v_cipher = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_setup_ssl_options", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 176, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Connection._setup_ssl_options", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10Connection_2_setup_ssl_options(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), __pyx_v_charset, __pyx_v_key, __pyx_v_cert, __pyx_v_ca, __pyx_v_capath, __pyx_v_cipher); + + /* "oursqlx/connection.pyx":176 + * self._context_cursors = [] + * + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, # <<<<<<<<<<<<<< + * capath=None, cipher=None): + * key = bytes_maybe_from_encoding(key, charset) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_2_setup_ssl_options(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_charset, PyObject *__pyx_v_key, PyObject *__pyx_v_cert, PyObject *__pyx_v_ca, PyObject *__pyx_v_capath, PyObject *__pyx_v_cipher) { + 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("_setup_ssl_options", 0); + __Pyx_INCREF(__pyx_v_key); + __Pyx_INCREF(__pyx_v_cert); + __Pyx_INCREF(__pyx_v_ca); + __Pyx_INCREF(__pyx_v_capath); + __Pyx_INCREF(__pyx_v_cipher); + + /* "oursqlx/connection.pyx":178 + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, + * capath=None, cipher=None): + * key = bytes_maybe_from_encoding(key, charset) # <<<<<<<<<<<<<< + * cert = bytes_maybe_from_encoding(cert, charset) + * ca = bytes_maybe_from_encoding(ca, charset) + */ + __pyx_t_1 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_key, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":179 + * capath=None, cipher=None): + * key = bytes_maybe_from_encoding(key, charset) + * cert = bytes_maybe_from_encoding(cert, charset) # <<<<<<<<<<<<<< + * ca = bytes_maybe_from_encoding(ca, charset) + * capath = bytes_maybe_from_encoding(capath, charset) + */ + __pyx_t_1 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_cert, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_cert, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":180 + * key = bytes_maybe_from_encoding(key, charset) + * cert = bytes_maybe_from_encoding(cert, charset) + * ca = bytes_maybe_from_encoding(ca, charset) # <<<<<<<<<<<<<< + * capath = bytes_maybe_from_encoding(capath, charset) + * cipher = bytes_maybe_from_encoding(cipher, charset) + */ + __pyx_t_1 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_ca, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_ca, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":181 + * cert = bytes_maybe_from_encoding(cert, charset) + * ca = bytes_maybe_from_encoding(ca, charset) + * capath = bytes_maybe_from_encoding(capath, charset) # <<<<<<<<<<<<<< + * cipher = bytes_maybe_from_encoding(cipher, charset) + * mysql_ssl_set(self.conn, bytes_or_null(key), bytes_or_null(cert), + */ + __pyx_t_1 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_capath, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_capath, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":182 + * ca = bytes_maybe_from_encoding(ca, charset) + * capath = bytes_maybe_from_encoding(capath, charset) + * cipher = bytes_maybe_from_encoding(cipher, charset) # <<<<<<<<<<<<<< + * mysql_ssl_set(self.conn, bytes_or_null(key), bytes_or_null(cert), + * bytes_or_null(ca), bytes_or_null(capath), bytes_or_null(cipher)) + */ + __pyx_t_1 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_cipher, __pyx_v_charset, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_cipher, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":183 + * capath = bytes_maybe_from_encoding(capath, charset) + * cipher = bytes_maybe_from_encoding(cipher, charset) + * mysql_ssl_set(self.conn, bytes_or_null(key), bytes_or_null(cert), # <<<<<<<<<<<<<< + * bytes_or_null(ca), bytes_or_null(capath), bytes_or_null(cipher)) + * + */ + (void)(mysql_ssl_set(__pyx_v_self->conn, __pyx_f_6oursql_bytes_or_null(__pyx_v_key), __pyx_f_6oursql_bytes_or_null(__pyx_v_cert), __pyx_f_6oursql_bytes_or_null(__pyx_v_ca), __pyx_f_6oursql_bytes_or_null(__pyx_v_capath), __pyx_f_6oursql_bytes_or_null(__pyx_v_cipher))); + + /* "oursqlx/connection.pyx":176 + * self._context_cursors = [] + * + * def _setup_ssl_options(self, charset, *, key=None, cert=None, ca=None, # <<<<<<<<<<<<<< + * capath=None, cipher=None): + * key = bytes_maybe_from_encoding(key, charset) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection._setup_ssl_options", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_cert); + __Pyx_XDECREF(__pyx_v_ca); + __Pyx_XDECREF(__pyx_v_capath); + __Pyx_XDECREF(__pyx_v_cipher); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":186 + * bytes_or_null(ca), bytes_or_null(capath), bytes_or_null(cipher)) + * + * def close(self): # <<<<<<<<<<<<<< + * """close() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_10Connection_4close[] = "close()\n \n Close the connection. The connection object and all associated cursors\n will become unusable.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_4close(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_4close(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("close", 0); + + /* "oursqlx/connection.pyx":192 + * will become unusable. + * """ + * if self.conn: # <<<<<<<<<<<<<< + * self.rollback() + * mysql_close(self.conn) + */ + __pyx_t_1 = (__pyx_v_self->conn != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":193 + * """ + * if self.conn: + * self.rollback() # <<<<<<<<<<<<<< + * mysql_close(self.conn) + * self.conn = NULL + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rollback); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":194 + * if self.conn: + * self.rollback() + * mysql_close(self.conn) # <<<<<<<<<<<<<< + * self.conn = NULL + * + */ + mysql_close(__pyx_v_self->conn); + + /* "oursqlx/connection.pyx":195 + * self.rollback() + * mysql_close(self.conn) + * self.conn = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->conn = NULL; + + /* "oursqlx/connection.pyx":192 + * will become unusable. + * """ + * if self.conn: # <<<<<<<<<<<<<< + * self.rollback() + * mysql_close(self.conn) + */ + } + + /* "oursqlx/connection.pyx":186 + * bytes_or_null(ca), bytes_or_null(capath), bytes_or_null(cipher)) + * + * def close(self): # <<<<<<<<<<<<<< + * """close() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Connection.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":197 + * self.conn = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.conn: + * mysql_close(self.conn) + */ + +/* Python wrapper */ +static void __pyx_pw_6oursql_10Connection_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6oursql_10Connection_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6oursql_10Connection_6__dealloc__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6oursql_10Connection_6__dealloc__(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "oursqlx/connection.pyx":198 + * + * def __dealloc__(self): + * if self.conn: # <<<<<<<<<<<<<< + * mysql_close(self.conn) + * self.conn = NULL + */ + __pyx_t_1 = (__pyx_v_self->conn != 0); + if (__pyx_t_1) { + + /* "oursqlx/connection.pyx":199 + * def __dealloc__(self): + * if self.conn: + * mysql_close(self.conn) # <<<<<<<<<<<<<< + * self.conn = NULL + * + */ + mysql_close(__pyx_v_self->conn); + + /* "oursqlx/connection.pyx":200 + * if self.conn: + * mysql_close(self.conn) + * self.conn = NULL # <<<<<<<<<<<<<< + * + * cdef int _raise_error(self) except -1: + */ + __pyx_v_self->conn = NULL; + + /* "oursqlx/connection.pyx":198 + * + * def __dealloc__(self): + * if self.conn: # <<<<<<<<<<<<<< + * mysql_close(self.conn) + * self.conn = NULL + */ + } + + /* "oursqlx/connection.pyx":197 + * self.conn = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.conn: + * mysql_close(self.conn) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "oursqlx/connection.pyx":202 + * self.conn = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * # _raise_error can only be called internally, so we shouldn't need to + * # check for if the connection is closed. + */ + +static int __pyx_f_6oursql_10Connection__raise_error(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + int __pyx_v_err; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_raise_error", 0); + + /* "oursqlx/connection.pyx":205 + * # _raise_error can only be called internally, so we shouldn't need to + * # check for if the connection is closed. + * cdef int err = mysql_errno(self.conn) # <<<<<<<<<<<<<< + * self.charset + * raise _exception_from_errno(err)( + */ + __pyx_v_err = mysql_errno(__pyx_v_self->conn); + + /* "oursqlx/connection.pyx":206 + * # check for if the connection is closed. + * cdef int err = mysql_errno(self.conn) + * self.charset # <<<<<<<<<<<<<< + * raise _exception_from_errno(err)( + * self._decode_char_p(mysql_error(self.conn)), err) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":207 + * cdef int err = mysql_errno(self.conn) + * self.charset + * raise _exception_from_errno(err)( # <<<<<<<<<<<<<< + * self._decode_char_p(mysql_error(self.conn)), err) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exception_from_errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/connection.pyx":208 + * self.charset + * raise _exception_from_errno(err)( + * self._decode_char_p(mysql_error(self.conn)), err) # <<<<<<<<<<<<<< + * + * cdef int _check_closed(self) except -1: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_decode_char_p(__pyx_v_self, mysql_error(__pyx_v_self->conn)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 207, __pyx_L1_error) + + /* "oursqlx/connection.pyx":202 + * self.conn = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * # _raise_error can only be called internally, so we shouldn't need to + * # check for if the connection is closed. + */ + + /* function exit code */ + __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_7); + __Pyx_AddTraceback("oursql.Connection._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":210 + * self._decode_char_p(mysql_error(self.conn)), err) + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn: + * raise ProgrammingError('connection closed') + */ + +static int __pyx_f_6oursql_10Connection__check_closed(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_closed", 0); + + /* "oursqlx/connection.pyx":211 + * + * cdef int _check_closed(self) except -1: + * if not self.conn: # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * + */ + __pyx_t_1 = ((!(__pyx_v_self->conn != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/connection.pyx":212 + * cdef int _check_closed(self) except -1: + * if not self.conn: + * raise ProgrammingError('connection closed') # <<<<<<<<<<<<<< + * + * def ping(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_connection_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_connection_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 212, __pyx_L1_error) + + /* "oursqlx/connection.pyx":211 + * + * cdef int _check_closed(self) except -1: + * if not self.conn: # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * + */ + } + + /* "oursqlx/connection.pyx":210 + * self._decode_char_p(mysql_error(self.conn)), err) + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn: + * raise ProgrammingError('connection closed') + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Connection._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":214 + * raise ProgrammingError('connection closed') + * + * def ping(self): # <<<<<<<<<<<<<< + * """ping() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_9ping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_10Connection_8ping[] = "ping()\n \n Make sure that the database connection is still open. If not, silently\n reconnect.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_9ping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ping (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_8ping(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_8ping(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ping", 0); + + /* "oursqlx/connection.pyx":220 + * reconnect. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * if mysql_ping(self.conn): + * self._raise_error() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 220, __pyx_L1_error) + + /* "oursqlx/connection.pyx":221 + * """ + * self._check_closed() + * if mysql_ping(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + __pyx_t_2 = (__pyx_f_6oursql_mysql_ping(__pyx_v_self->conn) != 0); + if (__pyx_t_2) { + + /* "oursqlx/connection.pyx":222 + * self._check_closed() + * if mysql_ping(self.conn): + * self._raise_error() # <<<<<<<<<<<<<< + * + * def commit(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 222, __pyx_L1_error) + + /* "oursqlx/connection.pyx":221 + * """ + * self._check_closed() + * if mysql_ping(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + } + + /* "oursqlx/connection.pyx":214 + * raise ProgrammingError('connection closed') + * + * def ping(self): # <<<<<<<<<<<<<< + * """ping() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql.Connection.ping", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":224 + * self._raise_error() + * + * def commit(self): # <<<<<<<<<<<<<< + * """commit() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_11commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_10Connection_10commit[] = "commit()\n \n Commit the current transaction.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_11commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("commit (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_10commit(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_10commit(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("commit", 0); + + /* "oursqlx/connection.pyx":229 + * Commit the current transaction. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * if mysql_commit(self.conn): + * self._raise_error() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 229, __pyx_L1_error) + + /* "oursqlx/connection.pyx":230 + * """ + * self._check_closed() + * if mysql_commit(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + __pyx_t_2 = (__pyx_f_6oursql_mysql_commit(__pyx_v_self->conn) != 0); + if (__pyx_t_2) { + + /* "oursqlx/connection.pyx":231 + * self._check_closed() + * if mysql_commit(self.conn): + * self._raise_error() # <<<<<<<<<<<<<< + * + * def rollback(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 231, __pyx_L1_error) + + /* "oursqlx/connection.pyx":230 + * """ + * self._check_closed() + * if mysql_commit(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + } + + /* "oursqlx/connection.pyx":224 + * self._raise_error() + * + * def commit(self): # <<<<<<<<<<<<<< + * """commit() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql.Connection.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":233 + * self._raise_error() + * + * def rollback(self): # <<<<<<<<<<<<<< + * """rollback() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_13rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_10Connection_12rollback[] = "rollback()\n \n Roll back the current transaction.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_13rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rollback (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_12rollback(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_12rollback(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rollback", 0); + + /* "oursqlx/connection.pyx":238 + * Roll back the current transaction. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * if mysql_rollback(self.conn): + * self._raise_error() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 238, __pyx_L1_error) + + /* "oursqlx/connection.pyx":239 + * """ + * self._check_closed() + * if mysql_rollback(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + __pyx_t_2 = (__pyx_f_6oursql_mysql_rollback(__pyx_v_self->conn) != 0); + if (__pyx_t_2) { + + /* "oursqlx/connection.pyx":240 + * self._check_closed() + * if mysql_rollback(self.conn): + * self._raise_error() # <<<<<<<<<<<<<< + * + * property charset: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 240, __pyx_L1_error) + + /* "oursqlx/connection.pyx":239 + * """ + * self._check_closed() + * if mysql_rollback(self.conn): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + } + + /* "oursqlx/connection.pyx":233 + * self._raise_error() + * + * def rollback(self): # <<<<<<<<<<<<<< + * """rollback() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql.Connection.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":249 + * strings. + * """ + * def __get__(self): # <<<<<<<<<<<<<< + * self._charset_bytes = PyBytes_FromString( + * mysql_character_set_name(self.conn)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_7charset_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_7charset_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_7charset___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_7charset___get__(struct __pyx_obj_6oursql_Connection *__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("__get__", 0); + + /* "oursqlx/connection.pyx":250 + * """ + * def __get__(self): + * self._charset_bytes = PyBytes_FromString( # <<<<<<<<<<<<<< + * mysql_character_set_name(self.conn)) + * self._charset = PyUnicode_FromStringAndSize( + */ + __pyx_t_1 = PyBytes_FromString(mysql_character_set_name(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_charset_bytes); + __Pyx_DECREF(__pyx_v_self->_charset_bytes); + __pyx_v_self->_charset_bytes = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":253 + * mysql_character_set_name(self.conn)) + * self._charset = PyUnicode_FromStringAndSize( + * PyBytes_AS_STRING(self._charset_bytes), # <<<<<<<<<<<<<< + * PyBytes_GET_SIZE(self._charset_bytes)) + * return self._charset + */ + __pyx_t_1 = __pyx_v_self->_charset_bytes; + __Pyx_INCREF(__pyx_t_1); + + /* "oursqlx/connection.pyx":254 + * self._charset = PyUnicode_FromStringAndSize( + * PyBytes_AS_STRING(self._charset_bytes), + * PyBytes_GET_SIZE(self._charset_bytes)) # <<<<<<<<<<<<<< + * return self._charset + * def __set__(self, value): + */ + __pyx_t_2 = __pyx_v_self->_charset_bytes; + __Pyx_INCREF(__pyx_t_2); + + /* "oursqlx/connection.pyx":252 + * self._charset_bytes = PyBytes_FromString( + * mysql_character_set_name(self.conn)) + * self._charset = PyUnicode_FromStringAndSize( # <<<<<<<<<<<<<< + * PyBytes_AS_STRING(self._charset_bytes), + * PyBytes_GET_SIZE(self._charset_bytes)) + */ + __pyx_t_3 = PyUnicode_FromStringAndSize(PyBytes_AS_STRING(__pyx_t_1), PyBytes_GET_SIZE(__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_charset); + __Pyx_DECREF(__pyx_v_self->_charset); + __pyx_v_self->_charset = __pyx_t_3; + __pyx_t_3 = 0; + + /* "oursqlx/connection.pyx":255 + * PyBytes_AS_STRING(self._charset_bytes), + * PyBytes_GET_SIZE(self._charset_bytes)) + * return self._charset # <<<<<<<<<<<<<< + * def __set__(self, value): + * self._check_closed() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_charset); + __pyx_r = __pyx_v_self->_charset; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":249 + * strings. + * """ + * def __get__(self): # <<<<<<<<<<<<<< + * self._charset_bytes = PyBytes_FromString( + * mysql_character_set_name(self.conn)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Connection.charset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":256 + * PyBytes_GET_SIZE(self._charset_bytes)) + * return self._charset + * def __set__(self, value): # <<<<<<<<<<<<<< + * self._check_closed() + * svalue = PyUnicode_AsUTF8String(value) + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10Connection_7charset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6oursql_10Connection_7charset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_7charset_2__set__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10Connection_7charset_2__set__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_v_svalue = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "oursqlx/connection.pyx":257 + * return self._charset + * def __set__(self, value): + * self._check_closed() # <<<<<<<<<<<<<< + * svalue = PyUnicode_AsUTF8String(value) + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 257, __pyx_L1_error) + + /* "oursqlx/connection.pyx":258 + * def __set__(self, value): + * self._check_closed() + * svalue = PyUnicode_AsUTF8String(value) # <<<<<<<<<<<<<< + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): + * self._raise_error() + */ + __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_svalue = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":259 + * self._check_closed() + * svalue = PyUnicode_AsUTF8String(value) + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): # <<<<<<<<<<<<<< + * self._raise_error() + * self._charset_bytes = svalue + */ + __pyx_t_3 = (mysql_set_character_set(__pyx_v_self->conn, PyBytes_AS_STRING(__pyx_v_svalue)) != 0); + if (__pyx_t_3) { + + /* "oursqlx/connection.pyx":260 + * svalue = PyUnicode_AsUTF8String(value) + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): + * self._raise_error() # <<<<<<<<<<<<<< + * self._charset_bytes = svalue + * self._charset = value + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 260, __pyx_L1_error) + + /* "oursqlx/connection.pyx":259 + * self._check_closed() + * svalue = PyUnicode_AsUTF8String(value) + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): # <<<<<<<<<<<<<< + * self._raise_error() + * self._charset_bytes = svalue + */ + } + + /* "oursqlx/connection.pyx":261 + * if mysql_set_character_set(self.conn, PyBytes_AS_STRING(svalue)): + * self._raise_error() + * self._charset_bytes = svalue # <<<<<<<<<<<<<< + * self._charset = value + * + */ + __Pyx_INCREF(__pyx_v_svalue); + __Pyx_GIVEREF(__pyx_v_svalue); + __Pyx_GOTREF(__pyx_v_self->_charset_bytes); + __Pyx_DECREF(__pyx_v_self->_charset_bytes); + __pyx_v_self->_charset_bytes = __pyx_v_svalue; + + /* "oursqlx/connection.pyx":262 + * self._raise_error() + * self._charset_bytes = svalue + * self._charset = value # <<<<<<<<<<<<<< + * + * cdef object _decode_char_p(self, const_char *value): + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_charset); + __Pyx_DECREF(__pyx_v_self->_charset); + __pyx_v_self->_charset = __pyx_v_value; + + /* "oursqlx/connection.pyx":256 + * PyBytes_GET_SIZE(self._charset_bytes)) + * return self._charset + * def __set__(self, value): # <<<<<<<<<<<<<< + * self._check_closed() + * svalue = PyUnicode_AsUTF8String(value) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql.Connection.charset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_svalue); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":264 + * self._charset = value + * + * cdef object _decode_char_p(self, const_char *value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = strlen(value) + * return PyUnicode_Decode(value, length, + */ + +static PyObject *__pyx_f_6oursql_10Connection__decode_char_p(struct __pyx_obj_6oursql_Connection *__pyx_v_self, const char *__pyx_v_value) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_decode_char_p", 0); + + /* "oursqlx/connection.pyx":265 + * + * cdef object _decode_char_p(self, const_char *value): + * cdef Py_ssize_t length = strlen(value) # <<<<<<<<<<<<<< + * return PyUnicode_Decode(value, length, + * PyBytes_AS_STRING(self._charset_bytes), "strict") + */ + __pyx_v_length = strlen(__pyx_v_value); + + /* "oursqlx/connection.pyx":266 + * cdef object _decode_char_p(self, const_char *value): + * cdef Py_ssize_t length = strlen(value) + * return PyUnicode_Decode(value, length, # <<<<<<<<<<<<<< + * PyBytes_AS_STRING(self._charset_bytes), "strict") + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "oursqlx/connection.pyx":267 + * cdef Py_ssize_t length = strlen(value) + * return PyUnicode_Decode(value, length, + * PyBytes_AS_STRING(self._charset_bytes), "strict") # <<<<<<<<<<<<<< + * + * def warning_count(self): + */ + __pyx_t_1 = __pyx_v_self->_charset_bytes; + __Pyx_INCREF(__pyx_t_1); + + /* "oursqlx/connection.pyx":266 + * cdef object _decode_char_p(self, const_char *value): + * cdef Py_ssize_t length = strlen(value) + * return PyUnicode_Decode(value, length, # <<<<<<<<<<<<<< + * PyBytes_AS_STRING(self._charset_bytes), "strict") + * + */ + __pyx_t_2 = PyUnicode_Decode(__pyx_v_value, __pyx_v_length, PyBytes_AS_STRING(__pyx_t_1), ((char *)"strict")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":264 + * self._charset = value + * + * cdef object _decode_char_p(self, const_char *value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = strlen(value) + * return PyUnicode_Decode(value, length, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql.Connection._decode_char_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":269 + * PyBytes_AS_STRING(self._charset_bytes), "strict") + * + * def warning_count(self): # <<<<<<<<<<<<<< + * """warning_count() -> int + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_15warning_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_10Connection_14warning_count[] = "warning_count() -> int\n \n Return the number of warnings caused by the most-previously-executed\n query or statement.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_15warning_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("warning_count (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_14warning_count(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_14warning_count(struct __pyx_obj_6oursql_Connection *__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("warning_count", 0); + + /* "oursqlx/connection.pyx":275 + * query or statement. + * """ + * return mysql_warning_count(self.conn) # <<<<<<<<<<<<<< + * + * def cursor(self, cursor_class=None, **kwargs): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(mysql_warning_count(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":269 + * PyBytes_AS_STRING(self._charset_bytes), "strict") + * + * def warning_count(self): # <<<<<<<<<<<<<< + * """warning_count() -> int + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.warning_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":277 + * return mysql_warning_count(self.conn) + * + * def cursor(self, cursor_class=None, **kwargs): # <<<<<<<<<<<<<< + * """cursor([cursor_class,] **cursor_options) -> Cursor. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_17cursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_10Connection_16cursor[] = "cursor([cursor_class,] **cursor_options) -> Cursor.\n \n Create a new cursor associated with this connection of the specified \n type. If no cursor class is specified, the 'default_cursor' attribute\n is used as the cursor class. The cursor_options will be forwarded to \n the cursor's initializer; see the documentation for the cursor classes \n for details.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_17cursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cursor_class = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cursor (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cursor_class,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + 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); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cursor_class); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "cursor") < 0)) __PYX_ERR(2, 277, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cursor_class = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cursor", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("oursql.Connection.cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10Connection_16cursor(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), __pyx_v_cursor_class, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_16cursor(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_cursor_class, PyObject *__pyx_v_kwargs) { + 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cursor", 0); + __Pyx_INCREF(__pyx_v_cursor_class); + + /* "oursqlx/connection.pyx":286 + * for details. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * if cursor_class is None: + * cursor_class = self.default_cursor + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 286, __pyx_L1_error) + + /* "oursqlx/connection.pyx":287 + * """ + * self._check_closed() + * if cursor_class is None: # <<<<<<<<<<<<<< + * cursor_class = self.default_cursor + * return cursor_class(self, **kwargs) + */ + __pyx_t_2 = (__pyx_v_cursor_class == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "oursqlx/connection.pyx":288 + * self._check_closed() + * if cursor_class is None: + * cursor_class = self.default_cursor # <<<<<<<<<<<<<< + * return cursor_class(self, **kwargs) + * + */ + __pyx_t_4 = __pyx_v_self->default_cursor; + __Pyx_INCREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_cursor_class, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":287 + * """ + * self._check_closed() + * if cursor_class is None: # <<<<<<<<<<<<<< + * cursor_class = self.default_cursor + * return cursor_class(self, **kwargs) + */ + } + + /* "oursqlx/connection.pyx":289 + * if cursor_class is None: + * cursor_class = self.default_cursor + * return cursor_class(self, **kwargs) # <<<<<<<<<<<<<< + * + * property server_info: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_cursor_class, __pyx_t_4, __pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":277 + * return mysql_warning_count(self.conn) + * + * def cursor(self, cursor_class=None, **kwargs): # <<<<<<<<<<<<<< + * """cursor([cursor_class,] **cursor_options) -> Cursor. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.Connection.cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cursor_class); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":292 + * + * property server_info: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef const_char *info + * self._check_closed() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_11server_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_11server_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_11server_info___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_11server_info___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/connection.pyx":294 + * def __get__(self): + * cdef const_char *info + * self._check_closed() # <<<<<<<<<<<<<< + * self.charset + * return self._decode_char_p(mysql_get_server_info(self.conn)) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 294, __pyx_L1_error) + + /* "oursqlx/connection.pyx":295 + * cdef const_char *info + * self._check_closed() + * self.charset # <<<<<<<<<<<<<< + * return self._decode_char_p(mysql_get_server_info(self.conn)) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/connection.pyx":296 + * self._check_closed() + * self.charset + * return self._decode_char_p(mysql_get_server_info(self.conn)) # <<<<<<<<<<<<<< + * + * property ssl_cipher: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_decode_char_p(__pyx_v_self, mysql_get_server_info(__pyx_v_self->conn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":292 + * + * property server_info: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef const_char *info + * self._check_closed() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql.Connection.server_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":299 + * + * property ssl_cipher: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef const_char *res + * self._check_closed() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_10ssl_cipher_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_10ssl_cipher_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_10ssl_cipher___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_10ssl_cipher___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + const char *__pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/connection.pyx":301 + * def __get__(self): + * cdef const_char *res + * self._check_closed() # <<<<<<<<<<<<<< + * res = mysql_get_ssl_cipher(self.conn) + * if not res: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 301, __pyx_L1_error) + + /* "oursqlx/connection.pyx":302 + * cdef const_char *res + * self._check_closed() + * res = mysql_get_ssl_cipher(self.conn) # <<<<<<<<<<<<<< + * if not res: + * return None + */ + __pyx_v_res = mysql_get_ssl_cipher(__pyx_v_self->conn); + + /* "oursqlx/connection.pyx":303 + * self._check_closed() + * res = mysql_get_ssl_cipher(self.conn) + * if not res: # <<<<<<<<<<<<<< + * return None + * self.charset + */ + __pyx_t_2 = ((!(__pyx_v_res != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/connection.pyx":304 + * res = mysql_get_ssl_cipher(self.conn) + * if not res: + * return None # <<<<<<<<<<<<<< + * self.charset + * return self._decode_char_p(res) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/connection.pyx":303 + * self._check_closed() + * res = mysql_get_ssl_cipher(self.conn) + * if not res: # <<<<<<<<<<<<<< + * return None + * self.charset + */ + } + + /* "oursqlx/connection.pyx":305 + * if not res: + * return None + * self.charset # <<<<<<<<<<<<<< + * return self._decode_char_p(res) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/connection.pyx":306 + * return None + * self.charset + * return self._decode_char_p(res) # <<<<<<<<<<<<<< + * + * # Unless someone is monkeying around with calling __enter__ and __exit__ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->__pyx_vtab)->_decode_char_p(__pyx_v_self, __pyx_v_res); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":299 + * + * property ssl_cipher: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef const_char *res + * self._check_closed() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Connection.ssl_cipher.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":310 + * # Unless someone is monkeying around with calling __enter__ and __exit__ + * # manually, this approach is the simplest. Yaaay mostly-reentrant code. + * def __enter__(self): # <<<<<<<<<<<<<< + * curs = self.cursor() + * self._context_cursors.append(curs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_19__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_19__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_18__enter__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_18__enter__(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_v_curs = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__enter__", 0); + + /* "oursqlx/connection.pyx":311 + * # manually, this approach is the simplest. Yaaay mostly-reentrant code. + * def __enter__(self): + * curs = self.cursor() # <<<<<<<<<<<<<< + * self._context_cursors.append(curs) + * return curs.__enter__() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cursor); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_curs = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":312 + * def __enter__(self): + * curs = self.cursor() + * self._context_cursors.append(curs) # <<<<<<<<<<<<<< + * return curs.__enter__() + * + */ + __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_self->_context_cursors, __pyx_v_curs); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 312, __pyx_L1_error) + + /* "oursqlx/connection.pyx":313 + * curs = self.cursor() + * self._context_cursors.append(curs) + * return curs.__enter__() # <<<<<<<<<<<<<< + * + * def __exit__(self, exc, value, tb): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_curs, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":310 + * # Unless someone is monkeying around with calling __enter__ and __exit__ + * # manually, this approach is the simplest. Yaaay mostly-reentrant code. + * def __enter__(self): # <<<<<<<<<<<<<< + * curs = self.cursor() + * self._context_cursors.append(curs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Connection.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_curs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":315 + * return curs.__enter__() + * + * def __exit__(self, exc, value, tb): # <<<<<<<<<<<<<< + * curs = self._context_cursors.pop() + * curs.__exit__(exc, value, tb) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_21__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_21__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exc = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(2, 315, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(2, 315, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(2, 315, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_exc = values[0]; + __pyx_v_value = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 315, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Connection.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10Connection_20__exit__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), __pyx_v_exc, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_20__exit__(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_v_curs = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__exit__", 0); + + /* "oursqlx/connection.pyx":316 + * + * def __exit__(self, exc, value, tb): + * curs = self._context_cursors.pop() # <<<<<<<<<<<<<< + * curs.__exit__(exc, value, tb) + * + */ + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->_context_cursors); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_curs = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":317 + * def __exit__(self, exc, value, tb): + * curs = self._context_cursors.pop() + * curs.__exit__(exc, value, tb) # <<<<<<<<<<<<<< + * + * # FML. + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_curs, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_exc, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_exc, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_exc); + __Pyx_GIVEREF(__pyx_v_exc); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_exc); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":315 + * return curs.__enter__() + * + * def __exit__(self, exc, value, tb): # <<<<<<<<<<<<<< + * curs = self._context_cursors.pop() + * curs.__exit__(exc, value, tb) + */ + + /* function exit code */ + __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_5); + __Pyx_AddTraceback("oursql.Connection.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_curs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":320 + * + * # FML. + * def _escape_string(self, value): # <<<<<<<<<<<<<< + * """_escape_string(value) -> str. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_23_escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6oursql_10Connection_22_escape_string[] = "_escape_string(value) -> str.\n \n A wrapper around mysql_real_escape_string. Takes a bytestring in and \n produces a bytestring out. Please do not every use this unless mysql\n refuses to parameterize a query; oursql has good support for \n parameterization which also works consistently with unicode.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_23_escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_escape_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_22_escape_string(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_22_escape_string(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_escape_string", 0); + + /* "oursqlx/connection.pyx":328 + * parameterization which also works consistently with unicode. + * """ + * return _oursqlx_escape_string(self.conn, value) # <<<<<<<<<<<<<< + * + * def _escape_unicode_string(self, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = _oursqlx_escape_string(__pyx_v_self->conn, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":320 + * + * # FML. + * def _escape_string(self, value): # <<<<<<<<<<<<<< + * """_escape_string(value) -> str. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection._escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":330 + * return _oursqlx_escape_string(self.conn, value) + * + * def _escape_unicode_string(self, value): # <<<<<<<<<<<<<< + * """_escape_unicode_stirng(value) -> unicode. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_25_escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6oursql_10Connection_24_escape_unicode_string[] = "_escape_unicode_stirng(value) -> unicode.\n \n _escape_string that takes unicode in and produces unicode out, using\n the connection's charset. As with _escape_string, please do not use \n this function.\n "; +static PyObject *__pyx_pw_6oursql_10Connection_25_escape_unicode_string(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_escape_unicode_string (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_24_escape_unicode_string(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_24_escape_unicode_string(struct __pyx_obj_6oursql_Connection *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_v_charset = 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("_escape_unicode_string", 0); + + /* "oursqlx/connection.pyx":337 + * this function. + * """ + * charset = self.charset # <<<<<<<<<<<<<< + * return self._escape_string(value.encode(charset)).decode(charset) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_charset = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":338 + * """ + * charset = self.charset + * return self._escape_string(value.encode(charset)).decode(charset) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_charset); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_charset); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/connection.pyx":330 + * return _oursqlx_escape_string(self.conn, value) + * + * def _escape_unicode_string(self, value): # <<<<<<<<<<<<<< + * """_escape_unicode_stirng(value) -> unicode. + * + */ + + /* function exit code */ + __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("oursql.Connection._escape_unicode_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_charset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":73 + * cdef MYSQL *conn + * cdef object _charset, _charset_bytes, _context_cursors + * cdef readonly int use_unicode, autoping, raise_on_warnings # <<<<<<<<<<<<<< + * cdef public object default_cursor + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_11use_unicode_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_11use_unicode_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_11use_unicode___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_11use_unicode___get__(struct __pyx_obj_6oursql_Connection *__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 = __Pyx_PyInt_From_int(__pyx_v_self->use_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.use_unicode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_8autoping_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_8autoping_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_8autoping___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_8autoping___get__(struct __pyx_obj_6oursql_Connection *__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 = __Pyx_PyInt_From_int(__pyx_v_self->autoping); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.autoping.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_17raise_on_warnings_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_17raise_on_warnings_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_17raise_on_warnings___get__(struct __pyx_obj_6oursql_Connection *__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 = __Pyx_PyInt_From_int(__pyx_v_self->raise_on_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.raise_on_warnings.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/connection.pyx":74 + * cdef object _charset, _charset_bytes, _context_cursors + * cdef readonly int use_unicode, autoping, raise_on_warnings + * cdef public object default_cursor # <<<<<<<<<<<<<< + * + * def __cinit__(self, host=None, user=None, passwd=None, *, db=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_14default_cursor_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_14default_cursor_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_14default_cursor___get__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_14default_cursor___get__(struct __pyx_obj_6oursql_Connection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->default_cursor); + __pyx_r = __pyx_v_self->default_cursor; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10Connection_14default_cursor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6oursql_10Connection_14default_cursor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_14default_cursor_2__set__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10Connection_14default_cursor_2__set__(struct __pyx_obj_6oursql_Connection *__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->default_cursor); + __Pyx_DECREF(__pyx_v_self->default_cursor); + __pyx_v_self->default_cursor = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10Connection_14default_cursor_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6oursql_10Connection_14default_cursor_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_14default_cursor_4__del__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10Connection_14default_cursor_4__del__(struct __pyx_obj_6oursql_Connection *__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->default_cursor); + __Pyx_DECREF(__pyx_v_self->default_cursor); + __pyx_v_self->default_cursor = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_26__reduce_cython__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Connection *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10Connection_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_10Connection_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10Connection_28__setstate_cython__(((struct __pyx_obj_6oursql_Connection *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10Connection_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Connection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Connection.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":9 + * + * cdef class _AbstractIterWrapper: + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_1__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_1__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_AbstractIterWrapper___iter__(((struct __pyx_obj_6oursql__AbstractIterWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper___iter__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "oursqlx/statement.pyx":10 + * cdef class _AbstractIterWrapper: + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * cdef class _BinaryWhateverMixin: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":9 + * + * cdef class _AbstractIterWrapper: + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_AbstractIterWrapper_2__reduce_cython__(((struct __pyx_obj_6oursql__AbstractIterWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper_2__reduce_cython__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = () # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_v_state = __pyx_empty_tuple; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = () + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__AbstractIterWrap); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, None), state + * else: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__AbstractIterWrapper__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__AbstractIterWrap); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._AbstractIterWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__AbstractIterWrapper__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_AbstractIterWrapper_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_AbstractIterWrapper_4__setstate_cython__(((struct __pyx_obj_6oursql__AbstractIterWrapper *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_AbstractIterWrapper_4__setstate_cython__(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__AbstractIterWrapper__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6oursql___pyx_unpickle__AbstractIterWrapper__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle__AbstractIterWrapper, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__AbstractIterWrapper__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._AbstractIterWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":13 + * + * cdef class _BinaryWhateverMixin: + * def __next__(self): # <<<<<<<<<<<<<< + * ret = super(BinaryFileWrapper, self).next() + * return ret + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_BinaryWhateverMixin___next__(((struct __pyx_obj_6oursql__BinaryWhateverMixin *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin___next__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "oursqlx/statement.pyx":14 + * cdef class _BinaryWhateverMixin: + * def __next__(self): + * ret = super(BinaryFileWrapper, self).next() # <<<<<<<<<<<<<< + * return ret + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BinaryFileWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_ret = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":15 + * def __next__(self): + * ret = super(BinaryFileWrapper, self).next() + * return ret # <<<<<<<<<<<<<< + * + * cdef class IterWrapper(_AbstractIterWrapper): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":13 + * + * cdef class _BinaryWhateverMixin: + * def __next__(self): # <<<<<<<<<<<<<< + * ret = super(BinaryFileWrapper, self).next() + * return ret + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._BinaryWhateverMixin.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_BinaryWhateverMixin_2__reduce_cython__(((struct __pyx_obj_6oursql__BinaryWhateverMixin *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin_2__reduce_cython__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = () # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_v_state = __pyx_empty_tuple; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = () + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = () + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__BinaryWhateverMi); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, None), state + * else: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__BinaryWhateverMixin__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__BinaryWhateverMi); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_222419149); + __Pyx_GIVEREF(__pyx_int_222419149); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._BinaryWhateverMixin.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__BinaryWhateverMixin__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_20_BinaryWhateverMixin_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_20_BinaryWhateverMixin_4__setstate_cython__(((struct __pyx_obj_6oursql__BinaryWhateverMixin *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20_BinaryWhateverMixin_4__setstate_cython__(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__BinaryWhateverMixin__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6oursql___pyx_unpickle__BinaryWhateverMixin__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle__BinaryWhateverMixin, (type(self), 0xd41d8cd, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__BinaryWhateverMixin__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._BinaryWhateverMixin.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":28 + * cdef object iterobj, nextfunc + * + * def __cinit__(self, iterobj): # <<<<<<<<<<<<<< + * self.iterobj = iter(iterobj) + * self.nextfunc = self.iterobj.next + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_11IterWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_11IterWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_iterobj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iterobj,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); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterobj)) != 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, "__cinit__") < 0)) __PYX_ERR(4, 28, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_iterobj = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 28, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.IterWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_11IterWrapper___cinit__(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self), __pyx_v_iterobj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_11IterWrapper___cinit__(struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self, PyObject *__pyx_v_iterobj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "oursqlx/statement.pyx":29 + * + * def __cinit__(self, iterobj): + * self.iterobj = iter(iterobj) # <<<<<<<<<<<<<< + * self.nextfunc = self.iterobj.next + * + */ + __pyx_t_1 = PyObject_GetIter(__pyx_v_iterobj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->iterobj); + __Pyx_DECREF(__pyx_v_self->iterobj); + __pyx_v_self->iterobj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":30 + * def __cinit__(self, iterobj): + * self.iterobj = iter(iterobj) + * self.nextfunc = self.iterobj.next # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->iterobj, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->nextfunc); + __Pyx_DECREF(__pyx_v_self->nextfunc); + __pyx_v_self->nextfunc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":28 + * cdef object iterobj, nextfunc + * + * def __cinit__(self, iterobj): # <<<<<<<<<<<<<< + * self.iterobj = iter(iterobj) + * self.nextfunc = self.iterobj.next + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.IterWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":32 + * self.nextfunc = self.iterobj.next + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self.nextfunc() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11IterWrapper_3__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_11IterWrapper_3__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11IterWrapper_2__next__(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11IterWrapper_2__next__(struct __pyx_obj_6oursql_IterWrapper *__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("__next__", 0); + + /* "oursqlx/statement.pyx":33 + * + * def __next__(self): + * return self.nextfunc() # <<<<<<<<<<<<<< + * + * BinaryIterWrapper = type('BinaryIterWrapper', + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->nextfunc); + __pyx_t_2 = __pyx_v_self->nextfunc; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":32 + * self.nextfunc = self.iterobj.next + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self.nextfunc() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.IterWrapper.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11IterWrapper_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_11IterWrapper_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11IterWrapper_4__reduce_cython__(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11IterWrapper_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_IterWrapper *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.IterWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11IterWrapper_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_11IterWrapper_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11IterWrapper_6__setstate_cython__(((struct __pyx_obj_6oursql_IterWrapper *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11IterWrapper_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_IterWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.IterWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":59 + * cdef int doclose, done + * + * def __cinit__(self, fileobj, chunksize=8192, bint doclose=False): # <<<<<<<<<<<<<< + * self.fileobj = fileobj + * self.readfunc = fileobj.read + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_11FileWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_11FileWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileobj = 0; + PyObject *__pyx_v_chunksize = 0; + int __pyx_v_doclose; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileobj,&__pyx_n_s_chunksize,&__pyx_n_s_doclose,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_8192); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileobj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunksize); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doclose); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 59, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileobj = values[0]; + __pyx_v_chunksize = values[1]; + if (values[2]) { + __pyx_v_doclose = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_doclose == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 59, __pyx_L3_error) + } else { + __pyx_v_doclose = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 59, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.FileWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_11FileWrapper___cinit__(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self), __pyx_v_fileobj, __pyx_v_chunksize, __pyx_v_doclose); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_11FileWrapper___cinit__(struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self, PyObject *__pyx_v_fileobj, PyObject *__pyx_v_chunksize, int __pyx_v_doclose) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "oursqlx/statement.pyx":60 + * + * def __cinit__(self, fileobj, chunksize=8192, bint doclose=False): + * self.fileobj = fileobj # <<<<<<<<<<<<<< + * self.readfunc = fileobj.read + * self.chunksize = chunksize + */ + __Pyx_INCREF(__pyx_v_fileobj); + __Pyx_GIVEREF(__pyx_v_fileobj); + __Pyx_GOTREF(__pyx_v_self->fileobj); + __Pyx_DECREF(__pyx_v_self->fileobj); + __pyx_v_self->fileobj = __pyx_v_fileobj; + + /* "oursqlx/statement.pyx":61 + * def __cinit__(self, fileobj, chunksize=8192, bint doclose=False): + * self.fileobj = fileobj + * self.readfunc = fileobj.read # <<<<<<<<<<<<<< + * self.chunksize = chunksize + * self.doclose = doclose + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fileobj, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->readfunc); + __Pyx_DECREF(__pyx_v_self->readfunc); + __pyx_v_self->readfunc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":62 + * self.fileobj = fileobj + * self.readfunc = fileobj.read + * self.chunksize = chunksize # <<<<<<<<<<<<<< + * self.doclose = doclose + * self.done = False + */ + __Pyx_INCREF(__pyx_v_chunksize); + __Pyx_GIVEREF(__pyx_v_chunksize); + __Pyx_GOTREF(__pyx_v_self->chunksize); + __Pyx_DECREF(__pyx_v_self->chunksize); + __pyx_v_self->chunksize = __pyx_v_chunksize; + + /* "oursqlx/statement.pyx":63 + * self.readfunc = fileobj.read + * self.chunksize = chunksize + * self.doclose = doclose # <<<<<<<<<<<<<< + * self.done = False + * + */ + __pyx_v_self->doclose = __pyx_v_doclose; + + /* "oursqlx/statement.pyx":64 + * self.chunksize = chunksize + * self.doclose = doclose + * self.done = False # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __pyx_v_self->done = 0; + + /* "oursqlx/statement.pyx":59 + * cdef int doclose, done + * + * def __cinit__(self, fileobj, chunksize=8192, bint doclose=False): # <<<<<<<<<<<<<< + * self.fileobj = fileobj + * self.readfunc = fileobj.read + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.FileWrapper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":66 + * self.done = False + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self.done: + * raise StopIteration + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11FileWrapper_3__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_11FileWrapper_3__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11FileWrapper_2__next__(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11FileWrapper_2__next__(struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "oursqlx/statement.pyx":67 + * + * def __next__(self): + * if self.done: # <<<<<<<<<<<<<< + * raise StopIteration + * ret = self.readfunc(self.chunksize) + */ + __pyx_t_1 = (__pyx_v_self->done != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":68 + * def __next__(self): + * if self.done: + * raise StopIteration # <<<<<<<<<<<<<< + * ret = self.readfunc(self.chunksize) + * if not ret: + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + __PYX_ERR(4, 68, __pyx_L1_error) + + /* "oursqlx/statement.pyx":67 + * + * def __next__(self): + * if self.done: # <<<<<<<<<<<<<< + * raise StopIteration + * ret = self.readfunc(self.chunksize) + */ + } + + /* "oursqlx/statement.pyx":69 + * if self.done: + * raise StopIteration + * ret = self.readfunc(self.chunksize) # <<<<<<<<<<<<<< + * if not ret: + * if self.doclose: + */ + __Pyx_INCREF(__pyx_v_self->readfunc); + __pyx_t_3 = __pyx_v_self->readfunc; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->chunksize) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->chunksize); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_ret = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/statement.pyx":70 + * raise StopIteration + * ret = self.readfunc(self.chunksize) + * if not ret: # <<<<<<<<<<<<<< + * if self.doclose: + * self.fileobj.close() + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 70, __pyx_L1_error) + __pyx_t_5 = ((!__pyx_t_1) != 0); + if (__pyx_t_5) { + + /* "oursqlx/statement.pyx":71 + * ret = self.readfunc(self.chunksize) + * if not ret: + * if self.doclose: # <<<<<<<<<<<<<< + * self.fileobj.close() + * self.done = True + */ + __pyx_t_5 = (__pyx_v_self->doclose != 0); + if (__pyx_t_5) { + + /* "oursqlx/statement.pyx":72 + * if not ret: + * if self.doclose: + * self.fileobj.close() # <<<<<<<<<<<<<< + * self.done = True + * raise StopIteration + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fileobj, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/statement.pyx":71 + * ret = self.readfunc(self.chunksize) + * if not ret: + * if self.doclose: # <<<<<<<<<<<<<< + * self.fileobj.close() + * self.done = True + */ + } + + /* "oursqlx/statement.pyx":73 + * if self.doclose: + * self.fileobj.close() + * self.done = True # <<<<<<<<<<<<<< + * raise StopIteration + * return ret + */ + __pyx_v_self->done = 1; + + /* "oursqlx/statement.pyx":74 + * self.fileobj.close() + * self.done = True + * raise StopIteration # <<<<<<<<<<<<<< + * return ret + * + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + __PYX_ERR(4, 74, __pyx_L1_error) + + /* "oursqlx/statement.pyx":70 + * raise StopIteration + * ret = self.readfunc(self.chunksize) + * if not ret: # <<<<<<<<<<<<<< + * if self.doclose: + * self.fileobj.close() + */ + } + + /* "oursqlx/statement.pyx":75 + * self.done = True + * raise StopIteration + * return ret # <<<<<<<<<<<<<< + * + * BinaryFileWrapper = type('BinaryFileWrapper', + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":66 + * self.done = False + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self.done: + * raise StopIteration + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.FileWrapper.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11FileWrapper_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_11FileWrapper_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11FileWrapper_4__reduce_cython__(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11FileWrapper_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_FileWrapper *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.FileWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_11FileWrapper_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_11FileWrapper_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_11FileWrapper_6__setstate_cython__(((struct __pyx_obj_6oursql_FileWrapper *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_11FileWrapper_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_FileWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.FileWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":101 + * cdef public object warnings + * + * def __cinit__(self, Connection connection not None, # <<<<<<<<<<<<<< + * unsigned long string_limit=0, bint show_table=False, **kwargs): + * self.conn = connection + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_Statement_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_10_Statement_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6oursql_Connection *__pyx_v_connection = 0; + unsigned long __pyx_v_string_limit; + int __pyx_v_show_table; + CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,&__pyx_n_s_string_limit,&__pyx_n_s_show_table,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connection)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string_limit); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show_table); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 101, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_connection = ((struct __pyx_obj_6oursql_Connection *)values[0]); + if (values[1]) { + __pyx_v_string_limit = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_string_limit == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(4, 102, __pyx_L3_error) + } else { + __pyx_v_string_limit = ((unsigned long)0); + } + if (values[2]) { + __pyx_v_show_table = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_show_table == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 102, __pyx_L3_error) + } else { + + /* "oursqlx/statement.pyx":102 + * + * def __cinit__(self, Connection connection not None, + * unsigned long string_limit=0, bint show_table=False, **kwargs): # <<<<<<<<<<<<<< + * self.conn = connection + * self.stmt = mysql_stmt_init(self.conn.conn) + */ + __pyx_v_show_table = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 101, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("oursql._Statement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_connection), __pyx_ptype_6oursql_Connection, 0, "connection", 0))) __PYX_ERR(4, 101, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_10_Statement___cinit__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), __pyx_v_connection, __pyx_v_string_limit, __pyx_v_show_table, __pyx_v_kwargs); + + /* "oursqlx/statement.pyx":101 + * cdef public object warnings + * + * def __cinit__(self, Connection connection not None, # <<<<<<<<<<<<<< + * unsigned long string_limit=0, bint show_table=False, **kwargs): + * self.conn = connection + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_Statement___cinit__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_connection, unsigned long __pyx_v_string_limit, int __pyx_v_show_table, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "oursqlx/statement.pyx":103 + * def __cinit__(self, Connection connection not None, + * unsigned long string_limit=0, bint show_table=False, **kwargs): + * self.conn = connection # <<<<<<<<<<<<<< + * self.stmt = mysql_stmt_init(self.conn.conn) + * if not self.stmt: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_connection)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_connection)); + __Pyx_GOTREF(__pyx_v_self->conn); + __Pyx_DECREF(((PyObject *)__pyx_v_self->conn)); + __pyx_v_self->conn = __pyx_v_connection; + + /* "oursqlx/statement.pyx":104 + * unsigned long string_limit=0, bint show_table=False, **kwargs): + * self.conn = connection + * self.stmt = mysql_stmt_init(self.conn.conn) # <<<<<<<<<<<<<< + * if not self.stmt: + * raise MemoryError('alloc of statement failed') + */ + __pyx_v_self->stmt = mysql_stmt_init(__pyx_v_self->conn->conn); + + /* "oursqlx/statement.pyx":105 + * self.conn = connection + * self.stmt = mysql_stmt_init(self.conn.conn) + * if not self.stmt: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of statement failed') + * self.string_limit = string_limit + */ + __pyx_t_1 = ((!(__pyx_v_self->stmt != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":106 + * self.stmt = mysql_stmt_init(self.conn.conn) + * if not self.stmt: + * raise MemoryError('alloc of statement failed') # <<<<<<<<<<<<<< + * self.string_limit = string_limit + * self.show_table = show_table + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(4, 106, __pyx_L1_error) + + /* "oursqlx/statement.pyx":105 + * self.conn = connection + * self.stmt = mysql_stmt_init(self.conn.conn) + * if not self.stmt: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of statement failed') + * self.string_limit = string_limit + */ + } + + /* "oursqlx/statement.pyx":107 + * if not self.stmt: + * raise MemoryError('alloc of statement failed') + * self.string_limit = string_limit # <<<<<<<<<<<<<< + * self.show_table = show_table + * self.result_data = NULL + */ + __pyx_v_self->string_limit = __pyx_v_string_limit; + + /* "oursqlx/statement.pyx":108 + * raise MemoryError('alloc of statement failed') + * self.string_limit = string_limit + * self.show_table = show_table # <<<<<<<<<<<<<< + * self.result_data = NULL + * self.warnings = [] + */ + __pyx_v_self->show_table = __pyx_v_show_table; + + /* "oursqlx/statement.pyx":109 + * self.string_limit = string_limit + * self.show_table = show_table + * self.result_data = NULL # <<<<<<<<<<<<<< + * self.warnings = [] + * self.buffered = self.data_waiting = self.exhausted = False + */ + __pyx_v_self->result_data = NULL; + + /* "oursqlx/statement.pyx":110 + * self.show_table = show_table + * self.result_data = NULL + * self.warnings = [] # <<<<<<<<<<<<<< + * self.buffered = self.data_waiting = self.exhausted = False + * if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/statement.pyx":111 + * self.result_data = NULL + * self.warnings = [] + * self.buffered = self.data_waiting = self.exhausted = False # <<<<<<<<<<<<<< + * if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type): + * self._raise_error() + */ + __pyx_v_self->buffered = 0; + __pyx_v_self->data_waiting = 0; + __pyx_v_self->exhausted = 0; + + /* "oursqlx/statement.pyx":112 + * self.warnings = [] + * self.buffered = self.data_waiting = self.exhausted = False + * if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + __pyx_t_1 = (_oursqlx_init_stmt_cursor(__pyx_v_self->stmt, (&__pyx_v_self->cursor_type)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":113 + * self.buffered = self.data_waiting = self.exhausted = False + * if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type): + * self._raise_error() # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 113, __pyx_L1_error) + + /* "oursqlx/statement.pyx":112 + * self.warnings = [] + * self.buffered = self.data_waiting = self.exhausted = False + * if _oursqlx_init_stmt_cursor(self.stmt, &self.cursor_type): # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + } + + /* "oursqlx/statement.pyx":101 + * cdef public object warnings + * + * def __cinit__(self, Connection connection not None, # <<<<<<<<<<<<<< + * unsigned long string_limit=0, bint show_table=False, **kwargs): + * self.conn = connection + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._Statement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":115 + * self._raise_error() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * PyMem_Free(self.result_data) + */ + +/* Python wrapper */ +static void __pyx_pw_6oursql_10_Statement_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6oursql_10_Statement_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6oursql_10_Statement_2__dealloc__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6oursql_10_Statement_2__dealloc__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + __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("__dealloc__", 0); + + /* "oursqlx/statement.pyx":116 + * + * def __dealloc__(self): + * self.close() # <<<<<<<<<<<<<< + * PyMem_Free(self.result_data) + * PyMem_Free(self.bind) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":117 + * def __dealloc__(self): + * self.close() + * PyMem_Free(self.result_data) # <<<<<<<<<<<<<< + * PyMem_Free(self.bind) + * + */ + PyMem_Free(__pyx_v_self->result_data); + + /* "oursqlx/statement.pyx":118 + * self.close() + * PyMem_Free(self.result_data) + * PyMem_Free(self.bind) # <<<<<<<<<<<<<< + * + * def close(self): + */ + PyMem_Free(__pyx_v_self->bind); + + /* "oursqlx/statement.pyx":115 + * self._raise_error() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * PyMem_Free(self.result_data) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("oursql._Statement.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "oursqlx/statement.pyx":120 + * PyMem_Free(self.bind) + * + * def close(self): # <<<<<<<<<<<<<< + * if self.stmt: + * mysql_stmt_close(self.stmt) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_4close(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_4close(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("close", 0); + + /* "oursqlx/statement.pyx":121 + * + * def close(self): + * if self.stmt: # <<<<<<<<<<<<<< + * mysql_stmt_close(self.stmt) + * self.stmt = NULL + */ + __pyx_t_1 = (__pyx_v_self->stmt != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":122 + * def close(self): + * if self.stmt: + * mysql_stmt_close(self.stmt) # <<<<<<<<<<<<<< + * self.stmt = NULL + * + */ + mysql_stmt_close(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":123 + * if self.stmt: + * mysql_stmt_close(self.stmt) + * self.stmt = NULL # <<<<<<<<<<<<<< + * + * cdef int _raise_error(self) except -1: + */ + __pyx_v_self->stmt = NULL; + + /* "oursqlx/statement.pyx":121 + * + * def close(self): + * if self.stmt: # <<<<<<<<<<<<<< + * mysql_stmt_close(self.stmt) + * self.stmt = NULL + */ + } + + /* "oursqlx/statement.pyx":120 + * PyMem_Free(self.bind) + * + * def close(self): # <<<<<<<<<<<<<< + * if self.stmt: + * mysql_stmt_close(self.stmt) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":125 + * self.stmt = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * cdef int err = mysql_stmt_errno(self.stmt) + * # effect a sideeffect by looking up the charset, required for + */ + +static int __pyx_f_6oursql_10_Statement__raise_error(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + int __pyx_v_err; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_raise_error", 0); + + /* "oursqlx/statement.pyx":126 + * + * cdef int _raise_error(self) except -1: + * cdef int err = mysql_stmt_errno(self.stmt) # <<<<<<<<<<<<<< + * # effect a sideeffect by looking up the charset, required for + * # _decode_char_p + */ + __pyx_v_err = mysql_stmt_errno(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":129 + * # effect a sideeffect by looking up the charset, required for + * # _decode_char_p + * self.conn.charset # <<<<<<<<<<<<<< + * raise _exception_from_errno(err)( + * self.conn._decode_char_p(mysql_stmt_error(self.stmt)), err) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":130 + * # _decode_char_p + * self.conn.charset + * raise _exception_from_errno(err)( # <<<<<<<<<<<<<< + * self.conn._decode_char_p(mysql_stmt_error(self.stmt)), err) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exception_from_errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":131 + * self.conn.charset + * raise _exception_from_errno(err)( + * self.conn._decode_char_p(mysql_stmt_error(self.stmt)), err) # <<<<<<<<<<<<<< + * + * cdef int _check_closed(self) except -1: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->conn->__pyx_vtab)->_decode_char_p(__pyx_v_self->conn, mysql_stmt_error(__pyx_v_self->stmt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(4, 130, __pyx_L1_error) + + /* "oursqlx/statement.pyx":125 + * self.stmt = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * cdef int err = mysql_stmt_errno(self.stmt) + * # effect a sideeffect by looking up the charset, required for + */ + + /* function exit code */ + __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_7); + __Pyx_AddTraceback("oursql._Statement._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":133 + * self.conn._decode_char_p(mysql_stmt_error(self.stmt)), err) + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * if self.stmt: + */ + +static int __pyx_f_6oursql_10_Statement__check_closed(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_closed", 0); + + /* "oursqlx/statement.pyx":134 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * if self.stmt: + * self.close() + */ + __pyx_t_1 = ((!(__pyx_v_self->conn->conn != 0)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":135 + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: + * if self.stmt: # <<<<<<<<<<<<<< + * self.close() + * raise ProgrammingError('connection closed') + */ + __pyx_t_1 = (__pyx_v_self->stmt != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":136 + * if not self.conn.conn: + * if self.stmt: + * self.close() # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * if not self.stmt: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/statement.pyx":135 + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: + * if self.stmt: # <<<<<<<<<<<<<< + * self.close() + * raise ProgrammingError('connection closed') + */ + } + + /* "oursqlx/statement.pyx":137 + * if self.stmt: + * self.close() + * raise ProgrammingError('connection closed') # <<<<<<<<<<<<<< + * if not self.stmt: + * raise ProgrammingError('statement closed') + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_connection_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_connection_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(4, 137, __pyx_L1_error) + + /* "oursqlx/statement.pyx":134 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * if self.stmt: + * self.close() + */ + } + + /* "oursqlx/statement.pyx":138 + * self.close() + * raise ProgrammingError('connection closed') + * if not self.stmt: # <<<<<<<<<<<<<< + * raise ProgrammingError('statement closed') + * + */ + __pyx_t_1 = ((!(__pyx_v_self->stmt != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":139 + * raise ProgrammingError('connection closed') + * if not self.stmt: + * raise ProgrammingError('statement closed') # <<<<<<<<<<<<<< + * + * property string_limit: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_statement_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_statement_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(4, 139, __pyx_L1_error) + + /* "oursqlx/statement.pyx":138 + * self.close() + * raise ProgrammingError('connection closed') + * if not self.stmt: # <<<<<<<<<<<<<< + * raise ProgrammingError('statement closed') + * + */ + } + + /* "oursqlx/statement.pyx":133 + * self.conn._decode_char_p(mysql_stmt_error(self.stmt)), err) + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * if self.stmt: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql._Statement._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":142 + * + * property string_limit: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.string_limit + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_12string_limit_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_12string_limit_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_12string_limit___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_12string_limit___get__(struct __pyx_obj_6oursql__Statement *__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); + + /* "oursqlx/statement.pyx":143 + * property string_limit: + * def __get__(self): + * return self.string_limit # <<<<<<<<<<<<<< + * + * def __set__(self, unsigned long value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->string_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":142 + * + * property string_limit: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.string_limit + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Statement.string_limit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":145 + * return self.string_limit + * + * def __set__(self, unsigned long value): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError('string limit must be >= 0') + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_Statement_12string_limit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6oursql_10_Statement_12string_limit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + unsigned long __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_unsigned_long(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(4, 145, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("oursql._Statement.string_limit.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10_Statement_12string_limit_2__set__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), ((unsigned long)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_Statement_12string_limit_2__set__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, unsigned long __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "oursqlx/statement.pyx":146 + * + * def __set__(self, unsigned long value): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError('string limit must be >= 0') + * self.string_limit = value + */ + __pyx_t_1 = ((__pyx_v_value < 0) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":147 + * def __set__(self, unsigned long value): + * if value < 0: + * raise ValueError('string limit must be >= 0') # <<<<<<<<<<<<<< + * self.string_limit = value + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(4, 147, __pyx_L1_error) + + /* "oursqlx/statement.pyx":146 + * + * def __set__(self, unsigned long value): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError('string limit must be >= 0') + * self.string_limit = value + */ + } + + /* "oursqlx/statement.pyx":148 + * if value < 0: + * raise ValueError('string limit must be >= 0') + * self.string_limit = value # <<<<<<<<<<<<<< + * + * def prepare(self, statement): + */ + __pyx_v_self->string_limit = __pyx_v_value; + + /* "oursqlx/statement.pyx":145 + * return self.string_limit + * + * def __set__(self, unsigned long value): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError('string limit must be >= 0') + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._Statement.string_limit.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":150 + * self.string_limit = value + * + * def prepare(self, statement): # <<<<<<<<<<<<<< + * cdef char *buf + * cdef Py_ssize_t bufsize + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_7prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_7prepare(PyObject *__pyx_v_self, PyObject *__pyx_v_statement) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prepare (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_6prepare(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), ((PyObject *)__pyx_v_statement)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_6prepare(struct __pyx_obj_6oursql__Statement *__pyx_v_self, PyObject *__pyx_v_statement) { + char *__pyx_v_buf; + Py_ssize_t __pyx_v_bufsize; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("prepare", 0); + __Pyx_INCREF(__pyx_v_statement); + + /* "oursqlx/statement.pyx":153 + * cdef char *buf + * cdef Py_ssize_t bufsize + * self._check_closed() # <<<<<<<<<<<<<< + * if self.data_waiting: + * raise ProgrammingError('binding this query would cause rows to ' + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 153, __pyx_L1_error) + + /* "oursqlx/statement.pyx":154 + * cdef Py_ssize_t bufsize + * self._check_closed() + * if self.data_waiting: # <<<<<<<<<<<<<< + * raise ProgrammingError('binding this query would cause rows to ' + * 'become unfetchable') + */ + __pyx_t_2 = (__pyx_v_self->data_waiting != 0); + if (unlikely(__pyx_t_2)) { + + /* "oursqlx/statement.pyx":155 + * self._check_closed() + * if self.data_waiting: + * raise ProgrammingError('binding this query would cause rows to ' # <<<<<<<<<<<<<< + * 'become unfetchable') + * statement = bytes_maybe_from_encoding( + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_binding_this_query_would_cause_r) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_binding_this_query_would_cause_r); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 155, __pyx_L1_error) + + /* "oursqlx/statement.pyx":154 + * cdef Py_ssize_t bufsize + * self._check_closed() + * if self.data_waiting: # <<<<<<<<<<<<<< + * raise ProgrammingError('binding this query would cause rows to ' + * 'become unfetchable') + */ + } + + /* "oursqlx/statement.pyx":158 + * 'become unfetchable') + * statement = bytes_maybe_from_encoding( + * statement, self.conn.charset, False) # <<<<<<<<<<<<<< + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) + * if mysql_stmt_prepare(self.stmt, buf, bufsize): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "oursqlx/statement.pyx":157 + * raise ProgrammingError('binding this query would cause rows to ' + * 'become unfetchable') + * statement = bytes_maybe_from_encoding( # <<<<<<<<<<<<<< + * statement, self.conn.charset, False) + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) + */ + __pyx_t_6.__pyx_n = 1; + __pyx_t_6.allow_none = 0; + __pyx_t_4 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_statement, __pyx_t_3, &__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_statement, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":159 + * statement = bytes_maybe_from_encoding( + * statement, self.conn.charset, False) + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) # <<<<<<<<<<<<<< + * if mysql_stmt_prepare(self.stmt, buf, bufsize): + * self._raise_error() + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_statement, (&__pyx_v_buf), (&__pyx_v_bufsize)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 159, __pyx_L1_error) + + /* "oursqlx/statement.pyx":160 + * statement, self.conn.charset, False) + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) + * if mysql_stmt_prepare(self.stmt, buf, bufsize): # <<<<<<<<<<<<<< + * self._raise_error() + * self._alloc_buffer() + */ + __pyx_t_2 = (__pyx_f_6oursql_mysql_stmt_prepare(__pyx_v_self->stmt, __pyx_v_buf, __pyx_v_bufsize) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":161 + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) + * if mysql_stmt_prepare(self.stmt, buf, bufsize): + * self._raise_error() # <<<<<<<<<<<<<< + * self._alloc_buffer() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 161, __pyx_L1_error) + + /* "oursqlx/statement.pyx":160 + * statement, self.conn.charset, False) + * PyBytes_AsStringAndSize(statement, &buf, &bufsize) + * if mysql_stmt_prepare(self.stmt, buf, bufsize): # <<<<<<<<<<<<<< + * self._raise_error() + * self._alloc_buffer() + */ + } + + /* "oursqlx/statement.pyx":162 + * if mysql_stmt_prepare(self.stmt, buf, bufsize): + * self._raise_error() + * self._alloc_buffer() # <<<<<<<<<<<<<< + * + * cdef int _alloc_buffer(self) except -1: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_alloc_buffer(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 162, __pyx_L1_error) + + /* "oursqlx/statement.pyx":150 + * self.string_limit = value + * + * def prepare(self, statement): # <<<<<<<<<<<<<< + * cdef char *buf + * cdef Py_ssize_t bufsize + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._Statement.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_statement); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":164 + * self._alloc_buffer() + * + * cdef int _alloc_buffer(self) except -1: # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * cdef MYSQL_BIND *bind = NULL + */ + +static int __pyx_f_6oursql_10_Statement__alloc_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + MYSQL_RES *__pyx_v_res; + MYSQL_BIND *__pyx_v_bind; + struct __pyx_t_6oursql_column_output *__pyx_v_result_data; + PyObject *__pyx_v_fields = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + unsigned int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_alloc_buffer", 0); + + /* "oursqlx/statement.pyx":166 + * cdef int _alloc_buffer(self) except -1: + * cdef MYSQL_RES *res + * cdef MYSQL_BIND *bind = NULL # <<<<<<<<<<<<<< + * cdef column_output *result_data = NULL + * res = mysql_stmt_result_metadata(self.stmt) + */ + __pyx_v_bind = NULL; + + /* "oursqlx/statement.pyx":167 + * cdef MYSQL_RES *res + * cdef MYSQL_BIND *bind = NULL + * cdef column_output *result_data = NULL # <<<<<<<<<<<<<< + * res = mysql_stmt_result_metadata(self.stmt) + * + */ + __pyx_v_result_data = NULL; + + /* "oursqlx/statement.pyx":168 + * cdef MYSQL_BIND *bind = NULL + * cdef column_output *result_data = NULL + * res = mysql_stmt_result_metadata(self.stmt) # <<<<<<<<<<<<<< + * + * # Okay so. MySQL doesn't require that we keep around the MYSQL_BIND + */ + __pyx_v_res = mysql_stmt_result_metadata(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":179 + * # So! Since we have no reason not to, we free any previously bound + * # buffers. + * PyMem_Free(self.result_data) # <<<<<<<<<<<<<< + * self.result_data = NULL + * # But if we don't need any buffers, we're done anyway. + */ + PyMem_Free(__pyx_v_self->result_data); + + /* "oursqlx/statement.pyx":180 + * # buffers. + * PyMem_Free(self.result_data) + * self.result_data = NULL # <<<<<<<<<<<<<< + * # But if we don't need any buffers, we're done anyway. + * if not res: + */ + __pyx_v_self->result_data = NULL; + + /* "oursqlx/statement.pyx":182 + * self.result_data = NULL + * # But if we don't need any buffers, we're done anyway. + * if not res: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_1 = ((!(__pyx_v_res != 0)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":183 + * # But if we don't need any buffers, we're done anyway. + * if not res: + * return 0 # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":182 + * self.result_data = NULL + * # But if we don't need any buffers, we're done anyway. + * if not res: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + + /* "oursqlx/statement.pyx":185 + * return 0 + * + * try: # <<<<<<<<<<<<<< + * # Otherwise, we (try to) allocate the result buffers. + * fields = mysql_num_fields(res) + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "oursqlx/statement.pyx":187 + * try: + * # Otherwise, we (try to) allocate the result buffers. + * fields = mysql_num_fields(res) # <<<<<<<<<<<<<< + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) + * if not bind: + */ + __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(mysql_num_fields(__pyx_v_res)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 187, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_fields = __pyx_t_5; + __pyx_t_5 = 0; + + /* "oursqlx/statement.pyx":188 + * # Otherwise, we (try to) allocate the result buffers. + * fields = mysql_num_fields(res) + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) # <<<<<<<<<<<<<< + * if not bind: + * raise MemoryError('alloc of result bind structure failed') + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 188, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fields); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 188, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 188, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_bind = ((MYSQL_BIND *)PyMem_Malloc(__pyx_t_7)); + + /* "oursqlx/statement.pyx":189 + * fields = mysql_num_fields(res) + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) + * if not bind: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of result bind structure failed') + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + */ + __pyx_t_1 = ((!(__pyx_v_bind != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":190 + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) + * if not bind: + * raise MemoryError('alloc of result bind structure failed') # <<<<<<<<<<<<<< + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + * result_data = PyMem_Malloc( + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 190, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(4, 190, __pyx_L7_error) + + /* "oursqlx/statement.pyx":189 + * fields = mysql_num_fields(res) + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) + * if not bind: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of result bind structure failed') + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + */ + } + + /* "oursqlx/statement.pyx":191 + * if not bind: + * raise MemoryError('alloc of result bind structure failed') + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) # <<<<<<<<<<<<<< + * result_data = PyMem_Malloc( + * sizeof(column_output) * fields) + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t((sizeof(MYSQL_BIND))); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 191, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 191, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 191, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + (void)(memset(__pyx_v_bind, 0, __pyx_t_7)); + + /* "oursqlx/statement.pyx":193 + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + * result_data = PyMem_Malloc( + * sizeof(column_output) * fields) # <<<<<<<<<<<<<< + * if not result_data: + * raise MemoryError('alloc of result buffers failed') + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 193, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fields); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 193, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 193, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "oursqlx/statement.pyx":192 + * raise MemoryError('alloc of result bind structure failed') + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + * result_data = PyMem_Malloc( # <<<<<<<<<<<<<< + * sizeof(column_output) * fields) + * if not result_data: + */ + __pyx_v_result_data = ((struct __pyx_t_6oursql_column_output *)PyMem_Malloc(__pyx_t_7)); + + /* "oursqlx/statement.pyx":194 + * result_data = PyMem_Malloc( + * sizeof(column_output) * fields) + * if not result_data: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of result buffers failed') + * memset(result_data, 0, sizeof(column_output) * fields) + */ + __pyx_t_1 = ((!(__pyx_v_result_data != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":195 + * sizeof(column_output) * fields) + * if not result_data: + * raise MemoryError('alloc of result buffers failed') # <<<<<<<<<<<<<< + * memset(result_data, 0, sizeof(column_output) * fields) + * except: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 195, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(4, 195, __pyx_L7_error) + + /* "oursqlx/statement.pyx":194 + * result_data = PyMem_Malloc( + * sizeof(column_output) * fields) + * if not result_data: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of result buffers failed') + * memset(result_data, 0, sizeof(column_output) * fields) + */ + } + + /* "oursqlx/statement.pyx":196 + * if not result_data: + * raise MemoryError('alloc of result buffers failed') + * memset(result_data, 0, sizeof(column_output) * fields) # <<<<<<<<<<<<<< + * except: + * # We only want to free the buffers if there was a failure and we + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t((sizeof(struct __pyx_t_6oursql_column_output))); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 196, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_fields); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 196, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 196, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + (void)(memset(__pyx_v_result_data, 0, __pyx_t_7)); + + /* "oursqlx/statement.pyx":185 + * return 0 + * + * try: # <<<<<<<<<<<<<< + * # Otherwise, we (try to) allocate the result buffers. + * fields = mysql_num_fields(res) + */ + } + + /* "oursqlx/statement.pyx":205 + * else: + * # And we only want to save the buffers if there was no failure. + * self.bind = bind # <<<<<<<<<<<<<< + * self.result_data = result_data + * self.result_fields = fields + */ + /*else:*/ { + __pyx_v_self->bind = __pyx_v_bind; + + /* "oursqlx/statement.pyx":206 + * # And we only want to save the buffers if there was no failure. + * self.bind = bind + * self.result_data = result_data # <<<<<<<<<<<<<< + * self.result_fields = fields + * finally: + */ + __pyx_v_self->result_data = __pyx_v_result_data; + + /* "oursqlx/statement.pyx":207 + * self.bind = bind + * self.result_data = result_data + * self.result_fields = fields # <<<<<<<<<<<<<< + * finally: + * # But in any case, we don't need the result. + */ + __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_v_fields); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(4, 207, __pyx_L9_except_error) + __pyx_v_self->result_fields = __pyx_t_8; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L12_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "oursqlx/statement.pyx":197 + * raise MemoryError('alloc of result buffers failed') + * memset(result_data, 0, sizeof(column_output) * fields) + * except: # <<<<<<<<<<<<<< + * # We only want to free the buffers if there was a failure and we + * # can't use 'em. + */ + /*except:*/ { + __Pyx_AddTraceback("oursql._Statement._alloc_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(4, 197, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_9); + + /* "oursqlx/statement.pyx":200 + * # We only want to free the buffers if there was a failure and we + * # can't use 'em. + * PyMem_Free(result_data) # <<<<<<<<<<<<<< + * PyMem_Free(bind) + * raise + */ + PyMem_Free(__pyx_v_result_data); + + /* "oursqlx/statement.pyx":201 + * # can't use 'em. + * PyMem_Free(result_data) + * PyMem_Free(bind) # <<<<<<<<<<<<<< + * raise + * else: + */ + PyMem_Free(__pyx_v_bind); + + /* "oursqlx/statement.pyx":202 + * PyMem_Free(result_data) + * PyMem_Free(bind) + * raise # <<<<<<<<<<<<<< + * else: + * # And we only want to save the buffers if there was no failure. + */ + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_6, __pyx_t_9); + __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_9 = 0; + __PYX_ERR(4, 202, __pyx_L9_except_error) + } + __pyx_L9_except_error:; + + /* "oursqlx/statement.pyx":185 + * return 0 + * + * try: # <<<<<<<<<<<<<< + * # Otherwise, we (try to) allocate the result buffers. + * fields = mysql_num_fields(res) + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L5_error; + __pyx_L12_try_end:; + } + } + + /* "oursqlx/statement.pyx":210 + * finally: + * # But in any case, we don't need the result. + * mysql_free_result(res) # <<<<<<<<<<<<<< + * + * cdef int _bind_buffer(self) except -1: + */ + /*finally:*/ { + /*normal exit:*/{ + mysql_free_result(__pyx_v_res); + goto __pyx_L6; + } + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + mysql_free_result(__pyx_v_res); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + } + __pyx_L6:; + } + + /* "oursqlx/statement.pyx":164 + * self._alloc_buffer() + * + * cdef int _alloc_buffer(self) except -1: # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * cdef MYSQL_BIND *bind = NULL + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("oursql._Statement._alloc_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":212 + * mysql_free_result(res) + * + * cdef int _bind_buffer(self) except -1: # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * cdef MYSQL_FIELD *field + */ + +static int __pyx_f_6oursql_10_Statement__bind_buffer(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + MYSQL_RES *__pyx_v_res; + MYSQL_FIELD *__pyx_v_field; + MYSQL_BIND *__pyx_v_b; + struct __pyx_t_6oursql_column_output *__pyx_v_c; + unsigned int __pyx_v_fields; + unsigned int __pyx_v_i; + int __pyx_r; + __Pyx_RefNannyDeclarations + unsigned int __pyx_t_1; + MYSQL_BIND *__pyx_t_2; + struct __pyx_t_6oursql_column_output *__pyx_t_3; + int __pyx_t_4; + enum enum_field_types __pyx_t_5; + unsigned int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_bind_buffer", 0); + + /* "oursqlx/statement.pyx":218 + * cdef column_output *c + * cdef unsigned int fields, i + * res = mysql_stmt_result_metadata(self.stmt) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_res = mysql_stmt_result_metadata(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":220 + * res = mysql_stmt_result_metadata(self.stmt) + * + * try: # <<<<<<<<<<<<<< + * # And now we (try to) set up the result buffers. + * fields = mysql_num_fields(res) + */ + /*try:*/ { + + /* "oursqlx/statement.pyx":222 + * try: + * # And now we (try to) set up the result buffers. + * fields = mysql_num_fields(res) # <<<<<<<<<<<<<< + * for 0 <= i < fields: + * b, c = &self.bind[i], &self.result_data[i] + */ + __pyx_v_fields = mysql_num_fields(__pyx_v_res); + + /* "oursqlx/statement.pyx":223 + * # And now we (try to) set up the result buffers. + * fields = mysql_num_fields(res) + * for 0 <= i < fields: # <<<<<<<<<<<<<< + * b, c = &self.bind[i], &self.result_data[i] + * field = mysql_fetch_field_direct(res, i) + */ + __pyx_t_1 = __pyx_v_fields; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "oursqlx/statement.pyx":224 + * fields = mysql_num_fields(res) + * for 0 <= i < fields: + * b, c = &self.bind[i], &self.result_data[i] # <<<<<<<<<<<<<< + * field = mysql_fetch_field_direct(res, i) + * if field.type == MYSQL_TYPE_GEOMETRY: + */ + __pyx_t_2 = (&(__pyx_v_self->bind[__pyx_v_i])); + __pyx_t_3 = (&(__pyx_v_self->result_data[__pyx_v_i])); + __pyx_v_b = __pyx_t_2; + __pyx_v_c = __pyx_t_3; + + /* "oursqlx/statement.pyx":225 + * for 0 <= i < fields: + * b, c = &self.bind[i], &self.result_data[i] + * field = mysql_fetch_field_direct(res, i) # <<<<<<<<<<<<<< + * if field.type == MYSQL_TYPE_GEOMETRY: + * c.type = b.buffer_type = MYSQL_TYPE_STRING + */ + __pyx_v_field = mysql_fetch_field_direct(__pyx_v_res, __pyx_v_i); + + /* "oursqlx/statement.pyx":226 + * b, c = &self.bind[i], &self.result_data[i] + * field = mysql_fetch_field_direct(res, i) + * if field.type == MYSQL_TYPE_GEOMETRY: # <<<<<<<<<<<<<< + * c.type = b.buffer_type = MYSQL_TYPE_STRING + * else: + */ + __pyx_t_4 = ((__pyx_v_field->type == MYSQL_TYPE_GEOMETRY) != 0); + if (__pyx_t_4) { + + /* "oursqlx/statement.pyx":227 + * field = mysql_fetch_field_direct(res, i) + * if field.type == MYSQL_TYPE_GEOMETRY: + * c.type = b.buffer_type = MYSQL_TYPE_STRING # <<<<<<<<<<<<<< + * else: + * c.type = b.buffer_type = field.type + */ + __pyx_v_c->type = MYSQL_TYPE_STRING; + __pyx_v_b->buffer_type = MYSQL_TYPE_STRING; + + /* "oursqlx/statement.pyx":226 + * b, c = &self.bind[i], &self.result_data[i] + * field = mysql_fetch_field_direct(res, i) + * if field.type == MYSQL_TYPE_GEOMETRY: # <<<<<<<<<<<<<< + * c.type = b.buffer_type = MYSQL_TYPE_STRING + * else: + */ + goto __pyx_L8; + } + + /* "oursqlx/statement.pyx":229 + * c.type = b.buffer_type = MYSQL_TYPE_STRING + * else: + * c.type = b.buffer_type = field.type # <<<<<<<<<<<<<< + * c.flags = field.flags + * c.is_binary = (field.charsetnr == CS_BINARY) + */ + /*else*/ { + __pyx_t_5 = __pyx_v_field->type; + __pyx_v_c->type = __pyx_t_5; + __pyx_v_b->buffer_type = __pyx_t_5; + } + __pyx_L8:; + + /* "oursqlx/statement.pyx":230 + * else: + * c.type = b.buffer_type = field.type + * c.flags = field.flags # <<<<<<<<<<<<<< + * c.is_binary = (field.charsetnr == CS_BINARY) + * b.buffer_length = sizeof(column_data) + */ + __pyx_t_6 = __pyx_v_field->flags; + __pyx_v_c->flags = __pyx_t_6; + + /* "oursqlx/statement.pyx":231 + * c.type = b.buffer_type = field.type + * c.flags = field.flags + * c.is_binary = (field.charsetnr == CS_BINARY) # <<<<<<<<<<<<<< + * b.buffer_length = sizeof(column_data) + * b.buffer = &c.buf + */ + __pyx_v_c->is_binary = (__pyx_v_field->charsetnr == 63); + + /* "oursqlx/statement.pyx":232 + * c.flags = field.flags + * c.is_binary = (field.charsetnr == CS_BINARY) + * b.buffer_length = sizeof(column_data) # <<<<<<<<<<<<<< + * b.buffer = &c.buf + * b.length = &c.length + */ + __pyx_v_b->buffer_length = (sizeof(union __pyx_t_6oursql_column_data)); + + /* "oursqlx/statement.pyx":233 + * c.is_binary = (field.charsetnr == CS_BINARY) + * b.buffer_length = sizeof(column_data) + * b.buffer = &c.buf # <<<<<<<<<<<<<< + * b.length = &c.length + * b.is_null = &c.is_null + */ + __pyx_v_b->buffer = (&__pyx_v_c->buf); + + /* "oursqlx/statement.pyx":234 + * b.buffer_length = sizeof(column_data) + * b.buffer = &c.buf + * b.length = &c.length # <<<<<<<<<<<<<< + * b.is_null = &c.is_null + * b.error = &c.error + */ + __pyx_v_b->length = (&__pyx_v_c->length); + + /* "oursqlx/statement.pyx":235 + * b.buffer = &c.buf + * b.length = &c.length + * b.is_null = &c.is_null # <<<<<<<<<<<<<< + * b.error = &c.error + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: + */ + __pyx_v_b->is_null = (&__pyx_v_c->is_null); + + /* "oursqlx/statement.pyx":236 + * b.length = &c.length + * b.is_null = &c.is_null + * b.error = &c.error # <<<<<<<<<<<<<< + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: + * b.is_unsigned = True + */ + __pyx_v_b->error = (&__pyx_v_c->error); + + /* "oursqlx/statement.pyx":237 + * b.is_null = &c.is_null + * b.error = &c.error + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: # <<<<<<<<<<<<<< + * b.is_unsigned = True + * if mysql_stmt_bind_result(self.stmt, self.bind): + */ + __pyx_t_4 = (((__pyx_v_field->flags & __pyx_v_6oursql_UNSIGNED_NUM_FLAG) == __pyx_v_6oursql_UNSIGNED_NUM_FLAG) != 0); + if (__pyx_t_4) { + + /* "oursqlx/statement.pyx":238 + * b.error = &c.error + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: + * b.is_unsigned = True # <<<<<<<<<<<<<< + * if mysql_stmt_bind_result(self.stmt, self.bind): + * self._raise_error() + */ + __pyx_v_b->is_unsigned = 1; + + /* "oursqlx/statement.pyx":237 + * b.is_null = &c.is_null + * b.error = &c.error + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: # <<<<<<<<<<<<<< + * b.is_unsigned = True + * if mysql_stmt_bind_result(self.stmt, self.bind): + */ + } + } + + /* "oursqlx/statement.pyx":239 + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: + * b.is_unsigned = True + * if mysql_stmt_bind_result(self.stmt, self.bind): # <<<<<<<<<<<<<< + * self._raise_error() + * finally: + */ + __pyx_t_4 = (mysql_stmt_bind_result(__pyx_v_self->stmt, __pyx_v_self->bind) != 0); + if (__pyx_t_4) { + + /* "oursqlx/statement.pyx":240 + * b.is_unsigned = True + * if mysql_stmt_bind_result(self.stmt, self.bind): + * self._raise_error() # <<<<<<<<<<<<<< + * finally: + * # And clean up the result data. + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(4, 240, __pyx_L4_error) + + /* "oursqlx/statement.pyx":239 + * if field.flags & UNSIGNED_NUM_FLAG == UNSIGNED_NUM_FLAG: + * b.is_unsigned = True + * if mysql_stmt_bind_result(self.stmt, self.bind): # <<<<<<<<<<<<<< + * self._raise_error() + * finally: + */ + } + } + + /* "oursqlx/statement.pyx":243 + * finally: + * # And clean up the result data. + * mysql_free_result(res) # <<<<<<<<<<<<<< + * + * property has_result: + */ + /*finally:*/ { + /*normal exit:*/{ + mysql_free_result(__pyx_v_res); + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + mysql_free_result(__pyx_v_res); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "oursqlx/statement.pyx":212 + * mysql_free_result(res) + * + * cdef int _bind_buffer(self) except -1: # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * cdef MYSQL_FIELD *field + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql._Statement._bind_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":246 + * + * property has_result: + * def __get__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return self.result_data != NULL + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_10has_result_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_10has_result_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_10has_result___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_10has_result___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/statement.pyx":247 + * property has_result: + * def __get__(self): + * self._check_closed() # <<<<<<<<<<<<<< + * return self.result_data != NULL + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 247, __pyx_L1_error) + + /* "oursqlx/statement.pyx":248 + * def __get__(self): + * self._check_closed() + * return self.result_data != NULL # <<<<<<<<<<<<<< + * + * property description: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->result_data != NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":246 + * + * property has_result: + * def __get__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return self.result_data != NULL + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._Statement.has_result.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":251 + * + * property description: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * self._check_closed() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_11description_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_11description___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_11description___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + MYSQL_RES *__pyx_v_res; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/statement.pyx":253 + * def __get__(self): + * cdef MYSQL_RES *res + * self._check_closed() # <<<<<<<<<<<<<< + * if not self.result_data: + * return None + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 253, __pyx_L1_error) + + /* "oursqlx/statement.pyx":254 + * cdef MYSQL_RES *res + * self._check_closed() + * if not self.result_data: # <<<<<<<<<<<<<< + * return None + * res = mysql_stmt_result_metadata(self.stmt) + */ + __pyx_t_2 = ((!(__pyx_v_self->result_data != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":255 + * self._check_closed() + * if not self.result_data: + * return None # <<<<<<<<<<<<<< + * res = mysql_stmt_result_metadata(self.stmt) + * if not res: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":254 + * cdef MYSQL_RES *res + * self._check_closed() + * if not self.result_data: # <<<<<<<<<<<<<< + * return None + * res = mysql_stmt_result_metadata(self.stmt) + */ + } + + /* "oursqlx/statement.pyx":256 + * if not self.result_data: + * return None + * res = mysql_stmt_result_metadata(self.stmt) # <<<<<<<<<<<<<< + * if not res: + * self.result_data = NULL + */ + __pyx_v_res = mysql_stmt_result_metadata(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":257 + * return None + * res = mysql_stmt_result_metadata(self.stmt) + * if not res: # <<<<<<<<<<<<<< + * self.result_data = NULL + * return + */ + __pyx_t_2 = ((!(__pyx_v_res != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":258 + * res = mysql_stmt_result_metadata(self.stmt) + * if not res: + * self.result_data = NULL # <<<<<<<<<<<<<< + * return + * try: + */ + __pyx_v_self->result_data = NULL; + + /* "oursqlx/statement.pyx":259 + * if not res: + * self.result_data = NULL + * return # <<<<<<<<<<<<<< + * try: + * ret = description_from_res( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":257 + * return None + * res = mysql_stmt_result_metadata(self.stmt) + * if not res: # <<<<<<<<<<<<<< + * self.result_data = NULL + * return + */ + } + + /* "oursqlx/statement.pyx":260 + * self.result_data = NULL + * return + * try: # <<<<<<<<<<<<<< + * ret = description_from_res( + * self.conn, res, self.result_fields, self.show_table) + */ + /*try:*/ { + + /* "oursqlx/statement.pyx":262 + * try: + * ret = description_from_res( + * self.conn, res, self.result_fields, self.show_table) # <<<<<<<<<<<<<< + * finally: + * mysql_free_result(res) + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->conn); + __Pyx_INCREF(__pyx_t_3); + + /* "oursqlx/statement.pyx":261 + * return + * try: + * ret = description_from_res( # <<<<<<<<<<<<<< + * self.conn, res, self.result_fields, self.show_table) + * finally: + */ + __pyx_t_4 = __pyx_f_6oursql_description_from_res(((struct __pyx_obj_6oursql_Connection *)__pyx_t_3), __pyx_v_res, __pyx_v_self->result_fields, __pyx_v_self->show_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 261, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_ret = __pyx_t_4; + __pyx_t_4 = 0; + } + + /* "oursqlx/statement.pyx":264 + * self.conn, res, self.result_fields, self.show_table) + * finally: + * mysql_free_result(res) # <<<<<<<<<<<<<< + * return ret + * + */ + /*finally:*/ { + /*normal exit:*/{ + mysql_free_result(__pyx_v_res); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_1 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + mysql_free_result(__pyx_v_res); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "oursqlx/statement.pyx":265 + * finally: + * mysql_free_result(res) + * return ret # <<<<<<<<<<<<<< + * + * property column_names: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":251 + * + * property description: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef MYSQL_RES *res + * self._check_closed() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql._Statement.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":268 + * + * property column_names: + * def __get__(self): # <<<<<<<<<<<<<< + * desc = self.description + * if desc is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_12column_names_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_12column_names_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_12column_names___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_12column_names___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_v_desc = NULL; + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/statement.pyx":269 + * property column_names: + * def __get__(self): + * desc = self.description # <<<<<<<<<<<<<< + * if desc is None: + * return None + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_description); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_desc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":270 + * def __get__(self): + * desc = self.description + * if desc is None: # <<<<<<<<<<<<<< + * return None + * return [x[0] for x in desc] + */ + __pyx_t_2 = (__pyx_v_desc == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":271 + * desc = self.description + * if desc is None: + * return None # <<<<<<<<<<<<<< + * return [x[0] for x in desc] + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":270 + * def __get__(self): + * desc = self.description + * if desc is None: # <<<<<<<<<<<<<< + * return None + * return [x[0] for x in desc] + */ + } + + /* "oursqlx/statement.pyx":272 + * if desc is None: + * return None + * return [x[0] for x in desc] # <<<<<<<<<<<<<< + * + * def execute(self, *parameters): + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_v_desc)) || PyTuple_CheckExact(__pyx_v_desc)) { + __pyx_t_4 = __pyx_v_desc; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_desc); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 272, __pyx_L6_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 272, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 272, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(4, 272, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(4, 272, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L9_exit_scope; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":268 + * + * property column_names: + * def __get__(self): # <<<<<<<<<<<<<< + * desc = self.description + * if desc is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("oursql._Statement.column_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_desc); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":274 + * return [x[0] for x in desc] + * + * def execute(self, *parameters): # <<<<<<<<<<<<<< + * cdef char *buf = NULL + * cdef void *long_buffer + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_9execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_9execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_parameters = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "execute", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_parameters = __pyx_args; + __pyx_r = __pyx_pf_6oursql_10_Statement_8execute(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), __pyx_v_parameters); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_parameters); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_8execute(struct __pyx_obj_6oursql__Statement *__pyx_v_self, PyObject *__pyx_v_parameters) { + char *__pyx_v_buf; + void *__pyx_v_long_buffer; + MYSQL_BIND *__pyx_v_bind; + MYSQL_BIND *__pyx_v_b; + union __pyx_t_6oursql_column_data *__pyx_v_column; + union __pyx_t_6oursql_column_data *__pyx_v_c; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n_params; + Py_ssize_t __pyx_v_stmt_params; + Py_ssize_t __pyx_v_long_buffer_size; + PyObject *__pyx_v_long_strings = NULL; + PyObject *__pyx_v_temp_strings = NULL; + PyObject *__pyx_v_o = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_UCS4 __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + MYSQL_BIND *__pyx_t_9; + union __pyx_t_6oursql_column_data *__pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + unsigned PY_LONG_LONG __pyx_t_14; + PY_LONG_LONG __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); + PyObject *(*__pyx_t_18)(PyObject *); + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute", 0); + + /* "oursqlx/statement.pyx":275 + * + * def execute(self, *parameters): + * cdef char *buf = NULL # <<<<<<<<<<<<<< + * cdef void *long_buffer + * cdef MYSQL_BIND *bind = NULL, *b + */ + __pyx_v_buf = NULL; + + /* "oursqlx/statement.pyx":277 + * cdef char *buf = NULL + * cdef void *long_buffer + * cdef MYSQL_BIND *bind = NULL, *b # <<<<<<<<<<<<<< + * cdef column_data *column, *c + * cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size + */ + __pyx_v_bind = NULL; + + /* "oursqlx/statement.pyx":280 + * cdef column_data *column, *c + * cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size + * self._check_closed() # <<<<<<<<<<<<<< + * if self.data_waiting: + * raise ProgrammingError('executing this query would cause rows to ' + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 280, __pyx_L1_error) + + /* "oursqlx/statement.pyx":281 + * cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size + * self._check_closed() + * if self.data_waiting: # <<<<<<<<<<<<<< + * raise ProgrammingError('executing this query would cause rows to ' + * 'become unfetchable') + */ + __pyx_t_2 = (__pyx_v_self->data_waiting != 0); + if (unlikely(__pyx_t_2)) { + + /* "oursqlx/statement.pyx":282 + * self._check_closed() + * if self.data_waiting: + * raise ProgrammingError('executing this query would cause rows to ' # <<<<<<<<<<<<<< + * 'become unfetchable') + * n_params = PyTuple_GET_SIZE(parameters) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_executing_this_query_would_cause) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_executing_this_query_would_cause); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 282, __pyx_L1_error) + + /* "oursqlx/statement.pyx":281 + * cdef Py_ssize_t i, n_params, stmt_params, long_buffer_size + * self._check_closed() + * if self.data_waiting: # <<<<<<<<<<<<<< + * raise ProgrammingError('executing this query would cause rows to ' + * 'become unfetchable') + */ + } + + /* "oursqlx/statement.pyx":284 + * raise ProgrammingError('executing this query would cause rows to ' + * 'become unfetchable') + * n_params = PyTuple_GET_SIZE(parameters) # <<<<<<<<<<<<<< + * stmt_params = mysql_stmt_param_count(self.stmt) + * if stmt_params != n_params: + */ + __pyx_v_n_params = PyTuple_GET_SIZE(__pyx_v_parameters); + + /* "oursqlx/statement.pyx":285 + * 'become unfetchable') + * n_params = PyTuple_GET_SIZE(parameters) + * stmt_params = mysql_stmt_param_count(self.stmt) # <<<<<<<<<<<<<< + * if stmt_params != n_params: + * raise ProgrammingError('%d parameters expected, %d given' % ( + */ + __pyx_v_stmt_params = mysql_stmt_param_count(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":286 + * n_params = PyTuple_GET_SIZE(parameters) + * stmt_params = mysql_stmt_param_count(self.stmt) + * if stmt_params != n_params: # <<<<<<<<<<<<<< + * raise ProgrammingError('%d parameters expected, %d given' % ( + * stmt_params, n_params)) + */ + __pyx_t_2 = ((__pyx_v_stmt_params != __pyx_v_n_params) != 0); + if (unlikely(__pyx_t_2)) { + + /* "oursqlx/statement.pyx":287 + * stmt_params = mysql_stmt_param_count(self.stmt) + * if stmt_params != n_params: + * raise ProgrammingError('%d parameters expected, %d given' % ( # <<<<<<<<<<<<<< + * stmt_params, n_params)) + * long_strings = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = 0; + __pyx_t_7 = 127; + + /* "oursqlx/statement.pyx":288 + * if stmt_params != n_params: + * raise ProgrammingError('%d parameters expected, %d given' % ( + * stmt_params, n_params)) # <<<<<<<<<<<<<< + * long_strings = [] + * # So we don't have temporary values cleaned up before they're used. + */ + __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_stmt_params, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u_parameters_expected); + __pyx_t_6 += 22; + __Pyx_GIVEREF(__pyx_kp_u_parameters_expected); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u_parameters_expected); + __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_n_params, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u_given); + __pyx_t_6 += 6; + __Pyx_GIVEREF(__pyx_kp_u_given); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u_given); + + /* "oursqlx/statement.pyx":287 + * stmt_params = mysql_stmt_param_count(self.stmt) + * if stmt_params != n_params: + * raise ProgrammingError('%d parameters expected, %d given' % ( # <<<<<<<<<<<<<< + * stmt_params, n_params)) + * long_strings = [] + */ + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 287, __pyx_L1_error) + + /* "oursqlx/statement.pyx":286 + * n_params = PyTuple_GET_SIZE(parameters) + * stmt_params = mysql_stmt_param_count(self.stmt) + * if stmt_params != n_params: # <<<<<<<<<<<<<< + * raise ProgrammingError('%d parameters expected, %d given' % ( + * stmt_params, n_params)) + */ + } + + /* "oursqlx/statement.pyx":289 + * raise ProgrammingError('%d parameters expected, %d given' % ( + * stmt_params, n_params)) + * long_strings = [] # <<<<<<<<<<<<<< + * # So we don't have temporary values cleaned up before they're used. + * temp_strings = [] + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_long_strings = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":291 + * long_strings = [] + * # So we don't have temporary values cleaned up before they're used. + * temp_strings = [] # <<<<<<<<<<<<<< + * try: + * if n_params > 0: + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_temp_strings = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":292 + * # So we don't have temporary values cleaned up before they're used. + * temp_strings = [] + * try: # <<<<<<<<<<<<<< + * if n_params > 0: + * buf = PyMem_Malloc( + */ + /*try:*/ { + + /* "oursqlx/statement.pyx":293 + * temp_strings = [] + * try: + * if n_params > 0: # <<<<<<<<<<<<<< + * buf = PyMem_Malloc( + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + */ + __pyx_t_2 = ((__pyx_v_n_params > 0) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":294 + * try: + * if n_params > 0: + * buf = PyMem_Malloc( # <<<<<<<<<<<<<< + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + * if not buf: + */ + __pyx_v_buf = ((char *)PyMem_Malloc((((sizeof(MYSQL_BIND)) + (sizeof(union __pyx_t_6oursql_column_data))) * __pyx_v_n_params))); + + /* "oursqlx/statement.pyx":296 + * buf = PyMem_Malloc( + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + * if not buf: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of bind parameters failed') + * bind = buf + */ + __pyx_t_2 = ((!(__pyx_v_buf != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "oursqlx/statement.pyx":297 + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + * if not buf: + * raise MemoryError('alloc of bind parameters failed') # <<<<<<<<<<<<<< + * bind = buf + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 297, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 297, __pyx_L6_error) + + /* "oursqlx/statement.pyx":296 + * buf = PyMem_Malloc( + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + * if not buf: # <<<<<<<<<<<<<< + * raise MemoryError('alloc of bind parameters failed') + * bind = buf + */ + } + + /* "oursqlx/statement.pyx":298 + * if not buf: + * raise MemoryError('alloc of bind parameters failed') + * bind = buf # <<<<<<<<<<<<<< + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) + * column = (buf + (sizeof(MYSQL_BIND) * n_params)) + */ + __pyx_v_bind = ((MYSQL_BIND *)__pyx_v_buf); + + /* "oursqlx/statement.pyx":299 + * raise MemoryError('alloc of bind parameters failed') + * bind = buf + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) # <<<<<<<<<<<<<< + * column = (buf + (sizeof(MYSQL_BIND) * n_params)) + * memset(column, 0, sizeof(column_data) * n_params) + */ + (void)(memset(__pyx_v_bind, 0, ((sizeof(MYSQL_BIND)) * __pyx_v_n_params))); + + /* "oursqlx/statement.pyx":300 + * bind = buf + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) + * column = (buf + (sizeof(MYSQL_BIND) * n_params)) # <<<<<<<<<<<<<< + * memset(column, 0, sizeof(column_data) * n_params) + * # Cache the connection charset. + */ + __pyx_v_column = ((union __pyx_t_6oursql_column_data *)(__pyx_v_buf + ((sizeof(MYSQL_BIND)) * __pyx_v_n_params))); + + /* "oursqlx/statement.pyx":301 + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) + * column = (buf + (sizeof(MYSQL_BIND) * n_params)) + * memset(column, 0, sizeof(column_data) * n_params) # <<<<<<<<<<<<<< + * # Cache the connection charset. + * self.conn.charset + */ + (void)(memset(__pyx_v_column, 0, ((sizeof(union __pyx_t_6oursql_column_data)) * __pyx_v_n_params))); + + /* "oursqlx/statement.pyx":303 + * memset(column, 0, sizeof(column_data) * n_params) + * # Cache the connection charset. + * self.conn.charset # <<<<<<<<<<<<<< + * for 0 <= i < n_params: + * o = PyTuple_GET_ITEM(parameters, i) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 303, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":304 + * # Cache the connection charset. + * self.conn.charset + * for 0 <= i < n_params: # <<<<<<<<<<<<<< + * o = PyTuple_GET_ITEM(parameters, i) + * Py_INCREF(o) + */ + __pyx_t_6 = __pyx_v_n_params; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { + + /* "oursqlx/statement.pyx":305 + * self.conn.charset + * for 0 <= i < n_params: + * o = PyTuple_GET_ITEM(parameters, i) # <<<<<<<<<<<<<< + * Py_INCREF(o) + * b, c = &bind[i], &column[i] + */ + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_parameters, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 305, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":306 + * for 0 <= i < n_params: + * o = PyTuple_GET_ITEM(parameters, i) + * Py_INCREF(o) # <<<<<<<<<<<<<< + * b, c = &bind[i], &column[i] + * # This monolith should be refactored into something better + */ + Py_INCREF(__pyx_v_o); + + /* "oursqlx/statement.pyx":307 + * o = PyTuple_GET_ITEM(parameters, i) + * Py_INCREF(o) + * b, c = &bind[i], &column[i] # <<<<<<<<<<<<<< + * # This monolith should be refactored into something better + * # someday. It can't really work the same way as MySQLdb has + */ + __pyx_t_9 = (&(__pyx_v_bind[__pyx_v_i])); + __pyx_t_10 = (&(__pyx_v_column[__pyx_v_i])); + __pyx_v_b = __pyx_t_9; + __pyx_v_c = __pyx_t_10; + + /* "oursqlx/statement.pyx":312 + * # a conversion dict, since this involves some C-level union + * # and buffer munging. + * if o is None: # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_NULL + * b.buffer = NULL + */ + __pyx_t_2 = (__pyx_v_o == Py_None); + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":313 + * # and buffer munging. + * if o is None: + * b.buffer_type = MYSQL_TYPE_NULL # <<<<<<<<<<<<<< + * b.buffer = NULL + * elif PyUnicode_Check(o): + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_NULL; + + /* "oursqlx/statement.pyx":314 + * if o is None: + * b.buffer_type = MYSQL_TYPE_NULL + * b.buffer = NULL # <<<<<<<<<<<<<< + * elif PyUnicode_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING + */ + __pyx_v_b->buffer = NULL; + + /* "oursqlx/statement.pyx":312 + * # a conversion dict, since this involves some C-level union + * # and buffer munging. + * if o is None: # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_NULL + * b.buffer = NULL + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":315 + * b.buffer_type = MYSQL_TYPE_NULL + * b.buffer = NULL + * elif PyUnicode_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * if self.conn.use_unicode: + */ + __pyx_t_11 = (PyUnicode_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":316 + * b.buffer = NULL + * elif PyUnicode_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING # <<<<<<<<<<<<<< + * if self.conn.use_unicode: + * o = o.encode(self.conn._charset) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_STRING; + + /* "oursqlx/statement.pyx":317 + * elif PyUnicode_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING + * if self.conn.use_unicode: # <<<<<<<<<<<<<< + * o = o.encode(self.conn._charset) + * temp_strings.append(o) + */ + __pyx_t_11 = (__pyx_v_self->conn->use_unicode != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":318 + * b.buffer_type = MYSQL_TYPE_STRING + * if self.conn.use_unicode: + * o = o.encode(self.conn._charset) # <<<<<<<<<<<<<< + * temp_strings.append(o) + * PyBytes_AsStringAndSize(o, + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 318, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 318, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":319 + * if self.conn.use_unicode: + * o = o.encode(self.conn._charset) + * temp_strings.append(o) # <<<<<<<<<<<<<< + * PyBytes_AsStringAndSize(o, + * &b.buffer, &c.st) + */ + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(4, 319, __pyx_L6_error) + + /* "oursqlx/statement.pyx":317 + * elif PyUnicode_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING + * if self.conn.use_unicode: # <<<<<<<<<<<<<< + * o = o.encode(self.conn._charset) + * temp_strings.append(o) + */ + } + + /* "oursqlx/statement.pyx":320 + * o = o.encode(self.conn._charset) + * temp_strings.append(o) + * PyBytes_AsStringAndSize(o, # <<<<<<<<<<<<<< + * &b.buffer, &c.st) + * c.ul = c.st + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_o, ((char **)(&__pyx_v_b->buffer)), (&__pyx_v_c->st)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 320, __pyx_L6_error) + + /* "oursqlx/statement.pyx":322 + * PyBytes_AsStringAndSize(o, + * &b.buffer, &c.st) + * c.ul = c.st # <<<<<<<<<<<<<< + * b.length = &c.ul + * elif PyBytes_Check(o): + */ + __pyx_t_13 = __pyx_v_c->st; + __pyx_v_c->ul = __pyx_t_13; + + /* "oursqlx/statement.pyx":323 + * &b.buffer, &c.st) + * c.ul = c.st + * b.length = &c.ul # <<<<<<<<<<<<<< + * elif PyBytes_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING + */ + __pyx_v_b->length = (&__pyx_v_c->ul); + + /* "oursqlx/statement.pyx":315 + * b.buffer_type = MYSQL_TYPE_NULL + * b.buffer = NULL + * elif PyUnicode_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * if self.conn.use_unicode: + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":324 + * c.ul = c.st + * b.length = &c.ul + * elif PyBytes_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * PyBytes_AsStringAndSize(o, + */ + __pyx_t_11 = (PyBytes_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":325 + * b.length = &c.ul + * elif PyBytes_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING # <<<<<<<<<<<<<< + * PyBytes_AsStringAndSize(o, + * &b.buffer, &c.st) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_STRING; + + /* "oursqlx/statement.pyx":326 + * elif PyBytes_Check(o): + * b.buffer_type = MYSQL_TYPE_STRING + * PyBytes_AsStringAndSize(o, # <<<<<<<<<<<<<< + * &b.buffer, &c.st) + * c.ul = c.st + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_o, ((char **)(&__pyx_v_b->buffer)), (&__pyx_v_c->st)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 326, __pyx_L6_error) + + /* "oursqlx/statement.pyx":328 + * PyBytes_AsStringAndSize(o, + * &b.buffer, &c.st) + * c.ul = c.st # <<<<<<<<<<<<<< + * b.length = &c.ul + * elif PyInt_Check(o): + */ + __pyx_t_13 = __pyx_v_c->st; + __pyx_v_c->ul = __pyx_t_13; + + /* "oursqlx/statement.pyx":329 + * &b.buffer, &c.st) + * c.ul = c.st + * b.length = &c.ul # <<<<<<<<<<<<<< + * elif PyInt_Check(o): + * # MYSQL_TYPE_LONG really takes a C int, not a C long. + */ + __pyx_v_b->length = (&__pyx_v_c->ul); + + /* "oursqlx/statement.pyx":324 + * c.ul = c.st + * b.length = &c.ul + * elif PyBytes_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * PyBytes_AsStringAndSize(o, + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":330 + * c.ul = c.st + * b.length = &c.ul + * elif PyInt_Check(o): # <<<<<<<<<<<<<< + * # MYSQL_TYPE_LONG really takes a C int, not a C long. + * # This is necessary for platforms where sizeof(long) > + */ + __pyx_t_11 = (PyInt_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":334 + * # This is necessary for platforms where sizeof(long) > + * # sizeof(int). + * b.buffer_type = MYSQL_TYPE_LONGLONG # <<<<<<<<<<<<<< + * c.ll = PyInt_AS_LONG(o) + * b.buffer = &c.ll + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_LONGLONG; + + /* "oursqlx/statement.pyx":335 + * # sizeof(int). + * b.buffer_type = MYSQL_TYPE_LONGLONG + * c.ll = PyInt_AS_LONG(o) # <<<<<<<<<<<<<< + * b.buffer = &c.ll + * elif PyLong_Check(o): + */ + __pyx_v_c->ll = PyInt_AS_LONG(__pyx_v_o); + + /* "oursqlx/statement.pyx":336 + * b.buffer_type = MYSQL_TYPE_LONGLONG + * c.ll = PyInt_AS_LONG(o) + * b.buffer = &c.ll # <<<<<<<<<<<<<< + * elif PyLong_Check(o): + * b.buffer_type = MYSQL_TYPE_LONGLONG + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ll)); + + /* "oursqlx/statement.pyx":330 + * c.ul = c.st + * b.length = &c.ul + * elif PyInt_Check(o): # <<<<<<<<<<<<<< + * # MYSQL_TYPE_LONG really takes a C int, not a C long. + * # This is necessary for platforms where sizeof(long) > + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":337 + * c.ll = PyInt_AS_LONG(o) + * b.buffer = &c.ll + * elif PyLong_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_LONGLONG + * if o >= 0: + */ + __pyx_t_11 = (PyLong_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":338 + * b.buffer = &c.ll + * elif PyLong_Check(o): + * b.buffer_type = MYSQL_TYPE_LONGLONG # <<<<<<<<<<<<<< + * if o >= 0: + * c.ull = PyLong_AsUnsignedLongLong(o) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_LONGLONG; + + /* "oursqlx/statement.pyx":339 + * elif PyLong_Check(o): + * b.buffer_type = MYSQL_TYPE_LONGLONG + * if o >= 0: # <<<<<<<<<<<<<< + * c.ull = PyLong_AsUnsignedLongLong(o) + * b.buffer = &c.ull + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 339, __pyx_L6_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(4, 339, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":340 + * b.buffer_type = MYSQL_TYPE_LONGLONG + * if o >= 0: + * c.ull = PyLong_AsUnsignedLongLong(o) # <<<<<<<<<<<<<< + * b.buffer = &c.ull + * b.is_unsigned = True + */ + __pyx_t_14 = PyLong_AsUnsignedLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 340, __pyx_L6_error) + __pyx_v_c->ull = __pyx_t_14; + + /* "oursqlx/statement.pyx":341 + * if o >= 0: + * c.ull = PyLong_AsUnsignedLongLong(o) + * b.buffer = &c.ull # <<<<<<<<<<<<<< + * b.is_unsigned = True + * else: + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ull)); + + /* "oursqlx/statement.pyx":342 + * c.ull = PyLong_AsUnsignedLongLong(o) + * b.buffer = &c.ull + * b.is_unsigned = True # <<<<<<<<<<<<<< + * else: + * c.ll = PyLong_AsLongLong(o) + */ + __pyx_v_b->is_unsigned = 1; + + /* "oursqlx/statement.pyx":339 + * elif PyLong_Check(o): + * b.buffer_type = MYSQL_TYPE_LONGLONG + * if o >= 0: # <<<<<<<<<<<<<< + * c.ull = PyLong_AsUnsignedLongLong(o) + * b.buffer = &c.ull + */ + goto __pyx_L14; + } + + /* "oursqlx/statement.pyx":344 + * b.is_unsigned = True + * else: + * c.ll = PyLong_AsLongLong(o) # <<<<<<<<<<<<<< + * b.buffer = &c.ll + * elif PyFloat_Check(o): + */ + /*else*/ { + __pyx_t_15 = PyLong_AsLongLong(__pyx_v_o); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 344, __pyx_L6_error) + __pyx_v_c->ll = __pyx_t_15; + + /* "oursqlx/statement.pyx":345 + * else: + * c.ll = PyLong_AsLongLong(o) + * b.buffer = &c.ll # <<<<<<<<<<<<<< + * elif PyFloat_Check(o): + * b.buffer_type = MYSQL_TYPE_DOUBLE + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->ll)); + } + __pyx_L14:; + + /* "oursqlx/statement.pyx":337 + * c.ll = PyInt_AS_LONG(o) + * b.buffer = &c.ll + * elif PyLong_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_LONGLONG + * if o >= 0: + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":346 + * c.ll = PyLong_AsLongLong(o) + * b.buffer = &c.ll + * elif PyFloat_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DOUBLE + * c.d = PyFloat_AS_DOUBLE(o) + */ + __pyx_t_11 = (PyFloat_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":347 + * b.buffer = &c.ll + * elif PyFloat_Check(o): + * b.buffer_type = MYSQL_TYPE_DOUBLE # <<<<<<<<<<<<<< + * c.d = PyFloat_AS_DOUBLE(o) + * b.buffer = &c.d + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_DOUBLE; + + /* "oursqlx/statement.pyx":348 + * elif PyFloat_Check(o): + * b.buffer_type = MYSQL_TYPE_DOUBLE + * c.d = PyFloat_AS_DOUBLE(o) # <<<<<<<<<<<<<< + * b.buffer = &c.d + * elif PyDateTime_Check(o): + */ + __pyx_v_c->d = PyFloat_AS_DOUBLE(__pyx_v_o); + + /* "oursqlx/statement.pyx":349 + * b.buffer_type = MYSQL_TYPE_DOUBLE + * c.d = PyFloat_AS_DOUBLE(o) + * b.buffer = &c.d # <<<<<<<<<<<<<< + * elif PyDateTime_Check(o): + * b.buffer_type = MYSQL_TYPE_DATETIME + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->d)); + + /* "oursqlx/statement.pyx":346 + * c.ll = PyLong_AsLongLong(o) + * b.buffer = &c.ll + * elif PyFloat_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DOUBLE + * c.d = PyFloat_AS_DOUBLE(o) + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":350 + * c.d = PyFloat_AS_DOUBLE(o) + * b.buffer = &c.d + * elif PyDateTime_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DATETIME + * c.t.year = PyDateTime_GET_YEAR(o) + */ + __pyx_t_11 = (PyDateTime_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":351 + * b.buffer = &c.d + * elif PyDateTime_Check(o): + * b.buffer_type = MYSQL_TYPE_DATETIME # <<<<<<<<<<<<<< + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_DATETIME; + + /* "oursqlx/statement.pyx":352 + * elif PyDateTime_Check(o): + * b.buffer_type = MYSQL_TYPE_DATETIME + * c.t.year = PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) + */ + __pyx_v_c->t.year = PyDateTime_GET_YEAR(__pyx_v_o); + + /* "oursqlx/statement.pyx":353 + * b.buffer_type = MYSQL_TYPE_DATETIME + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< + * c.t.day = PyDateTime_GET_DAY(o) + * c.t.hour = PyDateTime_DATE_GET_HOUR(o) + */ + __pyx_v_c->t.month = PyDateTime_GET_MONTH(__pyx_v_o); + + /* "oursqlx/statement.pyx":354 + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< + * c.t.hour = PyDateTime_DATE_GET_HOUR(o) + * c.t.minute = PyDateTime_DATE_GET_MINUTE(o) + */ + __pyx_v_c->t.day = PyDateTime_GET_DAY(__pyx_v_o); + + /* "oursqlx/statement.pyx":355 + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) + * c.t.hour = PyDateTime_DATE_GET_HOUR(o) # <<<<<<<<<<<<<< + * c.t.minute = PyDateTime_DATE_GET_MINUTE(o) + * c.t.second = PyDateTime_DATE_GET_SECOND(o) + */ + __pyx_v_c->t.hour = PyDateTime_DATE_GET_HOUR(__pyx_v_o); + + /* "oursqlx/statement.pyx":356 + * c.t.day = PyDateTime_GET_DAY(o) + * c.t.hour = PyDateTime_DATE_GET_HOUR(o) + * c.t.minute = PyDateTime_DATE_GET_MINUTE(o) # <<<<<<<<<<<<<< + * c.t.second = PyDateTime_DATE_GET_SECOND(o) + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) + */ + __pyx_v_c->t.minute = PyDateTime_DATE_GET_MINUTE(__pyx_v_o); + + /* "oursqlx/statement.pyx":357 + * c.t.hour = PyDateTime_DATE_GET_HOUR(o) + * c.t.minute = PyDateTime_DATE_GET_MINUTE(o) + * c.t.second = PyDateTime_DATE_GET_SECOND(o) # <<<<<<<<<<<<<< + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) + * b.buffer = &c.t + */ + __pyx_v_c->t.second = PyDateTime_DATE_GET_SECOND(__pyx_v_o); + + /* "oursqlx/statement.pyx":358 + * c.t.minute = PyDateTime_DATE_GET_MINUTE(o) + * c.t.second = PyDateTime_DATE_GET_SECOND(o) + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) # <<<<<<<<<<<<<< + * b.buffer = &c.t + * elif PyDate_Check(o): + */ + __pyx_v_c->t.second_part = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o); + + /* "oursqlx/statement.pyx":359 + * c.t.second = PyDateTime_DATE_GET_SECOND(o) + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) + * b.buffer = &c.t # <<<<<<<<<<<<<< + * elif PyDate_Check(o): + * b.buffer_type = MYSQL_TYPE_DATE + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t)); + + /* "oursqlx/statement.pyx":350 + * c.d = PyFloat_AS_DOUBLE(o) + * b.buffer = &c.d + * elif PyDateTime_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DATETIME + * c.t.year = PyDateTime_GET_YEAR(o) + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":360 + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) + * b.buffer = &c.t + * elif PyDate_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DATE + * c.t.year = PyDateTime_GET_YEAR(o) + */ + __pyx_t_11 = (PyDate_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":361 + * b.buffer = &c.t + * elif PyDate_Check(o): + * b.buffer_type = MYSQL_TYPE_DATE # <<<<<<<<<<<<<< + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_DATE; + + /* "oursqlx/statement.pyx":362 + * elif PyDate_Check(o): + * b.buffer_type = MYSQL_TYPE_DATE + * c.t.year = PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) + */ + __pyx_v_c->t.year = PyDateTime_GET_YEAR(__pyx_v_o); + + /* "oursqlx/statement.pyx":363 + * b.buffer_type = MYSQL_TYPE_DATE + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< + * c.t.day = PyDateTime_GET_DAY(o) + * b.buffer = &c.t + */ + __pyx_v_c->t.month = PyDateTime_GET_MONTH(__pyx_v_o); + + /* "oursqlx/statement.pyx":364 + * c.t.year = PyDateTime_GET_YEAR(o) + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< + * b.buffer = &c.t + * elif PyTime_Check(o): + */ + __pyx_v_c->t.day = PyDateTime_GET_DAY(__pyx_v_o); + + /* "oursqlx/statement.pyx":365 + * c.t.month = PyDateTime_GET_MONTH(o) + * c.t.day = PyDateTime_GET_DAY(o) + * b.buffer = &c.t # <<<<<<<<<<<<<< + * elif PyTime_Check(o): + * b.buffer_type = MYSQL_TYPE_TIME + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t)); + + /* "oursqlx/statement.pyx":360 + * c.t.second_part = PyDateTime_DATE_GET_MICROSECOND(o) + * b.buffer = &c.t + * elif PyDate_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_DATE + * c.t.year = PyDateTime_GET_YEAR(o) + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":366 + * c.t.day = PyDateTime_GET_DAY(o) + * b.buffer = &c.t + * elif PyTime_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_TIME + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) + */ + __pyx_t_11 = (PyTime_Check(__pyx_v_o) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":367 + * b.buffer = &c.t + * elif PyTime_Check(o): + * b.buffer_type = MYSQL_TYPE_TIME # <<<<<<<<<<<<<< + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) + * c.t.minute = PyDateTime_TIME_GET_MINUTE(o) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_TIME; + + /* "oursqlx/statement.pyx":368 + * elif PyTime_Check(o): + * b.buffer_type = MYSQL_TYPE_TIME + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) # <<<<<<<<<<<<<< + * c.t.minute = PyDateTime_TIME_GET_MINUTE(o) + * c.t.second = PyDateTime_TIME_GET_SECOND(o) + */ + __pyx_v_c->t.hour = PyDateTime_TIME_GET_HOUR(__pyx_v_o); + + /* "oursqlx/statement.pyx":369 + * b.buffer_type = MYSQL_TYPE_TIME + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) + * c.t.minute = PyDateTime_TIME_GET_MINUTE(o) # <<<<<<<<<<<<<< + * c.t.second = PyDateTime_TIME_GET_SECOND(o) + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) + */ + __pyx_v_c->t.minute = PyDateTime_TIME_GET_MINUTE(__pyx_v_o); + + /* "oursqlx/statement.pyx":370 + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) + * c.t.minute = PyDateTime_TIME_GET_MINUTE(o) + * c.t.second = PyDateTime_TIME_GET_SECOND(o) # <<<<<<<<<<<<<< + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) + * b.buffer = &c.t + */ + __pyx_v_c->t.second = PyDateTime_TIME_GET_SECOND(__pyx_v_o); + + /* "oursqlx/statement.pyx":371 + * c.t.minute = PyDateTime_TIME_GET_MINUTE(o) + * c.t.second = PyDateTime_TIME_GET_SECOND(o) + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) # <<<<<<<<<<<<<< + * b.buffer = &c.t + * elif isinstance(o, decimal.Decimal): + */ + __pyx_v_c->t.second_part = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o); + + /* "oursqlx/statement.pyx":372 + * c.t.second = PyDateTime_TIME_GET_SECOND(o) + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) + * b.buffer = &c.t # <<<<<<<<<<<<<< + * elif isinstance(o, decimal.Decimal): + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL + */ + __pyx_v_b->buffer = ((void *)(&__pyx_v_c->t)); + + /* "oursqlx/statement.pyx":366 + * c.t.day = PyDateTime_GET_DAY(o) + * b.buffer = &c.t + * elif PyTime_Check(o): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_TIME + * c.t.hour = PyDateTime_TIME_GET_HOUR(o) + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":373 + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) + * b.buffer = &c.t + * elif isinstance(o, decimal.Decimal): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL + * o = str(o).encode() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 373, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 373, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = PyObject_IsInstance(__pyx_v_o, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(4, 373, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":374 + * b.buffer = &c.t + * elif isinstance(o, decimal.Decimal): + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL # <<<<<<<<<<<<<< + * o = str(o).encode() + * temp_strings.append(o) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_NEWDECIMAL; + + /* "oursqlx/statement.pyx":375 + * elif isinstance(o, decimal.Decimal): + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL + * o = str(o).encode() # <<<<<<<<<<<<<< + * temp_strings.append(o) + * b.buffer = PyBytes_AS_STRING(o) + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_o); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 375, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_4), NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 375, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":376 + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL + * o = str(o).encode() + * temp_strings.append(o) # <<<<<<<<<<<<<< + * b.buffer = PyBytes_AS_STRING(o) + * c.ul = PyBytes_GET_SIZE(o) + */ + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_temp_strings, __pyx_v_o); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(4, 376, __pyx_L6_error) + + /* "oursqlx/statement.pyx":377 + * o = str(o).encode() + * temp_strings.append(o) + * b.buffer = PyBytes_AS_STRING(o) # <<<<<<<<<<<<<< + * c.ul = PyBytes_GET_SIZE(o) + * b.length = &c.ul + */ + __pyx_v_b->buffer = PyBytes_AS_STRING(__pyx_v_o); + + /* "oursqlx/statement.pyx":378 + * temp_strings.append(o) + * b.buffer = PyBytes_AS_STRING(o) + * c.ul = PyBytes_GET_SIZE(o) # <<<<<<<<<<<<<< + * b.length = &c.ul + * elif isinstance(o, _AbstractIterWrapper): + */ + __pyx_v_c->ul = PyBytes_GET_SIZE(__pyx_v_o); + + /* "oursqlx/statement.pyx":379 + * b.buffer = PyBytes_AS_STRING(o) + * c.ul = PyBytes_GET_SIZE(o) + * b.length = &c.ul # <<<<<<<<<<<<<< + * elif isinstance(o, _AbstractIterWrapper): + * b.buffer_type = MYSQL_TYPE_STRING + */ + __pyx_v_b->length = (&__pyx_v_c->ul); + + /* "oursqlx/statement.pyx":373 + * c.t.second_part = PyDateTime_TIME_GET_MICROSECOND(o) + * b.buffer = &c.t + * elif isinstance(o, decimal.Decimal): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_NEWDECIMAL + * o = str(o).encode() + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":380 + * c.ul = PyBytes_GET_SIZE(o) + * b.length = &c.ul + * elif isinstance(o, _AbstractIterWrapper): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * b.length = &c.ul + */ + __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_o, __pyx_ptype_6oursql__AbstractIterWrapper); + __pyx_t_11 = (__pyx_t_2 != 0); + if (likely(__pyx_t_11)) { + + /* "oursqlx/statement.pyx":381 + * b.length = &c.ul + * elif isinstance(o, _AbstractIterWrapper): + * b.buffer_type = MYSQL_TYPE_STRING # <<<<<<<<<<<<<< + * b.length = &c.ul + * long_strings.append((i, o)) + */ + __pyx_v_b->buffer_type = MYSQL_TYPE_STRING; + + /* "oursqlx/statement.pyx":382 + * elif isinstance(o, _AbstractIterWrapper): + * b.buffer_type = MYSQL_TYPE_STRING + * b.length = &c.ul # <<<<<<<<<<<<<< + * long_strings.append((i, o)) + * else: + */ + __pyx_v_b->length = (&__pyx_v_c->ul); + + /* "oursqlx/statement.pyx":383 + * b.buffer_type = MYSQL_TYPE_STRING + * b.length = &c.ul + * long_strings.append((i, o)) # <<<<<<<<<<<<<< + * else: + * raise TypeError('cannot bind %r object' % o.__class__) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 383, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 383, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_o); + __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_long_strings, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(4, 383, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":380 + * c.ul = PyBytes_GET_SIZE(o) + * b.length = &c.ul + * elif isinstance(o, _AbstractIterWrapper): # <<<<<<<<<<<<<< + * b.buffer_type = MYSQL_TYPE_STRING + * b.length = &c.ul + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":385 + * long_strings.append((i, o)) + * else: + * raise TypeError('cannot bind %r object' % o.__class__) # <<<<<<<<<<<<<< + * if mysql_stmt_bind_param(self.stmt, bind): + * self._raise_error() + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 385, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_bind_r_object, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 385, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 385, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(4, 385, __pyx_L6_error) + } + __pyx_L12:; + } + + /* "oursqlx/statement.pyx":293 + * temp_strings = [] + * try: + * if n_params > 0: # <<<<<<<<<<<<<< + * buf = PyMem_Malloc( + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + */ + } + + /* "oursqlx/statement.pyx":386 + * else: + * raise TypeError('cannot bind %r object' % o.__class__) + * if mysql_stmt_bind_param(self.stmt, bind): # <<<<<<<<<<<<<< + * self._raise_error() + * for i, o in long_strings: + */ + __pyx_t_11 = (mysql_stmt_bind_param(__pyx_v_self->stmt, __pyx_v_bind) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":387 + * raise TypeError('cannot bind %r object' % o.__class__) + * if mysql_stmt_bind_param(self.stmt, bind): + * self._raise_error() # <<<<<<<<<<<<<< + * for i, o in long_strings: + * for s in o: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 387, __pyx_L6_error) + + /* "oursqlx/statement.pyx":386 + * else: + * raise TypeError('cannot bind %r object' % o.__class__) + * if mysql_stmt_bind_param(self.stmt, bind): # <<<<<<<<<<<<<< + * self._raise_error() + * for i, o in long_strings: + */ + } + + /* "oursqlx/statement.pyx":388 + * if mysql_stmt_bind_param(self.stmt, bind): + * self._raise_error() + * for i, o in long_strings: # <<<<<<<<<<<<<< + * for s in o: + * if self.conn.use_unicode: + */ + __pyx_t_4 = __pyx_v_long_strings; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 388, __pyx_L6_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 388, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(4, 388, __pyx_L6_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 388, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 388, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 388, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_8)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_5 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(4, 388, __pyx_L6_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L19_unpacking_done; + __pyx_L18_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(4, 388, __pyx_L6_error) + __pyx_L19_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 388, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_i = __pyx_t_13; + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursqlx/statement.pyx":389 + * self._raise_error() + * for i, o in long_strings: + * for s in o: # <<<<<<<<<<<<<< + * if self.conn.use_unicode: + * s = s.encode(self.conn._charset) + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_18 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 389, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_18 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 389, __pyx_L6_error) + } + for (;;) { + if (likely(!__pyx_t_18)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 389, __pyx_L6_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 389, __pyx_L6_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 389, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_18(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(4, 389, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursqlx/statement.pyx":390 + * for i, o in long_strings: + * for s in o: + * if self.conn.use_unicode: # <<<<<<<<<<<<<< + * s = s.encode(self.conn._charset) + * PyBytes_AsStringAndSize(s, + */ + __pyx_t_11 = (__pyx_v_self->conn->use_unicode != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":391 + * for s in o: + * if self.conn.use_unicode: + * s = s.encode(self.conn._charset) # <<<<<<<<<<<<<< + * PyBytes_AsStringAndSize(s, + * &long_buffer, &long_buffer_size) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 391, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_16, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 391, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursqlx/statement.pyx":390 + * for i, o in long_strings: + * for s in o: + * if self.conn.use_unicode: # <<<<<<<<<<<<<< + * s = s.encode(self.conn._charset) + * PyBytes_AsStringAndSize(s, + */ + } + + /* "oursqlx/statement.pyx":392 + * if self.conn.use_unicode: + * s = s.encode(self.conn._charset) + * PyBytes_AsStringAndSize(s, # <<<<<<<<<<<<<< + * &long_buffer, &long_buffer_size) + * if mysql_stmt_send_long_data(self.stmt, i, + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_s, ((char **)(&__pyx_v_long_buffer)), (&__pyx_v_long_buffer_size)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 392, __pyx_L6_error) + + /* "oursqlx/statement.pyx":394 + * PyBytes_AsStringAndSize(s, + * &long_buffer, &long_buffer_size) + * if mysql_stmt_send_long_data(self.stmt, i, # <<<<<<<<<<<<<< + * long_buffer, long_buffer_size): + * self._raise_error() + */ + __pyx_t_11 = (__pyx_f_6oursql_mysql_stmt_send_long_data(__pyx_v_self->stmt, __pyx_v_i, ((char *)__pyx_v_long_buffer), __pyx_v_long_buffer_size) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":396 + * if mysql_stmt_send_long_data(self.stmt, i, + * long_buffer, long_buffer_size): + * self._raise_error() # <<<<<<<<<<<<<< + * if mysql_stmt_execute(self.stmt): + * self._raise_error() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 396, __pyx_L6_error) + + /* "oursqlx/statement.pyx":394 + * PyBytes_AsStringAndSize(s, + * &long_buffer, &long_buffer_size) + * if mysql_stmt_send_long_data(self.stmt, i, # <<<<<<<<<<<<<< + * long_buffer, long_buffer_size): + * self._raise_error() + */ + } + + /* "oursqlx/statement.pyx":389 + * self._raise_error() + * for i, o in long_strings: + * for s in o: # <<<<<<<<<<<<<< + * if self.conn.use_unicode: + * s = s.encode(self.conn._charset) + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":388 + * if mysql_stmt_bind_param(self.stmt, bind): + * self._raise_error() + * for i, o in long_strings: # <<<<<<<<<<<<<< + * for s in o: + * if self.conn.use_unicode: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":397 + * long_buffer, long_buffer_size): + * self._raise_error() + * if mysql_stmt_execute(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): + */ + __pyx_t_11 = (__pyx_f_6oursql_mysql_stmt_execute(__pyx_v_self->stmt) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":398 + * self._raise_error() + * if mysql_stmt_execute(self.stmt): + * self._raise_error() # <<<<<<<<<<<<<< + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): + * self._raise_error() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 398, __pyx_L6_error) + + /* "oursqlx/statement.pyx":397 + * long_buffer, long_buffer_size): + * self._raise_error() + * if mysql_stmt_execute(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): + */ + } + + /* "oursqlx/statement.pyx":399 + * if mysql_stmt_execute(self.stmt): + * self._raise_error() + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): # <<<<<<<<<<<<<< + * self._raise_error() + * self.exhausted = False + */ + __pyx_t_11 = (_oursqlx_stmt_cursor_prefetch(__pyx_v_self->stmt, (&__pyx_v_self->buffered)) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":400 + * self._raise_error() + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): + * self._raise_error() # <<<<<<<<<<<<<< + * self.exhausted = False + * if self.result_data: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 400, __pyx_L6_error) + + /* "oursqlx/statement.pyx":399 + * if mysql_stmt_execute(self.stmt): + * self._raise_error() + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): # <<<<<<<<<<<<<< + * self._raise_error() + * self.exhausted = False + */ + } + + /* "oursqlx/statement.pyx":401 + * if _oursqlx_stmt_cursor_prefetch(self.stmt, &self.buffered): + * self._raise_error() + * self.exhausted = False # <<<<<<<<<<<<<< + * if self.result_data: + * self.data_waiting = True + */ + __pyx_v_self->exhausted = 0; + + /* "oursqlx/statement.pyx":402 + * self._raise_error() + * self.exhausted = False + * if self.result_data: # <<<<<<<<<<<<<< + * self.data_waiting = True + * if self.conn.warning_count(): + */ + __pyx_t_11 = (__pyx_v_self->result_data != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":403 + * self.exhausted = False + * if self.result_data: + * self.data_waiting = True # <<<<<<<<<<<<<< + * if self.conn.warning_count(): + * self.warnings.extend(_do_warnings_query(self.conn)) + */ + __pyx_v_self->data_waiting = 1; + + /* "oursqlx/statement.pyx":402 + * self._raise_error() + * self.exhausted = False + * if self.result_data: # <<<<<<<<<<<<<< + * self.data_waiting = True + * if self.conn.warning_count(): + */ + } + + /* "oursqlx/statement.pyx":404 + * if self.result_data: + * self.data_waiting = True + * if self.conn.warning_count(): # <<<<<<<<<<<<<< + * self.warnings.extend(_do_warnings_query(self.conn)) + * finally: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_warning_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 404, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 404, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(4, 404, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":405 + * self.data_waiting = True + * if self.conn.warning_count(): + * self.warnings.extend(_do_warnings_query(self.conn)) # <<<<<<<<<<<<<< + * finally: + * PyMem_Free(buf) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->warnings, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 405, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_do_warnings_query); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 405, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_16, ((PyObject *)__pyx_v_self->conn)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_self->conn)); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 405, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 405, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":404 + * if self.result_data: + * self.data_waiting = True + * if self.conn.warning_count(): # <<<<<<<<<<<<<< + * self.warnings.extend(_do_warnings_query(self.conn)) + * finally: + */ + } + } + + /* "oursqlx/statement.pyx":407 + * self.warnings.extend(_do_warnings_query(self.conn)) + * finally: + * PyMem_Free(buf) # <<<<<<<<<<<<<< + * + * def fetchone(self): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_buf); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_24); + __Pyx_XGOTREF(__pyx_t_25); + __Pyx_XGOTREF(__pyx_t_26); + __pyx_t_1 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + PyMem_Free(__pyx_v_buf); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_XGIVEREF(__pyx_t_25); + __Pyx_XGIVEREF(__pyx_t_26); + __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); + } + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23); + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "oursqlx/statement.pyx":274 + * return [x[0] for x in desc] + * + * def execute(self, *parameters): # <<<<<<<<<<<<<< + * cdef char *buf = NULL + * cdef void *long_buffer + */ + + /* function exit code */ + __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_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("oursql._Statement.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_long_strings); + __Pyx_XDECREF(__pyx_v_temp_strings); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":409 + * PyMem_Free(buf) + * + * def fetchone(self): # <<<<<<<<<<<<<< + * cdef MYSQL_BIND b_tryagain + * cdef column_output *c + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_11fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_11fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_10fetchone(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_10fetchone(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + MYSQL_BIND __pyx_v_b_tryagain; + struct __pyx_t_6oursql_column_output *__pyx_v_c; + union __pyx_t_6oursql_column_data *__pyx_v_d; + unsigned int __pyx_v_i; + int __pyx_v_result; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + unsigned long __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_UCS4 __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchone", 0); + + /* "oursqlx/statement.pyx":416 + * cdef int result + * cdef uint64_t u + * self._check_closed() # <<<<<<<<<<<<<< + * if not self.result_data or self.exhausted: + * return None + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 416, __pyx_L1_error) + + /* "oursqlx/statement.pyx":417 + * cdef uint64_t u + * self._check_closed() + * if not self.result_data or self.exhausted: # <<<<<<<<<<<<<< + * return None + * elif self.result_data: + */ + __pyx_t_3 = ((!(__pyx_v_self->result_data != 0)) != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_self->exhausted != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":418 + * self._check_closed() + * if not self.result_data or self.exhausted: + * return None # <<<<<<<<<<<<<< + * elif self.result_data: + * self._bind_buffer() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":417 + * cdef uint64_t u + * self._check_closed() + * if not self.result_data or self.exhausted: # <<<<<<<<<<<<<< + * return None + * elif self.result_data: + */ + } + + /* "oursqlx/statement.pyx":419 + * if not self.result_data or self.exhausted: + * return None + * elif self.result_data: # <<<<<<<<<<<<<< + * self._bind_buffer() + * result = mysql_stmt_fetch(self.stmt) + */ + __pyx_t_2 = (__pyx_v_self->result_data != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":420 + * return None + * elif self.result_data: + * self._bind_buffer() # <<<<<<<<<<<<<< + * result = mysql_stmt_fetch(self.stmt) + * self.fetched += 1 + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_bind_buffer(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 420, __pyx_L1_error) + + /* "oursqlx/statement.pyx":419 + * if not self.result_data or self.exhausted: + * return None + * elif self.result_data: # <<<<<<<<<<<<<< + * self._bind_buffer() + * result = mysql_stmt_fetch(self.stmt) + */ + } + + /* "oursqlx/statement.pyx":421 + * elif self.result_data: + * self._bind_buffer() + * result = mysql_stmt_fetch(self.stmt) # <<<<<<<<<<<<<< + * self.fetched += 1 + * if result == 1: + */ + __pyx_v_result = __pyx_f_6oursql_mysql_stmt_fetch(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":422 + * self._bind_buffer() + * result = mysql_stmt_fetch(self.stmt) + * self.fetched += 1 # <<<<<<<<<<<<<< + * if result == 1: + * self._raise_error() + */ + __pyx_v_self->fetched = (__pyx_v_self->fetched + 1); + + /* "oursqlx/statement.pyx":423 + * result = mysql_stmt_fetch(self.stmt) + * self.fetched += 1 + * if result == 1: # <<<<<<<<<<<<<< + * self._raise_error() + * elif result == MYSQL_NO_DATA: + */ + __pyx_t_2 = ((__pyx_v_result == 1) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":424 + * self.fetched += 1 + * if result == 1: + * self._raise_error() # <<<<<<<<<<<<<< + * elif result == MYSQL_NO_DATA: + * if mysql_stmt_free_result(self.stmt): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 424, __pyx_L1_error) + + /* "oursqlx/statement.pyx":423 + * result = mysql_stmt_fetch(self.stmt) + * self.fetched += 1 + * if result == 1: # <<<<<<<<<<<<<< + * self._raise_error() + * elif result == MYSQL_NO_DATA: + */ + goto __pyx_L6; + } + + /* "oursqlx/statement.pyx":425 + * if result == 1: + * self._raise_error() + * elif result == MYSQL_NO_DATA: # <<<<<<<<<<<<<< + * if mysql_stmt_free_result(self.stmt): + * self._raise_error() + */ + __pyx_t_2 = ((__pyx_v_result == MYSQL_NO_DATA) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":426 + * self._raise_error() + * elif result == MYSQL_NO_DATA: + * if mysql_stmt_free_result(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * self.buffered = self.data_waiting = False + */ + __pyx_t_2 = (mysql_stmt_free_result(__pyx_v_self->stmt) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":427 + * elif result == MYSQL_NO_DATA: + * if mysql_stmt_free_result(self.stmt): + * self._raise_error() # <<<<<<<<<<<<<< + * self.buffered = self.data_waiting = False + * self.exhausted = True + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 427, __pyx_L1_error) + + /* "oursqlx/statement.pyx":426 + * self._raise_error() + * elif result == MYSQL_NO_DATA: + * if mysql_stmt_free_result(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * self.buffered = self.data_waiting = False + */ + } + + /* "oursqlx/statement.pyx":428 + * if mysql_stmt_free_result(self.stmt): + * self._raise_error() + * self.buffered = self.data_waiting = False # <<<<<<<<<<<<<< + * self.exhausted = True + * return None + */ + __pyx_v_self->buffered = 0; + __pyx_v_self->data_waiting = 0; + + /* "oursqlx/statement.pyx":429 + * self._raise_error() + * self.buffered = self.data_waiting = False + * self.exhausted = True # <<<<<<<<<<<<<< + * return None + * if self.result_fields == 0: + */ + __pyx_v_self->exhausted = 1; + + /* "oursqlx/statement.pyx":430 + * self.buffered = self.data_waiting = False + * self.exhausted = True + * return None # <<<<<<<<<<<<<< + * if self.result_fields == 0: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":425 + * if result == 1: + * self._raise_error() + * elif result == MYSQL_NO_DATA: # <<<<<<<<<<<<<< + * if mysql_stmt_free_result(self.stmt): + * self._raise_error() + */ + } + __pyx_L6:; + + /* "oursqlx/statement.pyx":431 + * self.exhausted = True + * return None + * if self.result_fields == 0: # <<<<<<<<<<<<<< + * return () + * ret = PyTuple_New(self.result_fields) + */ + __pyx_t_2 = ((__pyx_v_self->result_fields == 0) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":432 + * return None + * if self.result_fields == 0: + * return () # <<<<<<<<<<<<<< + * ret = PyTuple_New(self.result_fields) + * # Cache the connection charset. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":431 + * self.exhausted = True + * return None + * if self.result_fields == 0: # <<<<<<<<<<<<<< + * return () + * ret = PyTuple_New(self.result_fields) + */ + } + + /* "oursqlx/statement.pyx":433 + * if self.result_fields == 0: + * return () + * ret = PyTuple_New(self.result_fields) # <<<<<<<<<<<<<< + * # Cache the connection charset. + * self.conn.charset + */ + __pyx_t_4 = PyTuple_New(__pyx_v_self->result_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ret = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":435 + * ret = PyTuple_New(self.result_fields) + * # Cache the connection charset. + * self.conn.charset # <<<<<<<<<<<<<< + * for 0 <= i < self.result_fields: + * c = &self.result_data[i] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":436 + * # Cache the connection charset. + * self.conn.charset + * for 0 <= i < self.result_fields: # <<<<<<<<<<<<<< + * c = &self.result_data[i] + * d = &c.buf + */ + __pyx_t_5 = __pyx_v_self->result_fields; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { + + /* "oursqlx/statement.pyx":437 + * self.conn.charset + * for 0 <= i < self.result_fields: + * c = &self.result_data[i] # <<<<<<<<<<<<<< + * d = &c.buf + * if c.is_null: + */ + __pyx_v_c = (&(__pyx_v_self->result_data[__pyx_v_i])); + + /* "oursqlx/statement.pyx":438 + * for 0 <= i < self.result_fields: + * c = &self.result_data[i] + * d = &c.buf # <<<<<<<<<<<<<< + * if c.is_null: + * val = None + */ + __pyx_v_d = (&__pyx_v_c->buf); + + /* "oursqlx/statement.pyx":439 + * c = &self.result_data[i] + * d = &c.buf + * if c.is_null: # <<<<<<<<<<<<<< + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, + */ + __pyx_t_2 = (__pyx_v_c->is_null != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":440 + * d = &c.buf + * if c.is_null: + * val = None # <<<<<<<<<<<<<< + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, + * MYSQL_TYPE_VAR_STRING): + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_val, Py_None); + + /* "oursqlx/statement.pyx":439 + * c = &self.result_data[i] + * d = &c.buf + * if c.is_null: # <<<<<<<<<<<<<< + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":441 + * if c.is_null: + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, # <<<<<<<<<<<<<< + * MYSQL_TYPE_VAR_STRING): + * # Oh string handling. + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + + /* "oursqlx/statement.pyx":442 + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, + * MYSQL_TYPE_VAR_STRING): # <<<<<<<<<<<<<< + * # Oh string handling. + * val = None + */ + __pyx_t_2 = 1; + + /* "oursqlx/statement.pyx":441 + * if c.is_null: + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, # <<<<<<<<<<<<<< + * MYSQL_TYPE_VAR_STRING): + * # Oh string handling. + */ + break; + default: + __pyx_t_2 = 0; + break; + } + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":444 + * MYSQL_TYPE_VAR_STRING): + * # Oh string handling. + * val = None # <<<<<<<<<<<<<< + * # If the string wasn't too long to fit in our minimal buffer, + * # then we can just copy it out of the buffer. + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_val, Py_None); + + /* "oursqlx/statement.pyx":447 + * # If the string wasn't too long to fit in our minimal buffer, + * # then we can just copy it out of the buffer. + * if not c.error: # <<<<<<<<<<<<<< + * val = PyBytes_FromStringAndSize(&d.c, c.length) + * # If we already have all the results stored clientside, or we + */ + __pyx_t_3 = ((!(__pyx_v_c->error != 0)) != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":448 + * # then we can just copy it out of the buffer. + * if not c.error: + * val = PyBytes_FromStringAndSize(&d.c, c.length) # <<<<<<<<<<<<<< + * # If we already have all the results stored clientside, or we + * # don't care about strings being too long, or we *do* care + */ + __pyx_t_4 = PyBytes_FromStringAndSize((&__pyx_v_d->c), __pyx_v_c->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":447 + * # If the string wasn't too long to fit in our minimal buffer, + * # then we can just copy it out of the buffer. + * if not c.error: # <<<<<<<<<<<<<< + * val = PyBytes_FromStringAndSize(&d.c, c.length) + * # If we already have all the results stored clientside, or we + */ + goto __pyx_L12; + } + + /* "oursqlx/statement.pyx":452 + * # don't care about strings being too long, or we *do* care + * # about strings being too long and it's not too long... + * elif (self.buffered # <<<<<<<<<<<<<< + * or not self.string_limit + * or c.length <= self.string_limit): + */ + __pyx_t_2 = (__pyx_v_self->buffered != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L13_bool_binop_done; + } + + /* "oursqlx/statement.pyx":453 + * # about strings being too long and it's not too long... + * elif (self.buffered + * or not self.string_limit # <<<<<<<<<<<<<< + * or c.length <= self.string_limit): + * # First, allocate a string of the necessary length. + */ + __pyx_t_2 = ((!(__pyx_v_self->string_limit != 0)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L13_bool_binop_done; + } + + /* "oursqlx/statement.pyx":454 + * elif (self.buffered + * or not self.string_limit + * or c.length <= self.string_limit): # <<<<<<<<<<<<<< + * # First, allocate a string of the necessary length. + * val = PyBytes_FromStringAndSize(NULL, c.length) + */ + __pyx_t_2 = ((__pyx_v_c->length <= __pyx_v_self->string_limit) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L13_bool_binop_done:; + + /* "oursqlx/statement.pyx":452 + * # don't care about strings being too long, or we *do* care + * # about strings being too long and it's not too long... + * elif (self.buffered # <<<<<<<<<<<<<< + * or not self.string_limit + * or c.length <= self.string_limit): + */ + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":456 + * or c.length <= self.string_limit): + * # First, allocate a string of the necessary length. + * val = PyBytes_FromStringAndSize(NULL, c.length) # <<<<<<<<<<<<<< + * # Then, fill up a MYSQL_BIND that will fetch into the + * # aforementioned string. + */ + __pyx_t_4 = PyBytes_FromStringAndSize(NULL, __pyx_v_c->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":459 + * # Then, fill up a MYSQL_BIND that will fetch into the + * # aforementioned string. + * memset(&b_tryagain, 0, sizeof(MYSQL_BIND)) # <<<<<<<<<<<<<< + * b_tryagain.buffer_type = MYSQL_TYPE_BLOB + * b_tryagain.buffer_length = c.length + */ + (void)(memset((&__pyx_v_b_tryagain), 0, (sizeof(MYSQL_BIND)))); + + /* "oursqlx/statement.pyx":460 + * # aforementioned string. + * memset(&b_tryagain, 0, sizeof(MYSQL_BIND)) + * b_tryagain.buffer_type = MYSQL_TYPE_BLOB # <<<<<<<<<<<<<< + * b_tryagain.buffer_length = c.length + * b_tryagain.buffer = PyBytes_AS_STRING(val) + */ + __pyx_v_b_tryagain.buffer_type = MYSQL_TYPE_BLOB; + + /* "oursqlx/statement.pyx":461 + * memset(&b_tryagain, 0, sizeof(MYSQL_BIND)) + * b_tryagain.buffer_type = MYSQL_TYPE_BLOB + * b_tryagain.buffer_length = c.length # <<<<<<<<<<<<<< + * b_tryagain.buffer = PyBytes_AS_STRING(val) + * # This means that if there is still a truncation error for + */ + __pyx_t_6 = __pyx_v_c->length; + __pyx_v_b_tryagain.buffer_length = __pyx_t_6; + + /* "oursqlx/statement.pyx":462 + * b_tryagain.buffer_type = MYSQL_TYPE_BLOB + * b_tryagain.buffer_length = c.length + * b_tryagain.buffer = PyBytes_AS_STRING(val) # <<<<<<<<<<<<<< + * # This means that if there is still a truncation error for + * # whatever reason, something later in the function will + */ + __pyx_v_b_tryagain.buffer = PyBytes_AS_STRING(__pyx_v_val); + + /* "oursqlx/statement.pyx":466 + * # whatever reason, something later in the function will + * # complain. + * b_tryagain.error = &c.error # <<<<<<<<<<<<<< + * # Aaand fetch it. + * if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0): + */ + __pyx_v_b_tryagain.error = (&__pyx_v_c->error); + + /* "oursqlx/statement.pyx":468 + * b_tryagain.error = &c.error + * # Aaand fetch it. + * if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0): # <<<<<<<<<<<<<< + * self._raise_error() + * # But, if we care about the length of the string, we need to + */ + __pyx_t_3 = (__pyx_f_6oursql_mysql_stmt_fetch_column(__pyx_v_self->stmt, (&__pyx_v_b_tryagain), __pyx_v_i, 0) != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":469 + * # Aaand fetch it. + * if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0): + * self._raise_error() # <<<<<<<<<<<<<< + * # But, if we care about the length of the string, we need to + * # make sure we have a consistent API. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 469, __pyx_L1_error) + + /* "oursqlx/statement.pyx":468 + * b_tryagain.error = &c.error + * # Aaand fetch it. + * if mysql_stmt_fetch_column(self.stmt, &b_tryagain, i, 0): # <<<<<<<<<<<<<< + * self._raise_error() + * # But, if we care about the length of the string, we need to + */ + } + + /* "oursqlx/statement.pyx":452 + * # don't care about strings being too long, or we *do* care + * # about strings being too long and it's not too long... + * elif (self.buffered # <<<<<<<<<<<<<< + * or not self.string_limit + * or c.length <= self.string_limit): + */ + } + __pyx_L12:; + + /* "oursqlx/statement.pyx":472 + * # But, if we care about the length of the string, we need to + * # make sure we have a consistent API. + * if self.string_limit: # <<<<<<<<<<<<<< + * # At this point, if 'val' still isn't set, it means we + * # should stream it from the database. + */ + __pyx_t_3 = (__pyx_v_self->string_limit != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":475 + * # At this point, if 'val' still isn't set, it means we + * # should stream it from the database. + * if val is None: # <<<<<<<<<<<<<< + * val = _ResultStringStream(self, i, c.length) + * c.error = False + */ + __pyx_t_3 = (__pyx_v_val == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":476 + * # should stream it from the database. + * if val is None: + * val = _ResultStringStream(self, i, c.length) # <<<<<<<<<<<<<< + * c.error = False + * # Since _ResultStringStream has a file-like interface, we + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyInt_From_unsigned_long(__pyx_v_c->length); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__ResultStringStream), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":477 + * if val is None: + * val = _ResultStringStream(self, i, c.length) + * c.error = False # <<<<<<<<<<<<<< + * # Since _ResultStringStream has a file-like interface, we + * # make sure that everything passed back has a file-like + */ + __pyx_v_c->error = 0; + + /* "oursqlx/statement.pyx":475 + * # At this point, if 'val' still isn't set, it means we + * # should stream it from the database. + * if val is None: # <<<<<<<<<<<<<< + * val = _ResultStringStream(self, i, c.length) + * c.error = False + */ + goto __pyx_L18; + } + + /* "oursqlx/statement.pyx":482 + * # interface. + * else: + * val = io.BytesIO(val) # <<<<<<<<<<<<<< + * # And if we're decoding unicode, decode unicode in a + * # streaming fashion! + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_io); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + } + __pyx_L18:; + + /* "oursqlx/statement.pyx":485 + * # And if we're decoding unicode, decode unicode in a + * # streaming fashion! + * if self.conn.use_unicode and not c.is_binary: # <<<<<<<<<<<<<< + * val = codecs.getreader(self.conn._charset)(val) + * else: + */ + __pyx_t_3 = (__pyx_v_self->conn->use_unicode != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L20_bool_binop_done; + } + __pyx_t_3 = ((!(__pyx_v_c->is_binary != 0)) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L20_bool_binop_done:; + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":486 + * # streaming fashion! + * if self.conn.use_unicode and not c.is_binary: + * val = codecs.getreader(self.conn._charset)(val) # <<<<<<<<<<<<<< + * else: + * # At this point, 'val' should be a string read in from the + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_codecs); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getreader); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":485 + * # And if we're decoding unicode, decode unicode in a + * # streaming fashion! + * if self.conn.use_unicode and not c.is_binary: # <<<<<<<<<<<<<< + * val = codecs.getreader(self.conn._charset)(val) + * else: + */ + } + + /* "oursqlx/statement.pyx":472 + * # But, if we care about the length of the string, we need to + * # make sure we have a consistent API. + * if self.string_limit: # <<<<<<<<<<<<<< + * # At this point, if 'val' still isn't set, it means we + * # should stream it from the database. + */ + goto __pyx_L17; + } + + /* "oursqlx/statement.pyx":491 + * # database since there's no possibility of streaming. If + * # we're handling unicode, decode it. + * if self.conn.use_unicode and not c.is_binary: # <<<<<<<<<<<<<< + * val = val.decode(self.conn._charset) + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->conn->use_unicode != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L23_bool_binop_done; + } + __pyx_t_3 = ((!(__pyx_v_c->is_binary != 0)) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L23_bool_binop_done:; + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":492 + * # we're handling unicode, decode it. + * if self.conn.use_unicode and not c.is_binary: + * val = val.decode(self.conn._charset) # <<<<<<<<<<<<<< + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): + * val = decimal.Decimal( + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":491 + * # database since there's no possibility of streaming. If + * # we're handling unicode, decode it. + * if self.conn.use_unicode and not c.is_binary: # <<<<<<<<<<<<<< + * val = val.decode(self.conn._charset) + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): + */ + } + } + __pyx_L17:; + + /* "oursqlx/statement.pyx":441 + * if c.is_null: + * val = None + * elif c.type in (MYSQL_TYPE_STRING, MYSQL_TYPE_BLOB, # <<<<<<<<<<<<<< + * MYSQL_TYPE_VAR_STRING): + * # Oh string handling. + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":493 + * if self.conn.use_unicode and not c.is_binary: + * val = val.decode(self.conn._charset) + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): # <<<<<<<<<<<<<< + * val = decimal.Decimal( + * PyBytes_FromStringAndSize(d.dec, c.length).decode(self.conn._charset)) + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + __pyx_t_2 = 1; + break; + default: + __pyx_t_2 = 0; + break; + } + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":494 + * val = val.decode(self.conn._charset) + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): + * val = decimal.Decimal( # <<<<<<<<<<<<<< + * PyBytes_FromStringAndSize(d.dec, c.length).decode(self.conn._charset)) + * # Sometimes mysql likes to give back invalid data instead of doing + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":495 + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): + * val = decimal.Decimal( + * PyBytes_FromStringAndSize(d.dec, c.length).decode(self.conn._charset)) # <<<<<<<<<<<<<< + * # Sometimes mysql likes to give back invalid data instead of doing + * # anything sensible. + */ + __pyx_t_8 = PyBytes_FromStringAndSize(__pyx_v_d->dec, __pyx_v_c->length); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":493 + * if self.conn.use_unicode and not c.is_binary: + * val = val.decode(self.conn._charset) + * elif c.type in (MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDECIMAL): # <<<<<<<<<<<<<< + * val = decimal.Decimal( + * PyBytes_FromStringAndSize(d.dec, c.length).decode(self.conn._charset)) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":498 + * # Sometimes mysql likes to give back invalid data instead of doing + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATE: + + /* "oursqlx/statement.pyx":499 + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, + * MYSQL_TYPE_DATE) and d.t.year == 0: # <<<<<<<<<<<<<< + * val = None + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): + */ + __pyx_t_2 = 1; + + /* "oursqlx/statement.pyx":498 + * # Sometimes mysql likes to give back invalid data instead of doing + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + */ + break; + default: + __pyx_t_2 = 0; + break; + } + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + } else { + __pyx_t_3 = __pyx_t_11; + goto __pyx_L25_bool_binop_done; + } + + /* "oursqlx/statement.pyx":499 + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, + * MYSQL_TYPE_DATE) and d.t.year == 0: # <<<<<<<<<<<<<< + * val = None + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): + */ + __pyx_t_11 = ((__pyx_v_d->t.year == 0) != 0); + __pyx_t_3 = __pyx_t_11; + __pyx_L25_bool_binop_done:; + + /* "oursqlx/statement.pyx":498 + * # Sometimes mysql likes to give back invalid data instead of doing + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + */ + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":500 + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None # <<<<<<<<<<<<<< + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_val, Py_None); + + /* "oursqlx/statement.pyx":498 + * # Sometimes mysql likes to give back invalid data instead of doing + * # anything sensible. + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":501 + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): # <<<<<<<<<<<<<< + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_11 = (__pyx_t_3 != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":502 + * val = None + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, # <<<<<<<<<<<<<< + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_DATE: + */ + __pyx_t_7 = PyDateTime_FromDateAndTime(__pyx_v_d->t.year, __pyx_v_d->t.month, __pyx_v_d->t.day, __pyx_v_d->t.hour, __pyx_v_d->t.minute, __pyx_v_d->t.second, __pyx_v_d->t.second_part); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":501 + * MYSQL_TYPE_DATE) and d.t.year == 0: + * val = None + * elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP): # <<<<<<<<<<<<<< + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":504 + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_DATE: # <<<<<<<<<<<<<< + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) + * elif c.type == MYSQL_TYPE_TIME: + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_DATE) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":505 + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_DATE: + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) # <<<<<<<<<<<<<< + * elif c.type == MYSQL_TYPE_TIME: + * val = PyTime_FromTime( + */ + __pyx_t_7 = PyDate_FromDate(__pyx_v_d->t.year, __pyx_v_d->t.month, __pyx_v_d->t.day); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":504 + * val = PyDateTime_FromDateAndTime(d.t.year, d.t.month, d.t.day, + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_DATE: # <<<<<<<<<<<<<< + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) + * elif c.type == MYSQL_TYPE_TIME: + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":506 + * elif c.type == MYSQL_TYPE_DATE: + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) + * elif c.type == MYSQL_TYPE_TIME: # <<<<<<<<<<<<<< + * val = PyTime_FromTime( + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_TIME) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":507 + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) + * elif c.type == MYSQL_TYPE_TIME: + * val = PyTime_FromTime( # <<<<<<<<<<<<<< + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_TINY: + */ + __pyx_t_7 = PyTime_FromTime(__pyx_v_d->t.hour, __pyx_v_d->t.minute, __pyx_v_d->t.second, __pyx_v_d->t.second_part); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":506 + * elif c.type == MYSQL_TYPE_DATE: + * val = PyDate_FromDate(d.t.year, d.t.month, d.t.day) + * elif c.type == MYSQL_TYPE_TIME: # <<<<<<<<<<<<<< + * val = PyTime_FromTime( + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":509 + * val = PyTime_FromTime( + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_TINY: # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u8) + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_TINY) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":510 + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_TINY: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u8) + * else: + */ + __pyx_t_11 = (((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":511 + * elif c.type == MYSQL_TYPE_TINY: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u8) # <<<<<<<<<<<<<< + * else: + * val = PyLong_FromLong(d.s8) + */ + __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_d->u8); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":510 + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_TINY: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u8) + * else: + */ + goto __pyx_L27; + } + + /* "oursqlx/statement.pyx":513 + * val = PyLong_FromUnsignedLong(d.u8) + * else: + * val = PyLong_FromLong(d.s8) # <<<<<<<<<<<<<< + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + */ + /*else*/ { + __pyx_t_7 = PyLong_FromLong(__pyx_v_d->s8); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + } + __pyx_L27:; + + /* "oursqlx/statement.pyx":509 + * val = PyTime_FromTime( + * d.t.hour, d.t.minute, d.t.second, d.t.second_part) + * elif c.type == MYSQL_TYPE_TINY: # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u8) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":514 + * else: + * val = PyLong_FromLong(d.s8) + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u16) + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_YEAR: + __pyx_t_11 = 1; + break; + default: + __pyx_t_11 = 0; + break; + } + __pyx_t_3 = (__pyx_t_11 != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":515 + * val = PyLong_FromLong(d.s8) + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u16) + * else: + */ + __pyx_t_3 = (((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG) != 0); + if (__pyx_t_3) { + + /* "oursqlx/statement.pyx":516 + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u16) # <<<<<<<<<<<<<< + * else: + * val = PyLong_FromLong(d.s16) + */ + __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_d->u16); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":515 + * val = PyLong_FromLong(d.s8) + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u16) + * else: + */ + goto __pyx_L28; + } + + /* "oursqlx/statement.pyx":518 + * val = PyLong_FromUnsignedLong(d.u16) + * else: + * val = PyLong_FromLong(d.s16) # <<<<<<<<<<<<<< + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + */ + /*else*/ { + __pyx_t_7 = PyLong_FromLong(__pyx_v_d->s16); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + } + __pyx_L28:; + + /* "oursqlx/statement.pyx":514 + * else: + * val = PyLong_FromLong(d.s8) + * elif c.type in (MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR): # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u16) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":519 + * else: + * val = PyLong_FromLong(d.s16) + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u32) + */ + switch (__pyx_v_c->type) { + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_INT24: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_11 = (__pyx_t_3 != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":520 + * val = PyLong_FromLong(d.s16) + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u32) + * else: + */ + __pyx_t_11 = (((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":521 + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u32) # <<<<<<<<<<<<<< + * else: + * val = PyLong_FromLong(d.s32) + */ + __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_d->u32); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":520 + * val = PyLong_FromLong(d.s16) + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLong(d.u32) + * else: + */ + goto __pyx_L29; + } + + /* "oursqlx/statement.pyx":523 + * val = PyLong_FromUnsignedLong(d.u32) + * else: + * val = PyLong_FromLong(d.s32) # <<<<<<<<<<<<<< + * elif c.type == MYSQL_TYPE_LONGLONG: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + */ + /*else*/ { + __pyx_t_7 = PyLong_FromLong(__pyx_v_d->s32); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + } + __pyx_L29:; + + /* "oursqlx/statement.pyx":519 + * else: + * val = PyLong_FromLong(d.s16) + * elif c.type in (MYSQL_TYPE_LONG, MYSQL_TYPE_INT24): # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLong(d.u32) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":524 + * else: + * val = PyLong_FromLong(d.s32) + * elif c.type == MYSQL_TYPE_LONGLONG: # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLongLong(d.u64) + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_LONGLONG) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":525 + * val = PyLong_FromLong(d.s32) + * elif c.type == MYSQL_TYPE_LONGLONG: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLongLong(d.u64) + * else: + */ + __pyx_t_11 = (((__pyx_v_c->flags & UNSIGNED_FLAG) == UNSIGNED_FLAG) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":526 + * elif c.type == MYSQL_TYPE_LONGLONG: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLongLong(d.u64) # <<<<<<<<<<<<<< + * else: + * val = PyLong_FromLongLong(d.s64) + */ + __pyx_t_7 = PyLong_FromUnsignedLongLong(__pyx_v_d->u64); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":525 + * val = PyLong_FromLong(d.s32) + * elif c.type == MYSQL_TYPE_LONGLONG: + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: # <<<<<<<<<<<<<< + * val = PyLong_FromUnsignedLongLong(d.u64) + * else: + */ + goto __pyx_L30; + } + + /* "oursqlx/statement.pyx":528 + * val = PyLong_FromUnsignedLongLong(d.u64) + * else: + * val = PyLong_FromLongLong(d.s64) # <<<<<<<<<<<<<< + * elif c.type == MYSQL_TYPE_FLOAT: + * val = d.f + */ + /*else*/ { + __pyx_t_7 = PyLong_FromLongLong(__pyx_v_d->s64); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + } + __pyx_L30:; + + /* "oursqlx/statement.pyx":524 + * else: + * val = PyLong_FromLong(d.s32) + * elif c.type == MYSQL_TYPE_LONGLONG: # <<<<<<<<<<<<<< + * if c.flags & UNSIGNED_FLAG == UNSIGNED_FLAG: + * val = PyLong_FromUnsignedLongLong(d.u64) + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":529 + * else: + * val = PyLong_FromLongLong(d.s64) + * elif c.type == MYSQL_TYPE_FLOAT: # <<<<<<<<<<<<<< + * val = d.f + * elif c.type == MYSQL_TYPE_DOUBLE: + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_FLOAT) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":530 + * val = PyLong_FromLongLong(d.s64) + * elif c.type == MYSQL_TYPE_FLOAT: + * val = d.f # <<<<<<<<<<<<<< + * elif c.type == MYSQL_TYPE_DOUBLE: + * val = d.d + */ + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_d->f); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":529 + * else: + * val = PyLong_FromLongLong(d.s64) + * elif c.type == MYSQL_TYPE_FLOAT: # <<<<<<<<<<<<<< + * val = d.f + * elif c.type == MYSQL_TYPE_DOUBLE: + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":531 + * elif c.type == MYSQL_TYPE_FLOAT: + * val = d.f + * elif c.type == MYSQL_TYPE_DOUBLE: # <<<<<<<<<<<<<< + * val = d.d + * elif c.type == MYSQL_TYPE_BIT: + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_DOUBLE) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":532 + * val = d.f + * elif c.type == MYSQL_TYPE_DOUBLE: + * val = d.d # <<<<<<<<<<<<<< + * elif c.type == MYSQL_TYPE_BIT: + * # Bitfields column come variable-length and always in big- + */ + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_d->d); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":531 + * elif c.type == MYSQL_TYPE_FLOAT: + * val = d.f + * elif c.type == MYSQL_TYPE_DOUBLE: # <<<<<<<<<<<<<< + * val = d.d + * elif c.type == MYSQL_TYPE_BIT: + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":533 + * elif c.type == MYSQL_TYPE_DOUBLE: + * val = d.d + * elif c.type == MYSQL_TYPE_BIT: # <<<<<<<<<<<<<< + * # Bitfields column come variable-length and always in big- + * # endian format. Convert it to an int instead of passing back + */ + __pyx_t_11 = ((__pyx_v_c->type == MYSQL_TYPE_BIT) != 0); + if (__pyx_t_11) { + + /* "oursqlx/statement.pyx":538 + * # a string that people would probably be converting to ints + * # anyway. + * val = bitval_from_char_p(&d.c, c.length) # <<<<<<<<<<<<<< + * else: + * val = PyBytes_FromStringAndSize(&d.c, c.length) + */ + __pyx_t_7 = __Pyx_PyInt_From_unsigned_long(__pyx_f_6oursql_bitval_from_char_p(((unsigned char *)(&__pyx_v_d->c)), __pyx_v_c->length)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":533 + * elif c.type == MYSQL_TYPE_DOUBLE: + * val = d.d + * elif c.type == MYSQL_TYPE_BIT: # <<<<<<<<<<<<<< + * # Bitfields column come variable-length and always in big- + * # endian format. Convert it to an int instead of passing back + */ + goto __pyx_L11; + } + + /* "oursqlx/statement.pyx":540 + * val = bitval_from_char_p(&d.c, c.length) + * else: + * val = PyBytes_FromStringAndSize(&d.c, c.length) # <<<<<<<<<<<<<< + * PyErr_WarnEx(Warning, "unknown column returned as string", 1) + * if c.error: + */ + /*else*/ { + __pyx_t_7 = PyBytes_FromStringAndSize((&__pyx_v_d->c), __pyx_v_c->length); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/statement.pyx":541 + * else: + * val = PyBytes_FromStringAndSize(&d.c, c.length) + * PyErr_WarnEx(Warning, "unknown column returned as string", 1) # <<<<<<<<<<<<<< + * if c.error: + * # This *shouldn't* ever happen. + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Warning); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyErr_WarnEx(__pyx_t_7, ((char *)"unknown column returned as string"), 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 541, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_L11:; + + /* "oursqlx/statement.pyx":542 + * val = PyBytes_FromStringAndSize(&d.c, c.length) + * PyErr_WarnEx(Warning, "unknown column returned as string", 1) + * if c.error: # <<<<<<<<<<<<<< + * # This *shouldn't* ever happen. + * raise InterfaceError('truncated column %d, type %d' % ( + */ + __pyx_t_11 = (__pyx_v_c->error != 0); + if (unlikely(__pyx_t_11)) { + + /* "oursqlx/statement.pyx":544 + * if c.error: + * # This *shouldn't* ever happen. + * raise InterfaceError('truncated column %d, type %d' % ( # <<<<<<<<<<<<<< + * i, c.type)) + * Py_INCREF(val) + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = 0; + __pyx_t_13 = 127; + __Pyx_INCREF(__pyx_kp_u_truncated_column); + __pyx_t_12 += 17; + __Pyx_GIVEREF(__pyx_kp_u_truncated_column); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_truncated_column); + + /* "oursqlx/statement.pyx":545 + * # This *shouldn't* ever happen. + * raise InterfaceError('truncated column %d, type %d' % ( + * i, c.type)) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * PyTuple_SET_ITEM(ret, i, val) + */ + __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_INCREF(__pyx_kp_u_type); + __pyx_t_12 += 7; + __Pyx_GIVEREF(__pyx_kp_u_type); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_type); + __pyx_t_10 = __Pyx_PyUnicode_From_enum__enum_field_types(__pyx_v_c->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13; + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10); + __pyx_t_10 = 0; + + /* "oursqlx/statement.pyx":544 + * if c.error: + * # This *shouldn't* ever happen. + * raise InterfaceError('truncated column %d, type %d' % ( # <<<<<<<<<<<<<< + * i, c.type)) + * Py_INCREF(val) + */ + __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(4, 544, __pyx_L1_error) + + /* "oursqlx/statement.pyx":542 + * val = PyBytes_FromStringAndSize(&d.c, c.length) + * PyErr_WarnEx(Warning, "unknown column returned as string", 1) + * if c.error: # <<<<<<<<<<<<<< + * # This *shouldn't* ever happen. + * raise InterfaceError('truncated column %d, type %d' % ( + */ + } + + /* "oursqlx/statement.pyx":546 + * raise InterfaceError('truncated column %d, type %d' % ( + * i, c.type)) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(ret, i, val) + * return ret + */ + Py_INCREF(__pyx_v_val); + + /* "oursqlx/statement.pyx":547 + * i, c.type)) + * Py_INCREF(val) + * PyTuple_SET_ITEM(ret, i, val) # <<<<<<<<<<<<<< + * return ret + * + */ + PyTuple_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_val); + } + + /* "oursqlx/statement.pyx":548 + * Py_INCREF(val) + * PyTuple_SET_ITEM(ret, i, val) + * return ret # <<<<<<<<<<<<<< + * + * def fetchall(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":409 + * PyMem_Free(buf) + * + * def fetchone(self): # <<<<<<<<<<<<<< + * cdef MYSQL_BIND b_tryagain + * cdef column_output *c + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("oursql._Statement.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":550 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * # buffer_results() calls _check_closed() + * self.buffer_results() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_13fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_13fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_12fetchall(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_12fetchall(struct __pyx_obj_6oursql__Statement *__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("fetchall", 0); + + /* "oursqlx/statement.pyx":552 + * def fetchall(self): + * # buffer_results() calls _check_closed() + * self.buffer_results() # <<<<<<<<<<<<<< + * return PySequence_List(self) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffer_results); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":553 + * # buffer_results() calls _check_closed() + * self.buffer_results() + * return PySequence_List(self) # <<<<<<<<<<<<<< + * + * def buffer_results(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":550 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * # buffer_results() calls _check_closed() + * self.buffer_results() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._Statement.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":555 + * return PySequence_List(self) + * + * def buffer_results(self): # <<<<<<<<<<<<<< + * self._check_closed() + * if not self.buffered: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_15buffer_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_15buffer_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("buffer_results (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_14buffer_results(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_14buffer_results(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("buffer_results", 0); + + /* "oursqlx/statement.pyx":556 + * + * def buffer_results(self): + * self._check_closed() # <<<<<<<<<<<<<< + * if not self.buffered: + * if mysql_stmt_store_result(self.stmt): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 556, __pyx_L1_error) + + /* "oursqlx/statement.pyx":557 + * def buffer_results(self): + * self._check_closed() + * if not self.buffered: # <<<<<<<<<<<<<< + * if mysql_stmt_store_result(self.stmt): + * self._raise_error() + */ + __pyx_t_2 = ((!(__pyx_v_self->buffered != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":558 + * self._check_closed() + * if not self.buffered: + * if mysql_stmt_store_result(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * self.buffered = True + */ + __pyx_t_2 = (__pyx_f_6oursql_mysql_stmt_store_result(__pyx_v_self->stmt) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":559 + * if not self.buffered: + * if mysql_stmt_store_result(self.stmt): + * self._raise_error() # <<<<<<<<<<<<<< + * self.buffered = True + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 559, __pyx_L1_error) + + /* "oursqlx/statement.pyx":558 + * self._check_closed() + * if not self.buffered: + * if mysql_stmt_store_result(self.stmt): # <<<<<<<<<<<<<< + * self._raise_error() + * self.buffered = True + */ + } + + /* "oursqlx/statement.pyx":560 + * if mysql_stmt_store_result(self.stmt): + * self._raise_error() + * self.buffered = True # <<<<<<<<<<<<<< + * + * def nextset(self): + */ + __pyx_v_self->buffered = 1; + + /* "oursqlx/statement.pyx":557 + * def buffer_results(self): + * self._check_closed() + * if not self.buffered: # <<<<<<<<<<<<<< + * if mysql_stmt_store_result(self.stmt): + * self._raise_error() + */ + } + + /* "oursqlx/statement.pyx":555 + * return PySequence_List(self) + * + * def buffer_results(self): # <<<<<<<<<<<<<< + * self._check_closed() + * if not self.buffered: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql._Statement.buffer_results", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":562 + * self.buffered = True + * + * def nextset(self): # <<<<<<<<<<<<<< + * return False + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_17nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_17nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nextset (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_16nextset(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_16nextset(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nextset", 0); + + /* "oursqlx/statement.pyx":563 + * + * def nextset(self): + * return False # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":562 + * self.buffered = True + * + * def nextset(self): # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":565 + * return False + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_19__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_19__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_18__iter__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_18__iter__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "oursqlx/statement.pyx":566 + * + * def __iter__(self): + * self._check_closed() # <<<<<<<<<<<<<< + * return PyCallIter_New(self.fetchone, None) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 566, __pyx_L1_error) + + /* "oursqlx/statement.pyx":567 + * def __iter__(self): + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) # <<<<<<<<<<<<<< + * + * property rowcount: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":565 + * return False + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._Statement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":570 + * + * property rowcount: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef my_ulonglong res + * self._check_closed() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_8rowcount_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_8rowcount___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_8rowcount___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + my_ulonglong __pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/statement.pyx":572 + * def __get__(self): + * cdef my_ulonglong res + * self._check_closed() # <<<<<<<<<<<<<< + * res = mysql_stmt_affected_rows(self.stmt) + * if res == ull_negone: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 572, __pyx_L1_error) + + /* "oursqlx/statement.pyx":573 + * cdef my_ulonglong res + * self._check_closed() + * res = mysql_stmt_affected_rows(self.stmt) # <<<<<<<<<<<<<< + * if res == ull_negone: + * return -1 + */ + __pyx_v_res = mysql_stmt_affected_rows(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":574 + * self._check_closed() + * res = mysql_stmt_affected_rows(self.stmt) + * if res == ull_negone: # <<<<<<<<<<<<<< + * return -1 + * else: + */ + __pyx_t_2 = ((__pyx_v_res == __pyx_v_6oursql_ull_negone) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":575 + * res = mysql_stmt_affected_rows(self.stmt) + * if res == ull_negone: + * return -1 # <<<<<<<<<<<<<< + * else: + * return res + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":574 + * self._check_closed() + * res = mysql_stmt_affected_rows(self.stmt) + * if res == ull_negone: # <<<<<<<<<<<<<< + * return -1 + * else: + */ + } + + /* "oursqlx/statement.pyx":577 + * return -1 + * else: + * return res # <<<<<<<<<<<<<< + * + * property lastrowid: + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "oursqlx/statement.pyx":570 + * + * property rowcount: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef my_ulonglong res + * self._check_closed() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._Statement.rowcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":580 + * + * property lastrowid: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef my_ulonglong res + * self._check_closed() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_9lastrowid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_9lastrowid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_9lastrowid___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_9lastrowid___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + my_ulonglong __pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/statement.pyx":582 + * def __get__(self): + * cdef my_ulonglong res + * self._check_closed() # <<<<<<<<<<<<<< + * res = mysql_stmt_insert_id(self.stmt) + * if res == 0: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 582, __pyx_L1_error) + + /* "oursqlx/statement.pyx":583 + * cdef my_ulonglong res + * self._check_closed() + * res = mysql_stmt_insert_id(self.stmt) # <<<<<<<<<<<<<< + * if res == 0: + * return None + */ + __pyx_v_res = mysql_stmt_insert_id(__pyx_v_self->stmt); + + /* "oursqlx/statement.pyx":584 + * self._check_closed() + * res = mysql_stmt_insert_id(self.stmt) + * if res == 0: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_2 = ((__pyx_v_res == 0) != 0); + if (__pyx_t_2) { + + /* "oursqlx/statement.pyx":585 + * res = mysql_stmt_insert_id(self.stmt) + * if res == 0: + * return None # <<<<<<<<<<<<<< + * else: + * return res + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/statement.pyx":584 + * self._check_closed() + * res = mysql_stmt_insert_id(self.stmt) + * if res == 0: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "oursqlx/statement.pyx":587 + * return None + * else: + * return res # <<<<<<<<<<<<<< + * + * property prefetch_rows: + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "oursqlx/statement.pyx":580 + * + * property lastrowid: + * def __get__(self): # <<<<<<<<<<<<<< + * cdef my_ulonglong res + * self._check_closed() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._Statement.lastrowid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":590 + * + * property prefetch_rows: + * def __get__(self): # <<<<<<<<<<<<<< + * return self._prefetch_rows + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_13prefetch_rows_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_13prefetch_rows_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_13prefetch_rows___get__(struct __pyx_obj_6oursql__Statement *__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); + + /* "oursqlx/statement.pyx":591 + * property prefetch_rows: + * def __get__(self): + * return self._prefetch_rows # <<<<<<<<<<<<<< + * + * def __set__(self, unsigned long value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_prefetch_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":590 + * + * property prefetch_rows: + * def __get__(self): # <<<<<<<<<<<<<< + * return self._prefetch_rows + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":593 + * return self._prefetch_rows + * + * def __set__(self, unsigned long value): # <<<<<<<<<<<<<< + * if value < 1: + * raise ValueError('must prefetch at least 1 row') + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_Statement_13prefetch_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6oursql_10_Statement_13prefetch_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + unsigned long __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_unsigned_long(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(4, 593, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_10_Statement_13prefetch_rows_2__set__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), ((unsigned long)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_Statement_13prefetch_rows_2__set__(struct __pyx_obj_6oursql__Statement *__pyx_v_self, unsigned long __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "oursqlx/statement.pyx":594 + * + * def __set__(self, unsigned long value): + * if value < 1: # <<<<<<<<<<<<<< + * raise ValueError('must prefetch at least 1 row') + * self._prefetch_rows = value + */ + __pyx_t_1 = ((__pyx_v_value < 1) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":595 + * def __set__(self, unsigned long value): + * if value < 1: + * raise ValueError('must prefetch at least 1 row') # <<<<<<<<<<<<<< + * self._prefetch_rows = value + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(4, 595, __pyx_L1_error) + + /* "oursqlx/statement.pyx":594 + * + * def __set__(self, unsigned long value): + * if value < 1: # <<<<<<<<<<<<<< + * raise ValueError('must prefetch at least 1 row') + * self._prefetch_rows = value + */ + } + + /* "oursqlx/statement.pyx":596 + * if value < 1: + * raise ValueError('must prefetch at least 1 row') + * self._prefetch_rows = value # <<<<<<<<<<<<<< + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, + * &self._prefetch_rows): + */ + __pyx_v_self->_prefetch_rows = __pyx_v_value; + + /* "oursqlx/statement.pyx":597 + * raise ValueError('must prefetch at least 1 row') + * self._prefetch_rows = value + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, # <<<<<<<<<<<<<< + * &self._prefetch_rows): + * self._raise_error() + */ + __pyx_t_1 = (_oursqlx_stmt_set_prefetch_rows(__pyx_v_self->stmt, (&__pyx_v_self->_prefetch_rows)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":599 + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, + * &self._prefetch_rows): + * self._raise_error() # <<<<<<<<<<<<<< + * + * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement), + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 599, __pyx_L1_error) + + /* "oursqlx/statement.pyx":597 + * raise ValueError('must prefetch at least 1 row') + * self._prefetch_rows = value + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, # <<<<<<<<<<<<<< + * &self._prefetch_rows): + * self._raise_error() + */ + } + + /* "oursqlx/statement.pyx":593 + * return self._prefetch_rows + * + * def __set__(self, unsigned long value): # <<<<<<<<<<<<<< + * if value < 1: + * raise ValueError('must prefetch at least 1 row') + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._Statement.prefetch_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":99 + * cdef int buffered, data_waiting, show_table, exhausted + * cdef Connection conn + * cdef public object warnings # <<<<<<<<<<<<<< + * + * def __cinit__(self, Connection connection not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_8warnings_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_8warnings_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_8warnings___get__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_8warnings___get__(struct __pyx_obj_6oursql__Statement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->warnings); + __pyx_r = __pyx_v_self->warnings; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_Statement_8warnings_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6oursql_10_Statement_8warnings_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_8warnings_2__set__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_Statement_8warnings_2__set__(struct __pyx_obj_6oursql__Statement *__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->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_Statement_8warnings_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6oursql_10_Statement_8warnings_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_8warnings_4__del__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_Statement_8warnings_4__del__(struct __pyx_obj_6oursql__Statement *__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->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_20__reduce_cython__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Statement.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_Statement_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_Statement_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_Statement_22__setstate_cython__(((struct __pyx_obj_6oursql__Statement *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_Statement_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Statement *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Statement.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":620 + * cdef int done + * + * def __cinit__(self, _Statement stmt not None, unsigned int index, # <<<<<<<<<<<<<< + * unsigned int length): + * self.stmt = stmt + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_19_ResultStringStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_19_ResultStringStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6oursql__Statement *__pyx_v_stmt = 0; + unsigned int __pyx_v_index; + unsigned int __pyx_v_length; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stmt,&__pyx_n_s_index,&__pyx_n_s_length,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stmt)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(4, 620, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(4, 620, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 620, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_stmt = ((struct __pyx_obj_6oursql__Statement *)values[0]); + __pyx_v_index = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_index == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(4, 620, __pyx_L3_error) + __pyx_v_length = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_length == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(4, 621, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 620, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql._ResultStringStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stmt), __pyx_ptype_6oursql__Statement, 0, "stmt", 0))) __PYX_ERR(4, 620, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_19_ResultStringStream___cinit__(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self), __pyx_v_stmt, __pyx_v_index, __pyx_v_length); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_19_ResultStringStream___cinit__(struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, struct __pyx_obj_6oursql__Statement *__pyx_v_stmt, unsigned int __pyx_v_index, unsigned int __pyx_v_length) { + int __pyx_r; + __Pyx_RefNannyDeclarations + unsigned int __pyx_t_1; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "oursqlx/statement.pyx":622 + * def __cinit__(self, _Statement stmt not None, unsigned int index, + * unsigned int length): + * self.stmt = stmt # <<<<<<<<<<<<<< + * self.stmt_fetched = stmt.fetched + * self.index = index + */ + __Pyx_INCREF(((PyObject *)__pyx_v_stmt)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stmt)); + __Pyx_GOTREF(__pyx_v_self->stmt); + __Pyx_DECREF(((PyObject *)__pyx_v_self->stmt)); + __pyx_v_self->stmt = __pyx_v_stmt; + + /* "oursqlx/statement.pyx":623 + * unsigned int length): + * self.stmt = stmt + * self.stmt_fetched = stmt.fetched # <<<<<<<<<<<<<< + * self.index = index + * self.length = length + */ + __pyx_t_1 = __pyx_v_stmt->fetched; + __pyx_v_self->stmt_fetched = __pyx_t_1; + + /* "oursqlx/statement.pyx":624 + * self.stmt = stmt + * self.stmt_fetched = stmt.fetched + * self.index = index # <<<<<<<<<<<<<< + * self.length = length + * self.offset = 0 + */ + __pyx_v_self->index = __pyx_v_index; + + /* "oursqlx/statement.pyx":625 + * self.stmt_fetched = stmt.fetched + * self.index = index + * self.length = length # <<<<<<<<<<<<<< + * self.offset = 0 + * memset(&self.bind, 0, sizeof(MYSQL_BIND)) + */ + __pyx_v_self->length = __pyx_v_length; + + /* "oursqlx/statement.pyx":626 + * self.index = index + * self.length = length + * self.offset = 0 # <<<<<<<<<<<<<< + * memset(&self.bind, 0, sizeof(MYSQL_BIND)) + * self.bind.buffer_type = MYSQL_TYPE_BLOB + */ + __pyx_v_self->offset = 0; + + /* "oursqlx/statement.pyx":627 + * self.length = length + * self.offset = 0 + * memset(&self.bind, 0, sizeof(MYSQL_BIND)) # <<<<<<<<<<<<<< + * self.bind.buffer_type = MYSQL_TYPE_BLOB + * self.bind.length = &self.length + */ + (void)(memset((&__pyx_v_self->bind), 0, (sizeof(MYSQL_BIND)))); + + /* "oursqlx/statement.pyx":628 + * self.offset = 0 + * memset(&self.bind, 0, sizeof(MYSQL_BIND)) + * self.bind.buffer_type = MYSQL_TYPE_BLOB # <<<<<<<<<<<<<< + * self.bind.length = &self.length + * self.done = False + */ + __pyx_v_self->bind.buffer_type = MYSQL_TYPE_BLOB; + + /* "oursqlx/statement.pyx":629 + * memset(&self.bind, 0, sizeof(MYSQL_BIND)) + * self.bind.buffer_type = MYSQL_TYPE_BLOB + * self.bind.length = &self.length # <<<<<<<<<<<<<< + * self.done = False + * + */ + __pyx_v_self->bind.length = (&__pyx_v_self->length); + + /* "oursqlx/statement.pyx":630 + * self.bind.buffer_type = MYSQL_TYPE_BLOB + * self.bind.length = &self.length + * self.done = False # <<<<<<<<<<<<<< + * + * def read(self, Py_ssize_t size=-1): + */ + __pyx_v_self->done = 0; + + /* "oursqlx/statement.pyx":620 + * cdef int done + * + * def __cinit__(self, _Statement stmt not None, unsigned int index, # <<<<<<<<<<<<<< + * unsigned int length): + * self.stmt = stmt + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/statement.pyx":632 + * self.done = False + * + * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<< + * """read(size=-1) -> str + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_3read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_19_ResultStringStream_2read[] = "read(size=-1) -> str\n \n Read some bytes from the database. Reading -1 bytes will attempt to \n fetch all remaining bytes.\n "; +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_3read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + Py_ssize_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,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); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(4, 632, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 632, __pyx_L3_error) + } else { + __pyx_v_size = ((Py_ssize_t)-1L); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 632, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql._ResultStringStream.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_19_ResultStringStream_2read(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self), __pyx_v_size); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_2read(struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, Py_ssize_t __pyx_v_size) { + Py_ssize_t __pyx_v_left; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read", 0); + + /* "oursqlx/statement.pyx":639 + * """ + * cdef Py_ssize_t left + * if self.done: # <<<<<<<<<<<<<< + * return '' + * self.stmt._check_closed() + */ + __pyx_t_1 = (__pyx_v_self->done != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":640 + * cdef Py_ssize_t left + * if self.done: + * return '' # <<<<<<<<<<<<<< + * self.stmt._check_closed() + * if self.stmt.fetched != self.stmt_fetched: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__21); + __pyx_r = __pyx_kp_u__21; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":639 + * """ + * cdef Py_ssize_t left + * if self.done: # <<<<<<<<<<<<<< + * return '' + * self.stmt._check_closed() + */ + } + + /* "oursqlx/statement.pyx":641 + * if self.done: + * return '' + * self.stmt._check_closed() # <<<<<<<<<<<<<< + * if self.stmt.fetched != self.stmt_fetched: + * raise ProgrammingError('row no longer available from database') + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->stmt->__pyx_vtab)->_check_closed(__pyx_v_self->stmt); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 641, __pyx_L1_error) + + /* "oursqlx/statement.pyx":642 + * return '' + * self.stmt._check_closed() + * if self.stmt.fetched != self.stmt_fetched: # <<<<<<<<<<<<<< + * raise ProgrammingError('row no longer available from database') + * left = self.length - self.offset + */ + __pyx_t_1 = ((__pyx_v_self->stmt->fetched != __pyx_v_self->stmt_fetched) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":643 + * self.stmt._check_closed() + * if self.stmt.fetched != self.stmt_fetched: + * raise ProgrammingError('row no longer available from database') # <<<<<<<<<<<<<< + * left = self.length - self.offset + * if size == -1 or size > left: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_row_no_longer_available_from_dat) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_row_no_longer_available_from_dat); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 643, __pyx_L1_error) + + /* "oursqlx/statement.pyx":642 + * return '' + * self.stmt._check_closed() + * if self.stmt.fetched != self.stmt_fetched: # <<<<<<<<<<<<<< + * raise ProgrammingError('row no longer available from database') + * left = self.length - self.offset + */ + } + + /* "oursqlx/statement.pyx":644 + * if self.stmt.fetched != self.stmt_fetched: + * raise ProgrammingError('row no longer available from database') + * left = self.length - self.offset # <<<<<<<<<<<<<< + * if size == -1 or size > left: + * size = left + */ + __pyx_v_left = (__pyx_v_self->length - __pyx_v_self->offset); + + /* "oursqlx/statement.pyx":645 + * raise ProgrammingError('row no longer available from database') + * left = self.length - self.offset + * if size == -1 or size > left: # <<<<<<<<<<<<<< + * size = left + * elif size < 0: + */ + __pyx_t_6 = ((__pyx_v_size == -1L) != 0); + if (!__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_6 = ((__pyx_v_size > __pyx_v_left) != 0); + __pyx_t_1 = __pyx_t_6; + __pyx_L6_bool_binop_done:; + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":646 + * left = self.length - self.offset + * if size == -1 or size > left: + * size = left # <<<<<<<<<<<<<< + * elif size < 0: + * raise ValueError("can't read negative bytes") + */ + __pyx_v_size = __pyx_v_left; + + /* "oursqlx/statement.pyx":645 + * raise ProgrammingError('row no longer available from database') + * left = self.length - self.offset + * if size == -1 or size > left: # <<<<<<<<<<<<<< + * size = left + * elif size < 0: + */ + goto __pyx_L5; + } + + /* "oursqlx/statement.pyx":647 + * if size == -1 or size > left: + * size = left + * elif size < 0: # <<<<<<<<<<<<<< + * raise ValueError("can't read negative bytes") + * ret = PyBytes_FromStringAndSize(NULL, size) + */ + __pyx_t_1 = ((__pyx_v_size < 0) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/statement.pyx":648 + * size = left + * elif size < 0: + * raise ValueError("can't read negative bytes") # <<<<<<<<<<<<<< + * ret = PyBytes_FromStringAndSize(NULL, size) + * self.bind.buffer_length = size + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(4, 648, __pyx_L1_error) + + /* "oursqlx/statement.pyx":647 + * if size == -1 or size > left: + * size = left + * elif size < 0: # <<<<<<<<<<<<<< + * raise ValueError("can't read negative bytes") + * ret = PyBytes_FromStringAndSize(NULL, size) + */ + } + __pyx_L5:; + + /* "oursqlx/statement.pyx":649 + * elif size < 0: + * raise ValueError("can't read negative bytes") + * ret = PyBytes_FromStringAndSize(NULL, size) # <<<<<<<<<<<<<< + * self.bind.buffer_length = size + * self.bind.buffer = PyBytes_AS_STRING(ret) + */ + __pyx_t_3 = PyBytes_FromStringAndSize(NULL, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_ret = __pyx_t_3; + __pyx_t_3 = 0; + + /* "oursqlx/statement.pyx":650 + * raise ValueError("can't read negative bytes") + * ret = PyBytes_FromStringAndSize(NULL, size) + * self.bind.buffer_length = size # <<<<<<<<<<<<<< + * self.bind.buffer = PyBytes_AS_STRING(ret) + * if mysql_stmt_fetch_column(self.stmt.stmt, + */ + __pyx_v_self->bind.buffer_length = __pyx_v_size; + + /* "oursqlx/statement.pyx":651 + * ret = PyBytes_FromStringAndSize(NULL, size) + * self.bind.buffer_length = size + * self.bind.buffer = PyBytes_AS_STRING(ret) # <<<<<<<<<<<<<< + * if mysql_stmt_fetch_column(self.stmt.stmt, + * &self.bind, self.index, self.offset): + */ + __pyx_v_self->bind.buffer = PyBytes_AS_STRING(__pyx_v_ret); + + /* "oursqlx/statement.pyx":652 + * self.bind.buffer_length = size + * self.bind.buffer = PyBytes_AS_STRING(ret) + * if mysql_stmt_fetch_column(self.stmt.stmt, # <<<<<<<<<<<<<< + * &self.bind, self.index, self.offset): + * self.stmt._raise_error() + */ + __pyx_t_1 = (__pyx_f_6oursql_mysql_stmt_fetch_column(__pyx_v_self->stmt->stmt, (&__pyx_v_self->bind), __pyx_v_self->index, __pyx_v_self->offset) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":654 + * if mysql_stmt_fetch_column(self.stmt.stmt, + * &self.bind, self.index, self.offset): + * self.stmt._raise_error() # <<<<<<<<<<<<<< + * self.offset += size + * left = self.length - self.offset + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6oursql__Statement *)__pyx_v_self->stmt->__pyx_vtab)->_raise_error(__pyx_v_self->stmt); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 654, __pyx_L1_error) + + /* "oursqlx/statement.pyx":652 + * self.bind.buffer_length = size + * self.bind.buffer = PyBytes_AS_STRING(ret) + * if mysql_stmt_fetch_column(self.stmt.stmt, # <<<<<<<<<<<<<< + * &self.bind, self.index, self.offset): + * self.stmt._raise_error() + */ + } + + /* "oursqlx/statement.pyx":655 + * &self.bind, self.index, self.offset): + * self.stmt._raise_error() + * self.offset += size # <<<<<<<<<<<<<< + * left = self.length - self.offset + * assert left >= 0, 'size remaining should be >= 0' + */ + __pyx_v_self->offset = (__pyx_v_self->offset + __pyx_v_size); + + /* "oursqlx/statement.pyx":656 + * self.stmt._raise_error() + * self.offset += size + * left = self.length - self.offset # <<<<<<<<<<<<<< + * assert left >= 0, 'size remaining should be >= 0' + * if left == 0: + */ + __pyx_v_left = (__pyx_v_self->length - __pyx_v_self->offset); + + /* "oursqlx/statement.pyx":657 + * self.offset += size + * left = self.length - self.offset + * assert left >= 0, 'size remaining should be >= 0' # <<<<<<<<<<<<<< + * if left == 0: + * self.done = True + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_left >= 0) != 0))) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_size_remaining_should_be_0); + __PYX_ERR(4, 657, __pyx_L1_error) + } + } + #endif + + /* "oursqlx/statement.pyx":658 + * left = self.length - self.offset + * assert left >= 0, 'size remaining should be >= 0' + * if left == 0: # <<<<<<<<<<<<<< + * self.done = True + * return ret + */ + __pyx_t_1 = ((__pyx_v_left == 0) != 0); + if (__pyx_t_1) { + + /* "oursqlx/statement.pyx":659 + * assert left >= 0, 'size remaining should be >= 0' + * if left == 0: + * self.done = True # <<<<<<<<<<<<<< + * return ret + */ + __pyx_v_self->done = 1; + + /* "oursqlx/statement.pyx":658 + * left = self.length - self.offset + * assert left >= 0, 'size remaining should be >= 0' + * if left == 0: # <<<<<<<<<<<<<< + * self.done = True + * return ret + */ + } + + /* "oursqlx/statement.pyx":660 + * if left == 0: + * self.done = True + * return ret # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/statement.pyx":632 + * self.done = False + * + * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<< + * """read(size=-1) -> str + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._ResultStringStream.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_19_ResultStringStream_4__reduce_cython__(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultStringStream *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._ResultStringStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_19_ResultStringStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_19_ResultStringStream_6__setstate_cython__(((struct __pyx_obj_6oursql__ResultStringStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_19_ResultStringStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultStringStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._ResultStringStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":21 + * conversions_dict = _conversions + * + * def __cinit__(self, Connection conn not None, bint show_table=False, # <<<<<<<<<<<<<< + * **kwargs): + * cdef my_ulonglong res + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_ResultSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_10_ResultSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0; + CYTHON_UNUSED int __pyx_v_show_table; + CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_show_table,0}; + PyObject* values[2] = {0,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 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show_table); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 21, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]); + if (values[1]) { + __pyx_v_show_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_show_table == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 21, __pyx_L3_error) + } else { + __pyx_v_show_table = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 21, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("oursql._ResultSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) __PYX_ERR(6, 21, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_10_ResultSet___cinit__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self), __pyx_v_conn, __pyx_v_show_table, __pyx_v_kwargs); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_ResultSet___cinit__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, CYTHON_UNUSED int __pyx_v_show_table, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { + my_ulonglong __pyx_v_res; + PyObject *__pyx_8genexpr1__pyx_v_d = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "oursqlx/query.pyx":24 + * **kwargs): + * cdef my_ulonglong res + * conn._check_closed() # <<<<<<<<<<<<<< + * self.conn = conn + * self.fields = mysql_field_count(self.conn.conn) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_check_closed(__pyx_v_conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 24, __pyx_L1_error) + + /* "oursqlx/query.pyx":25 + * cdef my_ulonglong res + * conn._check_closed() + * self.conn = conn # <<<<<<<<<<<<<< + * self.fields = mysql_field_count(self.conn.conn) + * self.res = mysql_store_result(self.conn.conn) + */ + __Pyx_INCREF(((PyObject *)__pyx_v_conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_conn)); + __Pyx_GOTREF(__pyx_v_self->conn); + __Pyx_DECREF(((PyObject *)__pyx_v_self->conn)); + __pyx_v_self->conn = __pyx_v_conn; + + /* "oursqlx/query.pyx":26 + * conn._check_closed() + * self.conn = conn + * self.fields = mysql_field_count(self.conn.conn) # <<<<<<<<<<<<<< + * self.res = mysql_store_result(self.conn.conn) + * if not self.res and self.fields != 0: + */ + __pyx_v_self->fields = mysql_field_count(__pyx_v_self->conn->conn); + + /* "oursqlx/query.pyx":27 + * self.conn = conn + * self.fields = mysql_field_count(self.conn.conn) + * self.res = mysql_store_result(self.conn.conn) # <<<<<<<<<<<<<< + * if not self.res and self.fields != 0: + * self._raise_error() + */ + __pyx_v_self->res = __pyx_f_6oursql_mysql_store_result(__pyx_v_self->conn->conn); + + /* "oursqlx/query.pyx":28 + * self.fields = mysql_field_count(self.conn.conn) + * self.res = mysql_store_result(self.conn.conn) + * if not self.res and self.fields != 0: # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + __pyx_t_3 = ((!(__pyx_v_self->res != 0)) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->fields != 0) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":29 + * self.res = mysql_store_result(self.conn.conn) + * if not self.res and self.fields != 0: + * self._raise_error() # <<<<<<<<<<<<<< + * + * res = mysql_affected_rows(self.conn.conn) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 29, __pyx_L1_error) + + /* "oursqlx/query.pyx":28 + * self.fields = mysql_field_count(self.conn.conn) + * self.res = mysql_store_result(self.conn.conn) + * if not self.res and self.fields != 0: # <<<<<<<<<<<<<< + * self._raise_error() + * + */ + } + + /* "oursqlx/query.pyx":31 + * self._raise_error() + * + * res = mysql_affected_rows(self.conn.conn) # <<<<<<<<<<<<<< + * if res == ull_negone: + * self.rowcount = -1 + */ + __pyx_v_res = mysql_affected_rows(__pyx_v_self->conn->conn); + + /* "oursqlx/query.pyx":32 + * + * res = mysql_affected_rows(self.conn.conn) + * if res == ull_negone: # <<<<<<<<<<<<<< + * self.rowcount = -1 + * else: + */ + __pyx_t_2 = ((__pyx_v_res == __pyx_v_6oursql_ull_negone) != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":33 + * res = mysql_affected_rows(self.conn.conn) + * if res == ull_negone: + * self.rowcount = -1 # <<<<<<<<<<<<<< + * else: + * self.rowcount = res + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_int_neg_1; + + /* "oursqlx/query.pyx":32 + * + * res = mysql_affected_rows(self.conn.conn) + * if res == ull_negone: # <<<<<<<<<<<<<< + * self.rowcount = -1 + * else: + */ + goto __pyx_L6; + } + + /* "oursqlx/query.pyx":35 + * self.rowcount = -1 + * else: + * self.rowcount = res # <<<<<<<<<<<<<< + * res = mysql_insert_id(self.conn.conn) + * if res == 0: + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyInt_From_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L6:; + + /* "oursqlx/query.pyx":36 + * else: + * self.rowcount = res + * res = mysql_insert_id(self.conn.conn) # <<<<<<<<<<<<<< + * if res == 0: + * self.lastrowid = None + */ + __pyx_v_res = mysql_insert_id(__pyx_v_self->conn->conn); + + /* "oursqlx/query.pyx":37 + * self.rowcount = res + * res = mysql_insert_id(self.conn.conn) + * if res == 0: # <<<<<<<<<<<<<< + * self.lastrowid = None + * else: + */ + __pyx_t_2 = ((__pyx_v_res == 0) != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":38 + * res = mysql_insert_id(self.conn.conn) + * if res == 0: + * self.lastrowid = None # <<<<<<<<<<<<<< + * else: + * self.lastrowid = res + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->lastrowid); + __Pyx_DECREF(__pyx_v_self->lastrowid); + __pyx_v_self->lastrowid = Py_None; + + /* "oursqlx/query.pyx":37 + * self.rowcount = res + * res = mysql_insert_id(self.conn.conn) + * if res == 0: # <<<<<<<<<<<<<< + * self.lastrowid = None + * else: + */ + goto __pyx_L7; + } + + /* "oursqlx/query.pyx":40 + * self.lastrowid = None + * else: + * self.lastrowid = res # <<<<<<<<<<<<<< + * + * if self.fields: + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyInt_From_my_ulonglong(__pyx_v_res); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->lastrowid); + __Pyx_DECREF(__pyx_v_self->lastrowid); + __pyx_v_self->lastrowid = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L7:; + + /* "oursqlx/query.pyx":42 + * self.lastrowid = res + * + * if self.fields: # <<<<<<<<<<<<<< + * self.description = description_from_res( + * conn, self.res, self.fields, self.show_table) + */ + __pyx_t_2 = (__pyx_v_self->fields != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":43 + * + * if self.fields: + * self.description = description_from_res( # <<<<<<<<<<<<<< + * conn, self.res, self.fields, self.show_table) + * self.conversion_info = conversion_info_from_res( + */ + __pyx_t_4 = __pyx_f_6oursql_description_from_res(__pyx_v_conn, __pyx_v_self->res, __pyx_v_self->fields, __pyx_v_self->show_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->description); + __Pyx_DECREF(__pyx_v_self->description); + __pyx_v_self->description = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/query.pyx":45 + * self.description = description_from_res( + * conn, self.res, self.fields, self.show_table) + * self.conversion_info = conversion_info_from_res( # <<<<<<<<<<<<<< + * self.res, self.fields) + * self.column_names = [d[0] for d in self.description] + */ + __pyx_t_4 = __pyx_f_6oursql_conversion_info_from_res(__pyx_v_self->res, __pyx_v_self->fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->conversion_info); + __Pyx_DECREF(__pyx_v_self->conversion_info); + __pyx_v_self->conversion_info = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/query.pyx":47 + * self.conversion_info = conversion_info_from_res( + * self.res, self.fields) + * self.column_names = [d[0] for d in self.description] # <<<<<<<<<<<<<< + * else: + * self.description = self.column_names = None + */ + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + if (likely(PyList_CheckExact(__pyx_v_self->description)) || PyTuple_CheckExact(__pyx_v_self->description)) { + __pyx_t_5 = __pyx_v_self->description; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_self->description); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 47, __pyx_L11_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 47, __pyx_L11_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 47, __pyx_L11_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } + } else { + __pyx_t_8 = __pyx_t_7(__pyx_t_5); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(6, 47, __pyx_L11_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_d, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(6, 47, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_d); __pyx_8genexpr1__pyx_v_d = 0; + goto __pyx_L14_exit_scope; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_d); __pyx_8genexpr1__pyx_v_d = 0; + goto __pyx_L1_error; + __pyx_L14_exit_scope:; + } /* exit inner scope */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->column_names); + __Pyx_DECREF(__pyx_v_self->column_names); + __pyx_v_self->column_names = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/query.pyx":42 + * self.lastrowid = res + * + * if self.fields: # <<<<<<<<<<<<<< + * self.description = description_from_res( + * conn, self.res, self.fields, self.show_table) + */ + goto __pyx_L8; + } + + /* "oursqlx/query.pyx":49 + * self.column_names = [d[0] for d in self.description] + * else: + * self.description = self.column_names = None # <<<<<<<<<<<<<< + * + * if self.conn.warning_count(): + */ + /*else*/ { + __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_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->column_names); + __Pyx_DECREF(__pyx_v_self->column_names); + __pyx_v_self->column_names = Py_None; + } + __pyx_L8:; + + /* "oursqlx/query.pyx":51 + * self.description = self.column_names = None + * + * if self.conn.warning_count(): # <<<<<<<<<<<<<< + * self.warnings = _do_warnings_query(self.conn) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_warning_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":52 + * + * if self.conn.warning_count(): + * self.warnings = _do_warnings_query(self.conn) # <<<<<<<<<<<<<< + * else: + * self.warnings = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_do_warnings_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_v_self->conn)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self->conn)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/query.pyx":51 + * self.description = self.column_names = None + * + * if self.conn.warning_count(): # <<<<<<<<<<<<<< + * self.warnings = _do_warnings_query(self.conn) + * else: + */ + goto __pyx_L15; + } + + /* "oursqlx/query.pyx":54 + * self.warnings = _do_warnings_query(self.conn) + * else: + * self.warnings = [] # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + /*else*/ { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L15:; + + /* "oursqlx/query.pyx":21 + * conversions_dict = _conversions + * + * def __cinit__(self, Connection conn not None, bint show_table=False, # <<<<<<<<<<<<<< + * **kwargs): + * cdef my_ulonglong res + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql._ResultSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_d); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":56 + * self.warnings = [] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + +/* Python wrapper */ +static void __pyx_pw_6oursql_10_ResultSet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6oursql_10_ResultSet_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6oursql_10_ResultSet_2__dealloc__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6oursql_10_ResultSet_2__dealloc__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + __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("__dealloc__", 0); + + /* "oursqlx/query.pyx":57 + * + * def __dealloc__(self): + * self.close() # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/query.pyx":56 + * self.warnings = [] + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("oursql._ResultSet.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "oursqlx/query.pyx":59 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self.res: + * mysql_free_result(self.res) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_4close(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_4close(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("close", 0); + + /* "oursqlx/query.pyx":60 + * + * def close(self): + * if self.res: # <<<<<<<<<<<<<< + * mysql_free_result(self.res) + * self.res = NULL + */ + __pyx_t_1 = (__pyx_v_self->res != 0); + if (__pyx_t_1) { + + /* "oursqlx/query.pyx":61 + * def close(self): + * if self.res: + * mysql_free_result(self.res) # <<<<<<<<<<<<<< + * self.res = NULL + * + */ + mysql_free_result(__pyx_v_self->res); + + /* "oursqlx/query.pyx":62 + * if self.res: + * mysql_free_result(self.res) + * self.res = NULL # <<<<<<<<<<<<<< + * + * cdef int _raise_error(self) except -1: + */ + __pyx_v_self->res = NULL; + + /* "oursqlx/query.pyx":60 + * + * def close(self): + * if self.res: # <<<<<<<<<<<<<< + * mysql_free_result(self.res) + * self.res = NULL + */ + } + + /* "oursqlx/query.pyx":59 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self.res: + * mysql_free_result(self.res) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":64 + * self.res = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * return self.conn._raise_error() + * + */ + +static int __pyx_f_6oursql_10_ResultSet__raise_error(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_raise_error", 0); + + /* "oursqlx/query.pyx":65 + * + * cdef int _raise_error(self) except -1: + * return self.conn._raise_error() # <<<<<<<<<<<<<< + * + * cdef int _check_closed(self) except -1: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->conn->__pyx_vtab)->_raise_error(__pyx_v_self->conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 65, __pyx_L1_error) + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "oursqlx/query.pyx":64 + * self.res = NULL + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * return self.conn._raise_error() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("oursql._ResultSet._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":67 + * return self.conn._raise_error() + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * if self.res: + */ + +static int __pyx_f_6oursql_10_ResultSet__check_closed(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_closed", 0); + + /* "oursqlx/query.pyx":68 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * if self.res: + * self.close() + */ + __pyx_t_1 = ((!(__pyx_v_self->conn->conn != 0)) != 0); + if (__pyx_t_1) { + + /* "oursqlx/query.pyx":69 + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: + * if self.res: # <<<<<<<<<<<<<< + * self.close() + * raise ProgrammingError('connection closed') + */ + __pyx_t_1 = (__pyx_v_self->res != 0); + if (__pyx_t_1) { + + /* "oursqlx/query.pyx":70 + * if not self.conn.conn: + * if self.res: + * self.close() # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * if not self.res: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":69 + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: + * if self.res: # <<<<<<<<<<<<<< + * self.close() + * raise ProgrammingError('connection closed') + */ + } + + /* "oursqlx/query.pyx":71 + * if self.res: + * self.close() + * raise ProgrammingError('connection closed') # <<<<<<<<<<<<<< + * if not self.res: + * raise ProgrammingError('query closed') + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_connection_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_connection_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(6, 71, __pyx_L1_error) + + /* "oursqlx/query.pyx":68 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * if self.res: + * self.close() + */ + } + + /* "oursqlx/query.pyx":72 + * self.close() + * raise ProgrammingError('connection closed') + * if not self.res: # <<<<<<<<<<<<<< + * raise ProgrammingError('query closed') + * + */ + __pyx_t_1 = ((!(__pyx_v_self->res != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/query.pyx":73 + * raise ProgrammingError('connection closed') + * if not self.res: + * raise ProgrammingError('query closed') # <<<<<<<<<<<<<< + * + * property has_result: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_query_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_query_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(6, 73, __pyx_L1_error) + + /* "oursqlx/query.pyx":72 + * self.close() + * raise ProgrammingError('connection closed') + * if not self.res: # <<<<<<<<<<<<<< + * raise ProgrammingError('query closed') + * + */ + } + + /* "oursqlx/query.pyx":67 + * return self.conn._raise_error() + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * if self.res: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql._ResultSet._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":76 + * + * property has_result: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.fields != 0 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_10has_result_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_10has_result_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_10has_result___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_10has_result___get__(struct __pyx_obj_6oursql__ResultSet *__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); + + /* "oursqlx/query.pyx":77 + * property has_result: + * def __get__(self): + * return self.fields != 0 # <<<<<<<<<<<<<< + * + * def fetchone(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->fields != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/query.pyx":76 + * + * property has_result: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.fields != 0 + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._ResultSet.has_result.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":79 + * return self.fields != 0 + * + * def fetchone(self): # <<<<<<<<<<<<<< + * cdef MYSQL_ROW row + * cdef unsigned int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_7fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_7fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_6fetchone(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_6fetchone(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + MYSQL_ROW __pyx_v_row; + unsigned int __pyx_v_i; + unsigned long *__pyx_v_lengths; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_d = NULL; + PyObject *__pyx_v_field_type = NULL; + CYTHON_UNUSED PyObject *__pyx_v_flags = NULL; + PyObject *__pyx_v_charsetnr = NULL; + PyObject *__pyx_v_converter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchone", 0); + + /* "oursqlx/query.pyx":83 + * cdef unsigned int i + * cdef unsigned long *lengths + * self._check_closed() # <<<<<<<<<<<<<< + * row = mysql_fetch_row(self.res) + * if not row: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 83, __pyx_L1_error) + + /* "oursqlx/query.pyx":84 + * cdef unsigned long *lengths + * self._check_closed() + * row = mysql_fetch_row(self.res) # <<<<<<<<<<<<<< + * if not row: + * return None + */ + __pyx_v_row = __pyx_f_6oursql_mysql_fetch_row(__pyx_v_self->res); + + /* "oursqlx/query.pyx":85 + * self._check_closed() + * row = mysql_fetch_row(self.res) + * if not row: # <<<<<<<<<<<<<< + * return None + * lengths = mysql_fetch_lengths(self.res) + */ + __pyx_t_2 = ((!(__pyx_v_row != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":86 + * row = mysql_fetch_row(self.res) + * if not row: + * return None # <<<<<<<<<<<<<< + * lengths = mysql_fetch_lengths(self.res) + * if not lengths: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/query.pyx":85 + * self._check_closed() + * row = mysql_fetch_row(self.res) + * if not row: # <<<<<<<<<<<<<< + * return None + * lengths = mysql_fetch_lengths(self.res) + */ + } + + /* "oursqlx/query.pyx":87 + * if not row: + * return None + * lengths = mysql_fetch_lengths(self.res) # <<<<<<<<<<<<<< + * if not lengths: + * self._raise_error() + */ + __pyx_v_lengths = mysql_fetch_lengths(__pyx_v_self->res); + + /* "oursqlx/query.pyx":88 + * return None + * lengths = mysql_fetch_lengths(self.res) + * if not lengths: # <<<<<<<<<<<<<< + * self._raise_error() + * ret = PyTuple_New(self.fields) + */ + __pyx_t_2 = ((!(__pyx_v_lengths != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":89 + * lengths = mysql_fetch_lengths(self.res) + * if not lengths: + * self._raise_error() # <<<<<<<<<<<<<< + * ret = PyTuple_New(self.fields) + * # Cache the connection charset. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 89, __pyx_L1_error) + + /* "oursqlx/query.pyx":88 + * return None + * lengths = mysql_fetch_lengths(self.res) + * if not lengths: # <<<<<<<<<<<<<< + * self._raise_error() + * ret = PyTuple_New(self.fields) + */ + } + + /* "oursqlx/query.pyx":90 + * if not lengths: + * self._raise_error() + * ret = PyTuple_New(self.fields) # <<<<<<<<<<<<<< + * # Cache the connection charset. + * self.conn.charset + */ + __pyx_t_3 = PyTuple_New(__pyx_v_self->fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_ret = __pyx_t_3; + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":92 + * ret = PyTuple_New(self.fields) + * # Cache the connection charset. + * self.conn.charset # <<<<<<<<<<<<<< + * for 0 <= i < self.fields: + * if not row[i]: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":93 + * # Cache the connection charset. + * self.conn.charset + * for 0 <= i < self.fields: # <<<<<<<<<<<<<< + * if not row[i]: + * d = None + */ + __pyx_t_4 = __pyx_v_self->fields; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "oursqlx/query.pyx":94 + * self.conn.charset + * for 0 <= i < self.fields: + * if not row[i]: # <<<<<<<<<<<<<< + * d = None + * else: + */ + __pyx_t_2 = ((!((__pyx_v_row[__pyx_v_i]) != 0)) != 0); + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":95 + * for 0 <= i < self.fields: + * if not row[i]: + * d = None # <<<<<<<<<<<<<< + * else: + * d = PyBytes_FromStringAndSize(row[i], lengths[i]) + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_d, Py_None); + + /* "oursqlx/query.pyx":94 + * self.conn.charset + * for 0 <= i < self.fields: + * if not row[i]: # <<<<<<<<<<<<<< + * d = None + * else: + */ + goto __pyx_L7; + } + + /* "oursqlx/query.pyx":97 + * d = None + * else: + * d = PyBytes_FromStringAndSize(row[i], lengths[i]) # <<<<<<<<<<<<<< + * field_type, flags, charsetnr = self.conversion_info[i] + * converter = self.conversions_dict.get(field_type) + */ + /*else*/ { + __pyx_t_3 = PyBytes_FromStringAndSize((__pyx_v_row[__pyx_v_i]), (__pyx_v_lengths[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":98 + * else: + * d = PyBytes_FromStringAndSize(row[i], lengths[i]) + * field_type, flags, charsetnr = self.conversion_info[i] # <<<<<<<<<<<<<< + * converter = self.conversions_dict.get(field_type) + * if converter: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->conversion_info, __pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(6, 98, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + 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_ERR(6, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L8_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_L8_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_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(6, 98, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(6, 98, __pyx_L1_error) + __pyx_L9_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_field_type, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_flags, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_charsetnr, __pyx_t_7); + __pyx_t_7 = 0; + + /* "oursqlx/query.pyx":99 + * d = PyBytes_FromStringAndSize(row[i], lengths[i]) + * field_type, flags, charsetnr = self.conversion_info[i] + * converter = self.conversions_dict.get(field_type) # <<<<<<<<<<<<<< + * if converter: + * d = converter(d) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_conversions_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_field_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_field_type); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_converter, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":100 + * field_type, flags, charsetnr = self.conversion_info[i] + * converter = self.conversions_dict.get(field_type) + * if converter: # <<<<<<<<<<<<<< + * d = converter(d) + * elif self.conn.use_unicode and charsetnr != CS_BINARY: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_converter); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 100, __pyx_L1_error) + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":101 + * converter = self.conversions_dict.get(field_type) + * if converter: + * d = converter(d) # <<<<<<<<<<<<<< + * elif self.conn.use_unicode and charsetnr != CS_BINARY: + * d = d.decode(self.conn._charset) + */ + __Pyx_INCREF(__pyx_v_converter); + __pyx_t_6 = __pyx_v_converter; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_d); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":100 + * field_type, flags, charsetnr = self.conversion_info[i] + * converter = self.conversions_dict.get(field_type) + * if converter: # <<<<<<<<<<<<<< + * d = converter(d) + * elif self.conn.use_unicode and charsetnr != CS_BINARY: + */ + goto __pyx_L10; + } + + /* "oursqlx/query.pyx":102 + * if converter: + * d = converter(d) + * elif self.conn.use_unicode and charsetnr != CS_BINARY: # <<<<<<<<<<<<<< + * d = d.decode(self.conn._charset) + * Py_INCREF(d) + */ + __pyx_t_10 = (__pyx_v_self->conn->use_unicode != 0); + if (__pyx_t_10) { + } else { + __pyx_t_2 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_v_charsetnr, __pyx_int_63, 63, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(6, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_t_10; + __pyx_L11_bool_binop_done:; + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":103 + * d = converter(d) + * elif self.conn.use_unicode and charsetnr != CS_BINARY: + * d = d.decode(self.conn._charset) # <<<<<<<<<<<<<< + * Py_INCREF(d) + * PyTuple_SET_ITEM(ret, i, d) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_self->conn->_charset) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->conn->_charset); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":102 + * if converter: + * d = converter(d) + * elif self.conn.use_unicode and charsetnr != CS_BINARY: # <<<<<<<<<<<<<< + * d = d.decode(self.conn._charset) + * Py_INCREF(d) + */ + } + __pyx_L10:; + } + __pyx_L7:; + + /* "oursqlx/query.pyx":104 + * elif self.conn.use_unicode and charsetnr != CS_BINARY: + * d = d.decode(self.conn._charset) + * Py_INCREF(d) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(ret, i, d) + * return ret + */ + Py_INCREF(__pyx_v_d); + + /* "oursqlx/query.pyx":105 + * d = d.decode(self.conn._charset) + * Py_INCREF(d) + * PyTuple_SET_ITEM(ret, i, d) # <<<<<<<<<<<<<< + * return ret + * + */ + PyTuple_SET_ITEM(__pyx_v_ret, __pyx_v_i, __pyx_v_d); + } + + /* "oursqlx/query.pyx":106 + * Py_INCREF(d) + * PyTuple_SET_ITEM(ret, i, d) + * return ret # <<<<<<<<<<<<<< + * + * def fetchall(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/query.pyx":79 + * return self.fields != 0 + * + * def fetchone(self): # <<<<<<<<<<<<<< + * cdef MYSQL_ROW row + * cdef unsigned int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql._ResultSet.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_field_type); + __Pyx_XDECREF(__pyx_v_flags); + __Pyx_XDECREF(__pyx_v_charsetnr); + __Pyx_XDECREF(__pyx_v_converter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":108 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PySequence_List(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_9fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_9fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_8fetchall(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_8fetchall(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchall", 0); + + /* "oursqlx/query.pyx":109 + * + * def fetchall(self): + * self._check_closed() # <<<<<<<<<<<<<< + * return PySequence_List(self) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 109, __pyx_L1_error) + + /* "oursqlx/query.pyx":110 + * def fetchall(self): + * self._check_closed() + * return PySequence_List(self) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/query.pyx":108 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PySequence_List(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._ResultSet.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":112 + * return PySequence_List(self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_11__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_11__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_10__iter__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_10__iter__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "oursqlx/query.pyx":113 + * + * def __iter__(self): + * self._check_closed() # <<<<<<<<<<<<<< + * return PyCallIter_New(self.fetchone, None) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__ResultSet *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 113, __pyx_L1_error) + + /* "oursqlx/query.pyx":114 + * def __iter__(self): + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) # <<<<<<<<<<<<<< + * + * cdef class _Query: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "oursqlx/query.pyx":112 + * return PySequence_List(self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql._ResultSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":15 + * cdef unsigned int fields + * cdef object conversion_info + * cdef readonly object rowcount, lastrowid, description, column_names # <<<<<<<<<<<<<< + * cdef public object warnings + * cdef int show_table + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_8rowcount_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_8rowcount___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_8rowcount___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->rowcount); + __pyx_r = __pyx_v_self->rowcount; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_9lastrowid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_9lastrowid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_9lastrowid___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->lastrowid); + __pyx_r = __pyx_v_self->lastrowid; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_11description_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_11description___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_11description___get__(struct __pyx_obj_6oursql__ResultSet *__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; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_12column_names_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_12column_names_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_12column_names___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_12column_names___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->column_names); + __pyx_r = __pyx_v_self->column_names; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":16 + * cdef object conversion_info + * cdef readonly object rowcount, lastrowid, description, column_names + * cdef public object warnings # <<<<<<<<<<<<<< + * cdef int show_table + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_8warnings_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_8warnings_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_8warnings___get__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_8warnings___get__(struct __pyx_obj_6oursql__ResultSet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->warnings); + __pyx_r = __pyx_v_self->warnings; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_ResultSet_8warnings_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6oursql_10_ResultSet_8warnings_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_8warnings_2__set__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_ResultSet_8warnings_2__set__(struct __pyx_obj_6oursql__ResultSet *__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->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_10_ResultSet_8warnings_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6oursql_10_ResultSet_8warnings_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_8warnings_4__del__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_10_ResultSet_8warnings_4__del__(struct __pyx_obj_6oursql__ResultSet *__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->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_12__reduce_cython__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultSet *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._ResultSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_ResultSet_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_ResultSet_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_ResultSet_14__setstate_cython__(((struct __pyx_obj_6oursql__ResultSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_ResultSet_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__ResultSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._ResultSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":128 + * cdef readonly object rowcount, lastrowid, description, warnings, has_result + * + * def __cinit__(self, Connection conn not None, query, *a, **kw): # <<<<<<<<<<<<<< + * cdef char *qstr + * cdef Py_ssize_t qlen + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_6_Query_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_6_Query_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0; + PyObject *__pyx_v_query = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_kw = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1; + __Pyx_GOTREF(__pyx_v_kw); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_a = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_a)) { + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_RefNannyFinishContext(); + return -1; + } + __Pyx_GOTREF(__pyx_v_a); + } else { + __pyx_v_a = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_query,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 2, 1); __PYX_ERR(6, 128, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__cinit__") < 0)) __PYX_ERR(6, 128, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]); + __pyx_v_query = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 128, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_a); __pyx_v_a = 0; + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_AddTraceback("oursql._Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) __PYX_ERR(6, 128, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_6_Query___cinit__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self), __pyx_v_conn, __pyx_v_query, __pyx_v_a, __pyx_v_kw); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XDECREF(__pyx_v_kw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_6_Query___cinit__(struct __pyx_obj_6oursql__Query *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, PyObject *__pyx_v_query, PyObject *__pyx_v_a, PyObject *__pyx_v_kw) { + char *__pyx_v_qstr; + Py_ssize_t __pyx_v_qlen; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + struct __pyx_opt_args_6oursql_bytes_maybe_from_encoding __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_query); + + /* "oursqlx/query.pyx":131 + * cdef char *qstr + * cdef Py_ssize_t qlen + * conn._check_closed() # <<<<<<<<<<<<<< + * self.conn = conn + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_conn->__pyx_vtab)->_check_closed(__pyx_v_conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 131, __pyx_L1_error) + + /* "oursqlx/query.pyx":132 + * cdef Py_ssize_t qlen + * conn._check_closed() + * self.conn = conn # <<<<<<<<<<<<<< + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) + * PyBytes_AsStringAndSize(query, &qstr, &qlen) + */ + __Pyx_INCREF(((PyObject *)__pyx_v_conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_conn)); + __Pyx_GOTREF(__pyx_v_self->conn); + __Pyx_DECREF(((PyObject *)__pyx_v_self->conn)); + __pyx_v_self->conn = __pyx_v_conn; + + /* "oursqlx/query.pyx":133 + * conn._check_closed() + * self.conn = conn + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) # <<<<<<<<<<<<<< + * PyBytes_AsStringAndSize(query, &qstr, &qlen) + * if mysql_real_query(self.conn.conn, qstr, qlen): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_charset); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4.__pyx_n = 1; + __pyx_t_4.allow_none = 0; + __pyx_t_3 = __pyx_f_6oursql_bytes_maybe_from_encoding(__pyx_v_query, __pyx_t_2, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":134 + * self.conn = conn + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) + * PyBytes_AsStringAndSize(query, &qstr, &qlen) # <<<<<<<<<<<<<< + * if mysql_real_query(self.conn.conn, qstr, qlen): + * self._raise_error() + */ + __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_query, (&__pyx_v_qstr), (&__pyx_v_qlen)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 134, __pyx_L1_error) + + /* "oursqlx/query.pyx":135 + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) + * PyBytes_AsStringAndSize(query, &qstr, &qlen) + * if mysql_real_query(self.conn.conn, qstr, qlen): # <<<<<<<<<<<<<< + * self._raise_error() + * self.res_a, self.res_kw = a, kw + */ + __pyx_t_5 = (__pyx_f_6oursql_mysql_real_query(__pyx_v_self->conn->conn, __pyx_v_qstr, __pyx_v_qlen) != 0); + if (__pyx_t_5) { + + /* "oursqlx/query.pyx":136 + * PyBytes_AsStringAndSize(query, &qstr, &qlen) + * if mysql_real_query(self.conn.conn, qstr, qlen): + * self._raise_error() # <<<<<<<<<<<<<< + * self.res_a, self.res_kw = a, kw + * self.warnings = [] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql__Query *)__pyx_v_self->__pyx_vtab)->_raise_error(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 136, __pyx_L1_error) + + /* "oursqlx/query.pyx":135 + * query = bytes_maybe_from_encoding(query, self.conn.charset, False) + * PyBytes_AsStringAndSize(query, &qstr, &qlen) + * if mysql_real_query(self.conn.conn, qstr, qlen): # <<<<<<<<<<<<<< + * self._raise_error() + * self.res_a, self.res_kw = a, kw + */ + } + + /* "oursqlx/query.pyx":137 + * if mysql_real_query(self.conn.conn, qstr, qlen): + * self._raise_error() + * self.res_a, self.res_kw = a, kw # <<<<<<<<<<<<<< + * self.warnings = [] + * self.new_result() + */ + __pyx_t_3 = __pyx_v_a; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_kw; + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->res_a); + __Pyx_DECREF(__pyx_v_self->res_a); + __pyx_v_self->res_a = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->res_kw); + __Pyx_DECREF(__pyx_v_self->res_kw); + __pyx_v_self->res_kw = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":138 + * self._raise_error() + * self.res_a, self.res_kw = a, kw + * self.warnings = [] # <<<<<<<<<<<<<< + * self.new_result() + * # XXX: support multiple result sets. + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->warnings); + __Pyx_DECREF(__pyx_v_self->warnings); + __pyx_v_self->warnings = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":139 + * self.res_a, self.res_kw = a, kw + * self.warnings = [] + * self.new_result() # <<<<<<<<<<<<<< + * # XXX: support multiple result sets. + * self.has_result = self.result.has_result + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_new_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":141 + * self.new_result() + * # XXX: support multiple result sets. + * self.has_result = self.result.has_result # <<<<<<<<<<<<<< + * + * _result_class = _ResultSet + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->result, __pyx_n_s_has_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 141, __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; + + /* "oursqlx/query.pyx":128 + * cdef readonly object rowcount, lastrowid, description, warnings, has_result + * + * def __cinit__(self, Connection conn not None, query, *a, **kw): # <<<<<<<<<<<<<< + * cdef char *qstr + * cdef Py_ssize_t qlen + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("oursql._Query.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_query); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":144 + * + * _result_class = _ResultSet + * def new_result(self): # <<<<<<<<<<<<<< + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) + * self.warnings.extend(res.warnings) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_3new_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_3new_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("new_result (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_2new_result(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_2new_result(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_v_res = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("new_result", 0); + + /* "oursqlx/query.pyx":145 + * _result_class = _ResultSet + * def new_result(self): + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) # <<<<<<<<<<<<<< + * self.warnings.extend(res.warnings) + * self.rowcount = res.rowcount + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_result_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self->conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->conn)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->conn)); + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_self->res_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_v_self->res_kw == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(6, 145, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_self->res_kw))) { + __pyx_t_3 = PyDict_Copy(__pyx_v_self->res_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_self->res_kw, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_res = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":146 + * def new_result(self): + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) + * self.warnings.extend(res.warnings) # <<<<<<<<<<<<<< + * self.rowcount = res.rowcount + * self.lastrowid = res.lastrowid + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->warnings, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":147 + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) + * self.warnings.extend(res.warnings) + * self.rowcount = res.rowcount # <<<<<<<<<<<<<< + * self.lastrowid = res.lastrowid + * self.description = res.description + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_rowcount); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":148 + * self.warnings.extend(res.warnings) + * self.rowcount = res.rowcount + * self.lastrowid = res.lastrowid # <<<<<<<<<<<<<< + * self.description = res.description + * self.result = res + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_lastrowid); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->lastrowid); + __Pyx_DECREF(__pyx_v_self->lastrowid); + __pyx_v_self->lastrowid = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":149 + * self.rowcount = res.rowcount + * self.lastrowid = res.lastrowid + * self.description = res.description # <<<<<<<<<<<<<< + * self.result = res + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->description); + __Pyx_DECREF(__pyx_v_self->description); + __pyx_v_self->description = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":150 + * self.lastrowid = res.lastrowid + * self.description = res.description + * self.result = res # <<<<<<<<<<<<<< + * + * cdef int _raise_error(self) except -1: + */ + __Pyx_INCREF(__pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __Pyx_GOTREF(__pyx_v_self->result); + __Pyx_DECREF(__pyx_v_self->result); + __pyx_v_self->result = __pyx_v_res; + + /* "oursqlx/query.pyx":144 + * + * _result_class = _ResultSet + * def new_result(self): # <<<<<<<<<<<<<< + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) + * self.warnings.extend(res.warnings) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql._Query.new_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":152 + * self.result = res + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * return self.conn._raise_error() + * + */ + +static int __pyx_f_6oursql_6_Query__raise_error(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_raise_error", 0); + + /* "oursqlx/query.pyx":153 + * + * cdef int _raise_error(self) except -1: + * return self.conn._raise_error() # <<<<<<<<<<<<<< + * + * def nextset(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Connection *)__pyx_v_self->conn->__pyx_vtab)->_raise_error(__pyx_v_self->conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 153, __pyx_L1_error) + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "oursqlx/query.pyx":152 + * self.result = res + * + * cdef int _raise_error(self) except -1: # <<<<<<<<<<<<<< + * return self.conn._raise_error() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("oursql._Query._raise_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":155 + * return self.conn._raise_error() + * + * def nextset(self): # <<<<<<<<<<<<<< + * cdef int res + * # XXX: support multiple result sets. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_5nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_5nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nextset (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_4nextset(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_4nextset(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nextset", 0); + + /* "oursqlx/query.pyx":158 + * cdef int res + * # XXX: support multiple result sets. + * self.result = None # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->result); + __Pyx_DECREF(__pyx_v_self->result); + __pyx_v_self->result = Py_None; + + /* "oursqlx/query.pyx":159 + * # XXX: support multiple result sets. + * self.result = None + * return False # <<<<<<<<<<<<<< + * + * if not self.result: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "oursqlx/query.pyx":155 + * return self.conn._raise_error() + * + * def nextset(self): # <<<<<<<<<<<<<< + * cdef int res + * # XXX: support multiple result sets. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":174 + * return True + * + * def fetchone(self): # <<<<<<<<<<<<<< + * while self.result is not None: + * if self.result.has_result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_7fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_7fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_6fetchone(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_6fetchone(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_v_row = 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchone", 0); + + /* "oursqlx/query.pyx":175 + * + * def fetchone(self): + * while self.result is not None: # <<<<<<<<<<<<<< + * if self.result.has_result: + * row = self.result.fetchone() + */ + while (1) { + __pyx_t_1 = (__pyx_v_self->result != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (!__pyx_t_2) break; + + /* "oursqlx/query.pyx":176 + * def fetchone(self): + * while self.result is not None: + * if self.result.has_result: # <<<<<<<<<<<<<< + * row = self.result.fetchone() + * if row is not None: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->result, __pyx_n_s_has_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 176, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "oursqlx/query.pyx":177 + * while self.result is not None: + * if self.result.has_result: + * row = self.result.fetchone() # <<<<<<<<<<<<<< + * if row is not None: + * return row + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->result, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/query.pyx":178 + * if self.result.has_result: + * row = self.result.fetchone() + * if row is not None: # <<<<<<<<<<<<<< + * return row + * self.nextset() + */ + __pyx_t_2 = (__pyx_v_row != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "oursqlx/query.pyx":179 + * row = self.result.fetchone() + * if row is not None: + * return row # <<<<<<<<<<<<<< + * self.nextset() + * return None + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_row); + __pyx_r = __pyx_v_row; + goto __pyx_L0; + + /* "oursqlx/query.pyx":178 + * if self.result.has_result: + * row = self.result.fetchone() + * if row is not None: # <<<<<<<<<<<<<< + * return row + * self.nextset() + */ + } + + /* "oursqlx/query.pyx":176 + * def fetchone(self): + * while self.result is not None: + * if self.result.has_result: # <<<<<<<<<<<<<< + * row = self.result.fetchone() + * if row is not None: + */ + } + + /* "oursqlx/query.pyx":180 + * if row is not None: + * return row + * self.nextset() # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextset); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "oursqlx/query.pyx":181 + * return row + * self.nextset() + * return None # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "oursqlx/query.pyx":174 + * return True + * + * def fetchone(self): # <<<<<<<<<<<<<< + * while self.result is not None: + * if self.result.has_result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._Query.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":183 + * return None + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return PyCallIter_New(self.fetchone, None) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_9__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_9__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_8__iter__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_8__iter__(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "oursqlx/query.pyx":184 + * + * def __iter__(self): + * return PyCallIter_New(self.fetchone, None) # <<<<<<<<<<<<<< + * + * def fetchall(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetchone); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyCallIter_New(__pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/query.pyx":183 + * return None + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return PyCallIter_New(self.fetchone, None) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._Query.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":186 + * return PyCallIter_New(self.fetchone, None) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return PySequence_List(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_11fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_11fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_10fetchall(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_10fetchall(struct __pyx_obj_6oursql__Query *__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("fetchall", 0); + + /* "oursqlx/query.pyx":187 + * + * def fetchall(self): + * return PySequence_List(self) # <<<<<<<<<<<<<< + * + * # Cython should support multiple inheritance one of these days. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursqlx/query.pyx":186 + * return PyCallIter_New(self.fetchone, None) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return PySequence_List(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Query.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/query.pyx":126 + * cdef Connection conn + * cdef object result, res_a, res_kw + * cdef readonly object rowcount, lastrowid, description, warnings, has_result # <<<<<<<<<<<<<< + * + * def __cinit__(self, Connection conn not None, query, *a, **kw): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_8rowcount_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_8rowcount___get__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_8rowcount___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->rowcount); + __pyx_r = __pyx_v_self->rowcount; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_9lastrowid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_9lastrowid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_9lastrowid___get__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_9lastrowid___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->lastrowid); + __pyx_r = __pyx_v_self->lastrowid; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_11description_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_11description___get__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_11description___get__(struct __pyx_obj_6oursql__Query *__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; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_8warnings_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_8warnings_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_8warnings___get__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_8warnings___get__(struct __pyx_obj_6oursql__Query *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->warnings); + __pyx_r = __pyx_v_self->warnings; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_10has_result_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_10has_result_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_10has_result___get__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_10has_result___get__(struct __pyx_obj_6oursql__Query *__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; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_12__reduce_cython__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Query *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Query.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6_Query_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_6_Query_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6_Query_14__setstate_cython__(((struct __pyx_obj_6oursql__Query *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6_Query_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__Query *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._Query.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_DictQuery_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_DictQuery_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_DictQuery___reduce_cython__(((struct __pyx_obj_6oursql__DictQuery *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_DictQuery___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__DictQuery *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._DictQuery.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10_DictQuery_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_10_DictQuery_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10_DictQuery_2__setstate_cython__(((struct __pyx_obj_6oursql__DictQuery *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10_DictQuery_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql__DictQuery *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._DictQuery.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":38 + * _query_class = _Query + * + * def __cinit__(self, Connection conn not None, bint try_plain_query=True, # <<<<<<<<<<<<<< + * **kwargs): + * self.conn = conn + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_6Cursor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_6Cursor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6oursql_Connection *__pyx_v_conn = 0; + int __pyx_v_try_plain_query; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_try_plain_query,0}; + PyObject* values[2] = {0,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 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_try_plain_query); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 38, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_conn = ((struct __pyx_obj_6oursql_Connection *)values[0]); + if (values[1]) { + __pyx_v_try_plain_query = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_try_plain_query == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 38, __pyx_L3_error) + } else { + __pyx_v_try_plain_query = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 38, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("oursql.Cursor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_6oursql_Connection, 0, "conn", 0))) __PYX_ERR(7, 38, __pyx_L1_error) + __pyx_r = __pyx_pf_6oursql_6Cursor___cinit__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_conn, __pyx_v_try_plain_query, __pyx_v_kwargs); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_6Cursor___cinit__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, struct __pyx_obj_6oursql_Connection *__pyx_v_conn, int __pyx_v_try_plain_query, PyObject *__pyx_v_kwargs) { + int __pyx_r; + __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("__cinit__", 0); + + /* "oursqlx/cursor.pyx":40 + * def __cinit__(self, Connection conn not None, bint try_plain_query=True, + * **kwargs): + * self.conn = conn # <<<<<<<<<<<<<< + * self._stmt_kwargs = kwargs + * self._statements = collections.deque() + */ + __Pyx_INCREF(((PyObject *)__pyx_v_conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_conn)); + __Pyx_GOTREF(__pyx_v_self->conn); + __Pyx_DECREF(((PyObject *)__pyx_v_self->conn)); + __pyx_v_self->conn = __pyx_v_conn; + + /* "oursqlx/cursor.pyx":41 + * **kwargs): + * self.conn = conn + * self._stmt_kwargs = kwargs # <<<<<<<<<<<<<< + * self._statements = collections.deque() + * self.messages = [] + */ + __Pyx_INCREF(__pyx_v_kwargs); + __Pyx_GIVEREF(__pyx_v_kwargs); + __Pyx_GOTREF(__pyx_v_self->_stmt_kwargs); + __Pyx_DECREF(__pyx_v_self->_stmt_kwargs); + __pyx_v_self->_stmt_kwargs = __pyx_v_kwargs; + + /* "oursqlx/cursor.pyx":42 + * self.conn = conn + * self._stmt_kwargs = kwargs + * self._statements = collections.deque() # <<<<<<<<<<<<<< + * self.messages = [] + * self.closed = False + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_statements); + __Pyx_DECREF(__pyx_v_self->_statements); + __pyx_v_self->_statements = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":43 + * self._stmt_kwargs = kwargs + * self._statements = collections.deque() + * self.messages = [] # <<<<<<<<<<<<<< + * self.closed = False + * self.rowcount = -1 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->messages); + __Pyx_DECREF(__pyx_v_self->messages); + __pyx_v_self->messages = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":44 + * self._statements = collections.deque() + * self.messages = [] + * self.closed = False # <<<<<<<<<<<<<< + * self.rowcount = -1 + * self.arraysize = 1 + */ + __pyx_v_self->closed = 0; + + /* "oursqlx/cursor.pyx":45 + * self.messages = [] + * self.closed = False + * self.rowcount = -1 # <<<<<<<<<<<<<< + * self.arraysize = 1 + * self.try_plain_query = try_plain_query + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_int_neg_1; + + /* "oursqlx/cursor.pyx":46 + * self.closed = False + * self.rowcount = -1 + * self.arraysize = 1 # <<<<<<<<<<<<<< + * self.try_plain_query = try_plain_query + * + */ + __pyx_v_self->arraysize = 1; + + /* "oursqlx/cursor.pyx":47 + * self.rowcount = -1 + * self.arraysize = 1 + * self.try_plain_query = try_plain_query # <<<<<<<<<<<<<< + * + * cdef int _check_closed(self) except -1: + */ + __pyx_v_self->try_plain_query = __pyx_v_try_plain_query; + + /* "oursqlx/cursor.pyx":38 + * _query_class = _Query + * + * def __cinit__(self, Connection conn not None, bint try_plain_query=True, # <<<<<<<<<<<<<< + * **kwargs): + * self.conn = conn + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Cursor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":49 + * self.try_plain_query = try_plain_query + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * raise ProgrammingError('connection closed') + */ + +static int __pyx_f_6oursql_6Cursor__check_closed(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_closed", 0); + + /* "oursqlx/cursor.pyx":50 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * if self.closed: + */ + __pyx_t_1 = ((!(__pyx_v_self->conn->conn != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/cursor.pyx":51 + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: + * raise ProgrammingError('connection closed') # <<<<<<<<<<<<<< + * if self.closed: + * raise ProgrammingError('cursor closed') + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_connection_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_connection_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(7, 51, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":50 + * + * cdef int _check_closed(self) except -1: + * if not self.conn.conn: # <<<<<<<<<<<<<< + * raise ProgrammingError('connection closed') + * if self.closed: + */ + } + + /* "oursqlx/cursor.pyx":52 + * if not self.conn.conn: + * raise ProgrammingError('connection closed') + * if self.closed: # <<<<<<<<<<<<<< + * raise ProgrammingError('cursor closed') + * + */ + __pyx_t_1 = (__pyx_v_self->closed != 0); + if (unlikely(__pyx_t_1)) { + + /* "oursqlx/cursor.pyx":53 + * raise ProgrammingError('connection closed') + * if self.closed: + * raise ProgrammingError('cursor closed') # <<<<<<<<<<<<<< + * + * def close(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_cursor_closed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_cursor_closed); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(7, 53, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":52 + * if not self.conn.conn: + * raise ProgrammingError('connection closed') + * if self.closed: # <<<<<<<<<<<<<< + * raise ProgrammingError('cursor closed') + * + */ + } + + /* "oursqlx/cursor.pyx":49 + * self.try_plain_query = try_plain_query + * + * cdef int _check_closed(self) except -1: # <<<<<<<<<<<<<< + * if not self.conn.conn: + * raise ProgrammingError('connection closed') + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor._check_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":55 + * raise ProgrammingError('cursor closed') + * + * def close(self): # <<<<<<<<<<<<<< + * """close() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_2close[] = "close()\n \n Close the cursor and discard the rest of the results. The cursor will\n immediately become unusable.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_2close(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_2close(struct __pyx_obj_6oursql_Cursor *__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("close", 0); + + /* "oursqlx/cursor.pyx":61 + * immediately become unusable. + * """ + * self.closed = True # <<<<<<<<<<<<<< + * self._statements.clear() + * + */ + __pyx_v_self->closed = 1; + + /* "oursqlx/cursor.pyx":62 + * """ + * self.closed = True + * self._statements.clear() # <<<<<<<<<<<<<< + * + * def _new_statement(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_statements, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":55 + * raise ProgrammingError('cursor closed') + * + * def close(self): # <<<<<<<<<<<<<< + * """close() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Cursor.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":64 + * self._statements.clear() + * + * def _new_statement(self): # <<<<<<<<<<<<<< + * stmt = self._statement_class(self.conn, **self._stmt_kwargs) + * stmt.prefetch_rows = self.arraysize + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_5_new_statement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_5_new_statement(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_new_statement (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_4_new_statement(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_4_new_statement(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_v_stmt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_new_statement", 0); + + /* "oursqlx/cursor.pyx":65 + * + * def _new_statement(self): + * stmt = self._statement_class(self.conn, **self._stmt_kwargs) # <<<<<<<<<<<<<< + * stmt.prefetch_rows = self.arraysize + * return stmt + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_statement_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self->conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->conn)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->conn)); + if (unlikely(__pyx_v_self->_stmt_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(7, 65, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_self->_stmt_kwargs))) { + __pyx_t_3 = PyDict_Copy(__pyx_v_self->_stmt_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_self->_stmt_kwargs, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_stmt = __pyx_t_4; + __pyx_t_4 = 0; + + /* "oursqlx/cursor.pyx":66 + * def _new_statement(self): + * stmt = self._statement_class(self.conn, **self._stmt_kwargs) + * stmt.prefetch_rows = self.arraysize # <<<<<<<<<<<<<< + * return stmt + * + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->arraysize); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_stmt, __pyx_n_s_prefetch_rows, __pyx_t_4) < 0) __PYX_ERR(7, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/cursor.pyx":67 + * stmt = self._statement_class(self.conn, **self._stmt_kwargs) + * stmt.prefetch_rows = self.arraysize + * return stmt # <<<<<<<<<<<<<< + * + * def _new_query(self, query): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_stmt); + __pyx_r = __pyx_v_stmt; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":64 + * self._statements.clear() + * + * def _new_statement(self): # <<<<<<<<<<<<<< + * stmt = self._statement_class(self.conn, **self._stmt_kwargs) + * stmt.prefetch_rows = self.arraysize + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor._new_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_stmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":69 + * return stmt + * + * def _new_query(self, query): # <<<<<<<<<<<<<< + * return self._query_class(self.conn, query, **self._stmt_kwargs) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_7_new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_7_new_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_new_query (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_6_new_query(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), ((PyObject *)__pyx_v_query)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_6_new_query(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_new_query", 0); + + /* "oursqlx/cursor.pyx":70 + * + * def _new_query(self, query): + * return self._query_class(self.conn, query, **self._stmt_kwargs) # <<<<<<<<<<<<<< + * + * def callproc(self, procname, params=()): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self->conn)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->conn)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->conn)); + __Pyx_INCREF(__pyx_v_query); + __Pyx_GIVEREF(__pyx_v_query); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_query); + if (unlikely(__pyx_v_self->_stmt_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(7, 70, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_self->_stmt_kwargs))) { + __pyx_t_3 = PyDict_Copy(__pyx_v_self->_stmt_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_self->_stmt_kwargs, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":69 + * return stmt + * + * def _new_query(self, query): # <<<<<<<<<<<<<< + * return self._query_class(self.conn, query, **self._stmt_kwargs) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor._new_query", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":72 + * return self._query_class(self.conn, query, **self._stmt_kwargs) + * + * def callproc(self, procname, params=()): # <<<<<<<<<<<<<< + * """callproc(procname, params=()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_9callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_8callproc[] = "callproc(procname, params=())\n \n Supposedly, run a stored procedure. MySQL's C API has no direct call\n for this; you need to execute stored procedures with the CALL statement\n instead. Calling this method always raises an exception.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_9callproc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_procname = 0; + CYTHON_UNUSED PyObject *__pyx_v_params = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("callproc (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_procname,&__pyx_n_s_params,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_procname)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_params); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callproc") < 0)) __PYX_ERR(7, 72, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_procname = values[0]; + __pyx_v_params = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("callproc", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 72, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.callproc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_8callproc(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_procname, __pyx_v_params); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_8callproc(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_params) { + 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("callproc", 0); + + /* "oursqlx/cursor.pyx":81 + * # This is slightly irritating, but not too horribly bad. The horribly + * # bad part is getting the results from a procedure. + * raise NotSupportedError('use the CALL statement with the execute ' # <<<<<<<<<<<<<< + * 'method to call stored procedures') + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_use_the_CALL_statement_with_the) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_use_the_CALL_statement_with_the); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(7, 81, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":72 + * return self._query_class(self.conn, query, **self._stmt_kwargs) + * + * def callproc(self, procname, params=()): # <<<<<<<<<<<<<< + * """callproc(procname, params=()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Cursor.callproc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":84 + * 'method to call stored procedures') + * + * def _do_autoping(self): # <<<<<<<<<<<<<< + * if self.conn.autoping: + * self.conn.ping() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_11_do_autoping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_11_do_autoping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_do_autoping (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_10_do_autoping(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_10_do_autoping(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_autoping", 0); + + /* "oursqlx/cursor.pyx":85 + * + * def _do_autoping(self): + * if self.conn.autoping: # <<<<<<<<<<<<<< + * self.conn.ping() + * + */ + __pyx_t_1 = (__pyx_v_self->conn->autoping != 0); + if (__pyx_t_1) { + + /* "oursqlx/cursor.pyx":86 + * def _do_autoping(self): + * if self.conn.autoping: + * self.conn.ping() # <<<<<<<<<<<<<< + * + * def execute(self, query, params=(), plain_query=False): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_ping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":85 + * + * def _do_autoping(self): + * if self.conn.autoping: # <<<<<<<<<<<<<< + * self.conn.ping() + * + */ + } + + /* "oursqlx/cursor.pyx":84 + * 'method to call stored procedures') + * + * def _do_autoping(self): # <<<<<<<<<<<<<< + * if self.conn.autoping: + * self.conn.ping() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor._do_autoping", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":88 + * self.conn.ping() + * + * def execute(self, query, params=(), plain_query=False): # <<<<<<<<<<<<<< + * """execute(query, params=(), plain_query=False) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_13execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_12execute[] = "execute(query, params=(), plain_query=False)\n \n Execute a query. If plain_query is true, run a plain, unparameterized\n query. MySQL cannot parameterize all kinds of statements, which makes\n it sometimes necessary to execute a plain query. If plain_query is true\n and params is true, an exception will be raised as plain queries cannot\n be parameterized.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_13execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_query = 0; + PyObject *__pyx_v_params = 0; + PyObject *__pyx_v_plain_query = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_params,&__pyx_n_s_plain_query,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_empty_tuple); + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_params); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plain_query); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(7, 88, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_query = values[0]; + __pyx_v_params = values[1]; + __pyx_v_plain_query = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 88, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_12execute(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_query, __pyx_v_params, __pyx_v_plain_query); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_12execute(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_params, PyObject *__pyx_v_plain_query) { + PyObject *__pyx_v_stmt = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute", 0); + + /* "oursqlx/cursor.pyx":97 + * be parameterized. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * self._do_autoping() + * # This, on the other hand, is just plain stupid. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 97, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":98 + * """ + * self._check_closed() + * self._do_autoping() # <<<<<<<<<<<<<< + * # This, on the other hand, is just plain stupid. + * if plain_query: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_do_autoping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":100 + * self._do_autoping() + * # This, on the other hand, is just plain stupid. + * if plain_query: # <<<<<<<<<<<<<< + * if params: + * # I *really* don't want to write an escaping API. Anything + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_plain_query); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 100, __pyx_L1_error) + if (__pyx_t_5) { + + /* "oursqlx/cursor.pyx":101 + * # This, on the other hand, is just plain stupid. + * if plain_query: + * if params: # <<<<<<<<<<<<<< + * # I *really* don't want to write an escaping API. Anything + * # worth parameterizing supports the prepared statement API + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_params); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 101, __pyx_L1_error) + if (unlikely(__pyx_t_5)) { + + /* "oursqlx/cursor.pyx":105 + * # worth parameterizing supports the prepared statement API + * # anyway, so this shouldn't matter too much. + * raise ProgrammingError("can't call execute with both " # <<<<<<<<<<<<<< + * "parameters and a plain query") + * stmt = self._new_query(query) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_can_t_call_execute_with_both_par) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_can_t_call_execute_with_both_par); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(7, 105, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":101 + * # This, on the other hand, is just plain stupid. + * if plain_query: + * if params: # <<<<<<<<<<<<<< + * # I *really* don't want to write an escaping API. Anything + * # worth parameterizing supports the prepared statement API + */ + } + + /* "oursqlx/cursor.pyx":107 + * raise ProgrammingError("can't call execute with both " + * "parameters and a plain query") + * stmt = self._new_query(query) # <<<<<<<<<<<<<< + * else: + * stmt = self._new_statement() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_new_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_query) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_stmt = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":100 + * self._do_autoping() + * # This, on the other hand, is just plain stupid. + * if plain_query: # <<<<<<<<<<<<<< + * if params: + * # I *really* don't want to write an escaping API. Anything + */ + goto __pyx_L3; + } + + /* "oursqlx/cursor.pyx":109 + * stmt = self._new_query(query) + * else: + * stmt = self._new_statement() # <<<<<<<<<<<<<< + * try: + * stmt.prepare(query) + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_new_statement); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_stmt = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":110 + * else: + * stmt = self._new_statement() + * try: # <<<<<<<<<<<<<< + * stmt.prepare(query) + * except Error, e: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "oursqlx/cursor.pyx":111 + * stmt = self._new_statement() + * try: + * stmt.prepare(query) # <<<<<<<<<<<<<< + * except Error, e: + * # So, if MySQL refuses to parameterize the query, we optionally + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_prepare); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 111, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_query) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 111, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":110 + * else: + * stmt = self._new_statement() + * try: # <<<<<<<<<<<<<< + * stmt.prepare(query) + * except Error, e: + */ + } + + /* "oursqlx/cursor.pyx":122 + * raise + * else: + * stmt.execute(*params) # <<<<<<<<<<<<<< + * self._update_fields(stmt) + * + */ + /*else:*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_execute); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 122, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 122, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 122, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/cursor.pyx":112 + * try: + * stmt.prepare(query) + * except Error, e: # <<<<<<<<<<<<<< + * # So, if MySQL refuses to parameterize the query, we optionally + * # try it again through the stupid query API. This is optional + */ + __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Error); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 112, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + if (__pyx_t_1) { + __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(7, 112, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_e = __pyx_t_3; + + /* "oursqlx/cursor.pyx":117 + * # because you can lose state data if this is always done + * # implicitly. + * if self.try_plain_query and e.errno == ER_UNSUPPORTED_PS: # <<<<<<<<<<<<<< + * return self.execute(query, params, plain_query=True) + * else: + */ + __pyx_t_10 = (__pyx_v_self->try_plain_query != 0); + if (__pyx_t_10) { + } else { + __pyx_t_5 = __pyx_t_10; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 117, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyInt_From_int(ER_UNSUPPORTED_PS); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 117, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_9, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 117, __pyx_L7_except_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(7, 117, __pyx_L7_except_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = __pyx_t_10; + __pyx_L14_bool_binop_done:; + if (likely(__pyx_t_5)) { + + /* "oursqlx/cursor.pyx":118 + * # implicitly. + * if self.try_plain_query and e.errno == ER_UNSUPPORTED_PS: + * return self.execute(query, params, plain_query=True) # <<<<<<<<<<<<<< + * else: + * raise + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_execute); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 118, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 118, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_query); + __Pyx_GIVEREF(__pyx_v_query); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_query); + __Pyx_INCREF(__pyx_v_params); + __Pyx_GIVEREF(__pyx_v_params); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_params); + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 118, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_plain_query, Py_True) < 0) __PYX_ERR(7, 118, __pyx_L7_except_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 118, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_except_return; + + /* "oursqlx/cursor.pyx":117 + * # because you can lose state data if this is always done + * # implicitly. + * if self.try_plain_query and e.errno == ER_UNSUPPORTED_PS: # <<<<<<<<<<<<<< + * return self.execute(query, params, plain_query=True) + * else: + */ + } + + /* "oursqlx/cursor.pyx":120 + * return self.execute(query, params, plain_query=True) + * else: + * raise # <<<<<<<<<<<<<< + * else: + * stmt.execute(*params) + */ + /*else*/ { + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; + __PYX_ERR(7, 120, __pyx_L7_except_error) + } + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + + /* "oursqlx/cursor.pyx":110 + * else: + * stmt = self._new_statement() + * try: # <<<<<<<<<<<<<< + * stmt.prepare(query) + * except Error, e: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L8_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L10_try_end:; + } + } + __pyx_L3:; + + /* "oursqlx/cursor.pyx":123 + * else: + * stmt.execute(*params) + * self._update_fields(stmt) # <<<<<<<<<<<<<< + * + * def executemany(self, query, parambatch): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_update_fields(__pyx_v_self, __pyx_v_stmt, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 123, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":88 + * self.conn.ping() + * + * def execute(self, query, params=(), plain_query=False): # <<<<<<<<<<<<<< + * """execute(query, params=(), plain_query=False) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("oursql.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_stmt); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":125 + * self._update_fields(stmt) + * + * def executemany(self, query, parambatch): # <<<<<<<<<<<<<< + * """executemany(query, parambatch) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_15executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_14executemany[] = "executemany(query, parambatch)\n \n Execute the same query with different sets of parameters. This is more\n efficient than calling execute many times with the same query.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_15executemany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_query = 0; + PyObject *__pyx_v_parambatch = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("executemany (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_parambatch,0}; + PyObject* values[2] = {0,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 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parambatch)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("executemany", 1, 2, 2, 1); __PYX_ERR(7, 125, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "executemany") < 0)) __PYX_ERR(7, 125, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_query = values[0]; + __pyx_v_parambatch = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("executemany", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 125, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_14executemany(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_query, __pyx_v_parambatch); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_14executemany(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_parambatch) { + PyObject *__pyx_v_stmt = NULL; + PyObject *__pyx_v_rowcount = NULL; + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + struct __pyx_opt_args_6oursql_6Cursor__update_fields __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("executemany", 0); + + /* "oursqlx/cursor.pyx":131 + * efficient than calling execute many times with the same query. + * """ + * self._check_closed() # <<<<<<<<<<<<<< + * self._do_autoping() + * # No plain queries because they can't be parameterized anyway. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 131, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":132 + * """ + * self._check_closed() + * self._do_autoping() # <<<<<<<<<<<<<< + * # No plain queries because they can't be parameterized anyway. + * stmt = self._new_statement() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_do_autoping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":134 + * self._do_autoping() + * # No plain queries because they can't be parameterized anyway. + * stmt = self._new_statement() # <<<<<<<<<<<<<< + * stmt.prepare(query) + * rowcount = 0 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_new_statement); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_stmt = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":135 + * # No plain queries because they can't be parameterized anyway. + * stmt = self._new_statement() + * stmt.prepare(query) # <<<<<<<<<<<<<< + * rowcount = 0 + * for params in parambatch: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_prepare); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_query) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":136 + * stmt = self._new_statement() + * stmt.prepare(query) + * rowcount = 0 # <<<<<<<<<<<<<< + * for params in parambatch: + * stmt.execute(*params) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_rowcount = __pyx_int_0; + + /* "oursqlx/cursor.pyx":137 + * stmt.prepare(query) + * rowcount = 0 + * for params in parambatch: # <<<<<<<<<<<<<< + * stmt.execute(*params) + * # There's probably a better way to do this, but whatever. As far as + */ + if (likely(PyList_CheckExact(__pyx_v_parambatch)) || PyTuple_CheckExact(__pyx_v_parambatch)) { + __pyx_t_2 = __pyx_v_parambatch; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_parambatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 137, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(7, 137, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(7, 137, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(7, 137, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_params, __pyx_t_3); + __pyx_t_3 = 0; + + /* "oursqlx/cursor.pyx":138 + * rowcount = 0 + * for params in parambatch: + * stmt.execute(*params) # <<<<<<<<<<<<<< + * # There's probably a better way to do this, but whatever. As far as + * # I know we should get all values -1 or all values >= 0. + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_execute); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "oursqlx/cursor.pyx":141 + * # There's probably a better way to do this, but whatever. As far as + * # I know we should get all values -1 or all values >= 0. + * rowcount += stmt.rowcount # <<<<<<<<<<<<<< + * # Whatevs. + * if rowcount < 0: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_rowcount); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_rowcount, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_rowcount, __pyx_t_4); + __pyx_t_4 = 0; + + /* "oursqlx/cursor.pyx":137 + * stmt.prepare(query) + * rowcount = 0 + * for params in parambatch: # <<<<<<<<<<<<<< + * stmt.execute(*params) + * # There's probably a better way to do this, but whatever. As far as + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":143 + * rowcount += stmt.rowcount + * # Whatevs. + * if rowcount < 0: # <<<<<<<<<<<<<< + * rowcount = -1 + * self._update_fields(stmt, rowcount) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_rowcount, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 143, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(7, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { + + /* "oursqlx/cursor.pyx":144 + * # Whatevs. + * if rowcount < 0: + * rowcount = -1 # <<<<<<<<<<<<<< + * self._update_fields(stmt, rowcount) + * + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_DECREF_SET(__pyx_v_rowcount, __pyx_int_neg_1); + + /* "oursqlx/cursor.pyx":143 + * rowcount += stmt.rowcount + * # Whatevs. + * if rowcount < 0: # <<<<<<<<<<<<<< + * rowcount = -1 + * self._update_fields(stmt, rowcount) + */ + } + + /* "oursqlx/cursor.pyx":145 + * if rowcount < 0: + * rowcount = -1 + * self._update_fields(stmt, rowcount) # <<<<<<<<<<<<<< + * + * cdef int _update_fields(self, stmt, rowcount=None) except -1: + */ + __pyx_t_9.__pyx_n = 1; + __pyx_t_9.rowcount = __pyx_v_rowcount; + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_update_fields(__pyx_v_self, __pyx_v_stmt, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 145, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":125 + * self._update_fields(stmt) + * + * def executemany(self, query, parambatch): # <<<<<<<<<<<<<< + * """executemany(query, parambatch) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("oursql.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_stmt); + __Pyx_XDECREF(__pyx_v_rowcount); + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":147 + * self._update_fields(stmt, rowcount) + * + * cdef int _update_fields(self, stmt, rowcount=None) except -1: # <<<<<<<<<<<<<< + * self.messages.extend(stmt.warnings) + * if rowcount is None: + */ + +static int __pyx_f_6oursql_6Cursor__update_fields(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_stmt, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args) { + PyObject *__pyx_v_rowcount = ((PyObject *)Py_None); + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_update_fields", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_rowcount = __pyx_optional_args->rowcount; + } + } + + /* "oursqlx/cursor.pyx":148 + * + * cdef int _update_fields(self, stmt, rowcount=None) except -1: + * self.messages.extend(stmt.warnings) # <<<<<<<<<<<<<< + * if rowcount is None: + * self.rowcount = stmt.rowcount + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->messages, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":149 + * cdef int _update_fields(self, stmt, rowcount=None) except -1: + * self.messages.extend(stmt.warnings) + * if rowcount is None: # <<<<<<<<<<<<<< + * self.rowcount = stmt.rowcount + * else: + */ + __pyx_t_5 = (__pyx_v_rowcount == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "oursqlx/cursor.pyx":150 + * self.messages.extend(stmt.warnings) + * if rowcount is None: + * self.rowcount = stmt.rowcount # <<<<<<<<<<<<<< + * else: + * self.rowcount = rowcount + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_rowcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":149 + * cdef int _update_fields(self, stmt, rowcount=None) except -1: + * self.messages.extend(stmt.warnings) + * if rowcount is None: # <<<<<<<<<<<<<< + * self.rowcount = stmt.rowcount + * else: + */ + goto __pyx_L3; + } + + /* "oursqlx/cursor.pyx":152 + * self.rowcount = stmt.rowcount + * else: + * self.rowcount = rowcount # <<<<<<<<<<<<<< + * self.lastrowid = stmt.lastrowid + * self.description = stmt.description + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_rowcount); + __Pyx_GIVEREF(__pyx_v_rowcount); + __Pyx_GOTREF(__pyx_v_self->rowcount); + __Pyx_DECREF(__pyx_v_self->rowcount); + __pyx_v_self->rowcount = __pyx_v_rowcount; + } + __pyx_L3:; + + /* "oursqlx/cursor.pyx":153 + * else: + * self.rowcount = rowcount + * self.lastrowid = stmt.lastrowid # <<<<<<<<<<<<<< + * self.description = stmt.description + * if stmt.has_result: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_lastrowid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->lastrowid); + __Pyx_DECREF(__pyx_v_self->lastrowid); + __pyx_v_self->lastrowid = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":154 + * self.rowcount = rowcount + * self.lastrowid = stmt.lastrowid + * self.description = stmt.description # <<<<<<<<<<<<<< + * if stmt.has_result: + * self._statements.append(stmt) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_description); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->description); + __Pyx_DECREF(__pyx_v_self->description); + __pyx_v_self->description = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":155 + * self.lastrowid = stmt.lastrowid + * self.description = stmt.description + * if stmt.has_result: # <<<<<<<<<<<<<< + * self._statements.append(stmt) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stmt, __pyx_n_s_has_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 155, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "oursqlx/cursor.pyx":156 + * self.description = stmt.description + * if stmt.has_result: + * self._statements.append(stmt) # <<<<<<<<<<<<<< + * + * cdef int _check_statements(self) except -1: + */ + __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_self->_statements, __pyx_v_stmt); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 156, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":155 + * self.lastrowid = stmt.lastrowid + * self.description = stmt.description + * if stmt.has_result: # <<<<<<<<<<<<<< + * self._statements.append(stmt) + * + */ + } + + /* "oursqlx/cursor.pyx":147 + * self._update_fields(stmt, rowcount) + * + * cdef int _update_fields(self, stmt, rowcount=None) except -1: # <<<<<<<<<<<<<< + * self.messages.extend(stmt.warnings) + * if rowcount is None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor._update_fields", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":158 + * self._statements.append(stmt) + * + * cdef int _check_statements(self) except -1: # <<<<<<<<<<<<<< + * self._check_closed() + * if not self._statements: + */ + +static int __pyx_f_6oursql_6Cursor__check_statements(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_statements", 0); + + /* "oursqlx/cursor.pyx":159 + * + * cdef int _check_statements(self) except -1: + * self._check_closed() # <<<<<<<<<<<<<< + * if not self._statements: + * raise ProgrammingError('no results available') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 159, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":160 + * cdef int _check_statements(self) except -1: + * self._check_closed() + * if not self._statements: # <<<<<<<<<<<<<< + * raise ProgrammingError('no results available') + * + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_statements); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 160, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (unlikely(__pyx_t_3)) { + + /* "oursqlx/cursor.pyx":161 + * self._check_closed() + * if not self._statements: + * raise ProgrammingError('no results available') # <<<<<<<<<<<<<< + * + * def nextset(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_no_results_available) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_no_results_available); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(7, 161, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":160 + * cdef int _check_statements(self) except -1: + * self._check_closed() + * if not self._statements: # <<<<<<<<<<<<<< + * raise ProgrammingError('no results available') + * + */ + } + + /* "oursqlx/cursor.pyx":158 + * self._statements.append(stmt) + * + * cdef int _check_statements(self) except -1: # <<<<<<<<<<<<<< + * self._check_closed() + * if not self._statements: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("oursql.Cursor._check_statements", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":163 + * raise ProgrammingError('no results available') + * + * def nextset(self): # <<<<<<<<<<<<<< + * """nextset() -> True or None. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_17nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_16nextset[] = "nextset() -> True or None.\n \n Move to the next result set. If there are any result sets left, this\n returns True. Otherwise, None.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_17nextset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nextset (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_16nextset(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_16nextset(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("nextset", 0); + + /* "oursqlx/cursor.pyx":169 + * returns True. Otherwise, None. + * """ + * self._check_statements() # <<<<<<<<<<<<<< + * if self._statements[0].nextset(): + * return True + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_statements(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 169, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":170 + * """ + * self._check_statements() + * if self._statements[0].nextset(): # <<<<<<<<<<<<<< + * return True + * self._statements.popleft() + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_statements, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nextset); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "oursqlx/cursor.pyx":171 + * self._check_statements() + * if self._statements[0].nextset(): + * return True # <<<<<<<<<<<<<< + * self._statements.popleft() + * # DB-API, you so wacky. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":170 + * """ + * self._check_statements() + * if self._statements[0].nextset(): # <<<<<<<<<<<<<< + * return True + * self._statements.popleft() + */ + } + + /* "oursqlx/cursor.pyx":172 + * if self._statements[0].nextset(): + * return True + * self._statements.popleft() # <<<<<<<<<<<<<< + * # DB-API, you so wacky. + * return True if self._statements else None + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_statements, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":174 + * self._statements.popleft() + * # DB-API, you so wacky. + * return True if self._statements else None # <<<<<<<<<<<<<< + * + * def fetchone(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_statements); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 174, __pyx_L1_error) + if (__pyx_t_5) { + __Pyx_INCREF(Py_True); + __pyx_t_2 = Py_True; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_2 = Py_None; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":163 + * raise ProgrammingError('no results available') + * + * def nextset(self): # <<<<<<<<<<<<<< + * """nextset() -> True or None. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor.nextset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":176 + * return True if self._statements else None + * + * def fetchone(self): # <<<<<<<<<<<<<< + * """fetchone() -> row. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_19fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_18fetchone[] = "fetchone() -> row.\n \n Fetch one row from the current result set. If the result set was\n exhausted, this returns None. If there were no result sets, a \n ProgrammingError is raised.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_19fetchone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_18fetchone(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_18fetchone(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + 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("fetchone", 0); + + /* "oursqlx/cursor.pyx":183 + * ProgrammingError is raised. + * """ + * self._check_statements() # <<<<<<<<<<<<<< + * self._do_autoping() + * ret = self._statements[0].fetchone() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_statements(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 183, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":184 + * """ + * self._check_statements() + * self._do_autoping() # <<<<<<<<<<<<<< + * ret = self._statements[0].fetchone() + * if ret is None: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_do_autoping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":185 + * self._check_statements() + * self._do_autoping() + * ret = self._statements[0].fetchone() # <<<<<<<<<<<<<< + * if ret is None: + * self.nextset() + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_statements, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_ret = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":186 + * self._do_autoping() + * ret = self._statements[0].fetchone() + * if ret is None: # <<<<<<<<<<<<<< + * self.nextset() + * return ret + */ + __pyx_t_5 = (__pyx_v_ret == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "oursqlx/cursor.pyx":187 + * ret = self._statements[0].fetchone() + * if ret is None: + * self.nextset() # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextset); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":186 + * self._do_autoping() + * ret = self._statements[0].fetchone() + * if ret is None: # <<<<<<<<<<<<<< + * self.nextset() + * return ret + */ + } + + /* "oursqlx/cursor.pyx":188 + * if ret is None: + * self.nextset() + * return ret # <<<<<<<<<<<<<< + * + * def fetchmany(self, size=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":176 + * return True if self._statements else None + * + * def fetchone(self): # <<<<<<<<<<<<<< + * """fetchone() -> row. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":190 + * return ret + * + * def fetchmany(self, size=None): # <<<<<<<<<<<<<< + * """fetchmany(size=self.arraysize) -> list of rows. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_21fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_20fetchmany[] = "fetchmany(size=self.arraysize) -> list of rows.\n \n Fetch up to 'size' rows. If there aren't that many rows available in \n the database, this returns as many as were available. If there were no \n result sets, a ProgrammingError is raised.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_21fetchmany(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchmany (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + 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); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchmany") < 0)) __PYX_ERR(7, 190, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fetchmany", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 190, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_20fetchmany(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_size); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_20fetchmany(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_size) { + unsigned int __pyx_v_i; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_v_resultset = NULL; + PyObject *__pyx_v_row = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + unsigned int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchmany", 0); + __Pyx_INCREF(__pyx_v_size); + + /* "oursqlx/cursor.pyx":198 + * """ + * cdef unsigned int i + * self._check_statements() # <<<<<<<<<<<<<< + * self._do_autoping() + * if size is None: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_statements(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 198, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":199 + * cdef unsigned int i + * self._check_statements() + * self._do_autoping() # <<<<<<<<<<<<<< + * if size is None: + * size = self.arraysize + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_do_autoping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":200 + * self._check_statements() + * self._do_autoping() + * if size is None: # <<<<<<<<<<<<<< + * size = self.arraysize + * ret = [] + */ + __pyx_t_5 = (__pyx_v_size == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "oursqlx/cursor.pyx":201 + * self._do_autoping() + * if size is None: + * size = self.arraysize # <<<<<<<<<<<<<< + * ret = [] + * resultset = self._statements[0] + */ + __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->arraysize); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":200 + * self._check_statements() + * self._do_autoping() + * if size is None: # <<<<<<<<<<<<<< + * size = self.arraysize + * ret = [] + */ + } + + /* "oursqlx/cursor.pyx":202 + * if size is None: + * size = self.arraysize + * ret = [] # <<<<<<<<<<<<<< + * resultset = self._statements[0] + * # This is a little bit wacky for DB-API compliance. If there's fewer + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_ret = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":203 + * size = self.arraysize + * ret = [] + * resultset = self._statements[0] # <<<<<<<<<<<<<< + * # This is a little bit wacky for DB-API compliance. If there's fewer + * # rows available than requested, return everything available without + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->_statements, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_resultset = __pyx_t_2; + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":209 + * # result set at all, *then* switch to the next result set and return an + * # empty sequence. + * for 0 <= i < size: # <<<<<<<<<<<<<< + * row = resultset.fetchone() + * if row is None: + */ + __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(7, 209, __pyx_L1_error) + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "oursqlx/cursor.pyx":210 + * # empty sequence. + * for 0 <= i < size: + * row = resultset.fetchone() # <<<<<<<<<<<<<< + * if row is None: + * if i == 0: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_resultset, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":211 + * for 0 <= i < size: + * row = resultset.fetchone() + * if row is None: # <<<<<<<<<<<<<< + * if i == 0: + * self.nextset() + */ + __pyx_t_6 = (__pyx_v_row == Py_None); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "oursqlx/cursor.pyx":212 + * row = resultset.fetchone() + * if row is None: + * if i == 0: # <<<<<<<<<<<<<< + * self.nextset() + * return ret + */ + __pyx_t_5 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_5) { + + /* "oursqlx/cursor.pyx":213 + * if row is None: + * if i == 0: + * self.nextset() # <<<<<<<<<<<<<< + * return ret + * ret.append(row) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextset); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":212 + * row = resultset.fetchone() + * if row is None: + * if i == 0: # <<<<<<<<<<<<<< + * self.nextset() + * return ret + */ + } + + /* "oursqlx/cursor.pyx":214 + * if i == 0: + * self.nextset() + * return ret # <<<<<<<<<<<<<< + * ret.append(row) + * return ret + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":211 + * for 0 <= i < size: + * row = resultset.fetchone() + * if row is None: # <<<<<<<<<<<<<< + * if i == 0: + * self.nextset() + */ + } + + /* "oursqlx/cursor.pyx":215 + * self.nextset() + * return ret + * ret.append(row) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 215, __pyx_L1_error) + } + + /* "oursqlx/cursor.pyx":216 + * return ret + * ret.append(row) + * return ret # <<<<<<<<<<<<<< + * + * def fetchall(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":190 + * return ret + * + * def fetchmany(self, size=None): # <<<<<<<<<<<<<< + * """fetchmany(size=self.arraysize) -> list of rows. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XDECREF(__pyx_v_resultset); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF(__pyx_v_size); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":218 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * """fetchall() -> list of rows. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_23fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_22fetchall[] = "fetchall() -> list of rows.\n \n Fetch all available rows from the database. If there were no result \n sets, a ProgrammingError is raised.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_23fetchall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_22fetchall(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_22fetchall(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fetchall", 0); + + /* "oursqlx/cursor.pyx":224 + * sets, a ProgrammingError is raised. + * """ + * self._check_statements() # <<<<<<<<<<<<<< + * self._do_autoping() + * ret = [] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_statements(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 224, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":225 + * """ + * self._check_statements() + * self._do_autoping() # <<<<<<<<<<<<<< + * ret = [] + * while self._statements: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_do_autoping); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":226 + * self._check_statements() + * self._do_autoping() + * ret = [] # <<<<<<<<<<<<<< + * while self._statements: + * ret.extend(self._statements.popleft().fetchall()) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_ret = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":227 + * self._do_autoping() + * ret = [] + * while self._statements: # <<<<<<<<<<<<<< + * ret.extend(self._statements.popleft().fetchall()) + * return ret + */ + while (1) { + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_statements); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 227, __pyx_L1_error) + if (!__pyx_t_5) break; + + /* "oursqlx/cursor.pyx":228 + * ret = [] + * while self._statements: + * ret.extend(self._statements.popleft().fetchall()) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_statements, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "oursqlx/cursor.pyx":229 + * while self._statements: + * ret.extend(self._statements.popleft().fetchall()) + * return ret # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":218 + * return ret + * + * def fetchall(self): # <<<<<<<<<<<<<< + * """fetchall() -> list of rows. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("oursql.Cursor.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":231 + * return ret + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_25__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_25__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_24__iter__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_24__iter__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "oursqlx/cursor.pyx":232 + * + * def __iter__(self): + * self._check_closed() # <<<<<<<<<<<<<< + * return PyCallIter_New(self.fetchone, None) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6oursql_Cursor *)__pyx_v_self->__pyx_vtab)->_check_closed(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 232, __pyx_L1_error) + + /* "oursqlx/cursor.pyx":233 + * def __iter__(self): + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) # <<<<<<<<<<<<<< + * + * property connection: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyCallIter_New(__pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":231 + * return ret + * + * def __iter__(self): # <<<<<<<<<<<<<< + * self._check_closed() + * return PyCallIter_New(self.fetchone, None) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("oursql.Cursor.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":236 + * + * property connection: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.conn + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_10connection_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_10connection_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_10connection___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_10connection___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "oursqlx/cursor.pyx":237 + * property connection: + * def __get__(self): + * return self.conn # <<<<<<<<<<<<<< + * + * def setinputsizes(self, sizes): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->conn)); + __pyx_r = ((PyObject *)__pyx_v_self->conn); + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":236 + * + * property connection: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.conn + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":239 + * return self.conn + * + * def setinputsizes(self, sizes): # <<<<<<<<<<<<<< + * """setinputsizes(sizes) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_27setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_26setinputsizes[] = "setinputsizes(sizes)\n \n Do nothing; this operation is not supported by oursql.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_27setinputsizes(PyObject *__pyx_v_self, PyObject *__pyx_v_sizes) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setinputsizes (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_26setinputsizes(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), ((PyObject *)__pyx_v_sizes)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_26setinputsizes(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_sizes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setinputsizes", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":248 + * pass + * + * def setoutputsize(self, size, column=None): # <<<<<<<<<<<<<< + * """setoutputsize(size, column=None) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_29setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6oursql_6Cursor_28setoutputsize[] = "setoutputsize(size, column=None)\n \n Do nothing; this operation is not supported by oursql.\n "; +static PyObject *__pyx_pw_6oursql_6Cursor_29setoutputsize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_size = 0; + CYTHON_UNUSED PyObject *__pyx_v_column = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setoutputsize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_column,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setoutputsize") < 0)) __PYX_ERR(7, 248, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size = values[0]; + __pyx_v_column = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("setoutputsize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 248, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.setoutputsize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_28setoutputsize(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_size, __pyx_v_column); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_28setoutputsize(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_column) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setoutputsize", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":255 + * pass + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_31__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_31__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_30__enter__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_30__enter__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__", 0); + + /* "oursqlx/cursor.pyx":256 + * + * def __enter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __exit__(self, exc, value, tb): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "oursqlx/cursor.pyx":255 + * pass + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":258 + * return self + * + * def __exit__(self, exc, value, tb): # <<<<<<<<<<<<<< + * if exc: + * self.conn.rollback() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_33__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_33__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exc = 0; + CYTHON_UNUSED PyObject *__pyx_v_value = 0; + CYTHON_UNUSED PyObject *__pyx_v_tb = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(7, 258, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(7, 258, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(7, 258, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_exc = values[0]; + __pyx_v_value = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 258, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_6Cursor_32__exit__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), __pyx_v_exc, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_32__exit__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__exit__", 0); + + /* "oursqlx/cursor.pyx":259 + * + * def __exit__(self, exc, value, tb): + * if exc: # <<<<<<<<<<<<<< + * self.conn.rollback() + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 259, __pyx_L1_error) + if (__pyx_t_1) { + + /* "oursqlx/cursor.pyx":260 + * def __exit__(self, exc, value, tb): + * if exc: + * self.conn.rollback() # <<<<<<<<<<<<<< + * else: + * self.conn.commit() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_rollback); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":259 + * + * def __exit__(self, exc, value, tb): + * if exc: # <<<<<<<<<<<<<< + * self.conn.rollback() + * else: + */ + goto __pyx_L3; + } + + /* "oursqlx/cursor.pyx":262 + * self.conn.rollback() + * else: + * self.conn.commit() # <<<<<<<<<<<<<< + * self.close() + * + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->conn), __pyx_n_s_commit); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "oursqlx/cursor.pyx":263 + * else: + * self.conn.commit() + * self.close() # <<<<<<<<<<<<<< + * + * cdef class DictCursor(Cursor): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/cursor.pyx":258 + * return self + * + * def __exit__(self, exc, value, tb): # <<<<<<<<<<<<<< + * if exc: + * self.conn.rollback() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("oursql.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":29 + * """ + * + * cdef readonly object _statements, _stmt_kwargs # <<<<<<<<<<<<<< + * cdef Connection conn + * cdef int closed, try_plain_query + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_11_statements_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_11_statements_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_11_statements___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_11_statements___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_statements); + __pyx_r = __pyx_v_self->_statements; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_12_stmt_kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_12_stmt_kwargs_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_12_stmt_kwargs___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_stmt_kwargs); + __pyx_r = __pyx_v_self->_stmt_kwargs; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":32 + * cdef Connection conn + * cdef int closed, try_plain_query + * cdef readonly object rowcount, lastrowid, description, messages # <<<<<<<<<<<<<< + * cdef public unsigned long arraysize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_8rowcount_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_8rowcount___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_8rowcount___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->rowcount); + __pyx_r = __pyx_v_self->rowcount; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_9lastrowid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_9lastrowid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_9lastrowid___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_9lastrowid___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->lastrowid); + __pyx_r = __pyx_v_self->lastrowid; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_11description_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_11description___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_11description___get__(struct __pyx_obj_6oursql_Cursor *__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; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_8messages_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_8messages_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_8messages___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_8messages___get__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->messages); + __pyx_r = __pyx_v_self->messages; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursqlx/cursor.pyx":33 + * cdef int closed, try_plain_query + * cdef readonly object rowcount, lastrowid, description, messages + * cdef public unsigned long arraysize # <<<<<<<<<<<<<< + * + * _statement_class = _Statement + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_9arraysize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_9arraysize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_9arraysize___get__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_9arraysize___get__(struct __pyx_obj_6oursql_Cursor *__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 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->arraysize); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Cursor.arraysize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6oursql_6Cursor_9arraysize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6oursql_6Cursor_9arraysize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_9arraysize_2__set__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_6Cursor_9arraysize_2__set__(struct __pyx_obj_6oursql_Cursor *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + unsigned long __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_unsigned_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(7, 33, __pyx_L1_error) + __pyx_v_self->arraysize = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("oursql.Cursor.arraysize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_35__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_35__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_34__reduce_cython__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_34__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Cursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_6Cursor_37__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_6Cursor_37__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_6Cursor_36__setstate_cython__(((struct __pyx_obj_6oursql_Cursor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_6Cursor_36__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_Cursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.Cursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10DictCursor_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_10DictCursor_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10DictCursor___reduce_cython__(((struct __pyx_obj_6oursql_DictCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10DictCursor___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_DictCursor *__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("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.DictCursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_10DictCursor_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_10DictCursor_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_10DictCursor_2__setstate_cython__(((struct __pyx_obj_6oursql_DictCursor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_10DictCursor_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6oursql_DictCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(3, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql.DictCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursql.pyx":102 + * cdef readonly object values + * + * def __init__(self, *values): # <<<<<<<<<<<<<< + * self.values = frozenset(values) + * + */ + +/* Python wrapper */ +static int __pyx_pw_6oursql_16_DBAPITypeObject_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6oursql_16_DBAPITypeObject_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_values = 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_values = __pyx_args; + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject___init__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self), __pyx_v_values); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6oursql_16_DBAPITypeObject___init__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v_values) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "oursql.pyx":103 + * + * def __init__(self, *values): + * self.values = frozenset(values) # <<<<<<<<<<<<<< + * + * def __richcmp__(self, other, int op): + */ + __pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "oursql.pyx":102 + * cdef readonly object values + * + * def __init__(self, *values): # <<<<<<<<<<<<<< + * self.values = frozenset(values) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._DBAPITypeObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursql.pyx":105 + * self.values = frozenset(values) + * + * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return other in self.values + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject_2__richcmp__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_2__richcmp__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_UCS4 __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + + /* "oursql.pyx":106 + * + * def __richcmp__(self, other, int op): + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return other in self.values + * elif op == Py_NE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_1) { + + /* "oursql.pyx":107 + * def __richcmp__(self, other, int op): + * if op == Py_EQ: + * return other in self.values # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return other not in self.values + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_other, __pyx_v_self->values, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursql.pyx":106 + * + * def __richcmp__(self, other, int op): + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return other in self.values + * elif op == Py_NE: + */ + } + + /* "oursql.pyx":108 + * if op == Py_EQ: + * return other in self.values + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return other not in self.values + * else: + */ + __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0); + if (likely(__pyx_t_1)) { + + /* "oursql.pyx":109 + * return other in self.values + * elif op == Py_NE: + * return other not in self.values # <<<<<<<<<<<<<< + * else: + * raise TypeError('unorderable types: %r and %r' % ( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_other, __pyx_v_self->values, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "oursql.pyx":108 + * if op == Py_EQ: + * return other in self.values + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return other not in self.values + * else: + */ + } + + /* "oursql.pyx":111 + * return other not in self.values + * else: + * raise TypeError('unorderable types: %r and %r' % ( # <<<<<<<<<<<<<< + * type(self), type(other))) + * + */ + /*else*/ { + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = 127; + __Pyx_INCREF(__pyx_kp_u_unorderable_types); + __pyx_t_3 += 19; + __Pyx_GIVEREF(__pyx_kp_u_unorderable_types); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_unorderable_types); + + /* "oursql.pyx":112 + * else: + * raise TypeError('unorderable types: %r and %r' % ( + * type(self), type(other))) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4; + __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u_and); + __pyx_t_3 += 5; + __Pyx_GIVEREF(__pyx_kp_u_and); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_and); + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_other))), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4; + __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5); + __pyx_t_5 = 0; + + /* "oursql.pyx":111 + * return other not in self.values + * else: + * raise TypeError('unorderable types: %r and %r' % ( # <<<<<<<<<<<<<< + * type(self), type(other))) + * + */ + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 111, __pyx_L1_error) + } + + /* "oursql.pyx":105 + * self.values = frozenset(values) + * + * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return other in self.values + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._DBAPITypeObject.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursql.pyx":114 + * type(self), type(other))) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<_DBAPITypeObject representing %r at %#x>' % ( + * self.values, id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_5__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject_4__repr__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_4__repr__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "oursql.pyx":115 + * + * def __repr__(self): + * return '<_DBAPITypeObject representing %r at %#x>' % ( # <<<<<<<<<<<<<< + * self.values, id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "oursql.pyx":116 + * def __repr__(self): + * return '<_DBAPITypeObject representing %r at %#x>' % ( + * self.values, id(self)) # <<<<<<<<<<<<<< + * + * STRING = _DBAPITypeObject( + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->values); + __Pyx_GIVEREF(__pyx_v_self->values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->values); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + + /* "oursql.pyx":115 + * + * def __repr__(self): + * return '<_DBAPITypeObject representing %r at %#x>' % ( # <<<<<<<<<<<<<< + * self.values, id(self)) + * + */ + __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_DBAPITypeObject_representing_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "oursql.pyx":114 + * type(self), type(other))) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<_DBAPITypeObject representing %r at %#x>' % ( + * self.values, id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("oursql._DBAPITypeObject.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "oursql.pyx":100 + * + * cdef class _DBAPITypeObject: + * cdef readonly object values # <<<<<<<<<<<<<< + * + * def __init__(self, *values): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_6values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_6values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6values___get__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->values); + __pyx_r = __pyx_v_self->values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject_6__reduce_cython__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_6__reduce_cython__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.values,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->values); + __Pyx_GIVEREF(__pyx_v_self->values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->values); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.values,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self.values,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.values is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.values,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self.values is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->values != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.values is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":13 + * use_setstate = self.values is not None + * if use_setstate: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__DBAPITypeObject); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_252300414); + __Pyx_GIVEREF(__pyx_int_252300414); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_252300414); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self.values is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, None), state + * else: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__DBAPITypeObject__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__DBAPITypeObject); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_252300414); + __Pyx_GIVEREF(__pyx_int_252300414); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_252300414); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql._DBAPITypeObject.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__DBAPITypeObject__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6oursql_16_DBAPITypeObject_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_6oursql_16_DBAPITypeObject_8__setstate_cython__(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_16_DBAPITypeObject_8__setstate_cython__(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + 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("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle__DBAPITypeObject__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6oursql___pyx_unpickle__DBAPITypeObject__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle__DBAPITypeObject, (type(self), 0xf09cc7e, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle__DBAPITypeObject__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("oursql._DBAPITypeObject.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle__DictWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_19__pyx_unpickle__DictWhateverMixin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_19__pyx_unpickle__DictWhateverMixin = {"__pyx_unpickle__DictWhateverMixin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_19__pyx_unpickle__DictWhateverMixin, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6oursql_19__pyx_unpickle__DictWhateverMixin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle__DictWhateverMixin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DictWhateverMixin", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DictWhateverMixin", 1, 3, 3, 2); __PYX_ERR(3, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__DictWhateverMixin") < 0)) __PYX_ERR(3, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DictWhateverMixin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.__pyx_unpickle__DictWhateverMixin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_18__pyx_unpickle__DictWhateverMixin(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_18__pyx_unpickle__DictWhateverMixin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + 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; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__DictWhateverMixin", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6oursql___pyx_unpickle__DictWhateverMixin__set_state(((struct __pyx_obj_6oursql__DictWhateverMixin *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _DictWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__DictWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.__pyx_unpickle__DictWhateverMixin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + +static PyObject *__pyx_f_6oursql___pyx_unpickle__DictWhateverMixin__set_state(struct __pyx_obj_6oursql__DictWhateverMixin *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__DictWhateverMixin__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(3, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "(tree fragment)":13 + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql.__pyx_unpickle__DictWhateverMixin__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle__AbstractIterWrapper(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_21__pyx_unpickle__AbstractIterWrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_21__pyx_unpickle__AbstractIterWrapper = {"__pyx_unpickle__AbstractIterWrapper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_21__pyx_unpickle__AbstractIterWrapper, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6oursql_21__pyx_unpickle__AbstractIterWrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle__AbstractIterWrapper (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__AbstractIterWrapper", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__AbstractIterWrapper", 1, 3, 3, 2); __PYX_ERR(3, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__AbstractIterWrapper") < 0)) __PYX_ERR(3, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__AbstractIterWrapper", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.__pyx_unpickle__AbstractIterWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_20__pyx_unpickle__AbstractIterWrapper(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_20__pyx_unpickle__AbstractIterWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + 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; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__AbstractIterWrapper", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6oursql__AbstractIterWrapper), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6oursql___pyx_unpickle__AbstractIterWrapper__set_state(((struct __pyx_obj_6oursql__AbstractIterWrapper *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _AbstractIterWrapper.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__AbstractIterWrapper(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.__pyx_unpickle__AbstractIterWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + +static PyObject *__pyx_f_6oursql___pyx_unpickle__AbstractIterWrapper__set_state(struct __pyx_obj_6oursql__AbstractIterWrapper *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__AbstractIterWrapper__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(3, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "(tree fragment)":13 + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle__AbstractIterWrapper__set_state(<_AbstractIterWrapper> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__AbstractIterWrapper__set_state(_AbstractIterWrapper __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql.__pyx_unpickle__AbstractIterWrapper__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle__BinaryWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_23__pyx_unpickle__BinaryWhateverMixin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_23__pyx_unpickle__BinaryWhateverMixin = {"__pyx_unpickle__BinaryWhateverMixin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_23__pyx_unpickle__BinaryWhateverMixin, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6oursql_23__pyx_unpickle__BinaryWhateverMixin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle__BinaryWhateverMixin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__BinaryWhateverMixin", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__BinaryWhateverMixin", 1, 3, 3, 2); __PYX_ERR(3, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__BinaryWhateverMixin") < 0)) __PYX_ERR(3, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__BinaryWhateverMixin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.__pyx_unpickle__BinaryWhateverMixin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_22__pyx_unpickle__BinaryWhateverMixin(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_22__pyx_unpickle__BinaryWhateverMixin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + 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; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__BinaryWhateverMixin", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xd41d8cd: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6oursql___pyx_unpickle__BinaryWhateverMixin__set_state(((struct __pyx_obj_6oursql__BinaryWhateverMixin *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) + * __pyx_result = _BinaryWhateverMixin.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__BinaryWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.__pyx_unpickle__BinaryWhateverMixin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + +static PyObject *__pyx_f_6oursql___pyx_unpickle__BinaryWhateverMixin__set_state(struct __pyx_obj_6oursql__BinaryWhateverMixin *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__BinaryWhateverMixin__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(3, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "(tree fragment)":13 + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql.__pyx_unpickle__BinaryWhateverMixin__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle__DBAPITypeObject(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6oursql_25__pyx_unpickle__DBAPITypeObject(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6oursql_25__pyx_unpickle__DBAPITypeObject = {"__pyx_unpickle__DBAPITypeObject", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_25__pyx_unpickle__DBAPITypeObject, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6oursql_25__pyx_unpickle__DBAPITypeObject(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle__DBAPITypeObject (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DBAPITypeObject", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DBAPITypeObject", 1, 3, 3, 2); __PYX_ERR(3, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__DBAPITypeObject") < 0)) __PYX_ERR(3, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__DBAPITypeObject", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("oursql.__pyx_unpickle__DBAPITypeObject", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6oursql_24__pyx_unpickle__DBAPITypeObject(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6oursql_24__pyx_unpickle__DBAPITypeObject(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + 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; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle__DBAPITypeObject", 0); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xf09cc7e: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf09cc7e) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum != 0xf09cc7e: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum != 0xf09cc7e: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(3, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum != 0xf09cc7e: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "(tree fragment)":9 + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6oursql___pyx_unpickle__DBAPITypeObject__set_state(((struct __pyx_obj_6oursql__DBAPITypeObject *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf09cc7e = (values))" % __pyx_checksum) + * __pyx_result = _DBAPITypeObject.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): + * __pyx_result.values = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__DBAPITypeObject(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("oursql.__pyx_unpickle__DBAPITypeObject", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.values = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_f_6oursql___pyx_unpickle__DBAPITypeObject__set_state(struct __pyx_obj_6oursql__DBAPITypeObject *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + 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("__pyx_unpickle__DBAPITypeObject__set_state", 0); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): + * __pyx_result.values = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->values); + __Pyx_DECREF(__pyx_v___pyx_result->values); + __pyx_v___pyx_result->values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): + * __pyx_result.values = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(3, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 13, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result.values = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(3, 14, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): + * __pyx_result.values = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle__DBAPITypeObject__set_state(<_DBAPITypeObject> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__DBAPITypeObject__set_state(_DBAPITypeObject __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.values = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("oursql.__pyx_unpickle__DBAPITypeObject__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6oursql_Connection __pyx_vtable_6oursql_Connection; + +static PyObject *__pyx_tp_new_6oursql_Connection(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql_Connection *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql_Connection *)o); + p->__pyx_vtab = __pyx_vtabptr_6oursql_Connection; + p->_charset = Py_None; Py_INCREF(Py_None); + p->_charset_bytes = Py_None; Py_INCREF(Py_None); + p->_context_cursors = Py_None; Py_INCREF(Py_None); + p->default_cursor = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_10Connection_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql_Connection(PyObject *o) { + struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6oursql_10Connection_7__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->_charset); + Py_CLEAR(p->_charset_bytes); + Py_CLEAR(p->_context_cursors); + Py_CLEAR(p->default_cursor); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql_Connection(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o; + if (p->_charset) { + e = (*v)(p->_charset, a); if (e) return e; + } + if (p->_charset_bytes) { + e = (*v)(p->_charset_bytes, a); if (e) return e; + } + if (p->_context_cursors) { + e = (*v)(p->_context_cursors, a); if (e) return e; + } + if (p->default_cursor) { + e = (*v)(p->default_cursor, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql_Connection(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql_Connection *p = (struct __pyx_obj_6oursql_Connection *)o; + tmp = ((PyObject*)p->_charset); + p->_charset = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_charset_bytes); + p->_charset_bytes = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_context_cursors); + p->_context_cursors = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->default_cursor); + p->default_cursor = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_10Connection_charset(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_7charset_1__get__(o); +} + +static int __pyx_setprop_6oursql_10Connection_charset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10Connection_7charset_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6oursql_10Connection_server_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_11server_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10Connection_ssl_cipher(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_10ssl_cipher_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10Connection_use_unicode(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_11use_unicode_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10Connection_autoping(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_8autoping_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10Connection_raise_on_warnings(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_17raise_on_warnings_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10Connection_default_cursor(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10Connection_14default_cursor_1__get__(o); +} + +static int __pyx_setprop_6oursql_10Connection_default_cursor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10Connection_14default_cursor_3__set__(o, v); + } + else { + return __pyx_pw_6oursql_10Connection_14default_cursor_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6oursql_Connection[] = { + {"_setup_ssl_options", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_10Connection_3_setup_ssl_options, METH_VARARGS|METH_KEYWORDS, 0}, + {"close", (PyCFunction)__pyx_pw_6oursql_10Connection_5close, METH_NOARGS, __pyx_doc_6oursql_10Connection_4close}, + {"ping", (PyCFunction)__pyx_pw_6oursql_10Connection_9ping, METH_NOARGS, __pyx_doc_6oursql_10Connection_8ping}, + {"commit", (PyCFunction)__pyx_pw_6oursql_10Connection_11commit, METH_NOARGS, __pyx_doc_6oursql_10Connection_10commit}, + {"rollback", (PyCFunction)__pyx_pw_6oursql_10Connection_13rollback, METH_NOARGS, __pyx_doc_6oursql_10Connection_12rollback}, + {"warning_count", (PyCFunction)__pyx_pw_6oursql_10Connection_15warning_count, METH_NOARGS, __pyx_doc_6oursql_10Connection_14warning_count}, + {"cursor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_10Connection_17cursor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_10Connection_16cursor}, + {"__enter__", (PyCFunction)__pyx_pw_6oursql_10Connection_19__enter__, METH_NOARGS, 0}, + {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_10Connection_21__exit__, METH_VARARGS|METH_KEYWORDS, 0}, + {"_escape_string", (PyCFunction)__pyx_pw_6oursql_10Connection_23_escape_string, METH_O, __pyx_doc_6oursql_10Connection_22_escape_string}, + {"_escape_unicode_string", (PyCFunction)__pyx_pw_6oursql_10Connection_25_escape_unicode_string, METH_O, __pyx_doc_6oursql_10Connection_24_escape_unicode_string}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_10Connection_27__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_10Connection_29__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql_Connection[] = { + {(char *)"charset", __pyx_getprop_6oursql_10Connection_charset, __pyx_setprop_6oursql_10Connection_charset, (char *)"charset -> str\n \n Get or set the connection's current encoding. If use_unicode is \n enabled, this is the encoding that will be used to decode incoming\n strings.\n ", 0}, + {(char *)"server_info", __pyx_getprop_6oursql_10Connection_server_info, 0, (char *)0, 0}, + {(char *)"ssl_cipher", __pyx_getprop_6oursql_10Connection_ssl_cipher, 0, (char *)0, 0}, + {(char *)"use_unicode", __pyx_getprop_6oursql_10Connection_use_unicode, 0, (char *)0, 0}, + {(char *)"autoping", __pyx_getprop_6oursql_10Connection_autoping, 0, (char *)0, 0}, + {(char *)"raise_on_warnings", __pyx_getprop_6oursql_10Connection_raise_on_warnings, 0, (char *)0, 0}, + {(char *)"default_cursor", __pyx_getprop_6oursql_10Connection_default_cursor, __pyx_setprop_6oursql_10Connection_default_cursor, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql_Connection = { + PyVarObject_HEAD_INIT(0, 0) + "oursql.Connection", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql_Connection), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql_Connection, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Connection([host, user, passwd,] db=None, port=0, unix_socket=None, \n connect_timeout=None, read_timeout=None, write_timeout=None, \n protocol=None, ssl=None, read_default_file=None, \n read_default_group=None, init_command=None, charset_dir=None, \n shared_memory_base_name=None, local_infile=False, \n require_secure_auth=False, report_truncation=True, compress=False, \n found_rows=True, use_unicode=True, charset='utf8', autoping=False, \n default_cursor=None, raise_on_warnings=True, autoreconnect=False)\n \n Connect to the MySQL database. The first three parameters may be passed by \n position, but the rest may only be passed by keyword. All options except \n 'use_unicode', 'charset', 'autoping', 'default_cursor', and \n 'raise_on_warnings' correspond with parameters or flags to the \n mysql_real_connect function, or options to the mysql_options function. \n \n 'protocol' can be one of None, 'tcp', 'socket', 'pipe', or 'memory'. A\n 'protocol' of None will use the default protocol, and values otherwise \n correspond with the potential values of the 'protocol' option in the option \n file.\n \n 'ssl' can either be None or a dict where each key corresponds to a \n parameter of the mysql_ssl_set function, e.g. {'capath': '/etc/ssl/ca', \n 'cipher': 'DHE-RSA-AES256-SHA'}. Unspecified keys are the same as passing\n NULL to that parameter.\n \n If 'use_unicode' is true, oursql will attempt to return unicode wherever \n feasible. If 'charset' is not None, oursql will set the connection charset \n to the value provided. 'charset' defaults to using utf-8. If 'autoping' is \n true, oursql will run the 'ping' method before executing queries or \n fetching results to attempt to prevent connection timeout errors. \n 'default_cursor', if provided, will be used as the default cursor class \n when calling the 'cursor' method. If 'raise_on_warnings' is true, our""sql\n will raise a CollatedWarningsError exception if there were any warnings\n produced by running a query.\n \n Connections and their cursors can also be used as context managers.\n \n with some_connection.cursor() as cursor:\n do_something_with(cursor)\n \n Can also be written as:\n \n with some_connection as cursor:\n do_something_with(cursor)\n \n And both are equivalent to:\n \n cursor = some_connection.cursor()\n try:\n do_something_with(cursor)\n except:\n some_connection.rollback()\n raise\n else:\n some_connection.commit()\n finally:\n cursor.close()\n \n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql_Connection, /*tp_traverse*/ + __pyx_tp_clear_6oursql_Connection, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql_Connection, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql_Connection, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql_Connection, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql__DictWhateverMixin(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6oursql__DictWhateverMixin(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6oursql__DictWhateverMixin[] = { + {"fetchone", (PyCFunction)__pyx_pw_6oursql_18_DictWhateverMixin_1fetchone, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_18_DictWhateverMixin_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_18_DictWhateverMixin_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__DictWhateverMixin = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._DictWhateverMixin", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__DictWhateverMixin), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__DictWhateverMixin, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__DictWhateverMixin, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__DictWhateverMixin, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql__AbstractIterWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6oursql__AbstractIterWrapper(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6oursql__AbstractIterWrapper[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_20_AbstractIterWrapper_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_20_AbstractIterWrapper_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__AbstractIterWrapper = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._AbstractIterWrapper", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__AbstractIterWrapper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__AbstractIterWrapper, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6oursql_20_AbstractIterWrapper_1__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__AbstractIterWrapper, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__AbstractIterWrapper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql__BinaryWhateverMixin(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6oursql__BinaryWhateverMixin(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__(self);} + +static PyMethodDef __pyx_methods_6oursql__BinaryWhateverMixin[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__, METH_NOARGS|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_20_BinaryWhateverMixin_3__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_20_BinaryWhateverMixin_5__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__BinaryWhateverMixin = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._BinaryWhateverMixin", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__BinaryWhateverMixin), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__BinaryWhateverMixin, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + __pyx_pw_6oursql_20_BinaryWhateverMixin_1__next__, /*tp_iternext*/ + __pyx_methods_6oursql__BinaryWhateverMixin, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__BinaryWhateverMixin, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql_IterWrapper(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql_IterWrapper *p; + PyObject *o = __pyx_tp_new_6oursql__AbstractIterWrapper(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql_IterWrapper *)o); + p->iterobj = Py_None; Py_INCREF(Py_None); + p->nextfunc = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_11IterWrapper_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql_IterWrapper(PyObject *o) { + struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->iterobj); + Py_CLEAR(p->nextfunc); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6oursql__AbstractIterWrapper(o); +} + +static int __pyx_tp_traverse_6oursql_IterWrapper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o; + e = ((likely(__pyx_ptype_6oursql__AbstractIterWrapper)) ? ((__pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse) ? __pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6oursql_IterWrapper)); if (e) return e; + if (p->iterobj) { + e = (*v)(p->iterobj, a); if (e) return e; + } + if (p->nextfunc) { + e = (*v)(p->nextfunc, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql_IterWrapper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql_IterWrapper *p = (struct __pyx_obj_6oursql_IterWrapper *)o; + if (likely(__pyx_ptype_6oursql__AbstractIterWrapper)) { if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_clear) __pyx_ptype_6oursql__AbstractIterWrapper->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6oursql_IterWrapper); + tmp = ((PyObject*)p->iterobj); + p->iterobj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->nextfunc); + p->nextfunc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_specialmethod___pyx_pw_6oursql_11IterWrapper_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6oursql_11IterWrapper_3__next__(self);} + +static PyMethodDef __pyx_methods_6oursql_IterWrapper[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6oursql_11IterWrapper_3__next__, METH_NOARGS|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_11IterWrapper_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_11IterWrapper_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql_IterWrapper = { + PyVarObject_HEAD_INIT(0, 0) + "oursql.IterWrapper", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql_IterWrapper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql_IterWrapper, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IterWrapper(iterobj)\n \n IterWrapper is a wrapper class for arbitrary string-yielding iterable \n objects so that their contents can be streamed over the wire as a bound \n parameter for a query. The strings are assumed to be text and not arbitrary\n bytes.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql_IterWrapper, /*tp_traverse*/ + __pyx_tp_clear_6oursql_IterWrapper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6oursql_20_AbstractIterWrapper_1__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + __pyx_pw_6oursql_11IterWrapper_3__next__, /*tp_iternext*/ + __pyx_methods_6oursql_IterWrapper, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql_IterWrapper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql_FileWrapper(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql_FileWrapper *p; + PyObject *o = __pyx_tp_new_6oursql__AbstractIterWrapper(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql_FileWrapper *)o); + p->fileobj = Py_None; Py_INCREF(Py_None); + p->chunksize = Py_None; Py_INCREF(Py_None); + p->readfunc = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_11FileWrapper_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql_FileWrapper(PyObject *o) { + struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->fileobj); + Py_CLEAR(p->chunksize); + Py_CLEAR(p->readfunc); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6oursql__AbstractIterWrapper(o); +} + +static int __pyx_tp_traverse_6oursql_FileWrapper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o; + e = ((likely(__pyx_ptype_6oursql__AbstractIterWrapper)) ? ((__pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse) ? __pyx_ptype_6oursql__AbstractIterWrapper->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6oursql_FileWrapper)); if (e) return e; + if (p->fileobj) { + e = (*v)(p->fileobj, a); if (e) return e; + } + if (p->chunksize) { + e = (*v)(p->chunksize, a); if (e) return e; + } + if (p->readfunc) { + e = (*v)(p->readfunc, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql_FileWrapper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql_FileWrapper *p = (struct __pyx_obj_6oursql_FileWrapper *)o; + if (likely(__pyx_ptype_6oursql__AbstractIterWrapper)) { if (__pyx_ptype_6oursql__AbstractIterWrapper->tp_clear) __pyx_ptype_6oursql__AbstractIterWrapper->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6oursql_FileWrapper); + tmp = ((PyObject*)p->fileobj); + p->fileobj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->chunksize); + p->chunksize = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->readfunc); + p->readfunc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_specialmethod___pyx_pw_6oursql_11FileWrapper_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6oursql_11FileWrapper_3__next__(self);} + +static PyMethodDef __pyx_methods_6oursql_FileWrapper[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6oursql_11FileWrapper_3__next__, METH_NOARGS|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_11FileWrapper_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_11FileWrapper_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql_FileWrapper = { + PyVarObject_HEAD_INIT(0, 0) + "oursql.FileWrapper", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql_FileWrapper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql_FileWrapper, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "FileWrapper(fileobj, chunksize=8192, doclose=False)\n \n FileWrapper is a wrapper class for file-like objects so that their contents\n can be streamed over the wire as a bound parameter for a query. Strings \n read from the wrapped file are assumed to be text and not arbitrary bytes.\n \n Strings will be read by calling the 'read' method on the file object with\n the 'chunksize' parameter until it returns the empty string. If 'doclose'\n is true, the file will have its 'close' method called once it has been \n exhausted.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql_FileWrapper, /*tp_traverse*/ + __pyx_tp_clear_6oursql_FileWrapper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6oursql_20_AbstractIterWrapper_1__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + __pyx_pw_6oursql_11FileWrapper_3__next__, /*tp_iternext*/ + __pyx_methods_6oursql_FileWrapper, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql_FileWrapper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql__Statement __pyx_vtable_6oursql__Statement; + +static PyObject *__pyx_tp_new_6oursql__Statement(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql__Statement *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__Statement *)o); + p->__pyx_vtab = __pyx_vtabptr_6oursql__Statement; + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + p->warnings = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_10_Statement_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql__Statement(PyObject *o) { + struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6oursql_10_Statement_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->conn); + Py_CLEAR(p->warnings); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql__Statement(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o; + if (p->conn) { + e = (*v)(((PyObject *)p->conn), a); if (e) return e; + } + if (p->warnings) { + e = (*v)(p->warnings, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql__Statement(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql__Statement *p = (struct __pyx_obj_6oursql__Statement *)o; + tmp = ((PyObject*)p->conn); + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->warnings); + p->warnings = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_string_limit(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_12string_limit_1__get__(o); +} + +static int __pyx_setprop_6oursql_10_Statement_string_limit(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10_Statement_12string_limit_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_has_result(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_10has_result_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_description(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_11description_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_column_names(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_12column_names_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_rowcount(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_8rowcount_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_lastrowid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_9lastrowid_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_prefetch_rows(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_13prefetch_rows_1__get__(o); +} + +static int __pyx_setprop_6oursql_10_Statement_prefetch_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10_Statement_13prefetch_rows_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6oursql_10_Statement_warnings(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_Statement_8warnings_1__get__(o); +} + +static int __pyx_setprop_6oursql_10_Statement_warnings(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10_Statement_8warnings_3__set__(o, v); + } + else { + return __pyx_pw_6oursql_10_Statement_8warnings_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6oursql__Statement[] = { + {"close", (PyCFunction)__pyx_pw_6oursql_10_Statement_5close, METH_NOARGS, 0}, + {"prepare", (PyCFunction)__pyx_pw_6oursql_10_Statement_7prepare, METH_O, 0}, + {"execute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_10_Statement_9execute, METH_VARARGS|METH_KEYWORDS, 0}, + {"fetchone", (PyCFunction)__pyx_pw_6oursql_10_Statement_11fetchone, METH_NOARGS, 0}, + {"fetchall", (PyCFunction)__pyx_pw_6oursql_10_Statement_13fetchall, METH_NOARGS, 0}, + {"buffer_results", (PyCFunction)__pyx_pw_6oursql_10_Statement_15buffer_results, METH_NOARGS, 0}, + {"nextset", (PyCFunction)__pyx_pw_6oursql_10_Statement_17nextset, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_10_Statement_21__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_10_Statement_23__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql__Statement[] = { + {(char *)"string_limit", __pyx_getprop_6oursql_10_Statement_string_limit, __pyx_setprop_6oursql_10_Statement_string_limit, (char *)0, 0}, + {(char *)"has_result", __pyx_getprop_6oursql_10_Statement_has_result, 0, (char *)0, 0}, + {(char *)"description", __pyx_getprop_6oursql_10_Statement_description, 0, (char *)0, 0}, + {(char *)"column_names", __pyx_getprop_6oursql_10_Statement_column_names, 0, (char *)0, 0}, + {(char *)"rowcount", __pyx_getprop_6oursql_10_Statement_rowcount, 0, (char *)0, 0}, + {(char *)"lastrowid", __pyx_getprop_6oursql_10_Statement_lastrowid, 0, (char *)0, 0}, + {(char *)"prefetch_rows", __pyx_getprop_6oursql_10_Statement_prefetch_rows, __pyx_setprop_6oursql_10_Statement_prefetch_rows, (char *)0, 0}, + {(char *)"warnings", __pyx_getprop_6oursql_10_Statement_warnings, __pyx_setprop_6oursql_10_Statement_warnings, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__Statement = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._Statement", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__Statement), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__Statement, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_Statement(...)\n \n A class that represents a prepared statement. You should probably avoid\n touching this, even if it's more stable than _Query/_ResultSet.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql__Statement, /*tp_traverse*/ + __pyx_tp_clear_6oursql__Statement, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6oursql_10_Statement_19__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__Statement, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql__Statement, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__Statement, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql__ResultStringStream(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql__ResultStringStream *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__ResultStringStream *)o); + p->stmt = ((struct __pyx_obj_6oursql__Statement *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_19_ResultStringStream_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql__ResultStringStream(PyObject *o) { + struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->stmt); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql__ResultStringStream(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o; + if (p->stmt) { + e = (*v)(((PyObject *)p->stmt), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql__ResultStringStream(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql__ResultStringStream *p = (struct __pyx_obj_6oursql__ResultStringStream *)o; + tmp = ((PyObject*)p->stmt); + p->stmt = ((struct __pyx_obj_6oursql__Statement *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6oursql__ResultStringStream[] = { + {"read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_19_ResultStringStream_3read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_19_ResultStringStream_2read}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_19_ResultStringStream_5__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_19_ResultStringStream_7__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__ResultStringStream = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._ResultStringStream", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__ResultStringStream), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__ResultStringStream, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_ResultStringStream(...)\n \n _ResultStringStream represents an incoming stream of binary data from the\n database. You should never ever instantiate this class yourself.\n \n A _ResultStringStream must be used immediately; fetching any additional \n rows from the database will cause it to go out of sync and become unusable.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql__ResultStringStream, /*tp_traverse*/ + __pyx_tp_clear_6oursql__ResultStringStream, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__ResultStringStream, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__ResultStringStream, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql__ResultSet __pyx_vtable_6oursql__ResultSet; + +static PyObject *__pyx_tp_new_6oursql__ResultSet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql__ResultSet *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__ResultSet *)o); + p->__pyx_vtab = __pyx_vtabptr_6oursql__ResultSet; + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + p->conversion_info = Py_None; Py_INCREF(Py_None); + p->rowcount = Py_None; Py_INCREF(Py_None); + p->lastrowid = Py_None; Py_INCREF(Py_None); + p->description = Py_None; Py_INCREF(Py_None); + p->column_names = Py_None; Py_INCREF(Py_None); + p->warnings = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_10_ResultSet_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql__ResultSet(PyObject *o) { + struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_6oursql_10_ResultSet_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->conn); + Py_CLEAR(p->conversion_info); + Py_CLEAR(p->rowcount); + Py_CLEAR(p->lastrowid); + Py_CLEAR(p->description); + Py_CLEAR(p->column_names); + Py_CLEAR(p->warnings); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql__ResultSet(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o; + if (p->conn) { + e = (*v)(((PyObject *)p->conn), a); if (e) return e; + } + if (p->conversion_info) { + e = (*v)(p->conversion_info, a); if (e) return e; + } + if (p->rowcount) { + e = (*v)(p->rowcount, a); if (e) return e; + } + if (p->lastrowid) { + e = (*v)(p->lastrowid, a); if (e) return e; + } + if (p->description) { + e = (*v)(p->description, a); if (e) return e; + } + if (p->column_names) { + e = (*v)(p->column_names, a); if (e) return e; + } + if (p->warnings) { + e = (*v)(p->warnings, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql__ResultSet(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql__ResultSet *p = (struct __pyx_obj_6oursql__ResultSet *)o; + tmp = ((PyObject*)p->conn); + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->conversion_info); + p->conversion_info = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->rowcount); + p->rowcount = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->lastrowid); + p->lastrowid = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->description); + p->description = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->column_names); + p->column_names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->warnings); + p->warnings = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_has_result(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_10has_result_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_rowcount(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_8rowcount_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_lastrowid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_9lastrowid_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_description(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_11description_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_column_names(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_12column_names_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_10_ResultSet_warnings(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_10_ResultSet_8warnings_1__get__(o); +} + +static int __pyx_setprop_6oursql_10_ResultSet_warnings(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_10_ResultSet_8warnings_3__set__(o, v); + } + else { + return __pyx_pw_6oursql_10_ResultSet_8warnings_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6oursql__ResultSet[] = { + {"close", (PyCFunction)__pyx_pw_6oursql_10_ResultSet_5close, METH_NOARGS, 0}, + {"fetchone", (PyCFunction)__pyx_pw_6oursql_10_ResultSet_7fetchone, METH_NOARGS, 0}, + {"fetchall", (PyCFunction)__pyx_pw_6oursql_10_ResultSet_9fetchall, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_10_ResultSet_13__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_10_ResultSet_15__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql__ResultSet[] = { + {(char *)"has_result", __pyx_getprop_6oursql_10_ResultSet_has_result, 0, (char *)0, 0}, + {(char *)"rowcount", __pyx_getprop_6oursql_10_ResultSet_rowcount, 0, (char *)0, 0}, + {(char *)"lastrowid", __pyx_getprop_6oursql_10_ResultSet_lastrowid, 0, (char *)0, 0}, + {(char *)"description", __pyx_getprop_6oursql_10_ResultSet_description, 0, (char *)0, 0}, + {(char *)"column_names", __pyx_getprop_6oursql_10_ResultSet_column_names, 0, (char *)0, 0}, + {(char *)"warnings", __pyx_getprop_6oursql_10_ResultSet_warnings, __pyx_setprop_6oursql_10_ResultSet_warnings, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__ResultSet = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._ResultSet", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__ResultSet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__ResultSet, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_ResultSet(...)\n \n You should never ever instantiate a _ResultSet yourself unless you really\n know what you're doing. \n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql__ResultSet, /*tp_traverse*/ + __pyx_tp_clear_6oursql__ResultSet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6oursql_10_ResultSet_11__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__ResultSet, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql__ResultSet, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__ResultSet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql__Query __pyx_vtable_6oursql__Query; + +static PyObject *__pyx_tp_new_6oursql__Query(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql__Query *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__Query *)o); + p->__pyx_vtab = __pyx_vtabptr_6oursql__Query; + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + p->result = Py_None; Py_INCREF(Py_None); + p->res_a = Py_None; Py_INCREF(Py_None); + p->res_kw = Py_None; Py_INCREF(Py_None); + p->rowcount = Py_None; Py_INCREF(Py_None); + p->lastrowid = Py_None; Py_INCREF(Py_None); + p->description = Py_None; Py_INCREF(Py_None); + p->warnings = Py_None; Py_INCREF(Py_None); + p->has_result = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_6_Query_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql__Query(PyObject *o) { + struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->conn); + Py_CLEAR(p->result); + Py_CLEAR(p->res_a); + Py_CLEAR(p->res_kw); + Py_CLEAR(p->rowcount); + Py_CLEAR(p->lastrowid); + Py_CLEAR(p->description); + Py_CLEAR(p->warnings); + Py_CLEAR(p->has_result); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql__Query(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o; + if (p->conn) { + e = (*v)(((PyObject *)p->conn), a); if (e) return e; + } + if (p->result) { + e = (*v)(p->result, a); if (e) return e; + } + if (p->res_a) { + e = (*v)(p->res_a, a); if (e) return e; + } + if (p->res_kw) { + e = (*v)(p->res_kw, a); if (e) return e; + } + if (p->rowcount) { + e = (*v)(p->rowcount, a); if (e) return e; + } + if (p->lastrowid) { + e = (*v)(p->lastrowid, a); if (e) return e; + } + if (p->description) { + e = (*v)(p->description, a); if (e) return e; + } + if (p->warnings) { + e = (*v)(p->warnings, a); if (e) return e; + } + if (p->has_result) { + e = (*v)(p->has_result, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql__Query(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql__Query *p = (struct __pyx_obj_6oursql__Query *)o; + tmp = ((PyObject*)p->conn); + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->result); + p->result = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->res_a); + p->res_a = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->res_kw); + p->res_kw = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->rowcount); + p->rowcount = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->lastrowid); + p->lastrowid = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->description); + p->description = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->warnings); + p->warnings = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->has_result); + p->has_result = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_6_Query_rowcount(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6_Query_8rowcount_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6_Query_lastrowid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6_Query_9lastrowid_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6_Query_description(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6_Query_11description_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6_Query_warnings(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6_Query_8warnings_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6_Query_has_result(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6_Query_10has_result_1__get__(o); +} + +static PyMethodDef __pyx_methods_6oursql__Query[] = { + {"new_result", (PyCFunction)__pyx_pw_6oursql_6_Query_3new_result, METH_NOARGS, 0}, + {"nextset", (PyCFunction)__pyx_pw_6oursql_6_Query_5nextset, METH_NOARGS, 0}, + {"fetchone", (PyCFunction)__pyx_pw_6oursql_6_Query_7fetchone, METH_NOARGS, 0}, + {"fetchall", (PyCFunction)__pyx_pw_6oursql_6_Query_11fetchall, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_6_Query_13__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_6_Query_15__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql__Query[] = { + {(char *)"rowcount", __pyx_getprop_6oursql_6_Query_rowcount, 0, (char *)0, 0}, + {(char *)"lastrowid", __pyx_getprop_6oursql_6_Query_lastrowid, 0, (char *)0, 0}, + {(char *)"description", __pyx_getprop_6oursql_6_Query_description, 0, (char *)0, 0}, + {(char *)"warnings", __pyx_getprop_6oursql_6_Query_warnings, 0, (char *)0, 0}, + {(char *)"has_result", __pyx_getprop_6oursql_6_Query_has_result, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__Query = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._Query", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__Query), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__Query, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_Query(...)\n \n _Queries generate _ResultSets. Eventually they will also support generating\n multiple _ResultSets when dealing with queries that produce multiple result\n sets.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql__Query, /*tp_traverse*/ + __pyx_tp_clear_6oursql__Query, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6oursql_6_Query_9__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__Query, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql__Query, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__Query, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql__DictQuery __pyx_vtable_6oursql__DictQuery; + +static PyObject *__pyx_tp_new_6oursql__DictQuery(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql__DictQuery *p; + PyObject *o = __pyx_tp_new_6oursql__Query(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__DictQuery *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6oursql__Query*)__pyx_vtabptr_6oursql__DictQuery; + return o; +} + +static PyMethodDef __pyx_methods_6oursql__DictQuery[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_10_DictQuery_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_10_DictQuery_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__DictQuery = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._DictQuery", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__DictQuery), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__Query, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6oursql__Query, /*tp_traverse*/ + __pyx_tp_clear_6oursql__Query, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6oursql_6_Query_9__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + 0, /*tp_iternext*/ + __pyx_methods_6oursql__DictQuery, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__DictQuery, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql_Cursor __pyx_vtable_6oursql_Cursor; + +static PyObject *__pyx_tp_new_6oursql_Cursor(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql_Cursor *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql_Cursor *)o); + p->__pyx_vtab = __pyx_vtabptr_6oursql_Cursor; + p->_statements = Py_None; Py_INCREF(Py_None); + p->_stmt_kwargs = Py_None; Py_INCREF(Py_None); + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + p->rowcount = Py_None; Py_INCREF(Py_None); + p->lastrowid = Py_None; Py_INCREF(Py_None); + p->description = Py_None; Py_INCREF(Py_None); + p->messages = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6oursql_6Cursor_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6oursql_Cursor(PyObject *o) { + struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_statements); + Py_CLEAR(p->_stmt_kwargs); + Py_CLEAR(p->conn); + Py_CLEAR(p->rowcount); + Py_CLEAR(p->lastrowid); + Py_CLEAR(p->description); + Py_CLEAR(p->messages); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql_Cursor(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o; + if (p->_statements) { + e = (*v)(p->_statements, a); if (e) return e; + } + if (p->_stmt_kwargs) { + e = (*v)(p->_stmt_kwargs, a); if (e) return e; + } + if (p->conn) { + e = (*v)(((PyObject *)p->conn), a); if (e) return e; + } + if (p->rowcount) { + e = (*v)(p->rowcount, a); if (e) return e; + } + if (p->lastrowid) { + e = (*v)(p->lastrowid, a); if (e) return e; + } + if (p->description) { + e = (*v)(p->description, a); if (e) return e; + } + if (p->messages) { + e = (*v)(p->messages, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql_Cursor(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql_Cursor *p = (struct __pyx_obj_6oursql_Cursor *)o; + tmp = ((PyObject*)p->_statements); + p->_statements = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_stmt_kwargs); + p->_stmt_kwargs = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->conn); + p->conn = ((struct __pyx_obj_6oursql_Connection *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->rowcount); + p->rowcount = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->lastrowid); + p->lastrowid = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->description); + p->description = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->messages); + p->messages = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_connection(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_10connection_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor__statements(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_11_statements_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor__stmt_kwargs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_12_stmt_kwargs_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_rowcount(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_8rowcount_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_lastrowid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_9lastrowid_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_description(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_11description_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_messages(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_8messages_1__get__(o); +} + +static PyObject *__pyx_getprop_6oursql_6Cursor_arraysize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_6Cursor_9arraysize_1__get__(o); +} + +static int __pyx_setprop_6oursql_6Cursor_arraysize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6oursql_6Cursor_9arraysize_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6oursql_Cursor[] = { + {"close", (PyCFunction)__pyx_pw_6oursql_6Cursor_3close, METH_NOARGS, __pyx_doc_6oursql_6Cursor_2close}, + {"_new_statement", (PyCFunction)__pyx_pw_6oursql_6Cursor_5_new_statement, METH_NOARGS, 0}, + {"_new_query", (PyCFunction)__pyx_pw_6oursql_6Cursor_7_new_query, METH_O, 0}, + {"callproc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_9callproc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_6Cursor_8callproc}, + {"_do_autoping", (PyCFunction)__pyx_pw_6oursql_6Cursor_11_do_autoping, METH_NOARGS, 0}, + {"execute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_13execute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_6Cursor_12execute}, + {"executemany", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_15executemany, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_6Cursor_14executemany}, + {"nextset", (PyCFunction)__pyx_pw_6oursql_6Cursor_17nextset, METH_NOARGS, __pyx_doc_6oursql_6Cursor_16nextset}, + {"fetchone", (PyCFunction)__pyx_pw_6oursql_6Cursor_19fetchone, METH_NOARGS, __pyx_doc_6oursql_6Cursor_18fetchone}, + {"fetchmany", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_21fetchmany, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_6Cursor_20fetchmany}, + {"fetchall", (PyCFunction)__pyx_pw_6oursql_6Cursor_23fetchall, METH_NOARGS, __pyx_doc_6oursql_6Cursor_22fetchall}, + {"setinputsizes", (PyCFunction)__pyx_pw_6oursql_6Cursor_27setinputsizes, METH_O, __pyx_doc_6oursql_6Cursor_26setinputsizes}, + {"setoutputsize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_29setoutputsize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6oursql_6Cursor_28setoutputsize}, + {"__enter__", (PyCFunction)__pyx_pw_6oursql_6Cursor_31__enter__, METH_NOARGS, 0}, + {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6oursql_6Cursor_33__exit__, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_6Cursor_35__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_6Cursor_37__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql_Cursor[] = { + {(char *)"connection", __pyx_getprop_6oursql_6Cursor_connection, 0, (char *)0, 0}, + {(char *)"_statements", __pyx_getprop_6oursql_6Cursor__statements, 0, (char *)0, 0}, + {(char *)"_stmt_kwargs", __pyx_getprop_6oursql_6Cursor__stmt_kwargs, 0, (char *)0, 0}, + {(char *)"rowcount", __pyx_getprop_6oursql_6Cursor_rowcount, 0, (char *)0, 0}, + {(char *)"lastrowid", __pyx_getprop_6oursql_6Cursor_lastrowid, 0, (char *)0, 0}, + {(char *)"description", __pyx_getprop_6oursql_6Cursor_description, 0, (char *)0, 0}, + {(char *)"messages", __pyx_getprop_6oursql_6Cursor_messages, 0, (char *)0, 0}, + {(char *)"arraysize", __pyx_getprop_6oursql_6Cursor_arraysize, __pyx_setprop_6oursql_6Cursor_arraysize, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql_Cursor = { + PyVarObject_HEAD_INIT(0, 0) + "oursql.Cursor", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql_Cursor), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql_Cursor, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Cursor(...)\n \n Cursors should never be instantiated directly. They may be passed other \n options via the Connection.cursor method:\n \n - try_plain_query=True: If this is true, oursql will first attempt to run\n queries as prepared statements, and then fall back to the plain query \n API if MySQL refuses to parameterize the query. Otherwise, oursql will \n only run plain queries if explicitly asked.\n \n - show_table=False: If this is true, the name of the table will be \n prepended to the name of the column in the 'description' attribute of\n the cursor.\n \n - string_limit=0: Set a limit on the size of the buffer oursql will \n allocate when fetching strings over the wire. If the string_limit is \n nonzero, file-like objects will always be returned instead of strings. \n If the size of the string value is greater than the string_limit, the \n string will be streamed as necessary instead of fetched all at once.\n Note: plain queries buffer incoming result differently, and are \n therefore unaffected by the string_limit.\n \n Cursor instances yield tuples to represent rows.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql_Cursor, /*tp_traverse*/ + __pyx_tp_clear_6oursql_Cursor, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6oursql_6Cursor_25__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql_Cursor, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql_Cursor, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql_Cursor, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; +static struct __pyx_vtabstruct_6oursql_DictCursor __pyx_vtable_6oursql_DictCursor; + +static PyObject *__pyx_tp_new_6oursql_DictCursor(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6oursql_DictCursor *p; + PyObject *o = __pyx_tp_new_6oursql_Cursor(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql_DictCursor *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6oursql_Cursor*)__pyx_vtabptr_6oursql_DictCursor; + return o; +} + +static PyMethodDef __pyx_methods_6oursql_DictCursor[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_10DictCursor_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_10DictCursor_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql_DictCursor = { + PyVarObject_HEAD_INIT(0, 0) + "oursql.DictCursor", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql_DictCursor), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql_Cursor, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "DictCursor(...)\n \n Cursors should never be instantiated directly. They may be passed other \n options via the Connection.cursor method. See the documentation for the\n Cursor class for details.\n \n DictCursor instances represent rows as dicts mapping column names or \n aliases to values. These key names are taken from the 'description' \n attribute of the cursor, and are therefore affected by the 'show_table'\n cursor option. A ProgrammingError is raised when fetching a row if there \n were duplicate keys with inequal values.\n ", /*tp_doc*/ + __pyx_tp_traverse_6oursql_Cursor, /*tp_traverse*/ + __pyx_tp_clear_6oursql_Cursor, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6oursql_6Cursor_25__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + 0, /*tp_iternext*/ + __pyx_methods_6oursql_DictCursor, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql_DictCursor, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_6oursql__DBAPITypeObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6oursql__DBAPITypeObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6oursql__DBAPITypeObject *)o); + p->values = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6oursql__DBAPITypeObject(PyObject *o) { + struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->values); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6oursql__DBAPITypeObject(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o; + if (p->values) { + e = (*v)(p->values, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6oursql__DBAPITypeObject(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6oursql__DBAPITypeObject *p = (struct __pyx_obj_6oursql__DBAPITypeObject *)o; + tmp = ((PyObject*)p->values); + p->values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6oursql_16_DBAPITypeObject_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6oursql_16_DBAPITypeObject_6values_1__get__(o); +} + +static PyMethodDef __pyx_methods_6oursql__DBAPITypeObject[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_6oursql_16_DBAPITypeObject_7__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6oursql_16_DBAPITypeObject_9__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6oursql__DBAPITypeObject[] = { + {(char *)"values", __pyx_getprop_6oursql_16_DBAPITypeObject_values, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6oursql__DBAPITypeObject = { + PyVarObject_HEAD_INIT(0, 0) + "oursql._DBAPITypeObject", /*tp_name*/ + sizeof(struct __pyx_obj_6oursql__DBAPITypeObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6oursql__DBAPITypeObject, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6oursql_16_DBAPITypeObject_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6oursql__DBAPITypeObject, /*tp_traverse*/ + __pyx_tp_clear_6oursql__DBAPITypeObject, /*tp_clear*/ + __pyx_pw_6oursql_16_DBAPITypeObject_3__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6oursql__DBAPITypeObject, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6oursql__DBAPITypeObject, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6oursql_16_DBAPITypeObject_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6oursql__DBAPITypeObject, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_oursql(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_oursql}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "oursql", + __pyx_k_oursql_python_bindings_for_MySQL, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_kp_u_0_9_4, __pyx_k_0_9_4, sizeof(__pyx_k_0_9_4), 0, 1, 0, 0}, + {&__pyx_kp_u_2_0, __pyx_k_2_0, sizeof(__pyx_k_2_0), 0, 1, 0, 0}, + {&__pyx_kp_u_Aaron_Gallagher_habnabit_gmail_c, __pyx_k_Aaron_Gallagher_habnabit_gmail_c, sizeof(__pyx_k_Aaron_Gallagher_habnabit_gmail_c), 0, 1, 0, 0}, + {&__pyx_n_s_AbstractIterWrapper, __pyx_k_AbstractIterWrapper, sizeof(__pyx_k_AbstractIterWrapper), 0, 0, 1, 1}, + {&__pyx_n_s_BINARY, __pyx_k_BINARY, sizeof(__pyx_k_BINARY), 0, 0, 1, 1}, + {&__pyx_n_s_Binary, __pyx_k_Binary, sizeof(__pyx_k_Binary), 0, 0, 1, 1}, + {&__pyx_n_s_BinaryFileWrapper, __pyx_k_BinaryFileWrapper, sizeof(__pyx_k_BinaryFileWrapper), 0, 0, 1, 1}, + {&__pyx_n_u_BinaryFileWrapper, __pyx_k_BinaryFileWrapper, sizeof(__pyx_k_BinaryFileWrapper), 0, 1, 0, 1}, + {&__pyx_kp_u_BinaryFileWrapper_fileobj_chunks, __pyx_k_BinaryFileWrapper_fileobj_chunks, sizeof(__pyx_k_BinaryFileWrapper_fileobj_chunks), 0, 1, 0, 0}, + {&__pyx_n_s_BinaryIterWrapper, __pyx_k_BinaryIterWrapper, sizeof(__pyx_k_BinaryIterWrapper), 0, 0, 1, 1}, + {&__pyx_n_u_BinaryIterWrapper, __pyx_k_BinaryIterWrapper, sizeof(__pyx_k_BinaryIterWrapper), 0, 1, 0, 1}, + {&__pyx_kp_u_BinaryIterWrapper_iterobj_Binary, __pyx_k_BinaryIterWrapper_iterobj_Binary, sizeof(__pyx_k_BinaryIterWrapper_iterobj_Binary), 0, 1, 0, 0}, + {&__pyx_n_s_BinaryWhateverMixin, __pyx_k_BinaryWhateverMixin, sizeof(__pyx_k_BinaryWhateverMixin), 0, 0, 1, 1}, + {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1}, + {&__pyx_n_s_CollatedWarningsError, __pyx_k_CollatedWarningsError, sizeof(__pyx_k_CollatedWarningsError), 0, 0, 1, 1}, + {&__pyx_n_s_Connection, __pyx_k_Connection, sizeof(__pyx_k_Connection), 0, 0, 1, 1}, + {&__pyx_n_s_Cursor, __pyx_k_Cursor, sizeof(__pyx_k_Cursor), 0, 0, 1, 1}, + {&__pyx_n_s_DATE, __pyx_k_DATE, sizeof(__pyx_k_DATE), 0, 0, 1, 1}, + {&__pyx_n_s_DATETIME, __pyx_k_DATETIME, sizeof(__pyx_k_DATETIME), 0, 0, 1, 1}, + {&__pyx_n_s_DBAPITypeObject, __pyx_k_DBAPITypeObject, sizeof(__pyx_k_DBAPITypeObject), 0, 0, 1, 1}, + {&__pyx_kp_u_DBAPITypeObject_representing_r, __pyx_k_DBAPITypeObject_representing_r, sizeof(__pyx_k_DBAPITypeObject_representing_r), 0, 1, 0, 0}, + {&__pyx_n_s_DataError, __pyx_k_DataError, sizeof(__pyx_k_DataError), 0, 0, 1, 1}, + {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1}, + {&__pyx_n_s_Date, __pyx_k_Date, sizeof(__pyx_k_Date), 0, 0, 1, 1}, + {&__pyx_n_s_DateFromTicks, __pyx_k_DateFromTicks, sizeof(__pyx_k_DateFromTicks), 0, 0, 1, 1}, + {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1}, + {&__pyx_n_s_DictCursor, __pyx_k_DictCursor, sizeof(__pyx_k_DictCursor), 0, 0, 1, 1}, + {&__pyx_n_s_DictQuery, __pyx_k_DictQuery, sizeof(__pyx_k_DictQuery), 0, 0, 1, 1}, + {&__pyx_n_s_DictResultSet, __pyx_k_DictResultSet, sizeof(__pyx_k_DictResultSet), 0, 0, 1, 1}, + {&__pyx_n_u_DictResultSet, __pyx_k_DictResultSet, sizeof(__pyx_k_DictResultSet), 0, 1, 0, 1}, + {&__pyx_n_s_DictStatement, __pyx_k_DictStatement, sizeof(__pyx_k_DictStatement), 0, 0, 1, 1}, + {&__pyx_n_u_DictStatement, __pyx_k_DictStatement, sizeof(__pyx_k_DictStatement), 0, 1, 0, 1}, + {&__pyx_n_s_DictWhateverMixin, __pyx_k_DictWhateverMixin, sizeof(__pyx_k_DictWhateverMixin), 0, 0, 1, 1}, + {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, + {&__pyx_n_u_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 1, 0, 1}, + {&__pyx_n_s_Error___init, __pyx_k_Error___init, sizeof(__pyx_k_Error___init), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_FileWrapper, __pyx_k_FileWrapper, sizeof(__pyx_k_FileWrapper), 0, 0, 1, 1}, + {&__pyx_kp_u_H_M_S, __pyx_k_H_M_S, sizeof(__pyx_k_H_M_S), 0, 1, 0, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf0, __pyx_k_Incompatible_checksums_s_vs_0xf0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf0), 0, 0, 1, 0}, + {&__pyx_n_s_IntegrityError, __pyx_k_IntegrityError, sizeof(__pyx_k_IntegrityError), 0, 0, 1, 1}, + {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1}, + {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1}, + {&__pyx_n_s_IterWrapper, __pyx_k_IterWrapper, sizeof(__pyx_k_IterWrapper), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_NUMBER, __pyx_k_NUMBER, sizeof(__pyx_k_NUMBER), 0, 0, 1, 1}, + {&__pyx_n_s_NotSupportedError, __pyx_k_NotSupportedError, sizeof(__pyx_k_NotSupportedError), 0, 0, 1, 1}, + {&__pyx_n_s_Note, __pyx_k_Note, sizeof(__pyx_k_Note), 0, 0, 1, 1}, + {&__pyx_n_u_Note, __pyx_k_Note, sizeof(__pyx_k_Note), 0, 1, 0, 1}, + {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1}, + {&__pyx_n_s_PermissionsError, __pyx_k_PermissionsError, sizeof(__pyx_k_PermissionsError), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1}, + {&__pyx_n_s_Query, __pyx_k_Query, sizeof(__pyx_k_Query), 0, 0, 1, 1}, + {&__pyx_n_s_ROWID, __pyx_k_ROWID, sizeof(__pyx_k_ROWID), 0, 0, 1, 1}, + {&__pyx_n_s_ResultSet, __pyx_k_ResultSet, sizeof(__pyx_k_ResultSet), 0, 0, 1, 1}, + {&__pyx_n_s_ResultStringStream, __pyx_k_ResultStringStream, sizeof(__pyx_k_ResultStringStream), 0, 0, 1, 1}, + {&__pyx_kp_u_SHOW_WARNINGS, __pyx_k_SHOW_WARNINGS, sizeof(__pyx_k_SHOW_WARNINGS), 0, 1, 0, 0}, + {&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1}, + {&__pyx_n_s_Statement, __pyx_k_Statement, sizeof(__pyx_k_Statement), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_TIME, __pyx_k_TIME, sizeof(__pyx_k_TIME), 0, 0, 1, 1}, + {&__pyx_n_s_TIMESTAMP, __pyx_k_TIMESTAMP, sizeof(__pyx_k_TIMESTAMP), 0, 0, 1, 1}, + {&__pyx_n_s_Time, __pyx_k_Time, sizeof(__pyx_k_Time), 0, 0, 1, 1}, + {&__pyx_n_s_TimeFromTicks, __pyx_k_TimeFromTicks, sizeof(__pyx_k_TimeFromTicks), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_TimestampFromTicks, __pyx_k_TimestampFromTicks, sizeof(__pyx_k_TimestampFromTicks), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UnknownError, __pyx_k_UnknownError, sizeof(__pyx_k_UnknownError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 0, 1, 1}, + {&__pyx_n_u_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 1, 0, 1}, + {&__pyx_kp_u_Y_m_d, __pyx_k_Y_m_d, sizeof(__pyx_k_Y_m_d), 0, 1, 0, 0}, + {&__pyx_kp_u_Y_m_d_H_M_S, __pyx_k_Y_m_d_H_M_S, sizeof(__pyx_k_Y_m_d_H_M_S), 0, 1, 0, 0}, + {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, + {&__pyx_kp_u_alloc_of_bind_parameters_failed, __pyx_k_alloc_of_bind_parameters_failed, sizeof(__pyx_k_alloc_of_bind_parameters_failed), 0, 1, 0, 0}, + {&__pyx_kp_u_alloc_of_conn_object_failed, __pyx_k_alloc_of_conn_object_failed, sizeof(__pyx_k_alloc_of_conn_object_failed), 0, 1, 0, 0}, + {&__pyx_kp_u_alloc_of_result_bind_structure_f, __pyx_k_alloc_of_result_bind_structure_f, sizeof(__pyx_k_alloc_of_result_bind_structure_f), 0, 1, 0, 0}, + {&__pyx_kp_u_alloc_of_result_buffers_failed, __pyx_k_alloc_of_result_buffers_failed, sizeof(__pyx_k_alloc_of_result_buffers_failed), 0, 1, 0, 0}, + {&__pyx_kp_u_alloc_of_statement_failed, __pyx_k_alloc_of_statement_failed, sizeof(__pyx_k_alloc_of_statement_failed), 0, 1, 0, 0}, + {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0}, + {&__pyx_n_s_apilevel, __pyx_k_apilevel, sizeof(__pyx_k_apilevel), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, + {&__pyx_n_s_autoping, __pyx_k_autoping, sizeof(__pyx_k_autoping), 0, 0, 1, 1}, + {&__pyx_n_s_autoreconnect, __pyx_k_autoreconnect, sizeof(__pyx_k_autoreconnect), 0, 0, 1, 1}, + {&__pyx_kp_u_binding_this_query_would_cause_r, __pyx_k_binding_this_query_would_cause_r, sizeof(__pyx_k_binding_this_query_would_cause_r), 0, 1, 0, 0}, + {&__pyx_n_s_bitval_from_string, __pyx_k_bitval_from_string, sizeof(__pyx_k_bitval_from_string), 0, 0, 1, 1}, + {&__pyx_n_s_buffer_results, __pyx_k_buffer_results, sizeof(__pyx_k_buffer_results), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_ca, __pyx_k_ca, sizeof(__pyx_k_ca), 0, 0, 1, 1}, + {&__pyx_kp_u_can_t_call_execute_with_both_par, __pyx_k_can_t_call_execute_with_both_par, sizeof(__pyx_k_can_t_call_execute_with_both_par), 0, 1, 0, 0}, + {&__pyx_kp_u_can_t_read_negative_bytes, __pyx_k_can_t_read_negative_bytes, sizeof(__pyx_k_can_t_read_negative_bytes), 0, 1, 0, 0}, + {&__pyx_kp_u_cannot_bind_r_object, __pyx_k_cannot_bind_r_object, sizeof(__pyx_k_cannot_bind_r_object), 0, 1, 0, 0}, + {&__pyx_n_s_capath, __pyx_k_capath, sizeof(__pyx_k_capath), 0, 0, 1, 1}, + {&__pyx_n_s_cert, __pyx_k_cert, sizeof(__pyx_k_cert), 0, 0, 1, 1}, + {&__pyx_n_s_charset, __pyx_k_charset, sizeof(__pyx_k_charset), 0, 0, 1, 1}, + {&__pyx_n_s_charset_dir, __pyx_k_charset_dir, sizeof(__pyx_k_charset_dir), 0, 0, 1, 1}, + {&__pyx_n_s_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 0, 1, 1}, + {&__pyx_n_s_cipher, __pyx_k_cipher, sizeof(__pyx_k_cipher), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_client_info, __pyx_k_client_info, sizeof(__pyx_k_client_info), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1}, + {&__pyx_n_s_column_names, __pyx_k_column_names, sizeof(__pyx_k_column_names), 0, 0, 1, 1}, + {&__pyx_kp_u_column_s_appears_more_than_once, __pyx_k_column_s_appears_more_than_once, sizeof(__pyx_k_column_s_appears_more_than_once), 0, 1, 0, 0}, + {&__pyx_n_s_commit, __pyx_k_commit, sizeof(__pyx_k_commit), 0, 0, 1, 1}, + {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1}, + {&__pyx_n_s_conn, __pyx_k_conn, sizeof(__pyx_k_conn), 0, 0, 1, 1}, + {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1}, + {&__pyx_n_s_connect_timeout, __pyx_k_connect_timeout, sizeof(__pyx_k_connect_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_connection, __pyx_k_connection, sizeof(__pyx_k_connection), 0, 0, 1, 1}, + {&__pyx_kp_u_connection_closed, __pyx_k_connection_closed, sizeof(__pyx_k_connection_closed), 0, 1, 0, 0}, + {&__pyx_n_s_conversions, __pyx_k_conversions, sizeof(__pyx_k_conversions), 0, 0, 1, 1}, + {&__pyx_n_s_conversions_dict, __pyx_k_conversions_dict, sizeof(__pyx_k_conversions_dict), 0, 0, 1, 1}, + {&__pyx_kp_u_could_not_initialize_mysql, __pyx_k_could_not_initialize_mysql, sizeof(__pyx_k_could_not_initialize_mysql), 0, 1, 0, 0}, + {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1}, + {&__pyx_n_s_cursor_class, __pyx_k_cursor_class, sizeof(__pyx_k_cursor_class), 0, 0, 1, 1}, + {&__pyx_kp_u_cursor_closed, __pyx_k_cursor_closed, sizeof(__pyx_k_cursor_closed), 0, 1, 0, 0}, + {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1}, + {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, + {&__pyx_n_s_date_from_string, __pyx_k_date_from_string, sizeof(__pyx_k_date_from_string), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_from_string, __pyx_k_datetime_from_string, sizeof(__pyx_k_datetime_from_string), 0, 0, 1, 1}, + {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1}, + {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_default_cursor, __pyx_k_default_cursor, sizeof(__pyx_k_default_cursor), 0, 0, 1, 1}, + {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, + {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_do_autoping, __pyx_k_do_autoping, sizeof(__pyx_k_do_autoping), 0, 0, 1, 1}, + {&__pyx_n_s_do_warnings_query, __pyx_k_do_warnings_query, sizeof(__pyx_k_do_warnings_query), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_u_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 0, 1}, + {&__pyx_n_s_doclose, __pyx_k_doclose, sizeof(__pyx_k_doclose), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_n_s_errnos, __pyx_k_errnos, sizeof(__pyx_k_errnos), 0, 0, 1, 1}, + {&__pyx_n_s_escape_string, __pyx_k_escape_string, sizeof(__pyx_k_escape_string), 0, 0, 1, 1}, + {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1}, + {&__pyx_n_s_exception_enum_map, __pyx_k_exception_enum_map, sizeof(__pyx_k_exception_enum_map), 0, 0, 1, 1}, + {&__pyx_n_s_exception_from_errno, __pyx_k_exception_from_errno, sizeof(__pyx_k_exception_from_errno), 0, 0, 1, 1}, + {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, + {&__pyx_kp_u_executing_this_query_would_cause, __pyx_k_executing_this_query_would_cause, sizeof(__pyx_k_executing_this_query_would_cause), 0, 1, 0, 0}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 0, 1, 1}, + {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1}, + {&__pyx_n_s_fetchone, __pyx_k_fetchone, sizeof(__pyx_k_fetchone), 0, 0, 1, 1}, + {&__pyx_n_s_fileobj, __pyx_k_fileobj, sizeof(__pyx_k_fileobj), 0, 0, 1, 1}, + {&__pyx_n_s_found_rows, __pyx_k_found_rows, sizeof(__pyx_k_found_rows), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_getreader, __pyx_k_getreader, sizeof(__pyx_k_getreader), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_kp_u_given, __pyx_k_given, sizeof(__pyx_k_given), 0, 1, 0, 0}, + {&__pyx_n_s_has_result, __pyx_k_has_result, sizeof(__pyx_k_has_result), 0, 0, 1, 1}, + {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_command, __pyx_k_init_command, sizeof(__pyx_k_init_command), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_iterobj, __pyx_k_iterobj, sizeof(__pyx_k_iterobj), 0, 0, 1, 1}, + {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_lastrowid, __pyx_k_lastrowid, sizeof(__pyx_k_lastrowid), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_local_infile, __pyx_k_local_infile, sizeof(__pyx_k_local_infile), 0, 0, 1, 1}, + {&__pyx_n_s_localtime, __pyx_k_localtime, sizeof(__pyx_k_localtime), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_u_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 1, 0, 1}, + {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_u_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 1, 0, 1}, + {&__pyx_n_s_multi_results, __pyx_k_multi_results, sizeof(__pyx_k_multi_results), 0, 0, 1, 1}, + {&__pyx_n_s_multi_statements, __pyx_k_multi_statements, sizeof(__pyx_k_multi_statements), 0, 0, 1, 1}, + {&__pyx_kp_u_must_prefetch_at_least_1_row, __pyx_k_must_prefetch_at_least_1_row, sizeof(__pyx_k_must_prefetch_at_least_1_row), 0, 1, 0, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_new_query, __pyx_k_new_query, sizeof(__pyx_k_new_query), 0, 0, 1, 1}, + {&__pyx_n_s_new_result, __pyx_k_new_result, sizeof(__pyx_k_new_result), 0, 0, 1, 1}, + {&__pyx_n_s_new_statement, __pyx_k_new_statement, sizeof(__pyx_k_new_statement), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_nextset, __pyx_k_nextset, sizeof(__pyx_k_nextset), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_kp_u_no_results_available, __pyx_k_no_results_available, sizeof(__pyx_k_no_results_available), 0, 1, 0, 0}, + {&__pyx_n_s_oursql, __pyx_k_oursql, sizeof(__pyx_k_oursql), 0, 0, 1, 1}, + {&__pyx_kp_s_oursqlx_conversions_pyx, __pyx_k_oursqlx_conversions_pyx, sizeof(__pyx_k_oursqlx_conversions_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_oursqlx_oursql_pyx, __pyx_k_oursqlx_oursql_pyx, sizeof(__pyx_k_oursqlx_oursql_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_oursqlx_util_pyx, __pyx_k_oursqlx_util_pyx, sizeof(__pyx_k_oursqlx_util_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_parambatch, __pyx_k_parambatch, sizeof(__pyx_k_parambatch), 0, 0, 1, 1}, + {&__pyx_kp_u_parameters_expected, __pyx_k_parameters_expected, sizeof(__pyx_k_parameters_expected), 0, 1, 0, 0}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_paramstyle, __pyx_k_paramstyle, sizeof(__pyx_k_paramstyle), 0, 0, 1, 1}, + {&__pyx_n_s_passwd, __pyx_k_passwd, sizeof(__pyx_k_passwd), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_ping, __pyx_k_ping, sizeof(__pyx_k_ping), 0, 0, 1, 1}, + {&__pyx_n_u_pipe, __pyx_k_pipe, sizeof(__pyx_k_pipe), 0, 1, 0, 1}, + {&__pyx_n_s_plain_query, __pyx_k_plain_query, sizeof(__pyx_k_plain_query), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_prefetch_rows, __pyx_k_prefetch_rows, sizeof(__pyx_k_prefetch_rows), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_prepare_2, __pyx_k_prepare_2, sizeof(__pyx_k_prepare_2), 0, 0, 1, 1}, + {&__pyx_n_s_procname, __pyx_k_procname, sizeof(__pyx_k_procname), 0, 0, 1, 1}, + {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1}, + {&__pyx_n_s_protocol_enum_map, __pyx_k_protocol_enum_map, sizeof(__pyx_k_protocol_enum_map), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle__AbstractIterWrap, __pyx_k_pyx_unpickle__AbstractIterWrap, sizeof(__pyx_k_pyx_unpickle__AbstractIterWrap), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle__BinaryWhateverMi, __pyx_k_pyx_unpickle__BinaryWhateverMi, sizeof(__pyx_k_pyx_unpickle__BinaryWhateverMi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle__DBAPITypeObject, __pyx_k_pyx_unpickle__DBAPITypeObject, sizeof(__pyx_k_pyx_unpickle__DBAPITypeObject), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle__DictWhateverMixi, __pyx_k_pyx_unpickle__DictWhateverMixi, sizeof(__pyx_k_pyx_unpickle__DictWhateverMixi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_n_u_qmark, __pyx_k_qmark, sizeof(__pyx_k_qmark), 0, 1, 0, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, + {&__pyx_kp_u_query_caused_warnings, __pyx_k_query_caused_warnings, sizeof(__pyx_k_query_caused_warnings), 0, 1, 0, 0}, + {&__pyx_n_s_query_class, __pyx_k_query_class, sizeof(__pyx_k_query_class), 0, 0, 1, 1}, + {&__pyx_kp_u_query_closed, __pyx_k_query_closed, sizeof(__pyx_k_query_closed), 0, 1, 0, 0}, + {&__pyx_n_s_raise_on_warnings, __pyx_k_raise_on_warnings, sizeof(__pyx_k_raise_on_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_read_default_file, __pyx_k_read_default_file, sizeof(__pyx_k_read_default_file), 0, 0, 1, 1}, + {&__pyx_n_s_read_default_group, __pyx_k_read_default_group, sizeof(__pyx_k_read_default_group), 0, 0, 1, 1}, + {&__pyx_n_s_read_timeout, __pyx_k_read_timeout, sizeof(__pyx_k_read_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_report_truncation, __pyx_k_report_truncation, sizeof(__pyx_k_report_truncation), 0, 0, 1, 1}, + {&__pyx_n_s_require_secure_auth, __pyx_k_require_secure_auth, sizeof(__pyx_k_require_secure_auth), 0, 0, 1, 1}, + {&__pyx_n_s_result_class, __pyx_k_result_class, sizeof(__pyx_k_result_class), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1}, + {&__pyx_kp_u_row_no_longer_available_from_dat, __pyx_k_row_no_longer_available_from_dat, sizeof(__pyx_k_row_no_longer_available_from_dat), 0, 1, 0, 0}, + {&__pyx_n_s_rowcount, __pyx_k_rowcount, sizeof(__pyx_k_rowcount), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_setup_ssl_options, __pyx_k_setup_ssl_options, sizeof(__pyx_k_setup_ssl_options), 0, 0, 1, 1}, + {&__pyx_n_s_shared_memory_base_name, __pyx_k_shared_memory_base_name, sizeof(__pyx_k_shared_memory_base_name), 0, 0, 1, 1}, + {&__pyx_n_s_should_raise, __pyx_k_should_raise, sizeof(__pyx_k_should_raise), 0, 0, 1, 1}, + {&__pyx_n_s_show_table, __pyx_k_show_table, sizeof(__pyx_k_show_table), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_kp_u_size_remaining_should_be_0, __pyx_k_size_remaining_should_be_0, sizeof(__pyx_k_size_remaining_should_be_0), 0, 1, 0, 0}, + {&__pyx_n_u_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 1, 0, 1}, + {&__pyx_n_s_ss, __pyx_k_ss, sizeof(__pyx_k_ss), 0, 0, 1, 1}, + {&__pyx_n_s_ssl, __pyx_k_ssl, sizeof(__pyx_k_ssl), 0, 0, 1, 1}, + {&__pyx_n_s_statement_class, __pyx_k_statement_class, sizeof(__pyx_k_statement_class), 0, 0, 1, 1}, + {&__pyx_kp_u_statement_closed, __pyx_k_statement_closed, sizeof(__pyx_k_statement_closed), 0, 1, 0, 0}, + {&__pyx_n_s_stmt, __pyx_k_stmt, sizeof(__pyx_k_stmt), 0, 0, 1, 1}, + {&__pyx_n_s_string_limit, __pyx_k_string_limit, sizeof(__pyx_k_string_limit), 0, 0, 1, 1}, + {&__pyx_kp_u_string_limit_must_be_0, __pyx_k_string_limit_must_be_0, sizeof(__pyx_k_string_limit_must_be_0), 0, 1, 0, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_u_tcp, __pyx_k_tcp, sizeof(__pyx_k_tcp), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_threadsafety, __pyx_k_threadsafety, sizeof(__pyx_k_threadsafety), 0, 0, 1, 1}, + {&__pyx_n_s_ticks, __pyx_k_ticks, sizeof(__pyx_k_ticks), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_time_from_string, __pyx_k_time_from_string, sizeof(__pyx_k_time_from_string), 0, 0, 1, 1}, + {&__pyx_kp_u_truncated_column, __pyx_k_truncated_column, sizeof(__pyx_k_truncated_column), 0, 1, 0, 0}, + {&__pyx_n_s_try_plain_query, __pyx_k_try_plain_query, sizeof(__pyx_k_try_plain_query), 0, 0, 1, 1}, + {&__pyx_n_s_tt, __pyx_k_tt, sizeof(__pyx_k_tt), 0, 0, 1, 1}, + {&__pyx_kp_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 0}, + {&__pyx_n_s_unix_socket, __pyx_k_unix_socket, sizeof(__pyx_k_unix_socket), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_kind_of_warning_r, __pyx_k_unknown_kind_of_warning_r, sizeof(__pyx_k_unknown_kind_of_warning_r), 0, 1, 0, 0}, + {&__pyx_kp_u_unknown_protocol, __pyx_k_unknown_protocol, sizeof(__pyx_k_unknown_protocol), 0, 1, 0, 0}, + {&__pyx_kp_u_unorderable_types, __pyx_k_unorderable_types, sizeof(__pyx_k_unorderable_types), 0, 1, 0, 0}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_u_use_the_CALL_statement_with_the, __pyx_k_use_the_CALL_statement_with_the, sizeof(__pyx_k_use_the_CALL_statement_with_the), 0, 1, 0, 0}, + {&__pyx_n_s_use_unicode, __pyx_k_use_unicode, sizeof(__pyx_k_use_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_warning_count, __pyx_k_warning_count, sizeof(__pyx_k_warning_count), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_write_timeout, __pyx_k_write_timeout, sizeof(__pyx_k_write_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(1, 65, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 102, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(4, 68, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 147, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 116, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "oursqlx/util.pyx":105 + * ret.append((kind, (message, err))) + * if should_raise and conn.raise_on_warnings: + * raise CollatedWarningsError('query caused warnings', extra=ret) # <<<<<<<<<<<<<< + * return ret + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_query_caused_warnings); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "oursqlx/conversions.pyx":11 + * def _datetime_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) # <<<<<<<<<<<<<< + * + * def _date_from_string(s): + */ + __pyx_slice__3 = PySlice_New(Py_None, __pyx_int_6, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(5, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__3); + __Pyx_GIVEREF(__pyx_slice__3); + + /* "oursqlx/conversions.pyx":15 + * def _date_from_string(s): + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) # <<<<<<<<<<<<<< + * + * def _time_from_string(s): + */ + __pyx_slice__4 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + + /* "oursqlx/conversions.pyx":19 + * def _time_from_string(s): + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) # <<<<<<<<<<<<<< + * + * _conversions = { + */ + __pyx_slice__5 = PySlice_New(__pyx_int_3, __pyx_int_6, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__5); + __Pyx_GIVEREF(__pyx_slice__5); + + /* "oursqlx/connection.pyx":102 + * self.conn = mysql_init(NULL) + * if not self.conn: + * raise MemoryError('alloc of conn object failed') # <<<<<<<<<<<<<< + * if protocol not in _protocol_enum_map: + * raise ProgrammingError('unknown protocol %r' % (protocol,)) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_alloc_of_conn_object_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "oursqlx/statement.pyx":106 + * self.stmt = mysql_stmt_init(self.conn.conn) + * if not self.stmt: + * raise MemoryError('alloc of statement failed') # <<<<<<<<<<<<<< + * self.string_limit = string_limit + * self.show_table = show_table + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_alloc_of_statement_failed); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "oursqlx/statement.pyx":147 + * def __set__(self, unsigned long value): + * if value < 0: + * raise ValueError('string limit must be >= 0') # <<<<<<<<<<<<<< + * self.string_limit = value + * + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_string_limit_must_be_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "oursqlx/statement.pyx":190 + * bind = PyMem_Malloc(sizeof(MYSQL_BIND) * fields) + * if not bind: + * raise MemoryError('alloc of result bind structure failed') # <<<<<<<<<<<<<< + * memset(bind, 0, sizeof(MYSQL_BIND) * fields) + * result_data = PyMem_Malloc( + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_alloc_of_result_bind_structure_f); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "oursqlx/statement.pyx":195 + * sizeof(column_output) * fields) + * if not result_data: + * raise MemoryError('alloc of result buffers failed') # <<<<<<<<<<<<<< + * memset(result_data, 0, sizeof(column_output) * fields) + * except: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_alloc_of_result_buffers_failed); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "oursqlx/statement.pyx":297 + * (sizeof(MYSQL_BIND) + sizeof(column_data)) * n_params) + * if not buf: + * raise MemoryError('alloc of bind parameters failed') # <<<<<<<<<<<<<< + * bind = buf + * memset(bind, 0, sizeof(MYSQL_BIND) * n_params) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_alloc_of_bind_parameters_failed); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "oursqlx/statement.pyx":595 + * def __set__(self, unsigned long value): + * if value < 1: + * raise ValueError('must prefetch at least 1 row') # <<<<<<<<<<<<<< + * self._prefetch_rows = value + * if _oursqlx_stmt_set_prefetch_rows(self.stmt, + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_must_prefetch_at_least_1_row); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "oursqlx/statement.pyx":648 + * size = left + * elif size < 0: + * raise ValueError("can't read negative bytes") # <<<<<<<<<<<<<< + * ret = PyBytes_FromStringAndSize(NULL, size) + * self.bind.buffer_length = size + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_can_t_read_negative_bytes); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "oursql.pyx":59 + * + * class Error(builtins.Exception): + * def __init__(self, message, errno=None, extra=None): # <<<<<<<<<<<<<< + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno + */ + __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_errno, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_oursql_pyx, __pyx_n_s_init, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "oursqlx/util.pyx":85 + * _oursqlx_UnknownError: UnknownError, + * } + * def _exception_from_errno(int err): # <<<<<<<<<<<<<< + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + */ + __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_err, __pyx_n_s_err); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_util_pyx, __pyx_n_s_exception_from_errno, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 85, __pyx_L1_error) + + /* "oursqlx/util.pyx":88 + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + * def _do_warnings_query(Connection conn not None): # <<<<<<<<<<<<<< + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') + */ + __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_conn, __pyx_n_s_should_raise, __pyx_n_s_q, __pyx_n_s_ret, __pyx_n_s_kind, __pyx_n_s_err, __pyx_n_s_message); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_util_pyx, __pyx_n_s_do_warnings_query, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 88, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":3 + * import decimal, datetime, time + * + * def _bitval_from_string(s): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length + * cdef unsigned char *ss + */ + __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_s, __pyx_n_s_length, __pyx_n_s_ss); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(5, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_bitval_from_string, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(5, 3, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":9 + * return bitval_from_char_p(ss, length) + * + * def _datetime_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) + */ + __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_tt); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(5, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_datetime_from_string, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(5, 9, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":13 + * return datetime.datetime(*tt[:6]) + * + * def _date_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) + */ + __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_tt); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(5, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_date_from_string, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(5, 13, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":17 + * return datetime.date(*tt[:3]) + * + * def _time_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) + */ + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_tt); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(5, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_time_from_string, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(5, 17, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":55 + * Binary = bytes + * + * def TimestampFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimestampFromTicks(ticks) -> Timestamp. + * + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_ticks); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(5, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_TimestampFromTicks, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(5, 55, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":62 + * return Timestamp(*time.localtime(ticks)[:6]) + * + * def DateFromTicks(ticks): # <<<<<<<<<<<<<< + * """DateFromTicks(ticks) -> Date. + * + */ + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_ticks); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(5, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_DateFromTicks, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(5, 62, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":69 + * return Date(*time.localtime(ticks)[:3]) + * + * def TimeFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimeFromTicks(ticks) -> Time. + * + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_ticks); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(5, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_oursqlx_conversions_pyx, __pyx_n_s_TimeFromTicks, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(5, 69, __pyx_L1_error) + + /* "oursql.pyx":92 + * # time, so it's threadsafe to call this. + * if mysql_library_init(0, NULL, NULL): + * raise InterfaceError('could not initialize mysql') # <<<<<<<<<<<<<< + * + * paramstyle = 'qmark' + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_could_not_initialize_mysql); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "(tree fragment)":1 + * def __pyx_unpickle__DictWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__DictWhateverMixi, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(3, 1, __pyx_L1_error) + __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__AbstractIterWrap, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(3, 1, __pyx_L1_error) + __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__BinaryWhateverMi, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(3, 1, __pyx_L1_error) + __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__DBAPITypeObject, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_252300414 = PyInt_FromLong(252300414L); if (unlikely(!__pyx_int_252300414)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_6oursql_Connection = &__pyx_vtable_6oursql_Connection; + __pyx_vtable_6oursql_Connection._raise_error = (int (*)(struct __pyx_obj_6oursql_Connection *))__pyx_f_6oursql_10Connection__raise_error; + __pyx_vtable_6oursql_Connection._check_closed = (int (*)(struct __pyx_obj_6oursql_Connection *))__pyx_f_6oursql_10Connection__check_closed; + __pyx_vtable_6oursql_Connection._decode_char_p = (PyObject *(*)(struct __pyx_obj_6oursql_Connection *, const char *))__pyx_f_6oursql_10Connection__decode_char_p; + if (PyType_Ready(&__pyx_type_6oursql_Connection) < 0) __PYX_ERR(2, 9, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql_Connection.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql_Connection.tp_dictoffset && __pyx_type_6oursql_Connection.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql_Connection.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql_Connection.tp_dict, __pyx_vtabptr_6oursql_Connection) < 0) __PYX_ERR(2, 9, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Connection, (PyObject *)&__pyx_type_6oursql_Connection) < 0) __PYX_ERR(2, 9, __pyx_L1_error) + if (__pyx_type_6oursql_Connection.tp_weaklistoffset == 0) __pyx_type_6oursql_Connection.tp_weaklistoffset = offsetof(struct __pyx_obj_6oursql_Connection, __weakref__); + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql_Connection) < 0) __PYX_ERR(2, 9, __pyx_L1_error) + __pyx_ptype_6oursql_Connection = &__pyx_type_6oursql_Connection; + if (PyType_Ready(&__pyx_type_6oursql__DictWhateverMixin) < 0) __PYX_ERR(1, 59, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__DictWhateverMixin.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__DictWhateverMixin.tp_dictoffset && __pyx_type_6oursql__DictWhateverMixin.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__DictWhateverMixin.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictWhateverMixin, (PyObject *)&__pyx_type_6oursql__DictWhateverMixin) < 0) __PYX_ERR(1, 59, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__DictWhateverMixin) < 0) __PYX_ERR(1, 59, __pyx_L1_error) + __pyx_ptype_6oursql__DictWhateverMixin = &__pyx_type_6oursql__DictWhateverMixin; + if (PyType_Ready(&__pyx_type_6oursql__AbstractIterWrapper) < 0) __PYX_ERR(4, 8, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__AbstractIterWrapper.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__AbstractIterWrapper.tp_dictoffset && __pyx_type_6oursql__AbstractIterWrapper.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__AbstractIterWrapper.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AbstractIterWrapper, (PyObject *)&__pyx_type_6oursql__AbstractIterWrapper) < 0) __PYX_ERR(4, 8, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__AbstractIterWrapper) < 0) __PYX_ERR(4, 8, __pyx_L1_error) + __pyx_ptype_6oursql__AbstractIterWrapper = &__pyx_type_6oursql__AbstractIterWrapper; + if (PyType_Ready(&__pyx_type_6oursql__BinaryWhateverMixin) < 0) __PYX_ERR(4, 12, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__BinaryWhateverMixin.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__BinaryWhateverMixin.tp_dictoffset && __pyx_type_6oursql__BinaryWhateverMixin.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__BinaryWhateverMixin.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryWhateverMixin, (PyObject *)&__pyx_type_6oursql__BinaryWhateverMixin) < 0) __PYX_ERR(4, 12, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__BinaryWhateverMixin) < 0) __PYX_ERR(4, 12, __pyx_L1_error) + __pyx_ptype_6oursql__BinaryWhateverMixin = &__pyx_type_6oursql__BinaryWhateverMixin; + __pyx_type_6oursql_IterWrapper.tp_base = __pyx_ptype_6oursql__AbstractIterWrapper; + if (PyType_Ready(&__pyx_type_6oursql_IterWrapper) < 0) __PYX_ERR(4, 17, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql_IterWrapper.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql_IterWrapper.tp_dictoffset && __pyx_type_6oursql_IterWrapper.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql_IterWrapper.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IterWrapper, (PyObject *)&__pyx_type_6oursql_IterWrapper) < 0) __PYX_ERR(4, 17, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql_IterWrapper) < 0) __PYX_ERR(4, 17, __pyx_L1_error) + __pyx_ptype_6oursql_IterWrapper = &__pyx_type_6oursql_IterWrapper; + __pyx_type_6oursql_FileWrapper.tp_base = __pyx_ptype_6oursql__AbstractIterWrapper; + if (PyType_Ready(&__pyx_type_6oursql_FileWrapper) < 0) __PYX_ERR(4, 43, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql_FileWrapper.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql_FileWrapper.tp_dictoffset && __pyx_type_6oursql_FileWrapper.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql_FileWrapper.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FileWrapper, (PyObject *)&__pyx_type_6oursql_FileWrapper) < 0) __PYX_ERR(4, 43, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql_FileWrapper) < 0) __PYX_ERR(4, 43, __pyx_L1_error) + __pyx_ptype_6oursql_FileWrapper = &__pyx_type_6oursql_FileWrapper; + __pyx_vtabptr_6oursql__Statement = &__pyx_vtable_6oursql__Statement; + __pyx_vtable_6oursql__Statement._raise_error = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__raise_error; + __pyx_vtable_6oursql__Statement._check_closed = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__check_closed; + __pyx_vtable_6oursql__Statement._alloc_buffer = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__alloc_buffer; + __pyx_vtable_6oursql__Statement._bind_buffer = (int (*)(struct __pyx_obj_6oursql__Statement *))__pyx_f_6oursql_10_Statement__bind_buffer; + if (PyType_Ready(&__pyx_type_6oursql__Statement) < 0) __PYX_ERR(4, 85, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__Statement.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__Statement.tp_dictoffset && __pyx_type_6oursql__Statement.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__Statement.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql__Statement.tp_dict, __pyx_vtabptr_6oursql__Statement) < 0) __PYX_ERR(4, 85, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Statement, (PyObject *)&__pyx_type_6oursql__Statement) < 0) __PYX_ERR(4, 85, __pyx_L1_error) + if (__pyx_type_6oursql__Statement.tp_weaklistoffset == 0) __pyx_type_6oursql__Statement.tp_weaklistoffset = offsetof(struct __pyx_obj_6oursql__Statement, __weakref__); + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__Statement) < 0) __PYX_ERR(4, 85, __pyx_L1_error) + __pyx_ptype_6oursql__Statement = &__pyx_type_6oursql__Statement; + if (PyType_Ready(&__pyx_type_6oursql__ResultStringStream) < 0) __PYX_ERR(4, 604, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__ResultStringStream.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__ResultStringStream.tp_dictoffset && __pyx_type_6oursql__ResultStringStream.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__ResultStringStream.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResultStringStream, (PyObject *)&__pyx_type_6oursql__ResultStringStream) < 0) __PYX_ERR(4, 604, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__ResultStringStream) < 0) __PYX_ERR(4, 604, __pyx_L1_error) + __pyx_ptype_6oursql__ResultStringStream = &__pyx_type_6oursql__ResultStringStream; + __pyx_vtabptr_6oursql__ResultSet = &__pyx_vtable_6oursql__ResultSet; + __pyx_vtable_6oursql__ResultSet._raise_error = (int (*)(struct __pyx_obj_6oursql__ResultSet *))__pyx_f_6oursql_10_ResultSet__raise_error; + __pyx_vtable_6oursql__ResultSet._check_closed = (int (*)(struct __pyx_obj_6oursql__ResultSet *))__pyx_f_6oursql_10_ResultSet__check_closed; + if (PyType_Ready(&__pyx_type_6oursql__ResultSet) < 0) __PYX_ERR(6, 4, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__ResultSet.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__ResultSet.tp_dictoffset && __pyx_type_6oursql__ResultSet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__ResultSet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql__ResultSet.tp_dict, __pyx_vtabptr_6oursql__ResultSet) < 0) __PYX_ERR(6, 4, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResultSet, (PyObject *)&__pyx_type_6oursql__ResultSet) < 0) __PYX_ERR(6, 4, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__ResultSet) < 0) __PYX_ERR(6, 4, __pyx_L1_error) + __pyx_ptype_6oursql__ResultSet = &__pyx_type_6oursql__ResultSet; + __pyx_vtabptr_6oursql__Query = &__pyx_vtable_6oursql__Query; + __pyx_vtable_6oursql__Query._raise_error = (int (*)(struct __pyx_obj_6oursql__Query *))__pyx_f_6oursql_6_Query__raise_error; + if (PyType_Ready(&__pyx_type_6oursql__Query) < 0) __PYX_ERR(6, 116, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__Query.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__Query.tp_dictoffset && __pyx_type_6oursql__Query.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__Query.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql__Query.tp_dict, __pyx_vtabptr_6oursql__Query) < 0) __PYX_ERR(6, 116, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Query, (PyObject *)&__pyx_type_6oursql__Query) < 0) __PYX_ERR(6, 116, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__Query) < 0) __PYX_ERR(6, 116, __pyx_L1_error) + __pyx_ptype_6oursql__Query = &__pyx_type_6oursql__Query; + __pyx_vtabptr_6oursql__DictQuery = &__pyx_vtable_6oursql__DictQuery; + __pyx_vtable_6oursql__DictQuery.__pyx_base = *__pyx_vtabptr_6oursql__Query; + __pyx_type_6oursql__DictQuery.tp_base = __pyx_ptype_6oursql__Query; + if (PyType_Ready(&__pyx_type_6oursql__DictQuery) < 0) __PYX_ERR(6, 193, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__DictQuery.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__DictQuery.tp_dictoffset && __pyx_type_6oursql__DictQuery.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__DictQuery.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql__DictQuery.tp_dict, __pyx_vtabptr_6oursql__DictQuery) < 0) __PYX_ERR(6, 193, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictQuery, (PyObject *)&__pyx_type_6oursql__DictQuery) < 0) __PYX_ERR(6, 193, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__DictQuery) < 0) __PYX_ERR(6, 193, __pyx_L1_error) + __pyx_ptype_6oursql__DictQuery = &__pyx_type_6oursql__DictQuery; + __pyx_vtabptr_6oursql_Cursor = &__pyx_vtable_6oursql_Cursor; + __pyx_vtable_6oursql_Cursor._check_closed = (int (*)(struct __pyx_obj_6oursql_Cursor *))__pyx_f_6oursql_6Cursor__check_closed; + __pyx_vtable_6oursql_Cursor._update_fields = (int (*)(struct __pyx_obj_6oursql_Cursor *, PyObject *, struct __pyx_opt_args_6oursql_6Cursor__update_fields *__pyx_optional_args))__pyx_f_6oursql_6Cursor__update_fields; + __pyx_vtable_6oursql_Cursor._check_statements = (int (*)(struct __pyx_obj_6oursql_Cursor *))__pyx_f_6oursql_6Cursor__check_statements; + if (PyType_Ready(&__pyx_type_6oursql_Cursor) < 0) __PYX_ERR(7, 3, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql_Cursor.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql_Cursor.tp_dictoffset && __pyx_type_6oursql_Cursor.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql_Cursor.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql_Cursor.tp_dict, __pyx_vtabptr_6oursql_Cursor) < 0) __PYX_ERR(7, 3, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Cursor, (PyObject *)&__pyx_type_6oursql_Cursor) < 0) __PYX_ERR(7, 3, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql_Cursor) < 0) __PYX_ERR(7, 3, __pyx_L1_error) + __pyx_ptype_6oursql_Cursor = &__pyx_type_6oursql_Cursor; + __pyx_vtabptr_6oursql_DictCursor = &__pyx_vtable_6oursql_DictCursor; + __pyx_vtable_6oursql_DictCursor.__pyx_base = *__pyx_vtabptr_6oursql_Cursor; + __pyx_type_6oursql_DictCursor.tp_base = __pyx_ptype_6oursql_Cursor; + if (PyType_Ready(&__pyx_type_6oursql_DictCursor) < 0) __PYX_ERR(7, 265, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql_DictCursor.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql_DictCursor.tp_dictoffset && __pyx_type_6oursql_DictCursor.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql_DictCursor.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6oursql_DictCursor.tp_dict, __pyx_vtabptr_6oursql_DictCursor) < 0) __PYX_ERR(7, 265, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictCursor, (PyObject *)&__pyx_type_6oursql_DictCursor) < 0) __PYX_ERR(7, 265, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql_DictCursor) < 0) __PYX_ERR(7, 265, __pyx_L1_error) + __pyx_ptype_6oursql_DictCursor = &__pyx_type_6oursql_DictCursor; + if (PyType_Ready(&__pyx_type_6oursql__DBAPITypeObject) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_6oursql__DBAPITypeObject.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6oursql__DBAPITypeObject.tp_dictoffset && __pyx_type_6oursql__DBAPITypeObject.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6oursql__DBAPITypeObject.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DBAPITypeObject, (PyObject *)&__pyx_type_6oursql__DBAPITypeObject) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6oursql__DBAPITypeObject) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_ptype_6oursql__DBAPITypeObject = &__pyx_type_6oursql__DBAPITypeObject; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initoursql(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initoursql(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_oursql(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_oursql(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_oursql(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'oursql' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #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("__Pyx_PyMODINIT_FUNC PyInit_oursql(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("oursql", __pyx_methods, __pyx_k_oursql_python_bindings_for_MySQL, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_oursql) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "oursql")) { + if (unlikely(PyDict_SetItemString(modules, "oursql", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "oursql.pyx":8 + * """ + * + * __author__ = 'Aaron Gallagher ' # <<<<<<<<<<<<<< + * __version__ = '0.9.4' + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Aaron_Gallagher_habnabit_gmail_c) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + + /* "oursql.pyx":9 + * + * __author__ = 'Aaron Gallagher ' + * __version__ = '0.9.4' # <<<<<<<<<<<<<< + * + * include "oursql.pxi" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_9_4) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + + /* "oursql.pyx":14 + * include "nogil.pyx" + * + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * cdef unsigned int UNSIGNED_NUM_FLAG = UNSIGNED_FLAG | NUM_FLAG + */ + (void)(PyDateTime_IMPORT); + + /* "oursql.pyx":16 + * PyDateTime_IMPORT + * + * cdef unsigned int UNSIGNED_NUM_FLAG = UNSIGNED_FLAG | NUM_FLAG # <<<<<<<<<<<<<< + * + * cdef union column_data: + */ + __pyx_v_6oursql_UNSIGNED_NUM_FLAG = (UNSIGNED_FLAG | NUM_FLAG); + + /* "oursql.pyx":53 + * column_data buf + * + * import builtins # <<<<<<<<<<<<<< + * + * class Warning(builtins.Warning): pass + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_builtins, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":55 + * import builtins + * + * class Warning(builtins.Warning): pass # <<<<<<<<<<<<<< + * class Note(Warning): pass + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Warning, __pyx_n_s_Warning, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Warning, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Warning, __pyx_t_4) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":56 + * + * class Warning(builtins.Warning): pass + * class Note(Warning): pass # <<<<<<<<<<<<<< + * + * class Error(builtins.Exception): + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Warning); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Note, __pyx_n_s_Note, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Note, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Note, __pyx_t_4) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":58 + * class Note(Warning): pass + * + * class Error(builtins.Exception): # <<<<<<<<<<<<<< + * def __init__(self, message, errno=None, extra=None): + * super(Error, self).__init__(errno, message, extra) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_builtins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "oursql.pyx":59 + * + * class Error(builtins.Exception): + * def __init__(self, message, errno=None, extra=None): # <<<<<<<<<<<<<< + * super(Error, self).__init__(errno, message, extra) + * self.errno = errno + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6oursql_5Error_1__init__, 0, __pyx_n_s_Error___init, NULL, __pyx_n_s_oursql, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__37); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursql.pyx":58 + * class Note(Warning): pass + * + * class Error(builtins.Exception): # <<<<<<<<<<<<<< + * def __init__(self, message, errno=None, extra=None): + * super(Error, self).__init__(errno, message, extra) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":64 + * self.extra = extra + * + * class InterfaceError(Error): pass # <<<<<<<<<<<<<< + * class DatabaseError(Error): pass + * class DataError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InterfaceError, __pyx_n_s_InterfaceError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InterfaceError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceError, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":65 + * + * class InterfaceError(Error): pass + * class DatabaseError(Error): pass # <<<<<<<<<<<<<< + * class DataError(DatabaseError): pass + * class OperationalError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_DatabaseError, __pyx_n_s_DatabaseError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DatabaseError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":66 + * class InterfaceError(Error): pass + * class DatabaseError(Error): pass + * class DataError(DatabaseError): pass # <<<<<<<<<<<<<< + * class OperationalError(DatabaseError): pass + * class IntegrityError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_DataError, __pyx_n_s_DataError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_DataError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataError, __pyx_t_4) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":67 + * class DatabaseError(Error): pass + * class DataError(DatabaseError): pass + * class OperationalError(DatabaseError): pass # <<<<<<<<<<<<<< + * class IntegrityError(DatabaseError): pass + * class InternalError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_OperationalError, __pyx_n_s_OperationalError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_OperationalError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":68 + * class DataError(DatabaseError): pass + * class OperationalError(DatabaseError): pass + * class IntegrityError(DatabaseError): pass # <<<<<<<<<<<<<< + * class InternalError(DatabaseError): pass + * class ProgrammingError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_IntegrityError, __pyx_n_s_IntegrityError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_IntegrityError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntegrityError, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":69 + * class OperationalError(DatabaseError): pass + * class IntegrityError(DatabaseError): pass + * class InternalError(DatabaseError): pass # <<<<<<<<<<<<<< + * class ProgrammingError(DatabaseError): pass + * class CollatedWarningsError(ProgrammingError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InternalError, __pyx_n_s_InternalError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InternalError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_4) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":70 + * class IntegrityError(DatabaseError): pass + * class InternalError(DatabaseError): pass + * class ProgrammingError(DatabaseError): pass # <<<<<<<<<<<<<< + * class CollatedWarningsError(ProgrammingError): pass + * class NotSupportedError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ProgrammingError, __pyx_n_s_ProgrammingError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ProgrammingError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_4) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":71 + * class InternalError(DatabaseError): pass + * class ProgrammingError(DatabaseError): pass + * class CollatedWarningsError(ProgrammingError): pass # <<<<<<<<<<<<<< + * class NotSupportedError(DatabaseError): pass + * class PermissionsError(DatabaseError): pass + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CollatedWarningsError, __pyx_n_s_CollatedWarningsError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CollatedWarningsError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CollatedWarningsError, __pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":72 + * class ProgrammingError(DatabaseError): pass + * class CollatedWarningsError(ProgrammingError): pass + * class NotSupportedError(DatabaseError): pass # <<<<<<<<<<<<<< + * class PermissionsError(DatabaseError): pass + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NotSupportedError, __pyx_n_s_NotSupportedError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NotSupportedError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NotSupportedError, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursql.pyx":73 + * class CollatedWarningsError(ProgrammingError): pass + * class NotSupportedError(DatabaseError): pass + * class PermissionsError(DatabaseError): pass # <<<<<<<<<<<<<< + * + * # This exception type is specifically for _exception_from_errno. I think this + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PermissionsError, __pyx_n_s_PermissionsError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PermissionsError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PermissionsError, __pyx_t_4) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":78 + * # is a good compromise: if the errno you get isn't valid, return something to + * # indicate that while also being functional. + * class UnknownError(Error): pass # <<<<<<<<<<<<<< + * + * cdef class Connection + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnknownError, __pyx_n_s_UnknownError, (PyObject *) NULL, __pyx_n_s_oursql, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnknownError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnknownError, __pyx_t_4) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":75 + * + * _exception_enum_map = { + * _oursqlx_InterfaceError: InterfaceError, # <<<<<<<<<<<<<< + * _oursqlx_DataError: DataError, + * _oursqlx_OperationalError: OperationalError, + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/util.pyx":76 + * _exception_enum_map = { + * _oursqlx_InterfaceError: InterfaceError, + * _oursqlx_DataError: DataError, # <<<<<<<<<<<<<< + * _oursqlx_OperationalError: OperationalError, + * _oursqlx_IntegrityError: IntegrityError, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_DataError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DataError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":77 + * _oursqlx_InterfaceError: InterfaceError, + * _oursqlx_DataError: DataError, + * _oursqlx_OperationalError: OperationalError, # <<<<<<<<<<<<<< + * _oursqlx_IntegrityError: IntegrityError, + * _oursqlx_InternalError: InternalError, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/util.pyx":78 + * _oursqlx_DataError: DataError, + * _oursqlx_OperationalError: OperationalError, + * _oursqlx_IntegrityError: IntegrityError, # <<<<<<<<<<<<<< + * _oursqlx_InternalError: InternalError, + * _oursqlx_ProgrammingError: ProgrammingError, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_IntegrityError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntegrityError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":79 + * _oursqlx_OperationalError: OperationalError, + * _oursqlx_IntegrityError: IntegrityError, + * _oursqlx_InternalError: InternalError, # <<<<<<<<<<<<<< + * _oursqlx_ProgrammingError: ProgrammingError, + * _oursqlx_NotSupportedError: NotSupportedError, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_InternalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/util.pyx":80 + * _oursqlx_IntegrityError: IntegrityError, + * _oursqlx_InternalError: InternalError, + * _oursqlx_ProgrammingError: ProgrammingError, # <<<<<<<<<<<<<< + * _oursqlx_NotSupportedError: NotSupportedError, + * _oursqlx_PermissionsError: PermissionsError, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":81 + * _oursqlx_InternalError: InternalError, + * _oursqlx_ProgrammingError: ProgrammingError, + * _oursqlx_NotSupportedError: NotSupportedError, # <<<<<<<<<<<<<< + * _oursqlx_PermissionsError: PermissionsError, + * _oursqlx_UnknownError: UnknownError, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_NotSupportedError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/util.pyx":82 + * _oursqlx_ProgrammingError: ProgrammingError, + * _oursqlx_NotSupportedError: NotSupportedError, + * _oursqlx_PermissionsError: PermissionsError, # <<<<<<<<<<<<<< + * _oursqlx_UnknownError: UnknownError, + * } + */ + __pyx_t_3 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_PermissionsError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PermissionsError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/util.pyx":83 + * _oursqlx_NotSupportedError: NotSupportedError, + * _oursqlx_PermissionsError: PermissionsError, + * _oursqlx_UnknownError: UnknownError, # <<<<<<<<<<<<<< + * } + * def _exception_from_errno(int err): + */ + __pyx_t_2 = __Pyx_PyInt_From_enum___oursqlx_exception_type(_oursqlx_UnknownError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UnknownError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exception_enum_map, __pyx_t_1) < 0) __PYX_ERR(1, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":85 + * _oursqlx_UnknownError: UnknownError, + * } + * def _exception_from_errno(int err): # <<<<<<<<<<<<<< + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_1_exception_from_errno, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exception_from_errno, __pyx_t_1) < 0) __PYX_ERR(1, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/util.pyx":88 + * return _exception_enum_map[_oursqlx_exc_from_errno(err)] + * + * def _do_warnings_query(Connection conn not None): # <<<<<<<<<<<<<< + * cdef int should_raise = False + * q = _Query(conn, 'SHOW WARNINGS') + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_3_do_warnings_query, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_do_warnings_query, __pyx_t_1) < 0) __PYX_ERR(1, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":1 + * import decimal, datetime, time # <<<<<<<<<<<<<< + * + * def _bitval_from_string(s): + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_1) < 0) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(5, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":3 + * import decimal, datetime, time + * + * def _bitval_from_string(s): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length + * cdef unsigned char *ss + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_5_bitval_from_string, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_bitval_from_string, __pyx_t_1) < 0) __PYX_ERR(5, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":9 + * return bitval_from_char_p(ss, length) + * + * def _datetime_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d %H:%M:%S') + * return datetime.datetime(*tt[:6]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_7_datetime_from_string, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_from_string, __pyx_t_1) < 0) __PYX_ERR(5, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":13 + * return datetime.datetime(*tt[:6]) + * + * def _date_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%Y-%m-%d') + * return datetime.date(*tt[:3]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_9_date_from_string, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_date_from_string, __pyx_t_1) < 0) __PYX_ERR(5, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":17 + * return datetime.date(*tt[:3]) + * + * def _time_from_string(s): # <<<<<<<<<<<<<< + * tt = time.strptime(s, '%H:%M:%S') + * return datetime.time(*tt[3:6]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6oursql_11_time_from_string, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time_from_string, __pyx_t_1) < 0) __PYX_ERR(5, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":22 + * + * _conversions = { + * MYSQL_TYPE_TINY: int, # <<<<<<<<<<<<<< + * MYSQL_TYPE_SHORT: int, + * MYSQL_TYPE_LONG: long, + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(22); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TINY); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":23 + * _conversions = { + * MYSQL_TYPE_TINY: int, + * MYSQL_TYPE_SHORT: int, # <<<<<<<<<<<<<< + * MYSQL_TYPE_LONG: long, + * MYSQL_TYPE_FLOAT: float, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_SHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":24 + * MYSQL_TYPE_TINY: int, + * MYSQL_TYPE_SHORT: int, + * MYSQL_TYPE_LONG: long, # <<<<<<<<<<<<<< + * MYSQL_TYPE_FLOAT: float, + * MYSQL_TYPE_DOUBLE: float, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyLong_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":25 + * MYSQL_TYPE_SHORT: int, + * MYSQL_TYPE_LONG: long, + * MYSQL_TYPE_FLOAT: float, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DOUBLE: float, + * MYSQL_TYPE_DECIMAL: float, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":26 + * MYSQL_TYPE_LONG: long, + * MYSQL_TYPE_FLOAT: float, + * MYSQL_TYPE_DOUBLE: float, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DECIMAL: float, + * MYSQL_TYPE_NEWDECIMAL: float, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":27 + * MYSQL_TYPE_FLOAT: float, + * MYSQL_TYPE_DOUBLE: float, + * MYSQL_TYPE_DECIMAL: float, # <<<<<<<<<<<<<< + * MYSQL_TYPE_NEWDECIMAL: float, + * MYSQL_TYPE_LONGLONG: long, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":28 + * MYSQL_TYPE_DOUBLE: float, + * MYSQL_TYPE_DECIMAL: float, + * MYSQL_TYPE_NEWDECIMAL: float, # <<<<<<<<<<<<<< + * MYSQL_TYPE_LONGLONG: long, + * MYSQL_TYPE_INT24: int, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_NEWDECIMAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":29 + * MYSQL_TYPE_DECIMAL: float, + * MYSQL_TYPE_NEWDECIMAL: float, + * MYSQL_TYPE_LONGLONG: long, # <<<<<<<<<<<<<< + * MYSQL_TYPE_INT24: int, + * MYSQL_TYPE_YEAR: int, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_LONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyLong_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":30 + * MYSQL_TYPE_NEWDECIMAL: float, + * MYSQL_TYPE_LONGLONG: long, + * MYSQL_TYPE_INT24: int, # <<<<<<<<<<<<<< + * MYSQL_TYPE_YEAR: int, + * MYSQL_TYPE_DECIMAL: decimal.Decimal, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":31 + * MYSQL_TYPE_LONGLONG: long, + * MYSQL_TYPE_INT24: int, + * MYSQL_TYPE_YEAR: int, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DECIMAL: decimal.Decimal, + * MYSQL_TYPE_NEWDECIMAL: decimal.Decimal, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_YEAR); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "oursqlx/conversions.pyx":32 + * MYSQL_TYPE_INT24: int, + * MYSQL_TYPE_YEAR: int, + * MYSQL_TYPE_DECIMAL: decimal.Decimal, # <<<<<<<<<<<<<< + * MYSQL_TYPE_NEWDECIMAL: decimal.Decimal, + * MYSQL_TYPE_BIT: _bitval_from_string, + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":33 + * MYSQL_TYPE_YEAR: int, + * MYSQL_TYPE_DECIMAL: decimal.Decimal, + * MYSQL_TYPE_NEWDECIMAL: decimal.Decimal, # <<<<<<<<<<<<<< + * MYSQL_TYPE_BIT: _bitval_from_string, + * MYSQL_TYPE_TIMESTAMP: _datetime_from_string, + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_NEWDECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/conversions.pyx":34 + * MYSQL_TYPE_DECIMAL: decimal.Decimal, + * MYSQL_TYPE_NEWDECIMAL: decimal.Decimal, + * MYSQL_TYPE_BIT: _bitval_from_string, # <<<<<<<<<<<<<< + * MYSQL_TYPE_TIMESTAMP: _datetime_from_string, + * MYSQL_TYPE_DATETIME: _datetime_from_string, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_BIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bitval_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":35 + * MYSQL_TYPE_NEWDECIMAL: decimal.Decimal, + * MYSQL_TYPE_BIT: _bitval_from_string, + * MYSQL_TYPE_TIMESTAMP: _datetime_from_string, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATETIME: _datetime_from_string, + * MYSQL_TYPE_DATE: _date_from_string, + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime_from_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/conversions.pyx":36 + * MYSQL_TYPE_BIT: _bitval_from_string, + * MYSQL_TYPE_TIMESTAMP: _datetime_from_string, + * MYSQL_TYPE_DATETIME: _datetime_from_string, # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE: _date_from_string, + * MYSQL_TYPE_TIME: _time_from_string, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DATETIME); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":37 + * MYSQL_TYPE_TIMESTAMP: _datetime_from_string, + * MYSQL_TYPE_DATETIME: _datetime_from_string, + * MYSQL_TYPE_DATE: _date_from_string, # <<<<<<<<<<<<<< + * MYSQL_TYPE_TIME: _time_from_string, + * + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date_from_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/conversions.pyx":38 + * MYSQL_TYPE_DATETIME: _datetime_from_string, + * MYSQL_TYPE_DATE: _date_from_string, + * MYSQL_TYPE_TIME: _time_from_string, # <<<<<<<<<<<<<< + * + * # None means to try to decode if we're using unicode and the field isn't + */ + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TIME); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_time_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":42 + * # None means to try to decode if we're using unicode and the field isn't + * # in 'binary' encoding. + * MYSQL_TYPE_BLOB: None, # <<<<<<<<<<<<<< + * MYSQL_TYPE_STRING: None, + * MYSQL_TYPE_VAR_STRING: None, + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":43 + * # in 'binary' encoding. + * MYSQL_TYPE_BLOB: None, + * MYSQL_TYPE_STRING: None, # <<<<<<<<<<<<<< + * MYSQL_TYPE_VAR_STRING: None, + * MYSQL_TYPE_VARCHAR: None, + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_STRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":44 + * MYSQL_TYPE_BLOB: None, + * MYSQL_TYPE_STRING: None, + * MYSQL_TYPE_VAR_STRING: None, # <<<<<<<<<<<<<< + * MYSQL_TYPE_VARCHAR: None, + * # For consistency with the statement API. + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_VAR_STRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":45 + * MYSQL_TYPE_STRING: None, + * MYSQL_TYPE_VAR_STRING: None, + * MYSQL_TYPE_VARCHAR: None, # <<<<<<<<<<<<<< + * # For consistency with the statement API. + * MYSQL_TYPE_SET: None, + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_VARCHAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":47 + * MYSQL_TYPE_VARCHAR: None, + * # For consistency with the statement API. + * MYSQL_TYPE_SET: None, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, Py_None) < 0) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_conversions, __pyx_t_1) < 0) __PYX_ERR(5, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":50 + * } + * + * Timestamp = datetime.datetime # <<<<<<<<<<<<<< + * Date = datetime.date + * Time = datetime.time + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":51 + * + * Timestamp = datetime.datetime + * Date = datetime.date # <<<<<<<<<<<<<< + * Time = datetime.time + * Binary = bytes + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Date, __pyx_t_1) < 0) __PYX_ERR(5, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/conversions.pyx":52 + * Timestamp = datetime.datetime + * Date = datetime.date + * Time = datetime.time # <<<<<<<<<<<<<< + * Binary = bytes + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Time, __pyx_t_4) < 0) __PYX_ERR(5, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":53 + * Date = datetime.date + * Time = datetime.time + * Binary = bytes # <<<<<<<<<<<<<< + * + * def TimestampFromTicks(ticks): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Binary, ((PyObject *)(&PyBytes_Type))) < 0) __PYX_ERR(5, 53, __pyx_L1_error) + + /* "oursqlx/conversions.pyx":55 + * Binary = bytes + * + * def TimestampFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimestampFromTicks(ticks) -> Timestamp. + * + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_13TimestampFromTicks, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimestampFromTicks, __pyx_t_4) < 0) __PYX_ERR(5, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":62 + * return Timestamp(*time.localtime(ticks)[:6]) + * + * def DateFromTicks(ticks): # <<<<<<<<<<<<<< + * """DateFromTicks(ticks) -> Date. + * + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_15DateFromTicks, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DateFromTicks, __pyx_t_4) < 0) __PYX_ERR(5, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/conversions.pyx":69 + * return Date(*time.localtime(ticks)[:3]) + * + * def TimeFromTicks(ticks): # <<<<<<<<<<<<<< + * """TimeFromTicks(ticks) -> Time. + * + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6oursql_17TimeFromTicks, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeFromTicks, __pyx_t_4) < 0) __PYX_ERR(5, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/connection.pyx":2 + * _protocol_enum_map = { + * None: MYSQL_PROTOCOL_DEFAULT, # <<<<<<<<<<<<<< + * 'tcp': MYSQL_PROTOCOL_TCP, + * 'socket': MYSQL_PROTOCOL_SOCKET, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyInt_From_enum__mysql_protocol_type(MYSQL_PROTOCOL_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, Py_None, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":3 + * _protocol_enum_map = { + * None: MYSQL_PROTOCOL_DEFAULT, + * 'tcp': MYSQL_PROTOCOL_TCP, # <<<<<<<<<<<<<< + * 'socket': MYSQL_PROTOCOL_SOCKET, + * 'pipe': MYSQL_PROTOCOL_PIPE, + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__mysql_protocol_type(MYSQL_PROTOCOL_TCP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_tcp, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":4 + * None: MYSQL_PROTOCOL_DEFAULT, + * 'tcp': MYSQL_PROTOCOL_TCP, + * 'socket': MYSQL_PROTOCOL_SOCKET, # <<<<<<<<<<<<<< + * 'pipe': MYSQL_PROTOCOL_PIPE, + * 'memory': MYSQL_PROTOCOL_MEMORY, + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__mysql_protocol_type(MYSQL_PROTOCOL_SOCKET); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_socket, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":5 + * 'tcp': MYSQL_PROTOCOL_TCP, + * 'socket': MYSQL_PROTOCOL_SOCKET, + * 'pipe': MYSQL_PROTOCOL_PIPE, # <<<<<<<<<<<<<< + * 'memory': MYSQL_PROTOCOL_MEMORY, + * } + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__mysql_protocol_type(MYSQL_PROTOCOL_PIPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_pipe, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/connection.pyx":6 + * 'socket': MYSQL_PROTOCOL_SOCKET, + * 'pipe': MYSQL_PROTOCOL_PIPE, + * 'memory': MYSQL_PROTOCOL_MEMORY, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__mysql_protocol_type(MYSQL_PROTOCOL_MEMORY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_memory, __pyx_t_1) < 0) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_protocol_enum_map, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":1 + * import datetime # <<<<<<<<<<<<<< + * import decimal + * import codecs + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":2 + * import datetime + * import decimal # <<<<<<<<<<<<<< + * import codecs + * import io + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_4) < 0) __PYX_ERR(4, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":3 + * import datetime + * import decimal + * import codecs # <<<<<<<<<<<<<< + * import io + * + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_4) < 0) __PYX_ERR(4, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":4 + * import decimal + * import codecs + * import io # <<<<<<<<<<<<<< + * + * cdef my_ulonglong ull_negone = -1 + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_io, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_4) < 0) __PYX_ERR(4, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/statement.pyx":6 + * import io + * + * cdef my_ulonglong ull_negone = -1 # <<<<<<<<<<<<<< + * + * cdef class _AbstractIterWrapper: + */ + __pyx_v_6oursql_ull_negone = ((my_ulonglong)-1L); + + /* "oursqlx/statement.pyx":36 + * + * BinaryIterWrapper = type('BinaryIterWrapper', + * (_BinaryWhateverMixin, IterWrapper), {'__module__': __name__, '__doc__': # <<<<<<<<<<<<<< + * """BinaryIterWrapper(iterobj) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql_IterWrapper)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql_IterWrapper)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_ptype_6oursql_IterWrapper)); + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_module, __pyx_t_2) < 0) __PYX_ERR(4, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_doc, __pyx_kp_u_BinaryIterWrapper_iterobj_Binary) < 0) __PYX_ERR(4, 36, __pyx_L1_error) + + /* "oursqlx/statement.pyx":35 + * return self.nextfunc() + * + * BinaryIterWrapper = type('BinaryIterWrapper', # <<<<<<<<<<<<<< + * (_BinaryWhateverMixin, IterWrapper), {'__module__': __name__, '__doc__': + * """BinaryIterWrapper(iterobj) + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_u_BinaryIterWrapper); + __Pyx_GIVEREF(__pyx_n_u_BinaryIterWrapper); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_BinaryIterWrapper); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryIterWrapper, __pyx_t_1) < 0) __PYX_ERR(4, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":78 + * + * BinaryFileWrapper = type('BinaryFileWrapper', + * (_BinaryWhateverMixin, FileWrapper), {'__module__': __name__, '__doc__': # <<<<<<<<<<<<<< + * """BinaryFileWrapper(fileobj, chunksize=8192, doclose=False) + * + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_6oursql__BinaryWhateverMixin)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql_FileWrapper)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql_FileWrapper)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_6oursql_FileWrapper)); + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_module, __pyx_t_4) < 0) __PYX_ERR(4, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_doc, __pyx_kp_u_BinaryFileWrapper_fileobj_chunks) < 0) __PYX_ERR(4, 78, __pyx_L1_error) + + /* "oursqlx/statement.pyx":77 + * return ret + * + * BinaryFileWrapper = type('BinaryFileWrapper', # <<<<<<<<<<<<<< + * (_BinaryWhateverMixin, FileWrapper), {'__module__': __name__, '__doc__': + * """BinaryFileWrapper(fileobj, chunksize=8192, doclose=False) + */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_u_BinaryFileWrapper); + __Pyx_GIVEREF(__pyx_n_u_BinaryFileWrapper); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_BinaryFileWrapper); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryFileWrapper, __pyx_t_2) < 0) __PYX_ERR(4, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/statement.pyx":601 + * self._raise_error() + * + * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement), # <<<<<<<<<<<<<< + * {'__module__': __name__}) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__Statement)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__Statement)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_6oursql__Statement)); + + /* "oursqlx/statement.pyx":602 + * + * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement), + * {'__module__': __name__}) # <<<<<<<<<<<<<< + * + * cdef class _ResultStringStream: + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_module, __pyx_t_1) < 0) __PYX_ERR(4, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/statement.pyx":601 + * self._raise_error() + * + * _DictStatement = type('_DictStatement', (_DictWhateverMixin, _Statement), # <<<<<<<<<<<<<< + * {'__module__': __name__}) + * + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_u_DictStatement); + __Pyx_GIVEREF(__pyx_n_u_DictStatement); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_DictStatement); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DictStatement, __pyx_t_4) < 0) __PYX_ERR(4, 601, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursqlx/query.pyx":19 + * cdef int show_table + * + * conversions_dict = _conversions # <<<<<<<<<<<<<< + * + * def __cinit__(self, Connection conn not None, bint show_table=False, + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_conversions); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__ResultSet->tp_dict, __pyx_n_s_conversions_dict, __pyx_t_4) < 0) __PYX_ERR(6, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyType_Modified(__pyx_ptype_6oursql__ResultSet); + + /* "oursqlx/query.pyx":143 + * self.has_result = self.result.has_result + * + * _result_class = _ResultSet # <<<<<<<<<<<<<< + * def new_result(self): + * res = self._result_class(self.conn, *self.res_a, **self.res_kw) + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__Query->tp_dict, __pyx_n_s_result_class, ((PyObject *)__pyx_ptype_6oursql__ResultSet)) < 0) __PYX_ERR(6, 143, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6oursql__Query); + + /* "oursqlx/query.pyx":190 + * + * # Cython should support multiple inheritance one of these days. + * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet), # <<<<<<<<<<<<<< + * {'__module__': __name__}) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_6oursql__DictWhateverMixin)); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6oursql__ResultSet)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6oursql__ResultSet)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_ptype_6oursql__ResultSet)); + + /* "oursqlx/query.pyx":191 + * # Cython should support multiple inheritance one of these days. + * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet), + * {'__module__': __name__}) # <<<<<<<<<<<<<< + * + * cdef class _DictQuery(_Query): + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_module, __pyx_t_2) < 0) __PYX_ERR(6, 191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursqlx/query.pyx":190 + * + * # Cython should support multiple inheritance one of these days. + * _DictResultSet = type('_DictResultSet', (_DictWhateverMixin, _ResultSet), # <<<<<<<<<<<<<< + * {'__module__': __name__}) + * + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_u_DictResultSet); + __Pyx_GIVEREF(__pyx_n_u_DictResultSet); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_DictResultSet); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DictResultSet, __pyx_t_1) < 0) __PYX_ERR(6, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/query.pyx":194 + * + * cdef class _DictQuery(_Query): + * _result_class = _DictResultSet # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DictResultSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql__DictQuery->tp_dict, __pyx_n_s_result_class, __pyx_t_1) < 0) __PYX_ERR(6, 194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6oursql__DictQuery); + + /* "oursqlx/cursor.pyx":1 + * import collections, itertools # <<<<<<<<<<<<<< + * + * cdef class Cursor: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) __PYX_ERR(7, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "oursqlx/cursor.pyx":35 + * cdef public unsigned long arraysize + * + * _statement_class = _Statement # <<<<<<<<<<<<<< + * _query_class = _Query + * + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_Cursor->tp_dict, __pyx_n_s_statement_class, ((PyObject *)__pyx_ptype_6oursql__Statement)) < 0) __PYX_ERR(7, 35, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6oursql_Cursor); + + /* "oursqlx/cursor.pyx":36 + * + * _statement_class = _Statement + * _query_class = _Query # <<<<<<<<<<<<<< + * + * def __cinit__(self, Connection conn not None, bint try_plain_query=True, + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_Cursor->tp_dict, __pyx_n_s_query_class, ((PyObject *)__pyx_ptype_6oursql__Query)) < 0) __PYX_ERR(7, 36, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6oursql_Cursor); + + /* "oursqlx/cursor.pyx":279 + * """ + * + * _statement_class = _DictStatement # <<<<<<<<<<<<<< + * _query_class = _DictQuery + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DictStatement); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_DictCursor->tp_dict, __pyx_n_s_statement_class, __pyx_t_1) < 0) __PYX_ERR(7, 279, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6oursql_DictCursor); + + /* "oursqlx/cursor.pyx":280 + * + * _statement_class = _DictStatement + * _query_class = _DictQuery # <<<<<<<<<<<<<< + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6oursql_DictCursor->tp_dict, __pyx_n_s_query_class, ((PyObject *)__pyx_ptype_6oursql__DictQuery)) < 0) __PYX_ERR(7, 280, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6oursql_DictCursor); + + /* "oursql.pyx":91 + * # The global import lock is held while modules are being imported for the first + * # time, so it's threadsafe to call this. + * if mysql_library_init(0, NULL, NULL): # <<<<<<<<<<<<<< + * raise InterfaceError('could not initialize mysql') + * + */ + __pyx_t_5 = (mysql_library_init(0, NULL, NULL) != 0); + if (unlikely(__pyx_t_5)) { + + /* "oursql.pyx":92 + * # time, so it's threadsafe to call this. + * if mysql_library_init(0, NULL, NULL): + * raise InterfaceError('could not initialize mysql') # <<<<<<<<<<<<<< + * + * paramstyle = 'qmark' + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 92, __pyx_L1_error) + + /* "oursql.pyx":91 + * # The global import lock is held while modules are being imported for the first + * # time, so it's threadsafe to call this. + * if mysql_library_init(0, NULL, NULL): # <<<<<<<<<<<<<< + * raise InterfaceError('could not initialize mysql') + * + */ + } + + /* "oursql.pyx":94 + * raise InterfaceError('could not initialize mysql') + * + * paramstyle = 'qmark' # <<<<<<<<<<<<<< + * threadsafety = 1 + * apilevel = '2.0' + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_paramstyle, __pyx_n_u_qmark) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "oursql.pyx":95 + * + * paramstyle = 'qmark' + * threadsafety = 1 # <<<<<<<<<<<<<< + * apilevel = '2.0' + * connect = Connection + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_threadsafety, __pyx_int_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + + /* "oursql.pyx":96 + * paramstyle = 'qmark' + * threadsafety = 1 + * apilevel = '2.0' # <<<<<<<<<<<<<< + * connect = Connection + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apilevel, __pyx_kp_u_2_0) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + + /* "oursql.pyx":97 + * threadsafety = 1 + * apilevel = '2.0' + * connect = Connection # <<<<<<<<<<<<<< + * + * cdef class _DBAPITypeObject: + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_connect, ((PyObject *)__pyx_ptype_6oursql_Connection)) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + + /* "oursql.pyx":119 + * + * STRING = _DBAPITypeObject( + * MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING) # <<<<<<<<<<<<<< + * BINARY = _DBAPITypeObject( + * MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB, + */ + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_ENUM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_VAR_STRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "oursql.pyx":118 + * self.values, id(self)) + * + * STRING = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING) + * BINARY = _DBAPITypeObject( + */ + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_4) < 0) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "oursql.pyx":121 + * MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING) + * BINARY = _DBAPITypeObject( + * MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB, # <<<<<<<<<<<<<< + * MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB) + * NUMBER = _DBAPITypeObject( + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_BLOB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_LONG_BLOB); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "oursql.pyx":122 + * BINARY = _DBAPITypeObject( + * MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB, + * MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB) # <<<<<<<<<<<<<< + * NUMBER = _DBAPITypeObject( + * MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, + */ + __pyx_t_1 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_MEDIUM_BLOB); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TINY_BLOB); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "oursql.pyx":120 + * STRING = _DBAPITypeObject( + * MYSQL_TYPE_ENUM, MYSQL_TYPE_STRING, MYSQL_TYPE_VAR_STRING) + * BINARY = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB, + * MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB) + */ + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY, __pyx_t_2) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "oursql.pyx":124 + * MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB) + * NUMBER = _DBAPITypeObject( + * MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, # <<<<<<<<<<<<<< + * MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR) + * DATE = _DBAPITypeObject( + */ + __pyx_t_2 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_INT24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "oursql.pyx":125 + * NUMBER = _DBAPITypeObject( + * MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, + * MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR) # <<<<<<<<<<<<<< + * DATE = _DBAPITypeObject( + * MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_LONGLONG); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TINY); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_YEAR); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + + /* "oursql.pyx":123 + * MYSQL_TYPE_BLOB, MYSQL_TYPE_LONG_BLOB, + * MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_TINY_BLOB) + * NUMBER = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, + * MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR) + */ + __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NUMBER, __pyx_t_9) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "oursql.pyx":127 + * MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR) + * DATE = _DBAPITypeObject( + * MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE) # <<<<<<<<<<<<<< + * TIME = _DBAPITypeObject( + * MYSQL_TYPE_TIME) + */ + __pyx_t_9 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DATE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_NEWDATE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "oursql.pyx":126 + * MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, + * MYSQL_TYPE_LONG, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_TINY, MYSQL_TYPE_YEAR) + * DATE = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE) + * TIME = _DBAPITypeObject( + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATE, __pyx_t_10) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "oursql.pyx":129 + * MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE) + * TIME = _DBAPITypeObject( + * MYSQL_TYPE_TIME) # <<<<<<<<<<<<<< + * DATETIME = TIMESTAMP = _DBAPITypeObject( + * MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME) + */ + __pyx_t_10 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "oursql.pyx":128 + * DATE = _DBAPITypeObject( + * MYSQL_TYPE_DATE, MYSQL_TYPE_NEWDATE) + * TIME = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_TIME) + * DATETIME = TIMESTAMP = _DBAPITypeObject( + */ + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIME, __pyx_t_8) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "oursql.pyx":131 + * MYSQL_TYPE_TIME) + * DATETIME = TIMESTAMP = _DBAPITypeObject( + * MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME) # <<<<<<<<<<<<<< + * ROWID = _DBAPITypeObject() + * + */ + __pyx_t_8 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyInt_From_enum__enum_field_types(MYSQL_TYPE_DATETIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "oursql.pyx":130 + * TIME = _DBAPITypeObject( + * MYSQL_TYPE_TIME) + * DATETIME = TIMESTAMP = _DBAPITypeObject( # <<<<<<<<<<<<<< + * MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME) + * ROWID = _DBAPITypeObject() + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATETIME, __pyx_t_10) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMESTAMP, __pyx_t_10) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "oursql.pyx":132 + * DATETIME = TIMESTAMP = _DBAPITypeObject( + * MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_DATETIME) + * ROWID = _DBAPITypeObject() # <<<<<<<<<<<<<< + * + * client_info = PyUnicode_FromString(mysql_get_client_info()) + */ + __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6oursql__DBAPITypeObject)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROWID, __pyx_t_10) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "oursql.pyx":134 + * ROWID = _DBAPITypeObject() + * + * client_info = PyUnicode_FromString(mysql_get_client_info()) # <<<<<<<<<<<<<< + * errnos = _oursqlx_generate_errno_dict() + */ + __pyx_t_10 = PyUnicode_FromString(mysql_get_client_info()); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_client_info, __pyx_t_10) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "oursql.pyx":135 + * + * client_info = PyUnicode_FromString(mysql_get_client_info()) + * errnos = _oursqlx_generate_errno_dict() # <<<<<<<<<<<<<< + */ + __pyx_t_10 = _oursqlx_generate_errno_dict(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_errnos, __pyx_t_10) < 0) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__DictWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_6oursql_19__pyx_unpickle__DictWhateverMixin, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__DictWhateverMixi, __pyx_t_10) < 0) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "(tree fragment)":11 + * __pyx_unpickle__DictWhateverMixin__set_state(<_DictWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__DictWhateverMixin__set_state(_DictWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_6oursql_21__pyx_unpickle__AbstractIterWrapper, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__AbstractIterWrap, __pyx_t_10) < 0) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle__BinaryWhateverMixin(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_6oursql_23__pyx_unpickle__BinaryWhateverMixin, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__BinaryWhateverMi, __pyx_t_10) < 0) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "(tree fragment)":11 + * __pyx_unpickle__BinaryWhateverMixin__set_state(<_BinaryWhateverMixin> __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle__BinaryWhateverMixin__set_state(_BinaryWhateverMixin __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_6oursql_25__pyx_unpickle__DBAPITypeObject, NULL, __pyx_n_s_oursql); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__DBAPITypeObject, __pyx_t_10) < 0) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "oursql.pyx":1 + * # cython: language_level=3 # <<<<<<<<<<<<<< + * """oursql python bindings for MySQL. + * + */ + __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_10) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init oursql", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init oursql"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +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, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +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 +} + +/* ParseKeywords */ +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_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 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(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 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(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, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + CYTHON_UNUSED Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind; + Py_ssize_t i, char_pos; + void *result_udata; +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely(char_pos + ulength < 0)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind)); + } else { + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + result_ulength++; + value_count++; + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* RaiseTooManyValuesToUnpack */ +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); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_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 +} + +/* UnpackItemEndCheck */ +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; +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + 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 (PyType_Check(type)) { +#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; + 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; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +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 *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + 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 = PyObject_Call(type, args, NULL); + 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) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else 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) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* SliceObject */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* pop */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { + if (Py_TYPE(L) == &PySet_Type) { + return PySet_Pop(L); + } + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { + if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { + __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); + return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); + } + return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #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); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_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_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, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned short uint16_t; + #else + typedef unsigned __int16 uint16_t; + #endif + #endif +#else + #include +#endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define GCC_DIAGNOSTIC +#endif +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(Py_ssize_t)*3+2]; + char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + Py_ssize_t remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (Py_ssize_t) (remaining / (8*8)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (Py_ssize_t) (remaining / (10*10)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (Py_ssize_t) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + if (last_one_off) { + assert(*dpos == '0'); + dpos++; + } + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* CIntToPyUnicode */ +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned short uint16_t; + #else + typedef unsigned __int16 uint16_t; + #endif + #endif +#else + #include +#endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define GCC_DIAGNOSTIC +#endif +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_unsigned_int(unsigned int value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(unsigned int)*3+2]; + char *dpos, *end = digits + sizeof(unsigned int)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + unsigned int remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (unsigned int) (remaining / (8*8)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (unsigned int) (remaining / (10*10)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (unsigned int) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + if (last_one_off) { + assert(*dpos == '0'); + dpos++; + } + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* CIntToPyUnicode */ +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned short uint16_t; + #else + typedef unsigned __int16 uint16_t; + #endif + #endif +#else + #include +#endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define GCC_DIAGNOSTIC +#endif +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_enum__enum_field_types(enum enum_field_types value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(enum enum_field_types)*3+2]; + char *dpos, *end = digits + sizeof(enum enum_field_types)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + enum enum_field_types remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const enum enum_field_types neg_one = (enum enum_field_types) -1, const_zero = (enum enum_field_types) 0; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (enum enum_field_types) (remaining / (8*8)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (enum enum_field_types) (remaining / (10*10)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (enum enum_field_types) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + if (last_one_off) { + assert(*dpos == '0'); + dpos++; + } + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_FALSE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_TRUE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_TRUE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* SetupReduce */ +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare_2); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunctionShared */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ +#if PY_MAJOR_VERSION < 3 + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; +#endif + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +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 - start) / 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, ((size_t)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); +} + +/* AddTraceback */ +#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, + 0, + 0, + 0, + 0, + __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, + __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; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + 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_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum___oursqlx_exception_type(enum _oursqlx_exception_type value) { + const enum _oursqlx_exception_type neg_one = (enum _oursqlx_exception_type) ((enum _oursqlx_exception_type) 0 - (enum _oursqlx_exception_type) 1), const_zero = (enum _oursqlx_exception_type) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum _oursqlx_exception_type) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum _oursqlx_exception_type) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum _oursqlx_exception_type) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum _oursqlx_exception_type) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum _oursqlx_exception_type) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum _oursqlx_exception_type), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__enum_field_types(enum enum_field_types value) { + const enum enum_field_types neg_one = (enum enum_field_types) ((enum enum_field_types) 0 - (enum enum_field_types) 1), const_zero = (enum enum_field_types) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum enum_field_types) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum enum_field_types) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum enum_field_types) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum enum_field_types) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum enum_field_types) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum enum_field_types), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__mysql_protocol_type(enum mysql_protocol_type value) { + const enum mysql_protocol_type neg_one = (enum mysql_protocol_type) ((enum mysql_protocol_type) 0 - (enum mysql_protocol_type) 1), const_zero = (enum mysql_protocol_type) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum mysql_protocol_type) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum mysql_protocol_type) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum mysql_protocol_type) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum mysql_protocol_type) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum mysql_protocol_type) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum mysql_protocol_type), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { + const unsigned long neg_one = (unsigned long) ((unsigned long) 0 - (unsigned long) 1), const_zero = (unsigned long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_my_ulonglong(my_ulonglong value) { + const my_ulonglong neg_one = (my_ulonglong) ((my_ulonglong) 0 - (my_ulonglong) 1), const_zero = (my_ulonglong) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(my_ulonglong) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(my_ulonglong) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(my_ulonglong) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(my_ulonglong) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(my_ulonglong) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(my_ulonglong), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { + const unsigned long neg_one = (unsigned long) ((unsigned long) 0 - (unsigned long) 1), const_zero = (unsigned long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned long) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) { + return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) { + return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT) { + return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned long) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { + return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { + return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { + return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { + return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) { + return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) { + return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned long) -1; + } + } else { + unsigned long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned long) -1; + val = __Pyx_PyInt_As_unsigned_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned long"); + return (unsigned long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned long"); + return (unsigned long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CheckBinaryVersion */ +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); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +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 + 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; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + 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; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */