mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-02-02 02:40:42 +01:00
refactoring, python tests, added missing test from fbt
This commit is contained in:
parent
62202b87c7
commit
c8af46bc79
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT * FROM Table_10 t10) dt;
|
||||
"""
|
||||
(SELECT * FROM Table_10 t10) dt;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -64,5 +63,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT * FROM Table_10 t10);
|
||||
"""
|
||||
(SELECT * FROM Table_10 t10);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -64,5 +63,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT * FROM Table_10 t10) dt (TEST_ID, TEST_DESC);
|
||||
"""
|
||||
(SELECT * FROM Table_10 t10) dt (TEST_ID, TEST_DESC);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -64,5 +63,5 @@ expected_stdout_1 = """ TEST_ID TEST_DESC
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT ID, ID FROM Table_10 t10) dt;
|
||||
"""
|
||||
(SELECT ID, ID FROM Table_10 t10) dt;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -51,12 +50,11 @@ expected_stderr_1 = """Statement failed, SQLSTATE = 42000
|
||||
Dynamic SQL Error
|
||||
-SQL error code = -104
|
||||
-Invalid command
|
||||
-column ID was specified multiple times for derived table DT
|
||||
"""
|
||||
-column ID was specified multiple times for derived table DT"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT * FROM Table_10 t10) dt (ID, ID);
|
||||
"""
|
||||
(SELECT * FROM Table_10 t10) dt (ID, ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -51,12 +50,11 @@ expected_stderr_1 = """Statement failed, SQLSTATE = 42000
|
||||
Dynamic SQL Error
|
||||
-SQL error code = -104
|
||||
-Invalid command
|
||||
-column ID was specified multiple times for derived table DT
|
||||
"""
|
||||
-column ID was specified multiple times for derived table DT"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -43,8 +43,7 @@ test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
Table_10 t10
|
||||
JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);
|
||||
"""
|
||||
JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ Dynamic SQL Error
|
||||
-Column unknown
|
||||
-T10.ID
|
||||
-At line 5, column 53
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -43,8 +43,7 @@ test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
Table_10 t10
|
||||
LEFT JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);
|
||||
"""
|
||||
LEFT JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ Dynamic SQL Error
|
||||
-Column unknown
|
||||
-T10.ID
|
||||
-At line 5, column 58
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -43,8 +43,7 @@ test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
Table_10 t10
|
||||
FULL JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);
|
||||
"""
|
||||
FULL JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ Dynamic SQL Error
|
||||
-Column unknown
|
||||
-T10.ID
|
||||
-At line 5, column 58
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -43,8 +43,7 @@ test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
Table_10 t10
|
||||
FULL JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);
|
||||
"""
|
||||
FULL JOIN (SELECT * FROM Table_10 t2 WHERE t2.ID = t10.ID) dt ON (1 = 1);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ Dynamic SQL Error
|
||||
-Column unknown
|
||||
-T10.ID
|
||||
-At line 5, column 58
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stderr = expected_stderr_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stderr == act_1.clean_stderr
|
||||
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
||||
|
||||
|
@ -44,8 +44,7 @@ test_script_1 = """SELECT
|
||||
(SELECT dt.Description FROM (SELECT t1.Description FROM
|
||||
Table_10 t1 WHERE t1.ID = t10.ID) dt) AS Description
|
||||
FROM
|
||||
Table_10 t10;
|
||||
"""
|
||||
Table_10 t10;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -66,5 +65,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -67,5 +67,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -67,5 +67,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -42,8 +42,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.DESCRIPTION
|
||||
FROM
|
||||
(SELECT DISTINCT DESCRIPTION FROM Table_10 t10) dt (DESCRIPTION);
|
||||
"""
|
||||
(SELECT DISTINCT DESCRIPTION FROM Table_10 t10) dt (DESCRIPTION);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -56,12 +55,11 @@ nine
|
||||
one
|
||||
seven
|
||||
three
|
||||
two
|
||||
"""
|
||||
two"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -45,8 +45,7 @@ test_script_1 = """SELECT
|
||||
FROM
|
||||
(SELECT FIRST 4 SKIP 2 ID, DESCRIPTION FROM Table_10 t10 ORDER BY ID) dt (ID, DESCRIPTION)
|
||||
WHERE
|
||||
dt.ID >= 4;
|
||||
"""
|
||||
dt.ID >= 4;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -59,5 +58,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -45,8 +45,7 @@ test_script_1 = """SELECT
|
||||
FROM
|
||||
(SELECT t1.ID, t1.DESCRIPTION FROM Table_10 t1 WHERE t1.ID <= 4
|
||||
UNION ALL
|
||||
SELECT t1.ID, t1.DESCRIPTION FROM Table_10 t1 WHERE t1.ID >= 5) dt (ID, DESCRIPTION);
|
||||
"""
|
||||
SELECT t1.ID, t1.DESCRIPTION FROM Table_10 t1 WHERE t1.ID >= 5) dt (ID, DESCRIPTION);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -67,5 +66,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -43,8 +43,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT t1.GROUPID, Count(t1.ID) FROM Table_10 t1 GROUP BY t1.GROUPID) dt (GROUPID, ID_COUNT);
|
||||
"""
|
||||
(SELECT t1.GROUPID, Count(t1.ID) FROM Table_10 t1 GROUP BY t1.GROUPID) dt (GROUPID, ID_COUNT);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ expected_stdout_1 = """ GROUPID ID_COUNT
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -45,20 +45,18 @@ test_script_1 = """SELECT
|
||||
FROM
|
||||
(SELECT t1.GROUPID, Count(t1.ID) FROM Table_10 t1 GROUP BY t1.GROUPID) dt (GROUPID, ID_COUNT)
|
||||
WHERE
|
||||
dt.ID_COUNT = 2;
|
||||
"""
|
||||
dt.ID_COUNT = 2;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """ GROUPID ID_COUNT
|
||||
============ =====================
|
||||
1 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -45,8 +45,7 @@ test_script_1 = """SELECT
|
||||
FROM
|
||||
(SELECT t1.GROUPID, Count(t1.ID) FROM Table_10 t1 GROUP BY t1.GROUPID) dt (GROUPID, ID_COUNT)
|
||||
WHERE
|
||||
dt.GROUPID >= 2;
|
||||
"""
|
||||
dt.GROUPID >= 2;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -54,12 +53,11 @@ expected_stdout_1 = """ GROUPID ID_COUNT
|
||||
============ =====================
|
||||
2 3
|
||||
3 4
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -43,8 +43,7 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
test_script_1 = """SELECT
|
||||
dt.*
|
||||
FROM
|
||||
(SELECT t2.ID, t2.GROUPID, (SELECT t1.GROUPID FROM Table_10 t1 WHERE t1.ID = t2.ID) FROM Table_10 t2) dt (ID, GROUPID1, GROUPID2);
|
||||
"""
|
||||
(SELECT t2.ID, t2.GROUPID, (SELECT t1.GROUPID FROM Table_10 t1 WHERE t1.ID = t2.ID) FROM Table_10 t2) dt (ID, GROUPID1, GROUPID2);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -65,5 +64,5 @@ expected_stdout_1 = """ ID GROUPID1 GROUPID2
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -50,8 +50,7 @@ FROM
|
||||
FROM
|
||||
Table_10 t2
|
||||
GROUP BY
|
||||
t2.GROUPID) dt (GROUPID, MIN_ID, MAX_ID);
|
||||
"""
|
||||
t2.GROUPID) dt (GROUPID, MIN_ID, MAX_ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -66,5 +65,5 @@ expected_stdout_1 = """ GROUPID MIN_ID MAX_ID
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -57,5 +57,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -73,8 +73,7 @@ INSERT INTO TABLEA (ID, DESCRIPTION) VALUES (2, 'Red');
|
||||
INSERT INTO TABLEA (ID, DESCRIPTION) VALUES (4, 'Green');
|
||||
INSERT INTO TABLEA (ID, DESCRIPTION) VALUES (8, 'Yellow');
|
||||
COMMIT;
|
||||
SELECT * FROM TABLEA;
|
||||
"""
|
||||
SELECT * FROM TABLEA;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -89,5 +88,5 @@ expected_stdout_1 = """ ID DESCRIPTION
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -74,12 +74,11 @@ expected_stdout_1 = """PLAN (T INDEX (I_TABLE_2_10_ASC))
|
||||
2 7
|
||||
2 8
|
||||
2 9
|
||||
2 10
|
||||
"""
|
||||
2 10"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -74,12 +74,11 @@ expected_stdout_1 = """PLAN (T INDEX (I_TABLE_2_10_DESC))
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
2 5
|
||||
"""
|
||||
2 5"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -69,8 +69,7 @@ SET TERM ;^
|
||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
|
||||
test_script_1 = """SET PLAN OFF;
|
||||
SELECT O_FIELD, O_COUNT FROM PR_A_TEST_STARTING_WITH('');
|
||||
"""
|
||||
SELECT O_FIELD, O_COUNT FROM PR_A_TEST_STARTING_WITH('');"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -85,5 +84,5 @@ F3 - NOT INDEXED 3"""
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -69,8 +69,7 @@ SET TERM ;^
|
||||
db_1 = db_factory(charset='ISO8859_1', sql_dialect=3, init=init_script_1)
|
||||
|
||||
test_script_1 = """SET PLAN OFF;
|
||||
SELECT O_FIELD, O_COUNT FROM PR_A_TEST_STARTING_WITH('');
|
||||
"""
|
||||
SELECT O_FIELD, O_COUNT FROM PR_A_TEST_STARTING_WITH('');"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -85,5 +84,5 @@ F3 - NOT INDEXED 3"""
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -72,5 +72,5 @@ expected_stdout_1 = """
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -92,5 +92,5 @@ expected_stdout_1 = """PLAN (T66 INDEX (I_TABLE_66_ASC))
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -106,12 +106,11 @@ expected_stdout_1 = """PLAN (T66 INDEX (I_TABLE_66_ASC))
|
||||
-8
|
||||
-4
|
||||
-2
|
||||
-1
|
||||
"""
|
||||
-1"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -64,12 +64,11 @@ A
|
||||
AA
|
||||
AAA
|
||||
AAAA
|
||||
AAAAB
|
||||
"""
|
||||
AAAAB"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -64,12 +64,11 @@ A
|
||||
AA
|
||||
AAA
|
||||
AAAA
|
||||
AAAAB
|
||||
"""
|
||||
AAAAB"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -74,12 +74,11 @@ expected_stdout_1 = """PLAN (T INDEX (I_TABLE_2_10_ASC))
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
2 5
|
||||
"""
|
||||
2 5"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -86,12 +86,11 @@ expected_stdout_1 = """PLAN (T66 INDEX (I_TABLE_66_DESC))
|
||||
1048575
|
||||
524287
|
||||
262143
|
||||
131071
|
||||
"""
|
||||
131071"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -85,12 +85,11 @@ expected_stdout_1 = """PLAN (T66 INDEX (I_TABLE_66_DESC))
|
||||
2097151
|
||||
1048575
|
||||
524287
|
||||
262143
|
||||
"""
|
||||
262143"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -74,12 +74,11 @@ expected_stdout_1 = """PLAN (T INDEX (I_TABLE_2_10_DESC))
|
||||
1 7
|
||||
1 8
|
||||
1 9
|
||||
1 10
|
||||
"""
|
||||
1 10"""
|
||||
|
||||
@pytest.mark.version('>=1.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
# qmid: functional.arno.indexes.upper_lower_bounds_01
|
||||
|
||||
import pytest
|
||||
from firebird.qa import db_factory, isql_act, Action
|
||||
from firebird.qa import db_factory, python_act, Action
|
||||
|
||||
# version: 3.0
|
||||
# resources: None
|
||||
@ -98,18 +98,28 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
# #SET STATS ON;
|
||||
# #SELECT B.B_INFO, A.A_VALUE FROM TableB B LEFT JOIN TableA A ON (1 = 0);
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """COUNT
|
||||
--------------------
|
||||
1
|
||||
sequential : {}
|
||||
indexed : {128: 1}
|
||||
"""
|
||||
act_1 = python_act('db_1', substitutions=substitutions_1)
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
|
||||
|
||||
def test_1(act_1: Action):
|
||||
sequential = {}
|
||||
indexed = {}
|
||||
with act_1.db.connect() as con:
|
||||
for tbl in con.info.get_table_access_stats():
|
||||
if tbl.table_id >= 128:
|
||||
sequential[tbl.table_id] = tbl.sequential
|
||||
indexed[tbl.table_id] = tbl.indexed
|
||||
with con.cursor() as c:
|
||||
c.execute("SELECT Count(*) FROM Table_1000 t1000 WHERE t1000.ID > 1 and t1000.ID >= 100 and t1000.ID = 500 and t1000.ID <= 900 and t1000.ID < 1000")
|
||||
cnt = c.fetchone()[0]
|
||||
for tbl in con.info.get_table_access_stats():
|
||||
if tbl.table_id >= 128:
|
||||
if tbl.sequential:
|
||||
sequential[tbl.table_id] = tbl.sequential - sequential.get(tbl.table_id, 0)
|
||||
if tbl.indexed:
|
||||
indexed[tbl.table_id] = tbl.indexed - indexed.get(tbl.table_id, 0)
|
||||
# Check
|
||||
assert cnt == 1
|
||||
assert sequential == {}
|
||||
assert indexed == {128: 1}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# qmid: functional.arno.indexes.upper_lower_bounds_02
|
||||
|
||||
import pytest
|
||||
from firebird.qa import db_factory, isql_act, Action
|
||||
from firebird.qa import db_factory, python_act, Action
|
||||
|
||||
# version: 3.0
|
||||
# resources: None
|
||||
@ -97,18 +97,28 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
# #SET STATS ON;
|
||||
# #SELECT B.B_INFO, A.A_VALUE FROM TableB B LEFT JOIN TableA A ON (1 = 0);
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """COUNT
|
||||
--------------------
|
||||
201
|
||||
sequential : {}
|
||||
indexed : {128: 201}
|
||||
"""
|
||||
act_1 = python_act('db_1', substitutions=substitutions_1)
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
|
||||
|
||||
def test_1(act_1: Action):
|
||||
sequential = {}
|
||||
indexed = {}
|
||||
with act_1.db.connect() as con:
|
||||
for tbl in con.info.get_table_access_stats():
|
||||
if tbl.table_id >= 128:
|
||||
sequential[tbl.table_id] = tbl.sequential
|
||||
indexed[tbl.table_id] = tbl.indexed
|
||||
with con.cursor() as c:
|
||||
c.execute("SELECT Count(*) FROM Table_1000 t1000 WHERE t1000.ID > 1 and t1000.ID >= 400 and t1000.ID <= 600 and t1000.ID < 1000")
|
||||
cnt = c.fetchone()[0]
|
||||
for tbl in con.info.get_table_access_stats():
|
||||
if tbl.table_id >= 128:
|
||||
if tbl.sequential:
|
||||
sequential[tbl.table_id] = tbl.sequential - sequential.get(tbl.table_id, 0)
|
||||
if tbl.indexed:
|
||||
indexed[tbl.table_id] = tbl.indexed - indexed.get(tbl.table_id, 0)
|
||||
# Check
|
||||
assert cnt == 201
|
||||
assert sequential == {}
|
||||
assert indexed == {128: 201}
|
||||
|
@ -86,12 +86,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F NATURAL, C INDEX (PK_COLORS)))
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -93,12 +93,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F NATURAL, C INDEX (PK_COLORS)))
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -83,12 +83,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
COLORID COLORNAME COUNT
|
||||
============ ==================== =====================
|
||||
1 Red 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -91,12 +91,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
COLORID COLORNAME COUNT
|
||||
============ ==================== =====================
|
||||
2 White 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -102,12 +102,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (V F INDEX (FK_FLOWERS_COLORS), V C INDEX
|
||||
4 Yellow 2
|
||||
5 Black 1
|
||||
6 Purple 1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -101,12 +101,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (V F INDEX (FK_FLOWERS_COLORS), V C INDEX
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -88,12 +88,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
4 Yellow 2
|
||||
5 Black 1
|
||||
6 Purple 1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -87,12 +87,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
4 Yellow 2
|
||||
5 Black 1
|
||||
6 Purple 1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -86,12 +86,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -86,12 +86,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -85,12 +85,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK
|
||||
2 White 2
|
||||
3 Blue 2
|
||||
4 Yellow 2
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -78,12 +78,11 @@ HAVING
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK_COLORS)))
|
||||
"""
|
||||
expected_stdout_1 = """PLAN SORT (JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK_COLORS)))"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -85,12 +85,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (C INDEX (I_COLORS_COLORNAME), F INDEX (F
|
||||
============ ==================== =====================
|
||||
3 Blue 2
|
||||
5 Black 1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -85,12 +85,11 @@ expected_stdout_1 = """PLAN SORT (JOIN (C INDEX (I_COLORS_COLORNAME), F INDEX (F
|
||||
============ ==================== =====================
|
||||
3 Blue 2
|
||||
5 Black 1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -54,5 +54,5 @@ expected_stdout_1 = """
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -22,7 +22,50 @@ from firebird.qa import db_factory, isql_act, Action
|
||||
|
||||
substitutions_1 = [('=', ''), ('[ \t]+', ' ')]
|
||||
|
||||
init_script_1 = """"""
|
||||
init_script_1 = """
|
||||
create table relations (
|
||||
relationid integer,
|
||||
relationname varchar(35)
|
||||
);
|
||||
|
||||
create table categories (
|
||||
categoryid integer,
|
||||
description varchar(20)
|
||||
);
|
||||
|
||||
create table relationcategories (
|
||||
relationid integer,
|
||||
categoryid integer
|
||||
);
|
||||
commit;
|
||||
|
||||
insert into relations (relationid, relationname) values (1, 'diving snorkel shop');
|
||||
insert into relations (relationid, relationname) values (2, 'bakery garbage');
|
||||
insert into relations (relationid, relationname) values (3, 'racing turtle');
|
||||
insert into relations (relationid, relationname) values (4, 'folding air-hook shop');
|
||||
|
||||
insert into categories (categoryid, description) values (1, 'relation');
|
||||
insert into categories (categoryid, description) values (2, 'debtor');
|
||||
insert into categories (categoryid, description) values (3, 'creditor');
|
||||
insert into categories (categoryid, description) values (4, 'newsletter');
|
||||
|
||||
insert into relationcategories (relationid, categoryid) values (1, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (3, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 3);
|
||||
commit;
|
||||
|
||||
-- Normally these indexes are created by the primary/foreign keys,
|
||||
-- but we don't want to rely on them for this test
|
||||
create unique asc index pk_relations on relations (relationid);
|
||||
create unique asc index pk_categories on categories (categoryid);
|
||||
create unique asc index pk_relationcategories on relationcategories (relationid, categoryid);
|
||||
create asc index fk_rc_relations on relationcategories (relationid);
|
||||
create asc index fk_rc_categories on relationcategories (categoryid);
|
||||
commit;
|
||||
"""
|
||||
|
||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
|
||||
@ -138,10 +181,32 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
#
|
||||
#
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
test_script_1 = """
|
||||
set plan on;
|
||||
-- set list on;
|
||||
-- FULL JOIN should return ...
|
||||
select
|
||||
r.relationname,
|
||||
rc.relationid,
|
||||
rc.categoryid,
|
||||
c.description
|
||||
from relations r
|
||||
full join relationcategories rc on (rc.relationid = r.relationid)
|
||||
full join categories c on (c.categoryid = rc.categoryid)
|
||||
order by
|
||||
rc.relationid desc
|
||||
,r.relationname
|
||||
,rc.categoryid
|
||||
,c.description
|
||||
;
|
||||
"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """
|
||||
Actual plan plan coincides with the expected.
|
||||
PLAN SORT (JOIN (JOIN (C NATURAL, JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS))), C NATURAL)))
|
||||
|
||||
RELATIONNAME RELATIONID CATEGORYID DESCRIPTION
|
||||
=================================== ============ ============ =============
|
||||
racing turtle 3 1 relation
|
||||
@ -154,9 +219,10 @@ expected_stdout_1 = """
|
||||
folding air-hook shop <null> <null> <null>
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
||||
|
@ -26,7 +26,50 @@ from firebird.qa import db_factory, isql_act, Action
|
||||
|
||||
substitutions_1 = [('=', ''), ('[ \t]+', ' ')]
|
||||
|
||||
init_script_1 = """"""
|
||||
init_script_1 = """
|
||||
create table relations (
|
||||
relationid integer,
|
||||
relationname varchar(35)
|
||||
);
|
||||
|
||||
create table categories (
|
||||
categoryid integer,
|
||||
description varchar(20)
|
||||
);
|
||||
|
||||
create table relationcategories (
|
||||
relationid integer,
|
||||
categoryid integer
|
||||
);
|
||||
commit;
|
||||
|
||||
insert into relations (relationid, relationname) values (1, 'diving snorkel shop');
|
||||
insert into relations (relationid, relationname) values (2, 'bakery garbage');
|
||||
insert into relations (relationid, relationname) values (3, 'racing turtle');
|
||||
insert into relations (relationid, relationname) values (4, 'folding air-hook shop');
|
||||
|
||||
insert into categories (categoryid, description) values (1, 'relation');
|
||||
insert into categories (categoryid, description) values (2, 'debtor');
|
||||
insert into categories (categoryid, description) values (3, 'creditor');
|
||||
insert into categories (categoryid, description) values (4, 'newsletter');
|
||||
|
||||
insert into relationcategories (relationid, categoryid) values (1, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (3, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 3);
|
||||
commit;
|
||||
|
||||
-- normally these indexes are created by the primary/foreign keys,
|
||||
-- but we don't want to rely on them for this test
|
||||
create unique asc index pk_relations on relations (relationid);
|
||||
create unique asc index pk_categories on categories (categoryid);
|
||||
create unique asc index pk_relationcategories on relationcategories (relationid, categoryid);
|
||||
create asc index fk_rc_relations on relationcategories (relationid);
|
||||
create asc index fk_rc_categories on relationcategories (categoryid);
|
||||
commit;
|
||||
"""
|
||||
|
||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
|
||||
@ -146,10 +189,33 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
#
|
||||
#
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
test_script_1 = """
|
||||
set plan on;
|
||||
--set list on;
|
||||
|
||||
--full join should return ...
|
||||
select
|
||||
r.relationname,
|
||||
rc.relationid,
|
||||
rc.categoryid,
|
||||
c.description
|
||||
from
|
||||
relations r
|
||||
full join relationcategories rc on (rc.relationid = r.relationid)
|
||||
full join categories c on (c.categoryid = rc.categoryid)
|
||||
where
|
||||
r.relationid >= 2
|
||||
order by
|
||||
rc.relationid desc
|
||||
,rc.categoryid
|
||||
;
|
||||
"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """
|
||||
Actual plan plan coincides with the expected.
|
||||
PLAN SORT (JOIN (JOIN (C NATURAL, JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS))), C NATURAL)))
|
||||
|
||||
RELATIONNAME RELATIONID CATEGORYID DESCRIPTION
|
||||
=================================== ============ ============ ============
|
||||
@ -159,9 +225,8 @@ expected_stdout_1 = """
|
||||
folding air-hook shop <null> <null> <null>
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
@ -22,7 +22,52 @@ from firebird.qa import db_factory, isql_act, Action
|
||||
|
||||
substitutions_1 = []
|
||||
|
||||
init_script_1 = """"""
|
||||
init_script_1 = """
|
||||
create table relations (
|
||||
relationid integer,
|
||||
relationname varchar(35)
|
||||
);
|
||||
|
||||
create table categories (
|
||||
categoryid integer,
|
||||
description varchar(20)
|
||||
);
|
||||
|
||||
create table relationcategories (
|
||||
relationid integer,
|
||||
categoryid integer
|
||||
);
|
||||
commit;
|
||||
|
||||
insert into relations (relationid, relationname) values (1, 'diving snorkel shop');
|
||||
insert into relations (relationid, relationname) values (2, 'bakery garbage');
|
||||
insert into relations (relationid, relationname) values (3, 'racing turtle');
|
||||
insert into relations (relationid, relationname) values (4, 'folding air-hook shop');
|
||||
|
||||
insert into categories (categoryid, description) values (1, 'relation');
|
||||
insert into categories (categoryid, description) values (2, 'debtor');
|
||||
insert into categories (categoryid, description) values (3, 'creditor');
|
||||
insert into categories (categoryid, description) values (4, 'newsletter');
|
||||
|
||||
insert into relationcategories (relationid, categoryid) values (1, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (3, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 3);
|
||||
|
||||
commit;
|
||||
|
||||
-- Normally these indexes are created by the primary/foreign keys,
|
||||
-- but we don't want to rely on them for this test
|
||||
create unique asc index pk_relations on relations (relationid);
|
||||
create unique asc index pk_categories on categories (categoryid);
|
||||
create unique asc index pk_relationcategories on relationcategories (relationid, categoryid);
|
||||
create asc index fk_rc_relations on relationcategories (relationid);
|
||||
create asc index fk_rc_categories on relationcategories (categoryid);
|
||||
|
||||
commit;
|
||||
"""
|
||||
|
||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
|
||||
@ -142,10 +187,30 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
#
|
||||
#
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
test_script_1 = """
|
||||
set plan on;
|
||||
set list on;
|
||||
-- full join should return ...
|
||||
select
|
||||
r.relationname,
|
||||
rc.relationid,
|
||||
rc.categoryid,
|
||||
c.description
|
||||
from
|
||||
relations r
|
||||
full join relationcategories rc on (rc.relationid = r.relationid)
|
||||
full join categories c on (c.categoryid = rc.categoryid)
|
||||
where
|
||||
c.categoryid >= 2
|
||||
order by
|
||||
rc.categoryid desc;
|
||||
"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """
|
||||
Actual plan plan coincides with the expected.
|
||||
PLAN SORT (JOIN (JOIN (C INDEX (PK_CATEGORIES), JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS))), C INDEX (PK_CATEGORIES))))
|
||||
|
||||
RELATIONNAME diving snorkel shop
|
||||
RELATIONID 1
|
||||
@ -165,9 +230,8 @@ expected_stdout_1 = """
|
||||
DESCRIPTION newsletter
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
@ -24,7 +24,53 @@ from firebird.qa import db_factory, isql_act, Action
|
||||
|
||||
substitutions_1 = []
|
||||
|
||||
init_script_1 = """"""
|
||||
init_script_1 = """
|
||||
create table relations (
|
||||
relationid integer,
|
||||
relationname varchar(35)
|
||||
);
|
||||
|
||||
create table categories (
|
||||
categoryid integer,
|
||||
description varchar(20)
|
||||
);
|
||||
|
||||
create table relationcategories (
|
||||
relationid integer,
|
||||
categoryid integer
|
||||
);
|
||||
|
||||
commit;
|
||||
|
||||
insert into relations (relationid, relationname) values (1, 'diving snorkel shop');
|
||||
insert into relations (relationid, relationname) values (2, 'bakery garbage');
|
||||
insert into relations (relationid, relationname) values (3, 'racing turtle');
|
||||
insert into relations (relationid, relationname) values (4, 'folding air-hook shop');
|
||||
|
||||
insert into categories (categoryid, description) values (1, 'relation');
|
||||
insert into categories (categoryid, description) values (2, 'debtor');
|
||||
insert into categories (categoryid, description) values (3, 'creditor');
|
||||
insert into categories (categoryid, description) values (4, 'newsletter');
|
||||
|
||||
insert into relationcategories (relationid, categoryid) values (1, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (3, 1);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (2, 2);
|
||||
insert into relationcategories (relationid, categoryid) values (1, 3);
|
||||
|
||||
commit;
|
||||
|
||||
-- normally these indexes are created by the primary/foreign keys,
|
||||
-- but we don't want to rely on them for this test
|
||||
create unique asc index pk_relations on relations (relationid);
|
||||
create unique asc index pk_categories on categories (categoryid);
|
||||
create unique asc index pk_relationcategories on relationcategories (relationid, categoryid);
|
||||
create asc index fk_rc_relations on relationcategories (relationid);
|
||||
create asc index fk_rc_categories on relationcategories (categoryid);
|
||||
|
||||
commit;
|
||||
"""
|
||||
|
||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
|
||||
@ -165,10 +211,42 @@ db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
||||
#
|
||||
#
|
||||
#---
|
||||
#act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
test_script_1 = """
|
||||
set plan on;
|
||||
set list on;
|
||||
|
||||
select
|
||||
r.relationname,
|
||||
rc.relationid,
|
||||
rc.categoryid,
|
||||
c.description
|
||||
from
|
||||
relations r
|
||||
full join relationcategories rc on (rc.relationid = r.relationid)
|
||||
full join categories c on (c.categoryid = rc.categoryid)
|
||||
where
|
||||
rc.categoryid is null and c.categoryid >= 1
|
||||
|
||||
UNION ALL --- ::::::: U N I O N A L L :::::::
|
||||
|
||||
select
|
||||
r.relationname,
|
||||
rc.relationid,
|
||||
rc.categoryid,
|
||||
c.description
|
||||
from
|
||||
relations r
|
||||
full join relationcategories rc on (rc.relationid = r.relationid)
|
||||
full join categories c on (c.categoryid = rc.categoryid)
|
||||
where
|
||||
rc.relationid is null and r.relationid >= 1;
|
||||
"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """
|
||||
Actual plan plan coincides with the expected.
|
||||
PLAN (JOIN (JOIN (C INDEX (PK_CATEGORIES), JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS))), C INDEX (PK_CATEGORIES))), JOIN (JOIN (C NATURAL, JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS))), C NATURAL)))
|
||||
|
||||
RELATIONNAME <null>
|
||||
RELATIONID <null>
|
||||
@ -180,9 +258,8 @@ expected_stdout_1 = """
|
||||
DESCRIPTION <null>
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5')
|
||||
@pytest.mark.xfail
|
||||
def test_1(db_1):
|
||||
pytest.fail("Test not IMPLEMENTED")
|
||||
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
@ -72,8 +72,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
Table_100 t100
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -82,12 +81,11 @@ expected_stdout_1 = """PLAN JOIN (T10 NATURAL, T100 INDEX (PK_TABLE_100))
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -94,8 +94,7 @@ SELECT
|
||||
FROM
|
||||
Table_3K t3K
|
||||
JOIN Table_100 t100 ON (t100.ID = t3K.ID)
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -104,12 +103,11 @@ expected_stdout_1 = """PLAN JOIN (T10 NATURAL, T100 INDEX (PK_TABLE_100), T3K IN
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -113,35 +113,20 @@ FROM
|
||||
JOIN Table_4K t4K ON (t4K.ID = t3K.ID)
|
||||
JOIN Table_1K t1K ON (t1K.ID = t4K.ID)
|
||||
JOIN Table_2K t2K ON (t2K.ID = t1K.ID)
|
||||
JOIN Table_1 t1 ON (t1.ID = t2K.ID);
|
||||
"""
|
||||
JOIN Table_1 t1 ON (t1.ID = t2K.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
expected_stdout_1 = """PLAN JOIN (T1 NATURAL, T1K INDEX (PK_TABLE_1K), T2K INDEX (PK_TABLE_2K), T3K INDEX (PK_TABLE_3K), T5K INDEX (PK_TABLE_5K), T4K INDEX (PK_TABLE_4K), T6K INDEX (PK_TABLE_6K), T8K INDEX (PK_TABLE_8K), T10K INDEX (PK_TABLE_10K))
|
||||
expected_stdout_1 = """PLAN JOIN (T1 NATURAL, T1K INDEX (PK_TABLE_1K), T2K INDEX (PK_TABLE_2K), T3K INDEX (PK_TABLE_3K), T4K INDEX (PK_TABLE_4K), T5K INDEX (PK_TABLE_5K), T6K INDEX (PK_TABLE_6K), T8K INDEX (PK_TABLE_8K), T10K INDEX (PK_TABLE_10K))
|
||||
|
||||
COUNT
|
||||
=====================
|
||||
1
|
||||
"""
|
||||
============
|
||||
|
||||
@pytest.mark.version('>=2.0,<4')
|
||||
1"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
|
||||
expected_stdout_2 = """PLAN JOIN (T1 NATURAL, T1K INDEX (PK_TABLE_1K), T2K INDEX (PK_TABLE_2K), T3K INDEX (PK_TABLE_3K), T4K INDEX (PK_TABLE_4K), T5K INDEX (PK_TABLE_5K), T6K INDEX (PK_TABLE_6K), T8K INDEX (PK_TABLE_8K), T10K INDEX (PK_TABLE_10K))
|
||||
|
||||
COUNT
|
||||
=====================
|
||||
1
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=4')
|
||||
def test_1(act_1: Action):
|
||||
act_1.charset = 'NONE'
|
||||
act_1.expected_stdout = expected_stdout_2
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -321,12 +321,11 @@ expected_stdout_1 = """PLAN JOIN (C INDEX (PK_COUNTRIES), R INDEX (FK_RELATIONS_
|
||||
COUNT
|
||||
=====================
|
||||
0
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -314,8 +314,7 @@ FROM
|
||||
WHERE
|
||||
c.CountryName LIKE 'N%'
|
||||
ORDER BY
|
||||
r.RelationName DESC;
|
||||
"""
|
||||
r.RelationName DESC;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -326,12 +325,11 @@ RELATIONNAME COUNTRYNAME
|
||||
|
||||
University Leiden NETHERLANDS
|
||||
University Delft NETHERLANDS
|
||||
University Amsterdam NETHERLANDS
|
||||
"""
|
||||
University Amsterdam NETHERLANDS"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -91,8 +91,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
View_100 v100
|
||||
JOIN View_10 v10 ON (v10.ID = v100.ID);
|
||||
"""
|
||||
JOIN View_10 v10 ON (v10.ID = v100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -101,12 +100,11 @@ expected_stdout_1 = """PLAN JOIN (V10 TABLE_10 NATURAL, V100 TABLE_100 INDEX (PK
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -129,8 +129,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
View_B vb
|
||||
JOIN View_A va ON (va.ID1K = vb.ID10K);
|
||||
"""
|
||||
JOIN View_A va ON (va.ID1K = vb.ID10K);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -140,12 +139,11 @@ expected_stdout_1 = """PLAN JOIN (VA T1K NATURAL, VB T3K INDEX (PK_TABLE_3K), VA
|
||||
COUNT
|
||||
============
|
||||
|
||||
1000
|
||||
"""
|
||||
1000"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -122,8 +122,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
View_B vb
|
||||
JOIN View_A va ON (va.ID1 = vb.ID100);
|
||||
"""
|
||||
JOIN View_A va ON (va.ID1 = vb.ID100);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -132,12 +131,11 @@ expected_stdout_1 = """PLAN JOIN (JOIN (VA T1 NATURAL, VA T250 INDEX (PK_TABLE_2
|
||||
COUNT
|
||||
=====================
|
||||
1
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -105,7 +105,6 @@ FROM
|
||||
WHERE
|
||||
t250.ID = t1.ID and
|
||||
t100.ID = t1.ID;
|
||||
|
||||
"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
@ -115,12 +114,11 @@ expected_stdout_1 = """PLAN JOIN (T1 NATURAL, T50 INDEX (PK_TABLE_50), T100 INDE
|
||||
COUNT
|
||||
============
|
||||
|
||||
1
|
||||
"""
|
||||
1"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -93,8 +93,7 @@ SELECT
|
||||
FROM
|
||||
Table_50 t50
|
||||
JOIN Table_100 t100 ON (t100.ID = t50.ID)
|
||||
JOIN Table_250 t250 ON (t250.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_250 t250 ON (t250.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -103,12 +102,11 @@ expected_stdout_1 = """PLAN JOIN (T50 NATURAL, T100 INDEX (PK_TABLE_100), T250 I
|
||||
COUNT
|
||||
============
|
||||
|
||||
50
|
||||
"""
|
||||
50"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -68,8 +68,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
Table_100 t100
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -78,12 +77,11 @@ expected_stdout_1 = """PLAN HASH (T100 NATURAL, T10 NATURAL)
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -87,8 +87,7 @@ SELECT
|
||||
FROM
|
||||
Table_1000 t1000
|
||||
JOIN Table_100 t100 ON (t100.ID = t1000.ID)
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -97,12 +96,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, T100 NATURAL, T10 NATURAL)
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -68,8 +68,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
Table_100 t100
|
||||
JOIN Table_10 t10 ON (t10.ID + (2 * 10) = t100.ID + 20);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID + (2 * 10) = t100.ID + 20);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -78,12 +77,11 @@ expected_stdout_1 = """PLAN HASH (T100 NATURAL, T10 NATURAL)
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -79,8 +79,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
Table_100 t100
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -89,12 +88,11 @@ expected_stdout_1 = """PLAN HASH (T100 NATURAL, T10 NATURAL)
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -98,8 +98,7 @@ SELECT
|
||||
Count(*)
|
||||
FROM
|
||||
Table_1000 t1000
|
||||
JOIN View_A va ON (va.ID100 = t1000.ID);
|
||||
"""
|
||||
JOIN View_A va ON (va.ID100 = t1000.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -108,12 +107,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, VA T100 NATURAL, VA T10 NATURAL
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -84,8 +84,7 @@ SELECT
|
||||
FROM
|
||||
Table_100 t100
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID)
|
||||
JOIN PR_List_1000 sp1000 ON (sp1000.ID = t10.ID);
|
||||
"""
|
||||
JOIN PR_List_1000 sp1000 ON (sp1000.ID = t10.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -94,12 +93,11 @@ expected_stdout_1 = """PLAN HASH (T100 NATURAL, T10 NATURAL, SP1000 NATURAL)
|
||||
COUNT
|
||||
=====================
|
||||
5
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -59,8 +59,7 @@ SELECT
|
||||
c.ColorName
|
||||
FROM
|
||||
Flowers f
|
||||
LEFT JOIN Colors c ON (1 = 0);
|
||||
"""
|
||||
LEFT JOIN Colors c ON (1 = 0);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -71,12 +70,11 @@ FLOWERNAME COLORNAME
|
||||
Rose <null>
|
||||
Tulip <null>
|
||||
Gerbera <null>
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -62,8 +62,7 @@ FROM
|
||||
Flowers f
|
||||
LEFT JOIN Colors c ON (1 = 0)
|
||||
WHERE
|
||||
c.ColorID IS NULL;
|
||||
"""
|
||||
c.ColorID IS NULL;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -73,12 +72,11 @@ FLOWERNAME COLORNAME
|
||||
|
||||
Rose <null>
|
||||
Tulip <null>
|
||||
Gerbera <null>
|
||||
"""
|
||||
Gerbera <null>"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -72,12 +72,11 @@ FLOWERNAME COLORNAME
|
||||
|
||||
Rose Red
|
||||
Tulip Yellow
|
||||
Gerbera Not defined
|
||||
"""
|
||||
Gerbera Not defined"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -61,8 +61,7 @@ SELECT
|
||||
c.ColorName
|
||||
FROM
|
||||
Flowers f
|
||||
LEFT JOIN Colors c ON (c.ColorID = f.ColorID);
|
||||
"""
|
||||
LEFT JOIN Colors c ON (c.ColorID = f.ColorID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -72,12 +71,11 @@ FLOWERNAME COLORNAME
|
||||
|
||||
Rose Red
|
||||
Tulip Yellow
|
||||
Gerbera Not defined
|
||||
"""
|
||||
Gerbera Not defined"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -62,8 +62,7 @@ SELECT
|
||||
FROM
|
||||
Flowers f
|
||||
LEFT JOIN Colors c ON ((c.ColorID = f.ColorID) AND
|
||||
(c.ColorID >= 1));
|
||||
"""
|
||||
(c.ColorID >= 1));"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -79,5 +78,5 @@ Gerbera <null>"""
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -66,8 +66,7 @@ FROM
|
||||
LEFT JOIN Colors c ON (c.ColorID = f1.ColorID) AND (c.ColorID > 0)
|
||||
WHERE
|
||||
(f2.ColorID = f1.ColorID) AND
|
||||
(c.ColorID > 0);
|
||||
"""
|
||||
(c.ColorID > 0);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -77,12 +76,11 @@ FLOWERNAME FLOWERNAME COLORNAME
|
||||
============================== ============================== ====================
|
||||
|
||||
Rose Rose Red
|
||||
Tulip Tulip Yellow
|
||||
"""
|
||||
Tulip Tulip Yellow"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -63,8 +63,7 @@ FROM
|
||||
Flowers f
|
||||
JOIN Colors c1 ON (c1.ColorID = f.ColorID)
|
||||
LEFT JOIN Colors c2 ON (c2.ColorID = c1.ColorID)
|
||||
JOIN Colors c3 ON (c3.ColorID = c1.ColorID);
|
||||
"""
|
||||
JOIN Colors c3 ON (c3.ColorID = c1.ColorID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -75,12 +74,11 @@ expected_stdout_1 = """PLAN JOIN (JOIN (JOIN (F NATURAL, C1 INDEX (PK_COLORS)),
|
||||
|
||||
1 1 1 1
|
||||
2 2 2 2
|
||||
0 0 0 0
|
||||
"""
|
||||
0 0 0 0"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -62,8 +62,7 @@ FROM
|
||||
LEFT JOIN Colors c ON (c.ColorID = f.ColorID) AND
|
||||
(c.ColorID > 0)
|
||||
WHERE
|
||||
f.ColorID >= 0;
|
||||
"""
|
||||
f.ColorID >= 0;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -75,12 +74,11 @@ PLAN JOIN (F INDEX (FK_FLOWERS_COLORS), C INDEX (PK_COLORS))
|
||||
1 1
|
||||
2 2
|
||||
0 <null>
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=2.5')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -72,12 +72,11 @@ expected_stdout_1 = """PLAN JOIN (JOIN (F NATURAL, C1 INDEX (PK_COLORS)), C2 IND
|
||||
|
||||
1 1 1
|
||||
2 2 2
|
||||
0 <null> 0
|
||||
"""
|
||||
0 <null> 0"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -62,8 +62,7 @@ FROM
|
||||
Flowers f
|
||||
LEFT JOIN Colors c ON (1 = 0)
|
||||
WHERE
|
||||
c.ColorID IS NULL or c.ColorID = 1;
|
||||
"""
|
||||
c.ColorID IS NULL or c.ColorID = 1;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -73,12 +72,11 @@ FLOWERNAME COLORNAME
|
||||
|
||||
Rose <null>
|
||||
Tulip <null>
|
||||
Gerbera <null>
|
||||
"""
|
||||
Gerbera <null>"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -84,5 +84,5 @@ expected_stdout_1 = """
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -73,12 +73,11 @@ expected_stdout_1 = """PLAN JOIN (F NATURAL, C INDEX (PK_COLORS))
|
||||
FLOWERNAME COLORNAME
|
||||
============================== ====================
|
||||
|
||||
Blanc <null>
|
||||
"""
|
||||
Blanc <null>"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -71,8 +71,7 @@ SELECT
|
||||
vc.ColorName
|
||||
FROM
|
||||
Flowers f
|
||||
LEFT JOIN VW_Colors vc ON (vc.ColorID = f.ColorID);
|
||||
"""
|
||||
LEFT JOIN VW_Colors vc ON (vc.ColorID = f.ColorID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -82,12 +81,11 @@ FLOWERNAME COLORNAME
|
||||
|
||||
Rose Red
|
||||
Tulip Yellow
|
||||
Gerbera Not defined
|
||||
"""
|
||||
Gerbera Not defined"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -90,8 +90,7 @@ SELECT
|
||||
FROM
|
||||
Table_1000 t1000
|
||||
JOIN Table_100 t100 ON (t100.ID = t1000.ID)
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -100,12 +99,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, JOIN (T10 NATURAL, T100 INDEX (
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -90,8 +90,7 @@ SELECT
|
||||
FROM
|
||||
Table_1000 t1000
|
||||
LEFT JOIN Table_100 t100 ON (t100.ID = t1000.ID)
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_10 t10 ON (t10.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -100,12 +99,11 @@ expected_stdout_1 = """PLAN HASH (T10 NATURAL, JOIN (T1000 NATURAL, T100 INDEX (
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -97,8 +97,7 @@ FROM
|
||||
Table_10 t10
|
||||
LEFT JOIN Table_1 t1 ON (t1.ID = t10.ID)
|
||||
JOIN Table_1000 t1000 ON (t1000.ID = t10.ID)
|
||||
JOIN Table_100 t100 ON (t100.ID = t1000.ID);
|
||||
"""
|
||||
JOIN Table_100 t100 ON (t100.ID = t1000.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -107,12 +106,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, JOIN (JOIN (T10 NATURAL, T1 IND
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -103,8 +103,7 @@ FROM
|
||||
LEFT JOIN Table_1 t1 ON (t1.ID = t10.ID)
|
||||
JOIN Table_100 t100 ON (t100.ID = t10.ID)
|
||||
LEFT JOIN Table_50 t50 ON (t50.ID = t100.ID)
|
||||
JOIN Table_1000 t1000 ON (t1000.ID = t100.ID);
|
||||
"""
|
||||
JOIN Table_1000 t1000 ON (t1000.ID = t100.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -113,12 +112,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, JOIN (HASH (T100 NATURAL, JOIN
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -110,8 +110,7 @@ FROM
|
||||
JOIN Table_1000 t1000 ON (t1000.ID = t500.ID)
|
||||
LEFT JOIN Table_10 t10 ON (t10.ID = t1000.ID)
|
||||
JOIN Table_50 t50 ON (t50.ID = t10.ID)
|
||||
JOIN Table_100 t100 ON (t100.ID = t500.ID);
|
||||
"""
|
||||
JOIN Table_100 t100 ON (t100.ID = t500.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -120,12 +119,11 @@ expected_stdout_1 = """PLAN HASH (T100 NATURAL, JOIN (JOIN (HASH (T1000 NATURAL,
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -109,8 +109,7 @@ FROM
|
||||
JOIN Table_1000 t1000 ON (t1000.ID = t500.ID)
|
||||
JOIN Table_10 t10 ON (t10.ID = t1000.ID)
|
||||
JOIN Table_50 t50 ON (t50.ID = t10.ID)
|
||||
JOIN Table_100 t100 ON (t100.ID = t500.ID);
|
||||
"""
|
||||
JOIN Table_100 t100 ON (t100.ID = t500.ID);"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -119,12 +118,11 @@ expected_stdout_1 = """PLAN HASH (T1000 NATURAL, T100 NATURAL, T10 NATURAL, JOIN
|
||||
COUNT
|
||||
=====================
|
||||
10
|
||||
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -74,8 +74,7 @@ FROM
|
||||
WHERE
|
||||
st.F1 = 5 and
|
||||
st.F2 = 50 and
|
||||
st.F3 = 550;
|
||||
"""
|
||||
st.F3 = 550;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -84,12 +83,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F1_F2_UNIQUE_ASC))
|
||||
F1 F2 F3
|
||||
============ ============ ============
|
||||
|
||||
5 50 550
|
||||
"""
|
||||
5 50 550"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -94,12 +94,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F1_F2_ASC))
|
||||
F1 F2 F3
|
||||
============ ============ ============
|
||||
|
||||
150 0 150
|
||||
"""
|
||||
150 0 150"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -91,12 +91,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F1_ASC))
|
||||
F1 F2 F3
|
||||
============ ============ ============
|
||||
|
||||
555 550 5
|
||||
"""
|
||||
555 550 5"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -73,8 +73,7 @@ FROM
|
||||
WHERE
|
||||
st.F1 >= 1 and
|
||||
st.F2 = 100 and
|
||||
st.F3 = 100;
|
||||
"""
|
||||
st.F3 = 100;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -83,12 +82,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F3_F2_ASC))
|
||||
F1 F2 F3
|
||||
============ ============ ============
|
||||
|
||||
100 100 100
|
||||
"""
|
||||
100 100 100"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -79,8 +79,7 @@ FROM
|
||||
WHERE
|
||||
st.F1 >= 1 and
|
||||
st.F2 = 100 and
|
||||
st.F3 = 100;
|
||||
"""
|
||||
st.F3 = 100;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -89,12 +88,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F3_F2_F1_ASC))
|
||||
F1 F2 F3
|
||||
============ ============ ============
|
||||
|
||||
100 100 100
|
||||
"""
|
||||
100 100 100"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -76,8 +76,7 @@ FROM
|
||||
SelectionTest st
|
||||
WHERE
|
||||
st.F1 = 55 and
|
||||
st.F2 IS NULL;
|
||||
"""
|
||||
st.F2 IS NULL;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -90,12 +89,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F1_F2_ASC))
|
||||
55 <null>
|
||||
55 <null>
|
||||
55 <null>
|
||||
55 <null>
|
||||
"""
|
||||
55 <null>"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -69,8 +69,7 @@ FROM
|
||||
SelectionTest st
|
||||
WHERE
|
||||
st.F1 = 100 and
|
||||
st.F2 STARTING WITH '55';
|
||||
"""
|
||||
st.F2 STARTING WITH '55';"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -79,12 +78,11 @@ expected_stdout_1 = """PLAN (ST INDEX (I_F1_F2_ASC))
|
||||
F1 F2
|
||||
============ ==================
|
||||
|
||||
100 55
|
||||
"""
|
||||
100 55"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -85,8 +85,7 @@ FROM
|
||||
WHERE
|
||||
RDB$RELATION_NAME = 'SELECTIVITYTEST'
|
||||
ORDER BY
|
||||
RDB$INDEX_NAME;
|
||||
"""
|
||||
RDB$INDEX_NAME;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -100,12 +99,11 @@ I_F02_DESC 0.00200
|
||||
I_F05_ASC 0.00498
|
||||
I_F05_DESC 0.00498
|
||||
I_F50_ASC 0.04762
|
||||
I_F50_DESC 0.04762
|
||||
"""
|
||||
I_F50_DESC 0.04762"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
@ -76,8 +76,7 @@ FROM
|
||||
WHERE
|
||||
RDB$RELATION_NAME = 'SELECTIVITYTEST'
|
||||
ORDER BY
|
||||
RDB$INDEX_NAME;
|
||||
"""
|
||||
RDB$INDEX_NAME;"""
|
||||
|
||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
||||
|
||||
@ -91,12 +90,11 @@ I_F02_DESC 0.00200
|
||||
I_F05_ASC 0.00498
|
||||
I_F05_DESC 0.00498
|
||||
I_F50_ASC 0.04762
|
||||
I_F50_DESC 0.04762
|
||||
"""
|
||||
I_F50_DESC 0.04762"""
|
||||
|
||||
@pytest.mark.version('>=2.0')
|
||||
def test_1(act_1: Action):
|
||||
act_1.expected_stdout = expected_stdout_1
|
||||
act_1.execute()
|
||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
||||
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user