Re: help with a simple ODBC program
Martin Evans <[email protected]>
| Newsgroups | gmane.comp.db.mysql.odbc |
|---|---|
| Organization | Easysoft Limited |
| Message-ID | <[email protected]> |
Patrick Galbraith wrote: > 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 <snipped program> NOTE: I have no continued your cc list, I don't know who those people are. I will attempt to find a few moments to look it over but in the mean time why don't you run valgrind on it. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/[email protected]