[fpc-pascal]mysql package under WinNT

Bernhard Steffen bernhard.steffen at gmx.net
Wed Mar 14 23:14:49 CET 2001

Michael and Mirek, thanks for your help.

I tried the following:

- changed all "cdecl" to "stdcall" in mysql.pp and mysql_com.pp
- added the correct {$linklib...} statements in mysql_com.pp
- changed the first parameter of my function call of mysql_connect()
  from a local var on stack to a global var within the unit
  (seems strange to me, but otherwise I will still get the error)

Now my program runs fine, every query gets executed etc. without any
apparent error.

... but still one thing doesn't work:

As soon as I run more than one query, I will get an WinNT error popup
when calling mysql_close():
	"Microsoft Visual C++ Debug Library
	Debug Assertion Failed
	Program:    <path> test.exe
	File:       dbgheap.c
	Line:       1011
	Expression: _CrtIsValidHeapPointer(pUserData)
- If I do an (A)bort, the program dies silently, no other command
  after mysql_close() gets executed
- If I do a (R)etry, I get yet another NT error: "unknown software
  exception" (0x80000003) at position 0x100278AB; after that, my
  program quits silently
- If I do an (I)gnore, program will quit with an runtime error 216 at
  the same position and a call stack trace gets printed

I'm doing queries in the way as described in "testdb.pp", ie 
*** mysql_connect
*** mysql_select_db
*** one or more:
	- mysql_query
	- mysql_store_result
	- one or more: mysql_fetch_row
	- mysql_free_result
*** mysql_close

Anything I forgot?

Since I updated, I'm now using MySQL 3.23.34 (debug version of client
lib) on WinNT. Program is compiled with -gl -gh.

Again, any help appreciated!


bernhard.steffen at gmx.net

More information about the fpc-pascal mailing list