/* real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil) */
static VALUE real_connect2(int argc, VALUE* argv, VALUE obj)
{
VALUE host, user, passwd, db, port, sock, flag;
char *h, *u, *p, *d, *s;
unsigned int pp, f;
MYSQL* m = GetHandler(obj);
rb_scan_args(argc, argv, "07", &host, &user, &passwd, &db, &port, &sock, &flag);
d = NILorSTRING(db);
f = NILorINT(flag);
h = NILorSTRING(host);
u = NILorSTRING(user);
p = NILorSTRING(passwd);
pp = NILorINT(port);
s = NILorSTRING(sock);
if (mysql_real_connect(m, h, u, p, d, pp, s, f) == NULL)
mysql_raise(m);
m->reconnect = 0;
GetMysqlStruct(obj)->connection = Qtrue;
return obj;
}