Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
help with a simple ODBC program

help with a simple ODBC program

2007-05-01       - By Patrick Galbraith

 Back
Reply:     1     2     3     4     5     6     7  

Hi all,

I'm working on a federated odbc storage engine, and was having problems
fetching results of a 'show table status'. I have one main odbc database
handle in the storage engine, and then allocate and free statement
handles for whatever calls I need to make. One of the storage engine
methods, "::info", does a 'show table status like 'tablename'". I kept
banging my head with the code segfaulting on fetching result sets, and
didn't know if it was something to do with the way I allocate memory in
the storage engine, so I decided to remove the problem into a simpler  
piece of code.

The code as far as I could tell, should work. What I did next was just
to write a simple C program that does just one simple show table status
call. It worked when I had the statement allocation and fetching all in
"main", but when I tried to see if having statement allocation in a
different function (one that simply takes an sql query and runs it) it
segfaults in the part of the program that iterates through the columns
of the result set. Everything works up to the point where my program
reports the number of columns, but then segfaults on any subsequent call
such as SQLColAttribute or SQLGetData. I can't figure it out. It makes
no sense. The loop that does all this worked perfectly when in the same
function (main) as the rest of the program setup.

I'm attaching this program that I wrote for anyone who would like to
help me  with this. I would appreciate any help, in advance, that anyone
can please give!

Kind regards,

Patrick

--
Patrick Galbraith, Senior Programmer
Grazr - Easy feed grazing and sharing
http://www.grazr.com

Satyam Eva Jayate - Truth Alone Triumphs
Mundaka Upanishad





--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc?unsub=mysql@(protected)