I've been trying to hook up to my own locally hosted MySQL database with the MySQL/C++ Connector package. The lines that are really giving me a problem are:
driver = get_driver_instance();
auto_ptr < Connection > con (driver -> connect("tcp://127.0.0.1:3306", "root", "root"));
Hitting the 2nd of the two lines gives me a memory allocation error. Here's the readout from the debugger.
HEAP[mySQLTestApp.exe]: Invalid allocation size - CCCCCCD0 (exceeded 7ffdefff)
First-chance exception at 0x7c812afb in mySQLTestApp.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012fa88..
HEAP[mySQLTestApp.exe]: Invalid allocation size - CCCCCCCD (exceeded 7ffdefff)
First-chance exception at 0x7c812afb in mySQLTestApp.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f428..
First-chance exception at 0x7c812afb in mySQLTestApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Unhandled exception at 0x7c812afb in mySQLTestApp.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f428..
I'm really not sure what I'm doing incorrectly. I thought it might have been the Connection pointer itself, so I tried converting it into the auto_ptr that you see now. Same error. I've tried different parameters for the connect function, but that doesn't seem to be the problem as well. Can anybody explain why I'm having memory leak problems so early in the program?