Discussion:
Sybase 15.7 ESQL/C problem/bug
(too old to reply)
Rebelde
2013-03-25 13:20:25 UTC
Permalink
Hello,

(Is this group still alive?)

I'm porting our applications from Sybase 15.0.3 ESQL/C to 15.7 and encounter
the following prolem or bug in the generated C-code of Sybase's CPRE:

$ env | egrep 'SYB|PLA'
DSQUERY=sisisSYB157
SYBASE_OCS=OCS
SYBPLATFORM=sun_svr464
SYBASE=/data/sybase157


$ /data/sybase157/OCS-15_0/bin/cpre64 -v
Sybase ESQL/C Precompiler/15.7/P-EBF19582 ESD #1/DRV.15.7.0.1/SPARC/Solaris
10/BUILD1570-012/64bit/OPT/Thu Dec 8 01:57:08 2011
...

$ cat my.ec
#include <stdio.h>
#include "sybsqlex.h"

EXEC SQL INCLUDE sqlca;

EXEC SQL BEGIN DECLARE SECTION;
struct mytable {
char tstchar[26];
long tstint;
} myt;
typedef struct mytable t_mytable;
EXEC SQL END DECLARE SECTION;

int openc()
{

EXEC SQL BEGIN DECLARE SECTION;
t_mytable *aaa = myt;
EXEC SQL END DECLARE SECTION;

EXEC SQL OPEN dbctest_scr USING :aaa->tstint;

}

$ /data/sybase157/OCS-15_0/bin/cpre64 -r -a -w -l -y my.ec

$ fgrep tstint my.c
long tstint;
** EXEC SQL OPEN dbctest_scr USING :aaa->tstint;
&_sql->dfmtCS_LONG_TYPE,&tstint,

Note the wrong argument '&tstint' instead of something like &(aaa->tstint);
of course the CC will not understand this;

it looks a bit like an older bug 52113, just google for

sybase 52113 cs_connect

Any ideas?

matthias
--
Matthias Apitz
UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370)
UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5
rebelde
2013-04-12 13:26:56 UTC
Permalink
Post by Rebelde
Note the wrong argument '&tstint' instead of something like
&(aaa->tstint); of course the CC will not understand this;
it looks a bit like an older bug 52113, just google for
sybase 52113 cs_connect
A similar bug was already mentioned in

SYBASE Technical News, vol 3 num 4
by Leigh Ann Huss ยป Wed, 16 Nov 1994 03:04:54 GMT

http://www.mofeel.net/261-comp-databases-sybase/29988ad670.aspx

which describes exactly the same bug:

Bugs Fixed in Embedded SQL/C 10.0.2
-----------------------------------
Bug # Description
----- -----------
...

52113 insert into xx (y,z) values (:INTSTRU1)-- where INTSTRU1 is struct
{long INTSTEL1}INTSTRU1, precompiler generates code of --
_sql->retcode = cs_convert(_sql->ctx,&_sql->dfmtCS_LONG_TYPE,&INTSTEL1).
Notice that &INTSTEL1 should be &INTSTRU1.INTSTEL1.
...

Meanwhile Sybase.com (or SAP.com) has recognised the issue as CR 726982 and will fix
it soon, hopefully.

Matthias
b***@sybase.com
2013-05-07 19:58:52 UTC
Permalink
Post by Rebelde
(Is this group still alive?)
Barely. Traffic has been shrinking steadily in recent years, much of it having moved to the Sybase-hosted sybase.public.ase.* newsgroups. Those newsgroups have recently been decommissioned by SAP in favor of topic areas on the SAP Community Network (http://scn.sap.com/welcome).

For ASE issues in general, there is the http://scn.sap.com/community/sybase-ase-custom-applications area and for issues with SAP solutions running on ASE there is the "SAP on Sybase ASE" area http://scn.sap.com/community/sybase-ase. There are other areas for other Sybase products as well, such as Powerbuilder and Sybase Unwired Platform.

So I still check in here now and then, but I'm now most active on SCN.sap.com.

-bret

Loading...