summaryrefslogtreecommitdiffstats
path: root/src/interfaces/ecpg/preproc/parse.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/parse.pl')
-rw-r--r--src/interfaces/ecpg/preproc/parse.pl37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index dee6b82..468e5be 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -24,7 +24,8 @@ my $brace_indent = 0;
my $yaccmode = 0;
my $in_rule = 0;
my $header_included = 0;
-my $feature_not_supported = 0;
+my $has_feature_not_supported = 0;
+my $has_if_command = 0;
my $tokenmode = 0;
my (%buff, $infield, $comment, %tokens, %addons);
@@ -136,12 +137,6 @@ sub main
{
line: while (<>)
{
- if (/ERRCODE_FEATURE_NOT_SUPPORTED/)
- {
- $feature_not_supported = 1;
- next line;
- }
-
chomp;
# comment out the line below to make the result file match (blank line wise)
@@ -167,6 +162,13 @@ sub main
$infield = 0;
}
+ if ($yaccmode == 1)
+ {
+ # Check for rules that throw FEATURE_NOT_SUPPORTED
+ $has_feature_not_supported = 1 if /ERRCODE_FEATURE_NOT_SUPPORTED/;
+ $has_if_command = 1 if /^\s*if/;
+ }
+
my $prec = 0;
# Make sure any braces are split
@@ -512,20 +514,17 @@ sub dump_fields
#Normal
add_to_buffer('rules', $ln);
- if ($feature_not_supported == 1)
+ if ($has_feature_not_supported and not $has_if_command)
{
-
- # we found an unsupported feature, but we have to
- # filter out ExecuteStmt: CREATE OptTemp TABLE ...
- # because the warning there is only valid in some situations
- if ($flds->[0] ne 'create' || $flds->[2] ne 'table')
- {
- add_to_buffer('rules',
- 'mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");'
- );
- }
- $feature_not_supported = 0;
+ # The backend unconditionally reports
+ # FEATURE_NOT_SUPPORTED in this rule, so let's emit
+ # a warning on the ecpg side.
+ add_to_buffer('rules',
+ 'mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");'
+ );
}
+ $has_feature_not_supported = 0;
+ $has_if_command = 0;
if ($len == 0)
{