summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-01-23 15:20:24 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-01-25 08:34:54 +0000
commite7827d556c302965af352b186a5cec86b548cf2a (patch)
tree48ebabe53a4d1e6d7ccc4a12907d0eb21243709c /connectivity
parent13421b4c424e7a2372382d7011f31e9795e01fd7 (diff)
OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup
Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04 Reviewed-on: https://gerrit.libreoffice.org/1826 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/parse/sqlbison.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 96d078291d5f..a0f7d43fe9af 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4772,7 +4772,18 @@ sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString & rValue)
//-----------------------------------------------------------------------------
OSQLParseNode::Rule OSQLParser::RuleIDToRule( sal_uInt32 _nRule )
{
- return s_aReverseRuleIDLookup[ _nRule ];
+ OSQLParser::RuleIDMap::const_iterator i (s_aReverseRuleIDLookup.find(_nRule));
+ if (i == s_aReverseRuleIDLookup.end())
+ {
+ SAL_WARN("connectivity.parse",
+ "connectivity::OSQLParser::RuleIDToRule cannot reverse-lookup rule. "
+ "Reverse mapping incomplete? "
+ "_nRule='" << _nRule << "' "
+ "yytname[_nRule]='" << yytname[_nRule] << "'");
+ return OSQLParseNode::UNKNOWN_RULE;
+ }
+ else
+ return i->second;
}
//-----------------------------------------------------------------------------