help with a simple ODBC program 2007-05-01 - By Patrick Galbraith
Back 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)
|
|