diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp
index f86e9f9c2..cf472f97f 100644
--- a/code/DDSCodeTester.cpp
+++ b/code/DDSCodeTester.cpp
@@ -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
diff --git a/code/XMLTester.xml b/code/XMLTester.xml
index e3dd819c6..be156d0b7 100644
--- a/code/XMLTester.xml
+++ b/code/XMLTester.xml
@@ -3363,6 +3363,34 @@
-->
<-->
+DDS_SQL_LIMITS_PROPERTY<-->
+
+
+
+
+
+
+ dds.sql.expression.max_expression_length
+ 20000
+
+
+ dds.sql.expression.max_subexpressions
+ 10
+
+
+
+
+
+
+<-->
+
FASTDDS_STATISTICS_MODULE<-->
diff --git a/docs/fastdds/dds_layer/topic/contentFilteredTopic/defaultFilter.rst b/docs/fastdds/dds_layer/topic/contentFilteredTopic/defaultFilter.rst
index e413a4727..317eeb236 100644
--- a/docs/fastdds/dds_layer/topic/contentFilteredTopic/defaultFilter.rst
+++ b/docs/fastdds/dds_layer/topic/contentFilteredTopic/defaultFilter.rst
@@ -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`
diff --git a/docs/fastdds/property_policies/non_consolidated_qos.rst b/docs/fastdds/property_policies/non_consolidated_qos.rst
index 2f05089bf..0c8e55a0f 100644
--- a/docs/fastdds/property_policies/non_consolidated_qos.rst
+++ b/docs/fastdds/property_policies/non_consolidated_qos.rst
@@ -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 `, 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