Re: [HACKERS] ecpg fixes

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: hackers(at)postgreSQL(dot)org, sakaida(at)psn(dot)ne(dot)jp
Subject: Re: [HACKERS] ecpg fixes
Date: 1999-05-10 05:00:45
Message-ID: 199905100500.BAA23953@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Can someone comment on this? It looks like part of this is applied, but
not all of it.

> Included are patches for 4/1 snapshot, submitted by Masaaki Sakaida.
>
> o Allow ecpg handle a floating point constant having more than 10 places
> o Fix ecpg runtime library memory leak
> --
> Tatsuo Ishii
> ------------------------------------------------------------
> *** src/interfaces/ecpg/preproc/pgc.l.orig Thu Apr 1 17:41:04 1999
> --- src/interfaces/ecpg/preproc/pgc.l Thu Apr 1 17:41:10 1999
> ***************
> *** 461,466 ****
> --- 461,475 ----
> }
> return ICONST;
> }
> + <C>{real} {
> + char* endptr;
> +
> + errno = 0;
> + yylval.dval = strtod((char *)yytext,&endptr);
> + if (*endptr != '\0' || errno == ERANGE)
> + yyerror("ERROR: Bad float input");
> + return FCONST;
> + }
> <SQL>:{identifier}(("->"|\.){identifier})* {
> yylval.str = mm_strdup((char*)yytext+1);
> return(CVARIABLE);
>
> ------------------------------------------------------------
>
>
> ------------------------------------------------------------
> *** src/interfaces/ecpg/lib/ecpglib.c.orig Thu Apr 1 17:10:52 1999
> --- src/interfaces/ecpg/lib/ecpglib.c Thu Apr 1 17:22:12 1999
> ***************
> *** 370,375 ****
> --- 370,403 ----
> return (true);
> }
>
> + static void
> + free_variable(struct variable *var)
> + {
> + struct variable *var_next;
> +
> + if( var == (struct variable *)NULL )
> + return;
> + var_next = var->next;
> + free(var);
> +
> + while(var_next)
> + {
> + var = var_next;
> + var_next = var->next;
> + free(var);
> + }
> + }
> +
> + static void
> + free_statement(struct statement *stmt)
> + {
> + if( stmt == (struct statement *)NULL )
> + return;
> + free_variable(stmt->inlist);
> + free_variable(stmt->outlist);
> + free(stmt);
> + }
> +
> static char *
> next_insert(char *text)
> {
> ***************
> *** 981,987 ****
> status = false;
> }
>
> - PQclear(results);
> break;
> case PGRES_EMPTY_QUERY:
> /* do nothing */
> --- 1009,1014 ----
> ***************
> *** 1017,1022 ****
> --- 1044,1050 ----
> status = false;
> break;
> }
> + PQclear(results);
> }
>
> /* check for asynchronous returns */
> ***************
> *** 1037,1042 ****
> --- 1065,1071 ----
> va_list args;
> struct statement *stmt;
> struct connection *con = get_connection(connection_name);
> + bool status;
>
> if (con == NULL)
> {
> ***************
> *** 1057,1063 ****
> return false;
> }
>
> ! return (ECPGexecute(stmt));
> }
>
> bool
> --- 1086,1094 ----
> return false;
> }
>
> ! status = ECPGexecute(stmt);
> ! free_statement(stmt);
> ! return (status);
> }
>
> bool
>
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-05-10 05:03:22 Re: [HACKERS] Parser bug: alias is a "non-group column"?
Previous Message Bruce Momjian 1999-05-10 04:53:13 Re: [HACKERS] INSERT INTO