From dd77299b705a8cc593eb2ee044d69825131e30ac Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Fri, 10 Mar 2023 19:09:36 +0300 Subject: [PATCH] Added/Updated tests\bugs\core_3690_dialect_1_test.py: restored test that was missed during migration. Thanks to Anton Zuev. --- tests/bugs/core_3690_dialect_1_test.py | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/bugs/core_3690_dialect_1_test.py diff --git a/tests/bugs/core_3690_dialect_1_test.py b/tests/bugs/core_3690_dialect_1_test.py new file mode 100644 index 00000000..43691247 --- /dev/null +++ b/tests/bugs/core_3690_dialect_1_test.py @@ -0,0 +1,39 @@ +#coding:utf-8 + +""" +ID: issue-4038 +ISSUE: 4038 +TITLE: Wrong warning message for ambiguous query +DESCRIPTION: SQL dialect 1 allows such queries for backward compatibility reasons +JIRA: CORE-3690 +FBTEST: bugs.core_3690 +""" + +import pytest +from firebird.qa import * + +db_1 = db_factory(sql_dialect=1) + +test_script = """ + set list on; + select m.mon$sql_dialect from mon$database m; + select 0*rdb$relation_id as id from rdb$database,rdb$database; +""" + +act_1 = python_act('db_1') + +expected_stdout_1 = """ + MON$SQL_DIALECT 1 + + SQL warning code = 204 + -Ambiguous field name between table RDB$DATABASE and table RDB$DATABASE + -RDB$RELATION_ID + + ID 0 +""" + +@pytest.mark.version('>=3') +def test_dialect_1(act_1: Action): + act_1.expected_stdout = expected_stdout_1 + act_1.isql(switches=['-q', '-sql_dialect', '1'], input=test_script, combine_output=True) + assert act_1.clean_stdout == act_1.clean_expected_stdout