Skip to Content.
Sympa Menu

freetds - Re: [freetds] request to implement dbmorecmds for dblib

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bill Stewart <bstewart AT verio.net>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] request to implement dbmorecmds for dblib
  • Date: Tue, 08 Apr 2003 15:02:20 -0400

James,

I have been working on getting the build setup on our servers for dbmorecmds for a bit now and here is what is going on:

For the freetds-0.62.dev.20030407 version, I can't seem to get it to build because of the following:

-----------------------------------------------------------------------
<snip lots of other make output>
for the gmake[3]: Nothing to be done for `all'.
gmake[3]: Leaving directory `/usr/shared/bstewart/autobahn/freetds-0.62.dev.20030407/src/tds/unittests'
gmake[3]: Entering directory `/usr/shared/bstewart/autobahn/freetds-0.62.dev.20030407/src/tds'
source='mem.c' object='mem.lo' libtool=yes \
depfile='.deps/mem.Plo' tmpdepfile='.deps/mem.TPlo' \
depmode=gcc /usr/local/bin/bash ../../depcomp \
/usr/local/bin/bash ../../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -DTDS50 -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c -o mem.lo `test -f 'mem.c' || echo './'`mem.c
cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -DTDS50 -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c mem.c -Wp,-MD,.deps/mem.TPlo -fPIC -DPIC -o .libs/mem.o
In file included from ../../include/tds.h:33,
from mem.c:36:
../../include/tdsiconv.h:60: syntax error before `iconv_t'
../../include/tdsiconv.h:64: syntax error before `ICONV_CONST'
../../include/tdsiconv.h:64: warning: function declaration isn't a prototype
mem.c: In function `tds_alloc_socket':
mem.c:657: structure has no member named `to_wire'
mem.c:657: `iconv_t' undeclared (first use in this function)
mem.c:657: (Each undeclared identifier is reported only once
mem.c:657: for each function it appears in.)
mem.c:658: structure has no member named `from_wire'
gmake[3]: *** [mem.lo] Error 1
gmake[3]: Leaving directory `/usr/shared/bstewart/autobahn/freetds-0.62.dev.20030407/src/tds'
<snip>

I also took the changes you made for dbmorecmds and tried to put them back in the freetds-0.61 version, since I could get that to build and it seems like it is always returns 1.

I took the diffs from cvs for dblib.c and sybdb.h, were there other changes that I might have missed?

Here is the diff for the changes to dblib.c that I put into 0.61:
-----------------------------------------------------------------

diff -u dblib.c.orig dblib.c
--- dblib.c.orig Tue Apr 8 12:09:38 2003
+++ dblib.c Tue Apr 8 14:58:04 2003
@@ -1023,6 +1023,11 @@

done = 0;

+ if (dbproc->dbresults_state & DBRESCMDS) {
+ dbproc->dbresults_state &= ~DBRESCMDS;
+ return dbproc->dbresults_retcode;
+ }
+
while (!done && (retcode = tds_process_result_tokens(tds, &result_type)) == TDS_SUCCEED) {
tdsdump_log(TDS_DBG_FUNC, "%L inside dbresults_r() result_type = %d retcode = %d\n", result_type, retcode);
switch (result_type) {
@@ -3584,8 +3589,20 @@
RETCODE
dbmorecmds(DBPROCESS * dbproc)
{
- tdsdump_log(TDS_DBG_FUNC, "%L UNIMPLEMENTED dbmorecmds()\n");
- return SUCCEED;
+ RETCODE rc;
+
+ tdsdump_log(TDS_DBG_FUNC, "%L inside dbmorecmds()\n");
+ /*
+ * Call dbresults, stow its return code and mark its state as "already called".
+ * Then return an interpretation of the return code.
+ * When the caller follows up with dbresults(),
+ * it will return the saved return code immediately. */
+
+ rc = dbresults_r(dbproc, 0);
+ dbproc->dbresults_state |= DBRESCMDS;
+ dbproc->dbresults_retcode = rc;
+ printf ("dbresults_retcode [%d]\n", rc);
+ return (rc == SUCCEED) ? SUCCEED : FAIL;
}

int

--------------------------------------------------------------------
Here is the diff for what I put into sybdb.h

diff -u sybd.h.orig sybdb.h
diff: sybd.h.orig: No such file or directory
mmmdev01 # diff -u sybdb.h.orig sybdb.h
--- sybdb.h.orig Tue Apr 8 14:31:01 2003
+++ sybdb.h Tue Apr 8 14:36:37 2003
@@ -92,6 +92,7 @@

#define BCPLABELED 5
#define BCPHINTS 6
+#define DBRESCMDS 0x80

typedef int RETCODE;

@@ -336,6 +337,8 @@
int noautofree;
int more_results; /* boolean. Are we expecting results? */
int empty_result; /* boolean. has dbsqlok eaten the results ? */
+ int dbresults_state;
+ int dbresults_retcode;
BYTE *user_data; /* see dbsetuserdata() and dbgetuserdata() */
unsigned char *dbbuf; /* is dynamic! */
int dbbufsz;
----------------------------------------------------------------------

Let me know what you think I should try now.

TIA,

Bill Stewart

Lowden, James K wrote:
From: Bill Stewart [mailto:bstewart AT verio.net]
Sent: April 4, 2003 11:00 AM

If someone might be interested in implementing or helping to implement dbmorecmds in Freetds dblib I would very much appreciate hearing from you.


Oh, what the dickens.
It's implemented in CVS, per my prior description. Once I figured out what
to do, the coding was simple. Please give the next snapshot a try and let
me know.
--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.


_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds







Archive powered by MHonArc 2.6.24.

Top of Page