Beispiel #1
0
static void close_conn(UMConnection conn)
{
    JSFiber::scope s;

    UMConnection_Close(conn);
    UMConnection_Destroy(conn);
}
Beispiel #2
0
static void Connection_Destructor(Connection *self)
{
  PRINTMARK();
  UMConnection_Destroy(self->conn);
  PRINTMARK();
  PyObject_Del(self);
  PRINTMARK();
  if (PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Exception is set for no error in %s", __FUNCTION__);
  PRINTMARK();
}
Beispiel #3
0
result_t mysql::close(exlib::AsyncEvent *ac)
{
    if (m_conn)
    {
        UMConnection_Close(m_conn);
        UMConnection_Destroy(m_conn);
        m_conn = NULL;
    }

    return 0;
}
Beispiel #4
0
result_t mysql::close(AsyncEvent *ac)
{
    if (!m_conn)
        return 0;

    if (!ac)
        return CHECK_ERROR(CALL_E_NOSYNC);

    if (m_conn)
    {
        UMConnection_Close(m_conn);
        UMConnection_Destroy(m_conn);
        m_conn = NULL;
    }

    return 0;
}
Beispiel #5
0
result_t mysql::connect(const char *host, int port, const char *username,
                        const char *password, const char *dbName)
{
    if (m_conn)
        return CALL_E_INVALID_CALL;

    m_conn = UMConnection_Create(&capi);
    if (!UMConnection_Connect(m_conn, host, port, username, password, dbName,
                              NULL, MCS_utf8mb4_bin))
    {
        result_t hr = error();

        UMConnection_Destroy(m_conn);
        m_conn = NULL;

        return hr;
    }

    return 0;
}
Beispiel #6
0
static void Connection_Destructor(Connection *self)
{
  UMConnection_Destroy(self->conn);
  PyObject_Del(self);
}
Beispiel #7
0
static void close_conn(UMConnection conn)
{
    UMConnection_Close(conn);
    UMConnection_Destroy(conn);
}