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
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Features

Bug Fixes
--------
* Display DATE and TIME scalars returned by `.|` transforms.
* Display `DATE` and `TIME` scalars returned by `.|` transforms.
* Stop truncating `/llm` table schemas at MySQL's `group_concat_max_len`.


Expand All @@ -17,6 +17,11 @@ Documentation
* Note transform limitations when the result contains invalid dates.


Internal
--------
* Improve test coverage for the `/delimiter` special command.


v2.32.3 (2026/12/02)
==============

Expand Down
27 changes: 23 additions & 4 deletions mycli_test/pytests/test_delimitercommand.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# type: ignore

from __future__ import annotations

import pytest
Expand Down Expand Up @@ -67,6 +65,27 @@ def test_split_handles_placeholder_collision_in_original_sql() -> None:
]


@pytest.mark.parametrize(
'literal',
[
'\ufffb',
'\ufffb\ufffb',
'\ufffb\ufffb\ufffb',
'\ufffb\ufffb\ufffc\ufffc text',
pytest.param(
'\ufffb\ufffb\ufffc\ufffc',
marks=pytest.mark.xfail(strict=True, reason='Adjacent original and generated placeholders are restored at the wrong offset.'),
),
],
)
def test_split_preserves_colliding_delimiter_placeholders(literal: str) -> None:
command = DelimiterCommand()
command.set('$$')
sql = f"select '{literal};'$$ select 2$$"

assert command._split(sql) == [f"select '{literal};'$$", 'select 2$$']


def test_queries_iter_resplits_remaining_input_after_delimiter_change() -> None:
command = DelimiterCommand()
queries = command.queries_iter('select 1; delimiter $$ select 2$$ select 3$$')
Expand All @@ -79,7 +98,7 @@ def test_queries_iter_resplits_remaining_input_after_delimiter_change() -> None:
assert list(queries) == ['select 2', 'select 3']


def test_queries_iter_reappends_old_trailing_delimiter_before_resplitting(monkeypatch) -> None:
def test_queries_iter_reappends_old_trailing_delimiter_before_resplitting(monkeypatch: pytest.MonkeyPatch) -> None:
command = DelimiterCommand()
command._delimiter = ';;'
split_calls: list[str] = []
Expand Down Expand Up @@ -171,5 +190,5 @@ def test_queries_iter_with_quoted_delimiter_containing_semicolon() -> None:
('select `#a;b`; select 2', ['select `#a;b`', 'select 2']),
],
)
def test_queries_iter_reads_hash_comment_without_a_space(sql, expected) -> None:
def test_queries_iter_reads_hash_comment_without_a_space(sql: str, expected: list[str]) -> None:
assert list(DelimiterCommand().queries_iter(sql)) == expected
Loading