How to compare database handles?
Posted by: Ingo Soetebier
Date: February 07, 2011 04:05AM

When I have two MYSQL database handles, does it work to compare using memcmp()? Sometimes there are bytes for padding in a struct, that may have no defined value.
I want to know, if it is the same database connection.

e.g.:

MYSQL * db1;
MYSQL * db2;

// Initialization...
// do something...

if( memcpy( db1, db2, sizeof(MYSQL) ) == 0 ) {
// same connection ?
} else {
// different connection ?
}


regards,
Ingo

Options: ReplyQuote


Subject
Views
Written By
Posted
How to compare database handles?
813
February 07, 2011 04:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.