Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,19 @@ void dds_domain_examples()
"true"); // true or True or TRUE or 1
//!--
}

{
// DDS_SQL_LIMITS_PROPERTY
DomainParticipantQos pqos;

pqos.properties().properties().emplace_back(
"dds.sql.expression.max_expression_length",
"20000");
pqos.properties().properties().emplace_back(
"dds.sql.expression.max_subexpressions",
"10");
//!--
}
}

//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS
Expand Down
28 changes: 28 additions & 0 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3363,6 +3363,34 @@
-->
<!--><-->

<!-->DDS_SQL_LIMITS_PROPERTY<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
<profiles>
-->
<participant profile_name="custom_sql_limits_domainparticipant_xml_profile">
<rtps>
<propertiesPolicy>
<properties>
<property>
<name>dds.sql.expression.max_expression_length</name>
<value>20000</value>
</property>
<property>
<name>dds.sql.expression.max_subexpressions</name>
<value>10</value>
</property>
</properties>
</propertiesPolicy>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->FASTDDS_STATISTICS_MODULE<-->
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
<rtps>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The default SQL-like filter
Filter expressions used by :ref:`dds_layer_topic_contentFilteredTopic` API may use a subset of SQL syntax, extended with
the possibility to use program variables in the SQL expression.
This section shows this default SQL-like syntax and how to use it.
Apart from the syntax described in this section, certain restrictions apply to the allowed SQL expressions.
These restrictions can be relaxed or tightened by the user, as explained in
:ref:`properties_sql_filter_expression_limits`.

* :ref:`default_sql_filter_grammar`
* :ref:`default_sql_filter_like`
Expand Down
43 changes: 43 additions & 0 deletions docs/fastdds/property_policies/non_consolidated_qos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -543,3 +543,46 @@ The following table lists all the optional QoS that can be serialized in the dis
:start-after: <!-->SERIALIZE_OPTIONAL_QOS_PROPERTY<-->
:end-before: <!--><-->
:lines: 2-4,6-17,19-20

.. _properties_sql_filter_expression_limits:

SQL Filter Expression limits
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When creating content-filtered topics using the
:ref:`default SQL-like filter <dds_layer_topic_contentFilteredTopic_default_filter>`, some restrictions apply to the
SQL expressions that can be used for content-based filtering.
The default limits are set to values that should be enough for most use cases, but they can be customized using the
following properties when a participant is created:

.. list-table::
:header-rows: 1
:align: left

* - PropertyPolicyQos name
- PropertyPolicyQos value
- Default value
* - ``"dds.sql.expression.max_expression_length"``
- Maximum length of the SQL expression, in characters.
- ``16384``
* - ``"dds.sql.expression.max_subexpressions"``
- Maximum number of sub-expressions in the SQL expression.
- ``256``

Creating content-filtered topics with expressions exceeding any of these limits will fail.
Expressions received in discovery messages exceeding any of these limits will be ignored, and filtering will happen
in the reader side.

.. tab-set-code::

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: // DDS_SQL_LIMITS_PROPERTY
:end-before: //!--
:dedent: 8

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->DDS_SQL_LIMITS_PROPERTY<-->
:end-before: <!--><-->
:lines: 2-4,6-21,23-24