Skip to content

Commit a79f819

Browse files
author
Michael Meskes
committed
'::' is no longer interpreted as a variable in a prepare statement.
1 parent 125bb6c commit a79f819

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,11 @@ Mon Sep 27 11:05:49 CEST 2004
18641864

18651865
- Synced parser.
18661866
- Removed Oracle transaction syntax to fix shift/reduce error.
1867+
1868+
Tue Oct 5 12:45:48 CEST 2004
1869+
1870+
- '::' is no longer interpreted as a variable in a prepare statement.
1871+
Added patch by Daniel Verite to fix this.
18671872
- Set ecpg version to 3.2.0.
18681873
- Set compat library version to 1.2.
18691874
- Set ecpg library version to 4.2.

src/interfaces/ecpg/ecpglib/prepare.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.12 2004/05/21 13:50:12 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.13 2004/10/05 10:48:37 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -46,9 +46,14 @@ replace_variables(char *text)
4646

4747
if (!string && *ptr == ':')
4848
{
49-
*ptr = '?';
50-
for (++ptr; *ptr && isvarchar(*ptr); ptr++)
51-
*ptr = ' ';
49+
if (ptr[1]==':')
50+
ptr+=2; /* skip '::' */
51+
else
52+
{
53+
*ptr = '?';
54+
for (++ptr; *ptr && isvarchar(*ptr); ptr++)
55+
*ptr = ' ';
56+
}
5257
}
5358
}
5459
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy