> The problem shows up in the function packet2result in the 
> module vin77.c.
> In the tests that I ran, the client returned the correct information;
> however, packet2result treated the buffer as if it contained 
> a length and a
> unterminated character string.  It calls SL_fromString to generate the
> results.  Depending on what is in the buffer, this produces 
> some interesting
> results.

The problem is that packet2result has no information about the structure of
the buffer returned from the kernel. And it hasn't this information because
it didn't ask for it (see patch below). 

@@ -4626,6 +4627,7 @@
     initResult (result, 0);
     do {
         i28initadbs (session);
+        session->segment->variant.C_3.sp1c_with_info_F = true;
         i28pcmd (session, cmd, UNDEF_SP00);
         if (getAutocommit (session)) {
             session->segment->variant.C_3.sp1c_commit_immediately_F = true;

sqlX will always do a prepare (which returns this information) and then an
execute (with a possible empty list of parameters), so it never runs into
this problem.

> The one odd case is the Python snippet that follows:
> 
>       cmmd = 'select first msgno, msgtext from messages where 
> msgno between 200
> and 700'
>       result = session.sql (cmmd)
>       result = session.sqlX (cmmd)
> 
> sql returned a character string while sqlX returned the 
> following error
> message:
> 
>       'sapdb.SQLError: [-5015] (at 29) Missing
> keyword:YEARS,WRITE,WORK,WHILE,WHENEVER,
>       WAIT,VTRACE,VSIZE,VIEW'
> 

There are a few anomalies regarding what is possible when executing SQL
directly (session.sql ()) and when doing a prepare first (which session.sqlX
() does internally). I'm afraid this is one of them.

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to