diff --git a/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sha256 b/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sha256 index 0f7e677dc53f..8bfc6d49dbe4 100644 --- a/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sha256 +++ b/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sha256 @@ -1 +1 @@ -7f4fb78d28927012f3c4b3a91b87b38dbebdd6c32f3654cf23fb75213be096ba +c6e4c74b1c854a51d9cd79d3c614b60a372ca60e88b8d69cbd90a7a674389080 diff --git a/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sql b/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sql index 7447e0aad999..1570b88d6bbc 100644 --- a/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sql +++ b/ledger/participant-integration-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sql @@ -133,7 +133,7 @@ CREATE TABLE participant_command_completions transaction_id NVARCHAR2(1000), -- null if the command was rejected and checkpoints status_code INTEGER, -- null for successful command and checkpoints - status_message NVARCHAR2(1000) -- null for successful command and checkpoints + status_message CLOB -- null for successful command and checkpoints ); CREATE INDEX participant_command_completions_idx ON participant_command_completions(completion_offset, application_id); diff --git a/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sha256 b/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sha256 index 5ca2b516c35a..b55dac07fe19 100644 --- a/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sha256 +++ b/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sha256 @@ -1 +1 @@ -5438a2b69c6c7581166e6498cdaac09c46945e0f01e5fb7359de0f85cbb130a4 +250ca12b5c10f57334d9c5f763bd8aab4ac564b0d6b6589ad976da404d3a2738 diff --git a/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sql b/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sql index c935b77e6857..27231d670eda 100644 --- a/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sql +++ b/ledger/participant-integration-api/src/main/resources/db/migration/oracle/V1__Init.sql @@ -185,7 +185,7 @@ CREATE TABLE participant_command_completions transaction_id NVARCHAR2(1000), -- null if the command was rejected and checkpoints status_code INTEGER, -- null for successful command and checkpoints - status_message NVARCHAR2(1000) -- null for successful command and checkpoints + status_message CLOB -- null for successful command and checkpoints ); create index participant_command_completions_idx on participant_command_completions(completion_offset, application_id); diff --git a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoCompletionsSpec.scala b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoCompletionsSpec.scala index 996bf3054ca2..d08237d28daa 100644 --- a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoCompletionsSpec.scala +++ b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoCompletionsSpec.scala @@ -5,10 +5,10 @@ package com.daml.platform.store.dao import java.time.Instant import java.util.UUID - import akka.stream.scaladsl.Sink import com.daml.ledger.api.v1.command_completion_service.CompletionStreamResponse import com.daml.ledger.offset.Offset +import com.daml.ledger.participant.state.v1.RejectionReasonV0 import com.daml.ledger.participant.state.{v1 => state} import com.daml.lf.data.Ref import com.daml.platform.ApiOffset @@ -189,6 +189,20 @@ private[dao] trait JdbcLedgerDaoCompletionsSpec extends OptionValues with LoneEl succeed } } + it should "allow arbitrarily large rejection reasons" in { + for { + from <- ledgerDao.lookupLedgerEnd() + _ <- storeMultiPartyRejection( + RejectionReasonV0.Inconsistent((0 to 10000).map(_ => " ").mkString("")) + ) + to <- ledgerDao.lookupLedgerEnd() + response1 <- ledgerDao.completions + .getCommandCompletions(from, to, applicationId, Set("WRONG")) + .runWith(Sink.seq) + } yield { + response1 shouldBe Seq.empty + } + } private def prepareStoreRejection( reason: state.RejectionReasonV0,