LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2006, 07:54 AM   #1
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
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
 
Old 04-30-2006, 08:33 AM   #2
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Client API I_AM Linux - Newbie 1 06-27-2005 02:52 AM
Can't locate API module structure `jk_module' renatopia Linux - General 2 10-14-2003 11:39 PM
apache Can't locate API module structure `pam_auth_module' JGarcia Linux - General 1 09-04-2003 03:31 PM
c++ and mysql api nakkaya Programming 4 03-28-2003 11:10 PM
mySQL and C API Problems [RJP]DeanLO Programming 1 11-15-2001 09:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration