Bug #69494 Unable to create function if dll build for mysql connection
Submitted: 17 Jun 2013 23:53 Modified: 27 Jun 2013 0:07
Reporter: Ezhil Arasan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: C API (client library) Severity:S1 (Critical)
Version:5.6.10 OS:Windows (Unable to create function if dll build for mysql connection)
Assigned to: CPU Architecture:Any
Tags: c/c++, MYSQL UDF

[17 Jun 2013 23:53] Ezhil Arasan
Function able to create in MYSQL  if i don't call mysql_init,mysql_real_connect.... 

WOrking Code :

char *RemoteExecSql(UDF_INIT *initid, UDF_ARGS *args, char *result,
			   unsigned long *length, char *is_null, char *error) {

 MYSQL *conn;		// the connection
  MYSQL_RES *res;	// the results
  MYSQL_ROW row;	// the results row (line by line)
// conn=mysql_init(NULL);

if i uncomment "conn=mysql_init(NULL);" part,  function creation throws following error

19:17:09	create function RemoteExecSql returns string   SONAME 'ClassLib5.dll'	Error Code: 1126. Can't open shared library 'ClassLib5.dll' (errno: 126 The specified module could not be found.)	0.016 sec

VisualStudio version :2008
VS 2008 & MYSQl bit :64

please advice what i need to call mysql_init,mysql_real_connect....

How to repeat:
[18 Jun 2013 19:53] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

You can not call mysql_inint in UDF functions. They are supposed to be built together with server, not communicate with it using client API.
[19 Jun 2013 8:10] Ezhil Arasan
Thanks for your comment. is any way to run dynamic query in remote server?

For example . I need to run dynamic query(eg.create table /Sp) in Server B by server A through mySQL stored procedure /function not from programming language exe.
[19 Jun 2013 19:56] Sveta Smirnova
Thank you for the feedback.

Yes, you can. But this bug database is for handling bugs in MySQL code, not for help with usage issues.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

You should also consult this part of the user manual: http://dev.mysql.com/doc/refman/5.6/en/c-api.html
[27 Jun 2013 0:07] Ezhil Arasan
Thank you