Re: ecpg enhance patch

From: SAKAIDA Masaaki <sakaida(at)psn(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ecpg enhance patch
Date: 2000-06-03 02:22:19
Message-ID: 39386BDB2BC.2256SAKAIDA@smtp.psn.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:

> Can I get a comment on this? It has not been applied. It appears to
> apply to an older release. New new file name is
> interfaces/ecpg/lib/execute.c.

The following patch could solve the next error cases in 6.5.3-ecpglib.

case 1.
strcpy(str, "T''EST'TEST");
exec sql insert into ecpg_test values ( 11, :str, 'kobe' ) ;

error(-201)(Too many arguments line 1025.

case 2.
str( str, "T'''?'ESTTEST");
exec sql insert into ecpg_test values ( 11, :str, 'kobe' ) ;

error(-202)(Too few arguments line 1024.)

However, these problems seems to be solved in 7.0-ecpglib.

> > Here is a patch that would enhance the efficiency in that skip strings
> > which have been already checked. The patch was made by Kazuko
> > Nakagawa. Michael, can you comment on this?
> >
> > *** ecpglib.c.orig Wed Dec 22 13:13:21 1999
> > --- ecpglib.c Wed Dec 22 13:37:32 1999
> > ***************
> > *** 398,403 ****
> > --- 398,404 ----
> > PGresult *results;
> > PGnotify *notify;
> > struct variable *var;
> > + int hostvarl = 0;
> >
> > copiedquery = ecpg_strdup(stmt->command, stmt->lineno);
> >
> > ***************
> > *** 569,575 ****
> > return false;
> >
> > strcpy(newcopy, copiedquery);
> > ! if ((p = next_insert(newcopy)) == NULL)
> > {
> >
> > /*
> > --- 570,576 ----
> > return false;
> >
> > strcpy(newcopy, copiedquery);
> > ! if ((p = next_insert(newcopy+hostvarl)) == NULL)
> > {
> >
> > /*
> > ***************
> > *** 582,587 ****
> > --- 583,589 ----
> > else
> > {
> > strcpy(p, tobeinserted);
> > + hostvarl = strlen(newcopy);
> >
> > /*
> > * The strange thing in the second argument is the rest of the
> >
> >
> > ************

--
Regards,
SAKAIDA Masaaki -- Osaka, Japan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-06-03 02:50:35 Re: Problems with recent CVS versions and Solaris.
Previous Message Lamar Owen 2000-06-03 00:26:55 Re: config files in /data