Ejemplo n.º 1
0
/*	shutdown()	*/
static VALUE my_shutdown(int argc, VALUE* argv, VALUE obj)
{
    MYSQL* m = GetHandler(obj);
    VALUE level;

    rb_scan_args(argc, argv, "01", &level);
#if MYSQL_VERSION_ID >= 40103
    if (mysql_shutdown(m, NIL_P(level) ? SHUTDOWN_DEFAULT : NUM2INT(level)) != 0)
#else
    if (mysql_shutdown(m) != 0)
#endif
	mysql_raise(m);
    return obj;
}
Ejemplo n.º 2
0
/* 关闭mysql 服务器 */
int CppMySQL3DB::shutDown()
{
	if( mysql_shutdown(_db_ptr,SHUTDOWN_DEFAULT) == 0 )
		return 0;
	else 
		return -1;
}
Ejemplo n.º 3
0
/**
 * @brief Shutdown MySQL.
 */
void G_MySQL_Shutdown(void) {
#if HAVE_MYSQL

	if (g_mysql_state.mysql) {
		mysql_shutdown(g_mysql_state.mysql, SHUTDOWN_DEFAULT);
		g_mysql_state.mysql = NULL;
	}

#endif
}
Ejemplo n.º 4
0
static PyObject* wsql_connection_shutdown(wsql_connection *self)
{
    int r;
    CHECK_CONNECTION(self, NULL);
    Py_BEGIN_ALLOW_THREADS
    r = mysql_shutdown(&(self->connection)
#if MYSQL_VERSION_ID >= 40103
                       , SHUTDOWN_DEFAULT
#endif
                      );
    Py_END_ALLOW_THREADS
    if (r)
        return wsql_raise_error(self);

    Py_RETURN_NONE;
}
Ejemplo n.º 5
0
//--------------------------------------------------------------------------
bool Connection::shutdown () 
{
  bool suc = !(mysql_shutdown(&mysql));
  if (throw_exceptions && !suc) throw MysqlBadQuery(error());
  else return suc;
}
Ejemplo n.º 6
0
int CDatabase_Connection::shutdown(enum mysql_enum_shutdown_level shutdown_level)
{
	return mysql_shutdown(&my, shutdown_level);
}
Ejemplo n.º 7
0
DBConnector::~DBConnector()
{
	Close();
	mysql_shutdown(&mysql, SHUTDOWN_DEFAULT);
}