8000 Added/Updated tests\bugs\core_3690_dialect_3_test.py: Separated expec… · FirebirdSQL/firebird-qa@3138ec7 · GitHub
[go: up one dir, main page]

Skip to content
  • Commit 3138ec7

    Browse files
    committed
    Added/Updated tests\bugs\core_3690_dialect_3_test.py: Separated expected output for FB major versions prior/since 6.x. Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
    1 parent fd10f11 commit 3138ec7

    File tree

    1 file changed

    +26
    -11
    lines changed

    1 file changed

    +26
    -11
    lines changed

    tests/bugs/core_3690_dialect_3_test.py

    Lines changed: 26 additions & 11 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2,38 +2,53 @@
    22

    33
    """
    44
    ID: issue-4038
    5-
    ISSUE: https://github.com/FirebirdSQL/firebird/issues/4038
    5+
    ISSUE: 4038
    66
    TITLE: Wrong warning message for ambiguous query
    7-
    DESCRIPTION: SQL dialect 1 allows such queries for backward compatibility reasons
    7+
    DESCRIPTION: Check for dialect 3.
    88
    JIRA: CORE-3690
    99
    FBTEST: bugs.core_3690
    10+
    NOTES:
    11+
    [27.06.2025] pzotov
    12+
    Separated expected output for FB major versions prior/since 6.x.
    13+
    No substitutions are used to suppress schema and quotes. Discussed with dimitr, 24.06.2025 12:39.
    14+
    15+
    Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
    1016
    """
    1117

    1218
    import pytest
    1319
    from firebird.qa import *
    1420

    15-
    db_3 = db_factory(sql_dialect=3)
    21+
    db = db_factory()
    1622

    1723
    test_script = """
    1824
    set list on;
    1925
    select m.mon$sql_dialect from mon$database m;
    2026
    select 0*rdb$relation_id as id from rdb$database,rdb$database;
    2127
    """
    2228

    23-
    act_3 = python_act('db_3')
    24-
    25-
    expected_stdout_3 = """
    26-
    MON$SQL_DIALECT 3
    29+
    substitutions = [('[ \t]+', ' ')]
    30+
    act = python_act('db', substitutions = substitutions)
    2731

    32+
    expected_stdout_5x = """
    33+
    MON$SQL_DIALECT 3
    2834
    Statement failed, SQLSTATE = 42702
    2935
    Dynamic SQL Error
    3036
    -SQL error code = -204
    3137
    -Ambiguous field name between table RDB$DATABASE and table RDB$DATABASE
    3238
    -RDB$RELATION_ID
    3339
    """
    3440

    41+
    expected_stdout_6x = """
    42+
    MON$SQL_DIALECT 3
    43+
    Statement failed, SQLSTATE = 42702
    44+
    Dynamic SQL Error
    45+
    -SQL error code = -204
    46+
    -Ambiguous field name between table "SYSTEM"."RDB$DATABASE" and table "SYSTEM"."RDB$DATABASE"
    47+
    -RDB$RELATION_ID
    48+
    """
    49+
    3550
    @pytest.mark.version('>=3')
    36-
    def test_dialect_3(act_3: Action):
    37-
    act_3.expected_stdout = expected_stdout_3
    38-
    act_3.isql(switches=['-q', '-sql_dialect', '3'], input=test_script, combine_output=True)
    39-
    assert act_3.clean_stdout == act_3.clean_expected_stdout
    51+
    def test_1(act: Action):
    52+
    act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x
    53+
    act.isql(switches=['-q'], input=test_script, combine_output=True)
    54+
    assert act.clean_stdout == act.clean_expected_stdout

    0 commit comments

    Comments
     (0)
    0