Melanie Ware wrote:
I am using mysql 4.0.17 on Red Hat Linux.

I am using the C API to access mysql

The application I am writing should parse a xml file and write details to the mysql database.

The xml elements as they are read are fed into a simple data structure. On the completion of the structure details the datbase should be checked for a prior entry.

This works successfully for the first 3 entries. The 4th. entry executes the SELECT statement but appears to wipe the structure contents

The code is as follows.

select_query = "SELECT file_id FROM File WHERE file_name = 'RPCMap.h'";

mysql_query (conn, select_query);

I know that the line containing the mysql_query statement destroys the struture data content because I have used gdb to print the structure values as I step through the code.

The results you are seeing are more likely a gdb peculiarity. To verify, try printing out select_query before and after the call to mysql_query() without the use of gdb.


If you discover that select_query is indeed modified through a call to mysql_query(), I would run your program through valgrind to see if it happens to smash the stack earlier on. In 5 years of extensive work with the C API, I have never seen mysql_query() corrupt the caller's buffer.




-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to