]> granicus.if.org Git - postgresql/commitdiff
In ecpg preprocessor, don't try to look up constants in the test for
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 11 Mar 2011 13:44:40 +0000 (15:44 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 11 Mar 2011 15:23:31 +0000 (17:23 +0200)
variable hiding. A constant is not a variable. It worked in most cases by
accident, because we add constants to the global list of variables (why?),
but float constants like 1.23 were interpreted as struct field references,
and not found.

Backpatch to 9.0, where the test for variable hiding was added.

src/interfaces/ecpg/preproc/type.c

index eb7d4aeb9bc3df30e9a4b2028e7049eaa4c0cb11..1b8a2a698f4f209a68a723df064c700e748d8f5d 100644 (file)
@@ -245,7 +245,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, const int bra
        struct variable *var;
 
        if (type->type != ECPGt_descriptor && type->type != ECPGt_sqlda &&
-               type->type != ECPGt_char_variable &&
+               type->type != ECPGt_char_variable && type->type != ECPGt_const &&
                brace_level >= 0)
        {
                char       *str;