From 70fd3e3af9e9cc9eb397937f95368a29aa60b619 Mon Sep 17 00:00:00 2001 From: Daniel Kukula Date: Wed, 23 Oct 2024 08:06:46 +0200 Subject: [PATCH] remove coment validation --- lib/postgrex/protocol.ex | 10 +--------- test/query_test.exs | 4 ---- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/postgrex/protocol.ex b/lib/postgrex/protocol.ex index dfa3eb69..17d8aa05 100644 --- a/lib/postgrex/protocol.ex +++ b/lib/postgrex/protocol.ex @@ -16,9 +16,6 @@ defmodule Postgrex.Protocol do message: "`:commit_comment` option cannot contain sequence \"*/\"" ) - @comment_validation_error Postgrex.Error.exception( - message: "`:comment` option cannot contain sequence \"*/\"" - ) defstruct sock: nil, connection_id: nil, @@ -355,12 +352,7 @@ defmodule Postgrex.Protocol do false -> comment = Keyword.get(opts, :comment) - - if is_binary(comment) && String.contains?(comment, "*/") do - raise @comment_validation_error - else - parse_describe_flush(s, status, query, comment) - end + parse_describe_flush(s, status, query, comment) end end diff --git a/test/query_test.exs b/test/query_test.exs index 376962d8..bc3d895c 100644 --- a/test/query_test.exs +++ b/test/query_test.exs @@ -1853,10 +1853,6 @@ defmodule QueryTest do test "comment", context do assert [[123]] = query("select 123", [], comment: "query comment goes here") - - assert_raise Postgrex.Error, fn -> - query("select 123", [], comment: "*/ DROP TABLE 123 --") - end end @tag :big_binary