LibreOffice Module connectivity (master) 1
|
#include <sqlnode.hxx>
Public Member Functions | |
OSQLParseNode (const char *_pValueStr, SQLNodeType _eNodeType, sal_uInt32 _nNodeID=0) | |
OSQLParseNode (std::string_view _rValue, SQLNodeType eNewNodeType, sal_uInt32 nNewNodeID=0) | |
OSQLParseNode (OUString _sValue, SQLNodeType _eNodeType, sal_uInt32 _nNodeID=0) | |
OSQLParseNode (const OSQLParseNode &rParseNode) | |
OSQLParseNode & | operator= (const OSQLParseNode &rParseNode) |
bool | operator== (OSQLParseNode const &rParseNode) const |
virtual | ~OSQLParseNode () |
OSQLParseNode * | getParent () const |
void | setParent (OSQLParseNode *pParseNode) |
size_t | count () const |
OSQLParseNode * | getChild (sal_uInt32 nPos) const |
void | append (OSQLParseNode *pNewSubTree) |
void | insert (sal_uInt32 nPos, OSQLParseNode *pNewSubTree) |
void | replaceAndDelete (OSQLParseNode *pOldSubTree, OSQLParseNode *pNewSubTree) |
OSQLParseNode * | removeAt (sal_uInt32 nPos) |
void | replaceNodeValue (const OUString &rTableAlias, const OUString &rColumnName) |
bool | parseNodeToExecutableStatement (OUString &_out_rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, OSQLParser &_rParser, css::sdbc::SQLException *_pErrorHolder) const |
parses the node to a string which can be passed to a driver's connection for execution More... | |
void | parseNodeToStr (OUString &rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const IParseContext *pContext=nullptr, bool _bIntl=false, bool _bQuote=true) const |
void | parseNodeToPredicateStr (OUString &rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::lang::Locale &rIntl, OUString _sDec, const IParseContext *pContext=nullptr) const |
void | parseNodeToPredicateStr (OUString &rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::uno::Reference< css::beans::XPropertySet > &_xField, const OUString &_sTableAlias, const css::lang::Locale &rIntl, OUString strDec, const IParseContext *pContext=nullptr) const |
OSQLParseNode * | getByRule (OSQLParseNode::Rule eRule) const |
void | showParseTree (OUString &rString) const |
void | showParseTree (OUStringBuffer &_inout_rBuf, sal_uInt32 nLevel) const |
SQLNodeType | getNodeType () const |
sal_uInt32 | getRuleID () const |
Rule | getKnownRuleID () const |
returns the ID of the rule represented by the node If the node does not represent a rule, UNKNOWN_RULE is returned More... | |
sal_uInt32 | getTokenID () const |
bool | isRule () const |
bool | isToken () const |
const OUString & | getTokenValue () const |
bool | isLeaf () const |
Static Public Member Functions | |
static void | negateSearchCondition (OSQLParseNode *&pSearchCondition, bool bNegate=false) |
static void | disjunctiveNormalForm (OSQLParseNode *&pSearchCondition) |
static void | absorptions (OSQLParseNode *&pSearchCondition) |
static void | eraseBraces (OSQLParseNode *&pSearchCondition) |
static void | compress (OSQLParseNode *&pSearchCondition) |
static bool | getTableComponents (const OSQLParseNode *_pTableNode, css::uno::Any &_rCatalog, OUString &_rSchema, OUString &_rTable, const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData) |
static void | substituteParameterNames (OSQLParseNode const *_pNode) |
static OUString | getTableRange (const OSQLParseNode *_pTableRef) |
return a table range when it exists. More... | |
Protected Member Functions | |
void | parseNodeToStr (OUString &rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter, const css::uno::Reference< css::beans::XPropertySet > &_xField, const OUString &_sPredicateTableAlias, const css::lang::Locale &rIntl, const IParseContext *pContext, bool _bIntl, bool _bQuote, OUString _sDecSep, bool _bPredicate) const |
Private Member Functions | |
void | impl_parseNodeToString_throw (OUStringBuffer &rString, const SQLParseNodeParameter &rParam, bool bSimple=true) const |
void | impl_parseLikeNodeToString_throw (OUStringBuffer &rString, const SQLParseNodeParameter &rParam, bool bSimple=true) const |
void | impl_parseTableRangeNodeToString_throw (OUStringBuffer &rString, const SQLParseNodeParameter &rParam) const |
bool | impl_parseTableNameNodeToString_throw (OUStringBuffer &rString, const SQLParseNodeParameter &rParam) const |
parses a table_name node into a SQL statement particle. More... | |
bool | addDateValue (OUStringBuffer &rString, const SQLParseNodeParameter &rParam) const |
void | parseLeaf (OUStringBuffer &rString, const SQLParseNodeParameter &rParam) const |
Static Private Member Functions | |
static OUString | convertDateTimeString (const SQLParseNodeParameter &rParam, const OUString &rString) |
static OUString | convertDateString (const SQLParseNodeParameter &rParam, std::u16string_view rString) |
static OUString | convertTimeString (const SQLParseNodeParameter &rParam, std::u16string_view rString) |
Private Attributes | |
std::vector< std::unique_ptr< OSQLParseNode > > | m_aChildren |
OSQLParseNode * | m_pParent |
OUString | m_aNodeValue |
SQLNodeType | m_eNodeType |
sal_uInt32 | m_nNodeID |
Friends | |
class | OSQLParser |
Definition at line 103 of file sqlnode.hxx.
Definition at line 120 of file sqlnode.hxx.
connectivity::OSQLParseNode::OSQLParseNode | ( | const char * | _pValueStr, |
SQLNodeType | _eNodeType, | ||
sal_uInt32 | _nNodeID = 0 |
||
) |
Definition at line 1580 of file sqlnode.cxx.
References connectivity::Concat, m_eNodeType, and connectivity::Rule.
Referenced by absorptions(), compress(), disjunctiveNormalForm(), negateSearchCondition(), operator=(), OSQLParseNode(), replaceNodeValue(), and substituteParameterNames().
connectivity::OSQLParseNode::OSQLParseNode | ( | std::string_view | _rValue, |
SQLNodeType | eNewNodeType, | ||
sal_uInt32 | nNewNodeID = 0 |
||
) |
Definition at line 1591 of file sqlnode.cxx.
References connectivity::Concat, m_eNodeType, and connectivity::Rule.
connectivity::OSQLParseNode::OSQLParseNode | ( | OUString | _sValue, |
SQLNodeType | _eNodeType, | ||
sal_uInt32 | _nNodeID = 0 |
||
) |
Definition at line 1602 of file sqlnode.cxx.
References connectivity::Concat, m_eNodeType, and connectivity::Rule.
connectivity::OSQLParseNode::OSQLParseNode | ( | const OSQLParseNode & | rParseNode | ) |
Definition at line 1613 of file sqlnode.cxx.
References append(), m_aChildren, m_aNodeValue, m_eNodeType, m_nNodeID, m_pParent, and OSQLParseNode().
|
virtual |
Definition at line 1672 of file sqlnode.cxx.
|
static |
Definition at line 2038 of file sqlnode.cxx.
References absorptions(), append(), boolean_primary, boolean_term, eraseBraces(), getByRule(), getChild(), connectivity::MakeANDNode(), connectivity::MakeORNode(), nPos, OSQLParseNode(), connectivity::Punctuation, removeAt(), connectivity::Rule, connectivity::OSQLParser::RuleID(), search_condition, and SQL_ISRULE.
Referenced by absorptions(), disjunctiveNormalForm(), and eraseBraces().
|
private |
Definition at line 1691 of file sqlnode.cxx.
References connectivity::SQLParseNodeParameter::aMetaData, connectivity::SQLParseNodeParameter::bPredicate, convertDateString(), convertDateTimeString(), convertTimeString(), D, getNodeType(), connectivity::Keyword, m_aChildren, set_fct_spec, dbtools::DatabaseMetaData::shouldEscapeDateTime(), SQL_ISPUNCTUATION, SQL_ISRULE, SQL_ISTOKEN, and TS.
Referenced by impl_parseNodeToString_throw().
void connectivity::OSQLParseNode::append | ( | OSQLParseNode * | pNewSubTree | ) |
Definition at line 1677 of file sqlnode.cxx.
References getParent(), m_aChildren, and setParent().
Referenced by absorptions(), connectivity::OSQLParser::buildNode_Date(), compress(), connectivity::MakeANDNode(), connectivity::MakeORNode(), negateSearchCondition(), operator=(), OSQLParseNode(), replaceNodeValue(), and connectivity::ado::OPreparedStatement::replaceParameterNodeName().
|
static |
Definition at line 2141 of file sqlnode.cxx.
References append(), boolean_primary, boolean_term, compress(), count(), eraseBraces(), getChild(), getParent(), connectivity::MakeANDNode(), connectivity::MakeORNode(), OSQLParseNode(), connectivity::Punctuation, removeAt(), connectivity::Rule, connectivity::OSQLParser::RuleID(), search_condition, SQL_ISPUNCTUATION, and SQL_ISRULE.
Referenced by compress().
|
staticprivate |
Definition at line 201 of file sqlnode.cxx.
References dbtools::DBTypeConversion::getNULLDate(), connectivity::SQLParseNodeParameter::rLocale, dbtools::DBTypeConversion::toDate(), toDouble(), and connectivity::SQLParseNodeParameter::xFormatter.
Referenced by addDateValue().
|
staticprivate |
Definition at line 213 of file sqlnode.cxx.
References dbtools::DBTypeConversion::getNULLDate(), connectivity::SQLParseNodeParameter::rLocale, dbtools::DBTypeConversion::toDateTime(), toDouble(), and connectivity::SQLParseNodeParameter::xFormatter.
Referenced by addDateValue().
|
staticprivate |
Definition at line 225 of file sqlnode.cxx.
References connectivity::SQLParseNodeParameter::rLocale, toDouble(), dbtools::DBTypeConversion::toTime(), and connectivity::SQLParseNodeParameter::xFormatter.
Referenced by addDateValue().
|
inline |
Definition at line 255 of file sqlnode.hxx.
Referenced by connectivity::file::OPreparedStatement::AddParameter(), connectivity::macab::MacabCommonStatement::analyseOrderByClause(), connectivity::macab::MacabCommonStatement::analyseWhereClause(), connectivity::file::OStatement_Base::analyzeSQL(), compress(), disjunctiveNormalForm(), eraseBraces(), connectivity::file::OPredicateCompiler::execute(), connectivity::file::OPredicateCompiler::execute_BETWEEN(), connectivity::file::OPredicateCompiler::execute_COMPARE(), connectivity::file::OPredicateCompiler::execute_Fold(), connectivity::file::OPredicateCompiler::execute_ISNULL(), connectivity::file::OPredicateCompiler::execute_LIKE(), connectivity::file::OPredicateCompiler::execute_Operand(), connectivity::file::OPredicateCompiler::executeFunction(), connectivity::file::OStatement_Base::GetAssignValues(), connectivity::OSQLParseTreeIterator::getColumnAlias(), connectivity::OSQLParseTreeIterator::getGroupByTree(), connectivity::OSQLParseTreeIterator::getHavingTree(), connectivity::OSQLParseTreeIterator::getOrderTree(), connectivity::OSQLParseTreeIterator::getQualified_join(), connectivity::OSQLParseTreeIterator::getSelect_statement(), connectivity::OSQLParseTreeIterator::getTableNode(), getTableRange(), connectivity::OSQLParseTreeIterator::getWhereTree(), connectivity::OSQLParseTreeIterator::impl_fillJoinConditions(), connectivity::evoab::OCommonStatement::impl_getColumnRefColumnName_throw(), impl_parseLikeNodeToString_throw(), impl_parseNodeToString_throw(), impl_parseTableRangeNodeToString_throw(), negateSearchCondition(), operator==(), connectivity::evoab::OCommonStatement::orderByAnalysis(), connectivity::file::OResultSet::OResultSet(), parseNodeToExecutableStatement(), replaceNodeValue(), connectivity::ado::OPreparedStatement::replaceParameterNodeName(), connectivity::file::OPreparedStatement::scanParameter(), connectivity::file::OStatement_Base::setOrderbyColumn(), connectivity::OSQLParseTreeIterator::setParseTree(), connectivity::file::OPredicateCompiler::start(), connectivity::file::OSQLAnalyzer::start(), substituteParameterNames(), connectivity::OSQLParseTreeIterator::traverseByColumnNames(), connectivity::OSQLParseTreeIterator::traverseCreateColumns(), connectivity::OSQLParseTreeIterator::traverseParameter(), connectivity::OSQLParseTreeIterator::traverseParameters(), connectivity::OSQLParseTreeIterator::traverseSearchCondition(), connectivity::OSQLParseTreeIterator::traverseSelectColumnNames(), connectivity::OSQLParseTreeIterator::traverseSelectionCriteria(), and connectivity::evoab::OCommonStatement::whereAnalysis().
|
static |
Definition at line 1794 of file sqlnode.cxx.
References absorptions(), boolean_primary, boolean_term, count(), disjunctiveNormalForm(), getChild(), connectivity::MakeANDNode(), connectivity::MakeORNode(), OSQLParseNode(), removeAt(), replaceAndDelete(), search_condition, and SQL_ISRULE.
Referenced by disjunctiveNormalForm().
|
static |
Definition at line 2020 of file sqlnode.cxx.
References absorptions(), boolean_primary, boolean_term, count(), getChild(), getParent(), removeAt(), search_condition, SQL_ISPUNCTUATION, and SQL_ISRULE.
Referenced by absorptions(), and compress().
OSQLParseNode * connectivity::OSQLParseNode::getByRule | ( | OSQLParseNode::Rule | eRule | ) | const |
Definition at line 1759 of file sqlnode.cxx.
References getByRule(), getRuleID(), isRule(), m_aChildren, and connectivity::OSQLParser::RuleID().
Referenced by absorptions(), getByRule(), dbtools::OPredicateInputController::implParseNode(), and connectivity::evoab::OCommonStatement::orderByAnalysis().
|
inline |
Definition at line 433 of file sqlnode.hxx.
References m_aChildren, and nPos.
Referenced by absorptions(), connectivity::macab::MacabCommonStatement::analyseOrderByClause(), connectivity::macab::MacabCommonStatement::analyseWhereClause(), connectivity::file::OStatement_Base::analyzeSQL(), compress(), disjunctiveNormalForm(), eraseBraces(), connectivity::file::OPredicateCompiler::execute(), connectivity::file::OPredicateCompiler::execute_BETWEEN(), connectivity::file::OPredicateCompiler::execute_COMPARE(), connectivity::file::OPredicateCompiler::execute_Fold(), connectivity::file::OPredicateCompiler::execute_ISNULL(), connectivity::file::OPredicateCompiler::execute_LIKE(), connectivity::file::OPredicateCompiler::execute_Operand(), connectivity::file::OPredicateCompiler::executeFunction(), connectivity::file::OStatement_Base::GetAssignValues(), connectivity::OSQLParseTreeIterator::getColumnAlias(), connectivity::OSQLParseTreeIterator::getFunctionReturnType(), connectivity::OSQLParseTreeIterator::getGroupByTree(), connectivity::OSQLParseTreeIterator::getHavingTree(), connectivity::OSQLParseTreeIterator::getOrderTree(), connectivity::OSQLParseTreeIterator::getQualified_join(), connectivity::OSQLParseTreeIterator::getSelect_statement(), connectivity::OSQLParseTreeIterator::getSimpleGroupByTree(), connectivity::OSQLParseTreeIterator::getSimpleHavingTree(), connectivity::OSQLParseTreeIterator::getSimpleOrderTree(), connectivity::OSQLParseTreeIterator::getSimpleWhereTree(), getTableComponents(), connectivity::evoab::OCommonStatement::getTableName(), connectivity::OSQLParseTreeIterator::getTableNode(), getTableRange(), connectivity::OSQLParseTreeIterator::getWhereTree(), connectivity::OSQLParseTreeIterator::impl_fillJoinConditions(), connectivity::evoab::OCommonStatement::impl_getColumnRefColumnName_throw(), impl_parseLikeNodeToString_throw(), impl_parseTableNameNodeToString_throw(), connectivity::OSQLParseTreeIterator::impl_traverse(), dbtools::OPredicateInputController::implParseNode(), negateSearchCondition(), connectivity::file::OResultSet::OpenImpl(), operator==(), connectivity::evoab::OCommonStatement::orderByAnalysis(), connectivity::file::OResultSet::OResultSet(), parseNodeToExecutableStatement(), connectivity::evoab::OCommonStatement::parseSql(), replaceNodeValue(), connectivity::ado::OPreparedStatement::replaceParameterNodeName(), connectivity::file::OPreparedStatement::scanParameter(), connectivity::macab::MacabCommonStatement::selectRecords(), connectivity::file::OStatement_Base::setOrderbyColumn(), connectivity::OSQLParseTreeIterator::setParseTree(), connectivity::macab::MacabCommonStatement::sortRecords(), connectivity::file::OPredicateCompiler::start(), connectivity::file::OSQLAnalyzer::start(), substituteParameterNames(), connectivity::OSQLParseTreeIterator::traverseByColumnNames(), connectivity::OSQLParseTreeIterator::traverseCreateColumns(), connectivity::OSQLParseTreeIterator::traverseParameter(), connectivity::OSQLParseTreeIterator::traverseParameters(), connectivity::OSQLParseTreeIterator::traverseSearchCondition(), connectivity::OSQLParseTreeIterator::traverseSelectColumnNames(), connectivity::OSQLParseTreeIterator::traverseSelectionCriteria(), connectivity::OSQLParseTreeIterator::traverseTableNames(), and connectivity::evoab::OCommonStatement::whereAnalysis().
OSQLParseNode::Rule connectivity::OSQLParseNode::getKnownRuleID | ( | ) | const |
returns the ID of the rule represented by the node If the node does not represent a rule, UNKNOWN_RULE is returned
Definition at line 2698 of file sqlnode.cxx.
References getRuleID(), isRule(), connectivity::OSQLParser::RuleIDToRule(), and UNKNOWN_RULE.
Referenced by getTableRange(), impl_parseNodeToString_throw(), impl_parseTableNameNodeToString_throw(), and connectivity::OSQLParseTreeIterator::traverseSelectColumnNames().
|
inline |
Definition at line 339 of file sqlnode.hxx.
Referenced by addDateValue(), connectivity::OSQLParser::convertNode(), connectivity::file::OPredicateCompiler::execute_BETWEEN(), connectivity::file::OPredicateCompiler::execute_COMPARE(), connectivity::file::OPredicateCompiler::execute_LIKE(), connectivity::file::OPredicateCompiler::execute_Operand(), connectivity::file::OStatement_Base::GetAssignValues(), connectivity::OSQLParseTreeIterator::impl_fillJoinConditions(), impl_parseNodeToString_throw(), dbtools::OPredicateInputController::implParseNode(), negateSearchCondition(), connectivity::file::OOperandConst::OOperandConst(), connectivity::file::OStatement_Base::ParseAssignValues(), connectivity::file::OPreparedStatement::scanParameter(), connectivity::file::OSQLAnalyzer::start(), connectivity::OSQLParseTreeIterator::traverseCreateColumns(), connectivity::OSQLParseTreeIterator::traverseParameters(), and connectivity::evoab::OCommonStatement::whereAnalysis().
|
inline |
Definition at line 251 of file sqlnode.hxx.
Referenced by append(), connectivity::OSQLParseNodesContainer::clearAndDelete(), compress(), eraseBraces(), impl_parseTableNameNodeToString_throw(), dbtools::OPredicateInputController::implParseNode(), insert(), parseLeaf(), replaceAndDelete(), connectivity::OSQLParseTreeIterator::traverseByColumnNames(), connectivity::OSQLParseTreeIterator::traverseParameter(), and connectivity::OSQLParseTreeIterator::traverseParameters().
|
inline |
Definition at line 342 of file sqlnode.hxx.
Referenced by getByRule(), getKnownRuleID(), and showParseTree().
|
static |
Definition at line 757 of file sqlnode.cxx.
References Any, catalog_name, getChild(), getTokenValue(), isToken(), SAL_WARN, schema_name, SQL_ISRULE, and table_name.
Referenced by connectivity::evoab::OCommonStatement::getTableName(), and connectivity::OSQLParseTreeIterator::traverseOneTableName().
|
static |
return a table range when it exists.
Definition at line 2705 of file sqlnode.cxx.
References count(), getChild(), getKnownRuleID(), getTokenValue(), isLeaf(), isToken(), nCount, range_variable, table_primary_as_range_column, and table_ref.
Referenced by connectivity::OSQLParseTreeIterator::getSelect_statement(), connectivity::evoab::OCommonStatement::getTableName(), and connectivity::OSQLParseTreeIterator::getTableNode().
|
inline |
Definition at line 350 of file sqlnode.hxx.
Referenced by connectivity::file::OPredicateCompiler::executeFunction(), connectivity::OSQLParseTreeIterator::getFunctionReturnType(), connectivity::OSQLParseTreeIterator::getQualified_join(), connectivity::file::OResultSet::OpenImpl(), showParseTree(), connectivity::OSQLParseTreeIterator::traverseCreateColumns(), and connectivity::OSQLParseTreeIterator::traverseParameter().
|
inline |
Definition at line 361 of file sqlnode.hxx.
Referenced by connectivity::macab::MacabCommonStatement::analyseOrderByClause(), connectivity::macab::MacabCommonStatement::analyseWhereClause(), connectivity::OSQLParser::buildNode_STR_NUM(), connectivity::file::OPredicateCompiler::execute_LIKE(), connectivity::file::OPredicateCompiler::execute_Operand(), connectivity::OSQLParser::extractDate(), connectivity::file::OStatement_Base::GetAssignValues(), connectivity::OSQLParseTreeIterator::getColumnAlias(), getTableComponents(), getTableRange(), connectivity::evoab::OCommonStatement::impl_getColumnRefColumnName_throw(), impl_parseTableNameNodeToString_throw(), dbtools::OPredicateInputController::implParseNode(), connectivity::file::OStatement_Base::ParseAssignValues(), parseNodeToExecutableStatement(), replaceNodeValue(), connectivity::file::OStatement_Base::setOrderbyColumn(), connectivity::OSQLParseTreeIterator::traverseCreateColumns(), connectivity::OSQLParseTreeIterator::traverseParameter(), connectivity::OSQLParseTreeIterator::traverseSearchCondition(), and connectivity::evoab::OCommonStatement::whereAnalysis().
|
private |
Definition at line 724 of file sqlnode.cxx.
References aStr, connectivity::SQLParseNodeParameter::bInternational, connectivity::SQLParseNodeParameter::bPredicate, column_ref, ConvertLikeToken(), count(), get(), getChild(), impl_parseNodeToString_throw(), isToken(), like_predicate, m_aChildren, SQL_ISRULE, u, and connectivity::SQLParseNodeParameter::xField.
Referenced by impl_parseNodeToString_throw().
|
private |
Definition at line 382 of file sqlnode.cxx.
References addDateValue(), all_or_any_predicate, connectivity::SQLParseNodeParameter::aMetaData, as_clause, between_predicate, between_predicate_part_2, connectivity::SQLParseNodeParameter::bParseToSDBCLevel, connectivity::SQLParseNodeParameter::bPredicate, connectivity::SQLParseNodeParameter::bQuote, cast_spec, char_value_fct, column_ref, connectivity::CommaListRule, comparison_predicate, comparison_predicate_part_2, count(), connectivity::Equal, existence_test, extract_exp, factor, general_set_fct, dbtools::DatabaseMetaData::generateASBeforeCorrelationName(), getKnownRuleID(), getNodeType(), i, impl_parseLikeNodeToString_throw(), impl_parseNodeToString_throw(), impl_parseTableNameNodeToString_throw(), impl_parseTableRangeNodeToString_throw(), in_predicate, isToken(), join_condition, length_exp, like_predicate, m_aChildren, m_aNodeValue, m_eNodeType, nCount, num_value_exp, odbc_call_spec, opt_as, other_like_predicate_part_2, parameter, parenthesized_boolean_value_expression, parseLeaf(), position_exp, set_fct_spec, dbtools::DatabaseMetaData::shouldSubstituteParameterNames(), SQL_ISRULE, subquery, table_name, table_ref, term, test_for_null, unique_test, value_exp_commalist, window_function, and connectivity::SQLParseNodeParameter::xField.
Referenced by impl_parseLikeNodeToString_throw(), impl_parseNodeToString_throw(), and parseNodeToExecutableStatement().
|
private |
parses a table_name node into a SQL statement particle.
Definition at line 617 of file sqlnode.cxx.
References connectivity::SQLParseNodeParameter::aMetaData, connectivity::SQLParseNodeParameter::bParseToSDBCLevel, connectivity::SQLParseNodeParameter::bQuote, DBG_UNHANDLED_EXCEPTION, Exception, getChild(), connectivity::OSQLParser::getErrorHelper(), dbtools::DatabaseMetaData::getIdentifierQuoteString(), getKnownRuleID(), dbtools::OPropertyMap::getNameByIndex(), getParent(), connectivity::OMetaConnection::getPropMap(), getTokenValue(), connectivity::OSQLParser::parseTree(), connectivity::SQLParseNodeParameter::pParser, PROPERTY_ID_COMMAND, PROPERTY_ID_ESCAPEPROCESSING, connectivity::SQLParseNodeParameter::pSubQueryHistory, connectivity::SQLError::raiseException(), table_ref, and connectivity::SQLParseNodeParameter::xQueries.
Referenced by impl_parseNodeToString_throw().
|
private |
Definition at line 714 of file sqlnode.cxx.
References count(), and m_aChildren.
Referenced by impl_parseNodeToString_throw().
void connectivity::OSQLParseNode::insert | ( | sal_uInt32 | nPos, |
OSQLParseNode * | pNewSubTree | ||
) |
Definition at line 2350 of file sqlnode.cxx.
References getParent(), m_aChildren, nPos, and setParent().
|
inline |
Definition at line 363 of file sqlnode.hxx.
Referenced by getTableRange(), and connectivity::evoab::OCommonStatement::orderByAnalysis().
|
inline |
Definition at line 354 of file sqlnode.hxx.
References connectivity::CommaListRule, connectivity::ListRule, and connectivity::Rule.
Referenced by connectivity::OSQLParser::convertNode(), getByRule(), connectivity::OSQLParseTreeIterator::getColumnAlias(), getKnownRuleID(), negateSearchCondition(), and connectivity::OSQLParseTreeIterator::traverseSelectColumnNames().
|
inline |
Definition at line 359 of file sqlnode.hxx.
Referenced by connectivity::macab::MacabCommonStatement::analyseWhereClause(), connectivity::file::OPredicateCompiler::execute_LIKE(), connectivity::file::OPredicateCompiler::executeFunction(), connectivity::file::OStatement_Base::GetAssignValues(), getTableComponents(), connectivity::OSQLParseTreeIterator::getTableNode(), getTableRange(), impl_parseLikeNodeToString_throw(), impl_parseNodeToString_throw(), showParseTree(), connectivity::OSQLParseTreeIterator::traverseSearchCondition(), and connectivity::evoab::OCommonStatement::whereAnalysis().
|
static |
Definition at line 1872 of file sqlnode.cxx.
References all_or_any_predicate, append(), between_predicate, boolean_factor, boolean_primary, boolean_term, comparison, comparison_predicate, count(), connectivity::Equal, getChild(), getNodeType(), connectivity::Great, connectivity::GreatEq, in_predicate, IS, isRule(), connectivity::Keyword, connectivity::Less, connectivity::LessEq, like_predicate, negateSearchCondition(), NOT, connectivity::NotEqual, OSQLParseNode(), removeAt(), replaceAndDelete(), connectivity::Rule, connectivity::OSQLParser::RuleID(), search_condition, SQL_ISRULE, SQL_ISTOKEN, sql_not, and test_for_null.
Referenced by negateSearchCondition().
OSQLParseNode & connectivity::OSQLParseNode::operator= | ( | const OSQLParseNode & | rParseNode | ) |
Definition at line 1635 of file sqlnode.cxx.
References append(), m_aChildren, m_aNodeValue, m_eNodeType, m_nNodeID, and OSQLParseNode().
bool connectivity::OSQLParseNode::operator== | ( | OSQLParseNode const & | rParseNode | ) | const |
Definition at line 1653 of file sqlnode.cxx.
References count(), getChild(), i, m_aNodeValue, m_eNodeType, m_nNodeID, parameter, and SQL_ISRULE.
|
private |
Definition at line 2397 of file sqlnode.cxx.
References connectivity::AccessDate, connectivity::SQLParseNodeParameter::aMetaData, connectivity::ApproxNum, connectivity::SQLParseNodeParameter::bInternational, connectivity::SQLParseNodeParameter::bPredicate, connectivity::SQLParseNodeParameter::bQuote, cast_spec, dbtools::DatabaseMetaData::getCatalogSeparator(), dbtools::DatabaseMetaData::getIdentifierQuoteString(), getParent(), connectivity::IntNum, connectivity::Keyword, m_aNodeValue, m_eNodeType, m_nNodeID, connectivity::SQLParseNodeParameter::m_rContext, connectivity::Name, connectivity::Punctuation, connectivity::SQLParseNodeParameter::sDecSep, SQL_ISRULE, connectivity::String, connectivity::OSQLParser::TokenIDToStr(), and u.
Referenced by impl_parseNodeToString_throw().
bool connectivity::OSQLParseNode::parseNodeToExecutableStatement | ( | OUString & | _out_rString, |
const css::uno::Reference< css::sdbc::XConnection > & | _rxConnection, | ||
OSQLParser & | _rParser, | ||
css::sdbc::SQLException * | _pErrorHolder | ||
) | const |
parses the node to a string which can be passed to a driver's connection for execution
Any particles of the parse tree which represent application-level features - such as queries appearing in the FROM part - are substituted, so that the resulting statement can be executed at an SDBC-level connection.
_out_rString | is an output parameter taking the resulting SQL statement |
_rxConnection | the connection relative to which to parse. This must be an SDB-level connection (e.g. support the XQueriesSupplier interface) for the method to be able to do all necessary substitutions. |
_rParser | the SQLParser used to create the node. This is needed in case we need to parse sub queries which are present in the SQL statement - those sub queries need to be parsed, too, to check whether they contain nested sub queries. |
_pErrorHolder | takes the error which occurred while generating the statement, if any. Might be <NULL>, in this case the error is not reported back, and can only be recognized by examining the return value. |
Currently, there's only one condition how this method can fail: If it contains a nested query which causes a cycle. E.g., consider a statement SELECT * from "foo"
, where foo
is a query defined as SELECT * FROM "bar"
, where bar
is defined as SELECT * FROM "foo"
. This statement obviously cannot be parsed to an executable statement.
If this method returns <FALSE>, you're encouraged to check and handle the error in <arg>_pErrorHolder</arg>.
Definition at line 318 of file sqlnode.cxx.
References connectivity::SQLParseNodeParameter::aMetaData, count(), getChild(), connectivity::OParseContext::getDefaultLocale(), getTokenValue(), impl_parseNodeToString_throw(), connectivity::SQLParseNodeParameter::pParser, removeAt(), dbtools::DatabaseMetaData::supportsSubqueriesInFrom(), and connectivity::SQLParseNodeParameter::xQueries.
void connectivity::OSQLParseNode::parseNodeToPredicateStr | ( | OUString & | rString, |
const css::uno::Reference< css::sdbc::XConnection > & | _rxConnection, | ||
const css::uno::Reference< css::util::XNumberFormatter > & | xFormatter, | ||
const css::lang::Locale & | rIntl, | ||
OUString | _sDec, | ||
const IParseContext * | pContext = nullptr |
||
) | const |
void connectivity::OSQLParseNode::parseNodeToPredicateStr | ( | OUString & | rString, |
const css::uno::Reference< css::sdbc::XConnection > & | _rxConnection, | ||
const css::uno::Reference< css::util::XNumberFormatter > & | xFormatter, | ||
const css::uno::Reference< css::beans::XPropertySet > & | _xField, | ||
const OUString & | _sTableAlias, | ||
const css::lang::Locale & | rIntl, | ||
OUString | strDec, | ||
const IParseContext * | pContext = nullptr |
||
) | const |
|
protected |
void connectivity::OSQLParseNode::parseNodeToStr | ( | OUString & | rString, |
const css::uno::Reference< css::sdbc::XConnection > & | _rxConnection, | ||
const IParseContext * | pContext = nullptr , |
||
bool | _bIntl = false , |
||
bool | _bQuote = true |
||
) | const |
Referenced by connectivity::OSQLParseTreeIterator::getFunctionReturnType(), dbtools::OPredicateInputController::implParseNode(), connectivity::file::OStatement_Base::setOrderbyColumn(), connectivity::OSQLParseTreeIterator::traverseByColumnNames(), connectivity::OSQLParseTreeIterator::traverseParameter(), connectivity::OSQLParseTreeIterator::traverseParameters(), connectivity::OSQLParseTreeIterator::traverseSearchCondition(), and connectivity::OSQLParseTreeIterator::traverseSelectColumnNames().
OSQLParseNode * connectivity::OSQLParseNode::removeAt | ( | sal_uInt32 | nPos | ) |
Definition at line 2362 of file sqlnode.cxx.
References m_aChildren, and nPos.
Referenced by absorptions(), compress(), disjunctiveNormalForm(), eraseBraces(), negateSearchCondition(), parseNodeToExecutableStatement(), replaceNodeValue(), and substituteParameterNames().
void connectivity::OSQLParseNode::replaceAndDelete | ( | OSQLParseNode * | pOldSubTree, |
OSQLParseNode * | pNewSubTree | ||
) |
Definition at line 2377 of file sqlnode.cxx.
References getParent(), m_aChildren, and setParent().
Referenced by disjunctiveNormalForm(), negateSearchCondition(), connectivity::ado::OPreparedStatement::replaceParameterNodeName(), and substituteParameterNames().
void connectivity::OSQLParseNode::replaceNodeValue | ( | const OUString & | rTableAlias, |
const OUString & | rColumnName | ||
) |
Definition at line 1743 of file sqlnode.cxx.
References append(), column_ref, count(), getChild(), getTokenValue(), i, connectivity::Name, OSQLParseNode(), connectivity::Punctuation, removeAt(), replaceNodeValue(), and SQL_ISRULE.
Referenced by replaceNodeValue().
|
inline |
Definition at line 253 of file sqlnode.hxx.
Referenced by append(), insert(), and replaceAndDelete().
void connectivity::OSQLParseNode::showParseTree | ( | OUString & | rString | ) | const |
Definition at line 2246 of file sqlnode.cxx.
References aBuf, and showParseTree().
Referenced by connectivity::evoab::OCommonStatement::parseSql(), and showParseTree().
void connectivity::OSQLParseNode::showParseTree | ( | OUStringBuffer & | _inout_rBuf, |
sal_uInt32 | nLevel | ||
) | const |
Definition at line 2254 of file sqlnode.cxx.
References connectivity::AccessDate, connectivity::ApproxNum, connectivity::Concat, connectivity::Equal, getRuleID(), getTokenID(), connectivity::Great, connectivity::GreatEq, connectivity::IntNum, isToken(), connectivity::Keyword, connectivity::Less, connectivity::LessEq, m_aChildren, m_aNodeValue, m_eNodeType, connectivity::Name, connectivity::NotEqual, connectivity::Punctuation, connectivity::OSQLParser::RuleIDToStr(), SAL_INFO, SAL_WARN, connectivity::String, and connectivity::OSQLParser::TokenIDToStr().
|
static |
Definition at line 1492 of file sqlnode.cxx.
References count(), getChild(), i, nCount, OSQLParseNode(), parameter, connectivity::Punctuation, removeAt(), replaceAndDelete(), SQL_ISRULE, and substituteParameterNames().
Referenced by substituteParameterNames(), and connectivity::ParameterSubstitution::substituteVariables().
|
friend |
Definition at line 105 of file sqlnode.hxx.
|
private |
Definition at line 108 of file sqlnode.hxx.
Referenced by addDateValue(), append(), getByRule(), getChild(), impl_parseLikeNodeToString_throw(), impl_parseNodeToString_throw(), impl_parseTableRangeNodeToString_throw(), insert(), operator=(), OSQLParseNode(), removeAt(), replaceAndDelete(), and showParseTree().
|
private |
Definition at line 110 of file sqlnode.hxx.
Referenced by impl_parseNodeToString_throw(), connectivity::OSQLParser::killThousandSeparator(), operator=(), operator==(), OSQLParseNode(), parseLeaf(), and showParseTree().
|
private |
Definition at line 113 of file sqlnode.hxx.
Referenced by impl_parseNodeToString_throw(), operator=(), operator==(), OSQLParseNode(), parseLeaf(), and showParseTree().
|
private |
Definition at line 114 of file sqlnode.hxx.
Referenced by operator=(), operator==(), OSQLParseNode(), and parseLeaf().
|
private |
Definition at line 109 of file sqlnode.hxx.
Referenced by OSQLParseNode().