Skip to content

Commit 524e010

Browse files
authored
Fix conformance test after cte fix (#16)
* fix regression bug introduced in fixing CTE bug previously The bug was because the new with catch is too aggressive and accidentally include other non-CTE with * trigger CI in both push and pull_request
1 parent 3119462 commit 524e010

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
on: push
1+
on:
2+
push:
3+
pull_request:
24
jobs:
35
test:
46
runs-on: ubuntu-22.04

.github/workflows/conformance.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
on: push
1+
on:
2+
push:
3+
pull_request:
24
jobs:
35
test:
46
runs-on: ubuntu-22.04

lib/mix/tasks/sql.gen.parser.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ defmodule Mix.Tasks.Sql.Gen.Parser do
156156
def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do
157157
{[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]}
158158
end
159-
def insert_node({:with = tag, meta, []}, unit, acc, context, root) do
159+
def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do
160160
{[], [], context, root ++ [{tag, meta, unit ++ acc}]}
161161
end
162162
def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do

lib/parser.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ defmodule SQL.Parser do
126126
def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do
127127
{[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]}
128128
end
129-
def insert_node({:with = tag, meta, []}, unit, acc, context, root) do
129+
def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do
130130
{[], [], context, root ++ [{tag, meta, unit ++ acc}]}
131131
end
132132
def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do

0 commit comments

Comments
 (0)