static PyObject *__pyx_pf_17clickhouse_driver_7columns_12stringcolumn_11FixedString_2read_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_ssize_t __pyx_v_n_items, PyObject *__pyx_v_buf) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_encoding = NULL;
  char *__pyx_v_c_encoding;
  PyObject *__pyx_v_data = NULL;
  char *__pyx_v_data_ptr;
  char *__pyx_v_c_string;
  PyObject *__pyx_v_items = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_items", 0);

  /* "clickhouse_driver/columns/stringcolumn.pyx":52
 * 
 *     def read_items(self, Py_ssize_t n_items, buf):
 *         cdef Py_ssize_t i, j, length = self.length             # <<<<<<<<<<<<<<
 *         encoding = self.encoding.encode('utf-8')
 *         cdef char* c_encoding = encoding
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_2;

  /* "clickhouse_driver/columns/stringcolumn.pyx":53
 *     def read_items(self, Py_ssize_t n_items, buf):
 *         cdef Py_ssize_t i, j, length = self.length
 *         encoding = self.encoding.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef char* c_encoding = encoding
 *         data = buf.read(length * n_items)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_encoding = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "clickhouse_driver/columns/stringcolumn.pyx":54
 *         cdef Py_ssize_t i, j, length = self.length
 *         encoding = self.encoding.encode('utf-8')
 *         cdef char* c_encoding = encoding             # <<<<<<<<<<<<<<
 *         data = buf.read(length * n_items)
 *         cdef char* data_ptr = PyBytes_AsString(data)
 */
  __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_encoding); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
  __pyx_v_c_encoding = __pyx_t_5;

  /* "clickhouse_driver/columns/stringcolumn.pyx":55
 *         encoding = self.encoding.encode('utf-8')
 *         cdef char* c_encoding = encoding
 *         data = buf.read(length * n_items)             # <<<<<<<<<<<<<<
 *         cdef char* data_ptr = PyBytes_AsString(data)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_length * __pyx_v_n_items)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "clickhouse_driver/columns/stringcolumn.pyx":56
 *         cdef char* c_encoding = encoding
 *         data = buf.read(length * n_items)
 *         cdef char* data_ptr = PyBytes_AsString(data)             # <<<<<<<<<<<<<<
 * 
 *         cdef char* c_string = <char *>PyMem_Malloc(length + 1)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_data); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 56, __pyx_L1_error)
  __pyx_v_data_ptr = __pyx_t_5;

  /* "clickhouse_driver/columns/stringcolumn.pyx":58
 *         cdef char* data_ptr = PyBytes_AsString(data)
 * 
 *         cdef char* c_string = <char *>PyMem_Malloc(length + 1)             # <<<<<<<<<<<<<<
 *         if not c_string:
 *             raise MemoryError()
 */
  __pyx_v_c_string = ((char *)PyMem_Malloc((__pyx_v_length + 1)));

  /* "clickhouse_driver/columns/stringcolumn.pyx":59
 * 
 *         cdef char* c_string = <char *>PyMem_Malloc(length + 1)
 *         if not c_string:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         c_string[length] = 0
 */
  __pyx_t_7 = ((!(__pyx_v_c_string != 0)) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "clickhouse_driver/columns/stringcolumn.pyx":60
 *         cdef char* c_string = <char *>PyMem_Malloc(length + 1)
 *         if not c_string:
 *             raise MemoryError()             # <<<<<<<<<<<<<<
 *         c_string[length] = 0
 * 
 */
    PyErr_NoMemory(); __PYX_ERR(0, 60, __pyx_L1_error)

    /* "clickhouse_driver/columns/stringcolumn.pyx":59
 * 
 *         cdef char* c_string = <char *>PyMem_Malloc(length + 1)
 *         if not c_string:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         c_string[length] = 0
 */
  }

  /* "clickhouse_driver/columns/stringcolumn.pyx":61
 *         if not c_string:
 *             raise MemoryError()
 *         c_string[length] = 0             # <<<<<<<<<<<<<<
 * 
 *         items = PyTuple_New(n_items)
 */
  (__pyx_v_c_string[__pyx_v_length]) = 0;

  /* "clickhouse_driver/columns/stringcolumn.pyx":63
 *         c_string[length] = 0
 * 
 *         items = PyTuple_New(n_items)             # <<<<<<<<<<<<<<
 *         for i in range(n_items):
 *             memcpy(c_string, &data_ptr[i * length], length)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_n_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_items = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "clickhouse_driver/columns/stringcolumn.pyx":64
 * 
 *         items = PyTuple_New(n_items)
 *         for i in range(n_items):             # <<<<<<<<<<<<<<
 *             memcpy(c_string, &data_ptr[i * length], length)
 * 
 */
  __pyx_t_2 = __pyx_v_n_items;
  __pyx_t_8 = __pyx_t_2;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "clickhouse_driver/columns/stringcolumn.pyx":65
 *         items = PyTuple_New(n_items)
 *         for i in range(n_items):
 *             memcpy(c_string, &data_ptr[i * length], length)             # <<<<<<<<<<<<<<
 * 
 *             # Get last non zero byte of string from the end.
 */
    (void)(memcpy(__pyx_v_c_string, (&(__pyx_v_data_ptr[(__pyx_v_i * __pyx_v_length)])), __pyx_v_length));

    /* "clickhouse_driver/columns/stringcolumn.pyx":68
 * 
 *             # Get last non zero byte of string from the end.
 *             j = length - 1             # <<<<<<<<<<<<<<
 *             while j >= 0 and not c_string[j]:
 *                 j -= 1
 */
    __pyx_v_j = (__pyx_v_length - 1);

    /* "clickhouse_driver/columns/stringcolumn.pyx":69
 *             # Get last non zero byte of string from the end.
 *             j = length - 1
 *             while j >= 0 and not c_string[j]:             # <<<<<<<<<<<<<<
 *                 j -= 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_7 = __pyx_t_10;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_10 = ((!((__pyx_v_c_string[__pyx_v_j]) != 0)) != 0);
      __pyx_t_7 = __pyx_t_10;
      __pyx_L8_bool_binop_done:;
      if (!__pyx_t_7) break;

      /* "clickhouse_driver/columns/stringcolumn.pyx":70
 *             j = length - 1
 *             while j >= 0 and not c_string[j]:
 *                 j -= 1             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "clickhouse_driver/columns/stringcolumn.pyx":72
 *                 j -= 1
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 item = c_string[:j + 1].decode(c_encoding)
 *             except UnicodeDecodeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "clickhouse_driver/columns/stringcolumn.pyx":73
 * 
 *             try:
 *                 item = c_string[:j + 1].decode(c_encoding)             # <<<<<<<<<<<<<<
 *             except UnicodeDecodeError:
 *                 item = PyBytes_FromStringAndSize(c_string, length)
 */
        __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_c_string, 0, (__pyx_v_j + 1), __pyx_v_c_encoding, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "clickhouse_driver/columns/stringcolumn.pyx":72
 *                 j -= 1
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 item = c_string[:j + 1].decode(c_encoding)
 *             except UnicodeDecodeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L17_try_end;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "clickhouse_driver/columns/stringcolumn.pyx":74
 *             try:
 *                 item = c_string[:j + 1].decode(c_encoding)
 *             except UnicodeDecodeError:             # <<<<<<<<<<<<<<
 *                 item = PyBytes_FromStringAndSize(c_string, length)
 *             Py_INCREF(item)
 */
      __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("clickhouse_driver.columns.stringcolumn.FixedString.read_items", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L12_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);

        /* "clickhouse_driver/columns/stringcolumn.pyx":75
 *                 item = c_string[:j + 1].decode(c_encoding)
 *             except UnicodeDecodeError:
 *                 item = PyBytes_FromStringAndSize(c_string, length)             # <<<<<<<<<<<<<<
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(items, i, item)
 */
        __pyx_t_6 = PyBytes_FromStringAndSize(__pyx_v_c_string, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 75, __pyx_L12_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L11_exception_handled;
      }
      goto __pyx_L12_except_error;
      __pyx_L12_except_error:;

      /* "clickhouse_driver/columns/stringcolumn.pyx":72
 *                 j -= 1
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 item = c_string[:j + 1].decode(c_encoding)
 *             except UnicodeDecodeError:
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L11_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L17_try_end:;
    }

    /* "clickhouse_driver/columns/stringcolumn.pyx":76
 *             except UnicodeDecodeError:
 *                 item = PyBytes_FromStringAndSize(c_string, length)
 *             Py_INCREF(item)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(items, i, item)
 * 
 */
    Py_INCREF(__pyx_v_item);

    /* "clickhouse_driver/columns/stringcolumn.pyx":77
 *                 item = PyBytes_FromStringAndSize(c_string, length)
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(items, i, item)             # <<<<<<<<<<<<<<
 * 
 *         PyMem_Free(c_string)
 */
    PyTuple_SET_ITEM(__pyx_v_items, __pyx_v_i, __pyx_v_item);
  }

  /* "clickhouse_driver/columns/stringcolumn.pyx":79
 *             PyTuple_SET_ITEM(items, i, item)
 * 
 *         PyMem_Free(c_string)             # <<<<<<<<<<<<<<
 * 
 *         return items
 */
  PyMem_Free(__pyx_v_c_string);

  /* "clickhouse_driver/columns/stringcolumn.pyx":81
 *         PyMem_Free(c_string)
 * 
 *         return items             # <<<<<<<<<<<<<<
 * 
 *     def write_items(self, items, buf):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_items);
  __pyx_r = __pyx_v_items;
  goto __pyx_L0;

  /* "clickhouse_driver/columns/stringcolumn.pyx":51
 *         super(FixedString, self).__init__(**kwargs)
 * 
 *     def read_items(self, Py_ssize_t n_items, buf):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, j, length = self.length
 *         encoding = self.encoding.encode('utf-8')
 */

  /* 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_6);
  __Pyx_AddTraceback("clickhouse_driver.columns.stringcolumn.FixedString.read_items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encoding);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_pf_17clickhouse_driver_7columns_12stringcolumn_11FixedString_2read_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_ssize_t __pyx_v_n_items, PyObject *__pyx_v_buf) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_encoding = NULL;
  char *__pyx_v_c_encoding;
  PyObject *__pyx_v_data = NULL;
  char *__pyx_v_data_ptr;
  char *__pyx_v_c_string;
  PyObject *__pyx_v_items = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_items", 0);

   
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_2;

   
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_encoding = __pyx_t_1;
  __pyx_t_1 = 0;

   
  __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_encoding); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
  __pyx_v_c_encoding = __pyx_t_5;

   
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_length * __pyx_v_n_items)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

   
  __pyx_t_5 = PyBytes_AsString(__pyx_v_data); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 56, __pyx_L1_error)
  __pyx_v_data_ptr = __pyx_t_5;

   
  __pyx_v_c_string = ((char *)PyMem_Malloc((__pyx_v_length + 1)));

   
  __pyx_t_7 = ((!(__pyx_v_c_string != 0)) != 0);
  if (unlikely(__pyx_t_7)) {

     
    PyErr_NoMemory(); __PYX_ERR(0, 60, __pyx_L1_error)

     
  }

   
  (__pyx_v_c_string[__pyx_v_length]) = 0;

   
  __pyx_t_1 = PyTuple_New(__pyx_v_n_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_items = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

   
  __pyx_t_2 = __pyx_v_n_items;
  __pyx_t_8 = __pyx_t_2;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

     
    (void)(memcpy(__pyx_v_c_string, (&(__pyx_v_data_ptr[(__pyx_v_i * __pyx_v_length)])), __pyx_v_length));

     
    __pyx_v_j = (__pyx_v_length - 1);

     
    while (1) {
      __pyx_t_10 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_7 = __pyx_t_10;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_10 = ((!((__pyx_v_c_string[__pyx_v_j]) != 0)) != 0);
      __pyx_t_7 = __pyx_t_10;
      __pyx_L8_bool_binop_done:;
      if (!__pyx_t_7) break;

       
      __pyx_v_j = (__pyx_v_j - 1);
    }

     
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
        {

         
        __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_c_string, 0, (__pyx_v_j + 1), __pyx_v_c_encoding, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
        __pyx_t_1 = 0;

         
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L17_try_end;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

       
      __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("clickhouse_driver.columns.stringcolumn.FixedString.read_items", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L12_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);

         
        __pyx_t_6 = PyBytes_FromStringAndSize(__pyx_v_c_string, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 75, __pyx_L12_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L11_exception_handled;
      }
      goto __pyx_L12_except_error;
      __pyx_L12_except_error:;

       
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L11_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L17_try_end:;
    }

     
    Py_INCREF(__pyx_v_item);

     
    PyTuple_SET_ITEM(__pyx_v_items, __pyx_v_i, __pyx_v_item);
  }

   
  PyMem_Free(__pyx_v_c_string);

   
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_items);
  __pyx_r = __pyx_v_items;
  goto __pyx_L0;

   

   
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("clickhouse_driver.columns.stringcolumn.FixedString.read_items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encoding);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}