Fixed segfault after error in parsing precision argument.
authorMichael Meskes <meskes@postgresql.org>
Fri, 26 Sep 2003 15:16:29 +0000 (15:16 +0000)
committerMichael Meskes <meskes@postgresql.org>
Fri, 26 Sep 2003 15:16:29 +0000 (15:16 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/preproc.y

index 742cd66c86f6243150d39d62179e1ec3ccb6b91b..15b7af94c6dfa58339fba627c2e4b485493a8c1d 100644 (file)
@@ -1656,6 +1656,11 @@ Tue Sep 23 14:50:45 CEST 2003
 
    - Changed struct definition handling so "struct foo {}" always gets
      defined.
+     
+Fri Sep 26 17:14:07 CEST 2003
+
+   - Incorrect datatype with precision argument should not create a
+     segfault.
    - Set ecpg version to 3.0.0
    - Set ecpg library to 4.0.0
    - Set pgtypes library to 1.0.0
index b49a85af4ffdd77e662b24584c664cfda186c034..2008c42c9cd61722d421e40ee1fe2f2e8f30e8f1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.260 2003/09/24 19:05:32 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.261 2003/09/26 15:16:29 meskes Exp $ */
 
 /* Copyright comment */
 %{
@@ -4785,7 +4785,11 @@ common_type: simple_type
                $$.type_str = make_str("decimal");
            }
            else
+           {
                mmerror(PARSE_ERROR, ET_ERROR, "Only numeric/decimal have precision/scale argument");
+               $$.type_enum = ECPGt_numeric;
+               $$.type_str = make_str("numeric");
+           }
            
            $$.type_dimension = make_str("-1");
            $$.type_index = make_str("-1");