hi!

>>>>> "A" == Arunachalam  <[EMAIL PROTECTED]> writes:

A> Hai MySQLians!!!
A> I have established the Successful Connection to MySQL from COBOL.

A> Now from COBOL I can able to query the MySQL and get back the
A> result sets using C APIs under MySQL 4.0.17-max both in windows
A> and Linux. Note that my Client is in Windows platform...

A> Its not enough for my application, I'm in need to use Prepared statements
A> for further SQL processing...

A> As per my searching I have found the right C API in libmysql.lib from
A> MySQL 5.0.0, (i have doubt: Is any eariler version 4.0.xx provides this???)
A> C API routines are: mysql_prepare(), mysql_bind_param(), mysql_execute(), 
A> mysql_stmt_affected_rows(), mysql_fetch(), mysql_stmt_close()...

You should probablty use MySQL 4.1 instead of MySQL 5.0 for testing
this as we make more often releases for 4.1 than for 5.0 (until 4.1 is
production ready).

A> I have installed MySQL 5.0.0-alpha for Windows and I have properly linked 
A> thelibmysql.lib into my COBOL compiler... To verify the Parameter Passing 
A> mechanism to the API routines i have taken the sample C code from MySQL 
A> manual (URL: * http://www.mysql.com/doc/en/mysql_execute.html * )

A> When I compiled this sample coding using VC++, it ask for *typelib.h* header 
A> file, it is not given with insatllation pack, under the Mysql folder 
A> (C:/MySQL/Include), I have searched on the net and include it accordingly.

Thanks for notifying us about this. typelib.h should be included in
the MySQL folder and we will do that for next MySQL windows release.
(4.1.2)

A> After that i have made changes in some variable names becaz of it follows 
A> other header files variable name as such.

What changes did you have to make ?
Including typelib.h should be enough.

I will ask our windows team to verify that the example works ok with
VC++

A> Upon all the changes I can able to execute succcessfully the coding and it 
A> does the function properly on the MySQL server database.

A> The PROBLEM I met is, Once this sample code executed and inserted data to 
A> the Database the server get's hanged - why???????????????

This shouldn't happen.
Can you please describe exactly what you mean with a 'hang' ?

- Does the connection in your test program stop respoding ?
- Can you connect to mysqld with other clients ?
- Does the MySQL server take all cpu

In the tests directory of the MySQL source tree there is a test
program 'client_test' that shows in detail how to use prepared
statements with MySQL.

A> (Note that If I didn't run this coding or my COBOL coding the Server remain 
A> function properly)

A> Kindly suggest me the solution or quote me the things i forgot to do...

In the released 5.0 server there is some known bugs in the prepared
statement handling for some specific prepared statements.  We have
fixed these bugs in 4.1.2 which should be available quite soon (we are
just now closing the last open bugs in 4.1 to be able to make a new
release ASAP).

To get any problems you have fixed, you could try to make a standalone
test case in C that we could try to repeate.

Another option is to follow the instructions in the MySQL manual of
how to debug MySQL and give us a stack trace of where mysqld is
hanging.

Another option is to use the debug version of mysqld and start it with
--debug.  The trace file that is written (in C:\ or /tmp) should give
us a good idea of where the bug could be.

Regards,
Monty
-- 
Michael Widenius <[EMAIL PROTECTED]>
MySQL AB, CTO
Helsinki, Finland

Are you MySQL certified?  www.mysql.com/certification

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to