Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6819

MSSQL doesn't support TRUE/FALSE keywords in its Join predicate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.39.0
    • None

    Description

      CREATE TABLE t1 (c11 int, c12 int);
      INSERT INTO t1 VALUES (1,10), (2,20), (3,30);
      CREATE TABLE t2 (c21 int, c22 int);
      SELECT * FROM t1 LEFT OUTER JOIN t2 ON TRUE;

      Msg 4145, Level 15, State 1, Server a08c6f7cfc77, Line 9
      An expression of non-boolean type specified in a context where a condition is expected, near ';'.

      TRUE/FALSE are not supported in MSSQL (but it is supported in most DBs). 

      The MSSQL way would be to write the query as :

      SELECT * FROM t1 LEFT OUTER JOIN t2 ON 1=1;

      MSSQL dialect should support this syntax.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sreeharsha_r Sree Harsha Ramanavarapu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: