LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   mysql c api,bad MYSQL_RES structure. (https://www.linuxquestions.org/questions/programming-9/mysql-c-api-bad-mysql_res-structure-440249/)

slzckboy 04-30-2006 07:54 AM

mysql c api,bad MYSQL_RES structure.
 
I am issuing the command
Code:

SELECT col_name from table_name
via the mysql C API.

All is well if table_name is found in the currently connected database,but there may be an instance in my program where table_name is not found.

mysql_store_result is returning 0xffffffff when the table name "table_name" is not found.
I was under the impression it should return NULL.

Thus the invalid address of 0xffffffff is causing my program to seg fault because 0xffffffff is non zero and thus is not picked up by the code as it is written att.

shouldn't the result structure be NULL in this scenario?
Or does the API just check for sql sytax errors?

Thnks

Robert

slzckboy 04-30-2006 08:33 AM

figured it out,it was the wrapper that i wrote around the mysql_real_query() function elsewhere in my code,and an ugly cast I had made on getting an error.:tisk:


All times are GMT -5. The time now is 02:51 PM.