Thanks Gustaf,

Trying nsdbmysql now.

Getting a few compiler warnings when building - are these all fairly benign?

gcc -I/usr/include/mysql -g -Wall -fPIC -g -O2
-fdebug-prefix-map=/build/tcl8.6-EAf4Te/tcl8.6-8.6.6+dfsg=.
-fstack-protector-strong -Wformat -Werror=format-security
-fno-unit-at-a-time -pipe -Wdate-time -D_FORTIFY_SOURCE=2
-I/usr/local/ns/include -I"/usr/include/tcl8.6"  -DHAVE_CONFIG_H    -c -o
nsdbmysql.o nsdbmysql.c
nsdbmysql.c: In function ‘Ns_DbDriverInit’:
nsdbmysql.c:120:29: warning: passing argument 1 of ‘Ns_RegisterProcInfo’
from incompatible pointer type [-Wincompatible-pointer-types]
         Ns_RegisterProcInfo(AtExit, "dbimy:cleanshutdown", NULL);
                             ^~~~~~
In file included from nsdbmysql.c:36:0:
/usr/local/ns/include/ns.h:2151:1: note: expected ‘ns_funcptr_t {aka void
(*)(void)}’ but argument is of type ‘void (*)(void *)’
 Ns_RegisterProcInfo(ns_funcptr_t procAddr, const char *desc, Ns_ArgProc
*argProc)
 ^~~~~~~~~~~~~~~~~~~
nsdbmysql.c: In function ‘DbGetRow’:
nsdbmysql.c:339:61: warning: format ‘%d’ expects argument of type ‘int’,
but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
         Ns_Log(Error, "DbGetRow: Number of columns in row (%d)"
                                                             ^
nsdbmysql.c: In function ‘DbServerInit’:
nsdbmysql.c:690:34: warning: passing argument 2 of ‘Ns_TclRegisterTrace’
from incompatible pointer type [-Wincompatible-pointer-types]
     Ns_TclRegisterTrace(hServer, DbInterpInit, NULL, NS_TCL_TRACE_CREATE);
                                  ^~~~~~~~~~~~
In file included from nsdbmysql.c:36:0:
/usr/local/ns/include/ns.h:3039:1: note: expected ‘int (*)(Tcl_Interp *,
const void *) {aka int (*)(struct Tcl_Interp *, const void *)}’ but
argument is of type ‘int (*)(Tcl_Interp *, void *) {aka int (*)(struct
Tcl_Interp *, void *)}’
 Ns_TclRegisterTrace(const char *server, Ns_TclTraceProc *proc, const void
*arg, Ns_TclTraceType when)
 ^~~~~~~~~~~~~~~~~~~
nsdbmysql.c: In function ‘InitThread’:
nsdbmysql.c:743:19: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     initialised = (int) Ns_TlsGet(&tls);
                   ^
nsdbmysql.c: In function ‘CleanupThread’:
nsdbmysql.c:754:23: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     int initialised = (int) arg;
                       ^
At top level:
nsdbmysql.c:34:24: warning: ‘RCSID’ defined but not used [-Wunused-variable]
 static const char     *RCSID = "$Id$";
                        ^~~~~






On Fri, 3 May 2019 at 21:59, Gustaf Neumann <neum...@wu.ac.at> wrote:

> On 03.05.19 16:35, David Osborne wrote:
> > I was hoping someone could help us understand what's happening below.
> >
> > We use the nsdbpg driver to access our main PostgreSQL database, but
> > we have a requirement to occasionally access a MysQL server database
> also.
> >
> > We thought Tcl8.6's tdbc might be an easy way to do this...
>
> the recommended approach is to use one of the NaviServer drivers for
> mysql (e.g nsdbmysql or nsdbimy).
>
> The problem seems to be, that the Tcl package you are using is not
> serializable for the blueprints. In general, it is not so clear, what
> should happen with (maybe open) Tcl managed connections, when the
> blueprint is reloaded.  Using the connection pools of the NaviServer
> modules are probably faster, easier to manage and agnostic to blueprint
> reloading.
>
> all the best
> -gn
>
>
>
> --
> Univ.Prof. Dr. Gustaf Neumann
> WU Vienna
> Institute of Information Systems and New Media
> Welthandelsplatz 1, A-1020 Vienna, Austria
>
>
>
> _______________________________________________
> naviserver-devel mailing list
> naviserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel
>


-- 

*David Osborne | Software Engineer*
Qcode Software, Castle House, Fairways Business Park, Inverness, IV2 6AA
*Email:* da...@qcode.co.uk | *Phone:* 01463 896 484
www.qcode.co.uk
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to