|
1 |
| -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.242 2003/06/29 09:25:19 meskes Exp $ */ |
| 1 | +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.243 2003/06/29 16:52:58 meskes Exp $ */ |
2 | 2 |
|
3 | 3 | /* Copyright comment */
|
4 | 4 | %{
|
@@ -2706,7 +2706,10 @@ cursor_options: /* EMPTY */ { $$ = EMPTY; }
|
2706 | 2706 | | cursor_options NO SCROLL { $$ = cat2_str($1, make_str("no scroll")); }
|
2707 | 2707 | ;
|
2708 | 2708 |
|
2709 |
| -opt_hold: /* EMPTY */ { $$ = EMPTY; } |
| 2709 | +opt_hold: /* EMPTY */ { if (compat == ECPG_COMPAT_INFORMIX_SE && autocommit == true) |
| 2710 | + $$ = make_str("with hold"); |
| 2711 | + else |
| 2712 | + $$ = EMPTY; } |
2710 | 2713 | | WITH HOLD { $$ = make_str("with hold"); }
|
2711 | 2714 | | WITHOUT HOLD { $$ = make_str("without hold"); }
|
2712 | 2715 | ;
|
@@ -4449,7 +4452,7 @@ single_vt_type: common_type
|
4449 | 4452 | }
|
4450 | 4453 | else if (strcmp($1, "decimal") == 0)
|
4451 | 4454 | {
|
4452 |
| - $$.type_enum = ECPGt_numeric; |
| 4455 | + $$.type_enum = ECPGt_decimal; |
4453 | 4456 | $$.type_str = make_str("Numeric");
|
4454 | 4457 | $$.type_dimension = make_str("-1");
|
4455 | 4458 | $$.type_index = make_str("-1");
|
@@ -4751,7 +4754,7 @@ common_type: simple_type
|
4751 | 4754 | if (strcmp($1, "numeric") != 0 && strcmp($1, "decimal") != 0)
|
4752 | 4755 | mmerror(PARSE_ERROR, ET_ERROR, "Only numeric/decimal have precision/scale argument");
|
4753 | 4756 |
|
4754 |
| - $$.type_enum = ECPGt_numeric; |
| 4757 | + $$.type_enum = (strcmp($1, "numeric") != 0) ? ECPGt_decimal : ECPGt_numeric; |
4755 | 4758 | $$.type_str = make_str("Numeric");
|
4756 | 4759 | $$.type_dimension = make_str("-1");
|
4757 | 4760 | $$.type_index = make_str("-1");
|
@@ -4803,7 +4806,7 @@ var_type: common_type
|
4803 | 4806 | }
|
4804 | 4807 | else if (strcmp($1, "decimal") == 0)
|
4805 | 4808 | {
|
4806 |
| - $$.type_enum = ECPGt_numeric; |
| 4809 | + $$.type_enum = ECPGt_decimal; |
4807 | 4810 | $$.type_str = make_str("Numeric");
|
4808 | 4811 | $$.type_dimension = make_str("-1");
|
4809 | 4812 | $$.type_index = make_str("-1");
|
@@ -5073,6 +5076,21 @@ variable: opt_pointer ECPGColLabelCommon opt_array_bounds opt_initializer
|
5073 | 5076 | $$ = cat_str(4, $1, mm_strdup($2), $3.str, $4);
|
5074 | 5077 | break;
|
5075 | 5078 |
|
| 5079 | + case ECPGt_decimal: /* this is used by informix and need to be initialized */ |
| 5080 | + if (atoi(dimension) < 0) |
| 5081 | + type = ECPGmake_simple_type(ECPGt_numeric, make_str("1")); |
| 5082 | + else |
| 5083 | + type = ECPGmake_array_type(ECPGmake_simple_type(ECPGt_numeric, make_str("1")), dimension); |
| 5084 | + |
| 5085 | + if (strlen($4) == 0) |
| 5086 | + { |
| 5087 | + $4 = mm_alloc(sizeof(" = {0, 0, 0, 0, 0, NULL, NULL}")); |
| 5088 | + strcpy($4, " = {0, 0, 0, 0, 0, NULL, NULL}"); |
| 5089 | + } |
| 5090 | + |
| 5091 | + $$ = cat_str(4, $1, mm_strdup($2), $3.str, $4); |
| 5092 | + |
| 5093 | + break; |
5076 | 5094 | default:
|
5077 | 5095 | if (atoi(dimension) < 0)
|
5078 | 5096 | type = ECPGmake_simple_type(actual_type[struct_level].type_enum, make_str("1"));
|
|
0 commit comments