sql.select.SelectTest inconsistency

Issue #669 resolved
jek created an issue
{{{
#!text
======================================================================
FAIL: testalias (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 418, in testalias
    WHERE mytable.myid = myothertable.otherid) AS t2view WHERE t2view.mytable_myid = :t2view_mytable_myid"
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT t2view.mytable_myid AS t2view_mytable_myid, t2view.mytable_name AS t2view_mytable_name, t2view.mytable_description AS t2view_mytable_description, t2view.myothertable_otherid AS t2view_myothertable_otherid FROM (SELECT mytable.myid AS mytable_myid, mytable.name AS mytable_name, mytable.description AS mytable_description, myothertable.otherid AS myothertable_otherid FROM myothertable, mytable WHERE mytable.myid = myothertable.otherid) AS t2view WHERE t2view.mytable_myid = :t2view_mytable_myid'
 does not match 
'SELECT t2view.mytable_myid AS t2view_mytable_myid, t2view.mytable_name AS t2view_mytable_name, t2view.mytable_description AS t2view_mytable_description, t2view.myothertable_otherid AS t2view_myothertable_otherid FROM (SELECT mytable.myid AS mytable_myid, mytable.name AS mytable_name, mytable.description AS mytable_description, myothertable.otherid AS myothertable_otherid FROM mytable, myothertable WHERE mytable.myid = myothertable.otherid) AS t2view WHERE t2view.mytable_myid = :t2view_mytable_myid'

======================================================================
FAIL: testand (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 246, in testand
    "SELECT * FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND mytable.name = :mytable_name AND myothertable.othername = :myothertable_othername AND sysdate() = today()"
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT * FROM myothertable, mytable WHERE mytable.myid = :mytable_myid AND mytable.name = :mytable_name AND myothertable.othername = :myothertable_othername AND sysdate() = today()'
 does not match 
'SELECT * FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND mytable.name = :mytable_name AND myothertable.othername = :myothertable_othername AND sysdate() = today()'

======================================================================
FAIL: testcolumnsubquery (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 199, in testcolumnsubquery
    self.runtest(select([s](table1,)), "SELECT mytable.myid, mytable.name, mytable.description, (SELECT mytable.myid FROM mytable) FROM mytable")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT mytable.myid, mytable.name, mytable.description, myid FROM mytable'
 does not match 
'SELECT mytable.myid, mytable.name, mytable.description, (SELECT mytable.myid FROM mytable) FROM mytable'

======================================================================
FAIL: testdontovercorrelate (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 136, in testdontovercorrelate
    self.runtest(select([table1](table1), from_obj=[table1.select()](table1,)), """SELECT mytable.myid, mytable.name, mytable.description FROM mytable, (SELECT mytable.myid AS myid, mytable.name AS name, mytable.description AS description FROM mytable)""")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT mytable.myid, mytable.name, mytable.description FROM (SELECT mytable.myid AS myid, mytable.name AS name, mytable.description AS description FROM mytable), mytable'
 does not match 
'SELECT mytable.myid, mytable.name, mytable.description FROM mytable, (SELECT mytable.myid AS myid, mytable.name AS name, mytable.description AS description FROM mytable)'

======================================================================
FAIL: testmssql_noorderbyinsubquery (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 132, in testmssql_noorderbyinsubquery
    self.runtest(select(['*']('*'), crit), """SELECT * FROM (SELECT mytable.myid AS myid FROM mytable ORDER BY mytable.myid) AS foo, mytable WHERE foo.myid = mytable.myid""", dialect=sqlite.dialect())
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT * FROM mytable, (SELECT mytable.myid AS myid FROM mytable ORDER BY mytable.myid) AS foo WHERE foo.myid = mytable.myid'
 does not match 
'SELECT * FROM (SELECT mytable.myid AS myid FROM mytable ORDER BY mytable.myid) AS foo, mytable WHERE foo.myid = mytable.myid'

======================================================================
FAIL: testor (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 257, in testor
    checkparams = {'myothertable_othername': 'asdf', 'myothertable_othername_1':'foo', 'myothertable_otherid': 9, 'mytable_myid': 12}
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT mytable.myid, mytable.name, mytable.description FROM myothertable, mytable WHERE mytable.myid = :mytable_myid AND (myothertable.othername = :myothertable_othername OR myothertable.othername = :myothertable_othername_1 OR myothertable.otherid = :myothertable_otherid) AND sysdate() = today()'
 does not match 
'SELECT mytable.myid, mytable.name, mytable.description FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND (myothertable.othername = :myothertable_othername OR myothertable.othername = :myothertable_othername_1 OR myothertable.otherid = :myothertable_otherid) AND sysdate() = today()'

======================================================================
FAIL: testselectselect (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 114, in testselectselect
    sq.myothertable_othername FROM (" + sqstring + ") AS sq")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT sq.mytable_myid, sq.mytable_name, sq.mytable_description, sq.myothertable_otherid, sq.myothertable_othername FROM (SELECT mytable.myid AS mytable_myid, mytable.name AS mytable_name, mytable.description AS mytable_description, myothertable.otherid AS myothertable_otherid, myothertable.othername AS myothertable_othername FROM myothertable, mytable WHERE mytable.myid = :mytable_myid AND myothertable.otherid = mytable.myid) AS sq'
 does not match 
'SELECT sq.mytable_myid, sq.mytable_name, sq.mytable_description, sq.myothertable_otherid, sq.myothertable_othername FROM (SELECT mytable.myid AS mytable_myid, mytable.name AS mytable_name, mytable.description AS mytable_description, myothertable.otherid AS myothertable_otherid, myothertable.othername AS myothertable_othername FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND myothertable.otherid = mytable.myid) AS sq'

======================================================================
FAIL: testtableselect (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 72, in testtableselect
    myothertable.othername FROM mytable, myothertable")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername FROM myothertable, mytable'
 does not match 
'SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername FROM mytable, myothertable'

======================================================================
FAIL: testtextmix (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 531, in testtextmix
    FROM mytable, myothertable WHERE foo.id = foofoo(lala) AND datetime(foo) = Today AND mytable.myid = myothertable.otherid")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, sysdate(), foo, bar, lala FROM myothertable, mytable WHERE foo.id = foofoo(lala) AND datetime(foo) = Today AND mytable.myid = myothertable.otherid'
 does not match 
'SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, sysdate(), foo, bar, lala FROM mytable, myothertable WHERE foo.id = foofoo(lala) AND datetime(foo) = Today AND mytable.myid = myothertable.otherid'

======================================================================
FAIL: testtextualsubquery (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 539, in testtextualsubquery
    "SELECT t.myid, t.name, t.description, foo.f FROM mytable AS t, (select f from bar where lala=heyhey) foo WHERE foo.f = t.id")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT t.myid, t.name, t.description, foo.f FROM (select f from bar where lala=heyhey) foo, mytable AS t WHERE foo.f = t.id'
 does not match 
'SELECT t.myid, t.name, t.description, foo.f FROM mytable AS t, (select f from bar where lala=heyhey) foo WHERE foo.f = t.id'

======================================================================
FAIL: testwheresubquery (sql.select.SelectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 149, in testwheresubquery
    """SELECT users.user_id, users.user_name, users.password, s.street FROM users, (SELECT addresses.street AS street FROM addresses WHERE addresses.user_id = users.user_id) AS s""")
  File "/home/jek/projects/oss/src/sa-0_4-quoting/test/sql/select.py", line 60, in runtest
    self.assert_(cc == result, "\n'" + cc + "'\n does not match \n'" + result + "'")
AssertionError: 
'SELECT users.user_id, users.user_name, users.password, s.street FROM (SELECT addresses.street AS street FROM addresses WHERE addresses.user_id = users.user_id) AS s, users'
 does not match 
'SELECT users.user_id, users.user_name, users.password, s.street FROM users, (SELECT addresses.street AS street FROM addresses WHERE addresses.user_id = users.user_id) AS s'

----------------------------------------------------------------------

Comments (2)

  1. Log in to comment