4 messages in com.mysql.lists.plusplusC API mysql_close()
FromSent OnAttachments
Mukul Sabharwal06 May 2004 19:02 
Kevin Cowley07 May 2004 02:33 
Darryl Rodden07 May 2004 08:00 
Sinisa Milivojevic08 May 2004 05:31 
Subject:C API mysql_close()
From:Mukul Sabharwal (muk@mnstate.edu)
Date:05/06/2004 07:02:58 PM
List:com.mysql.lists.plusplus

Hello,

This is a problem in the C API, but I guess someone here could help me out.

int verify(const char *logid, const char *passwd) { MYSQL mysql; mysql = database_initialize(0); mysql_close(mysql);

}

The above is a cut down version from my functions. I'm trying to close the mysql connection, but it crashes with a coredump everytime mysql_close() is called... and that's the line where segmentation fault is attained.

database_initialize returns a copy of MYSQL.

MYSQL database_initialize(int x) {

MYSQL mysql; mysql_init(&mysql); mysql_real_connect(&mysql...

return MYSQL;

}

Don't know why it's crashing! Is something I'm doing wrong, cause it seems passing MYSQL between functions is what makes this thing wrong?