■ ■ ■ ■ ■ ■
go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go
| skipped 107 lines |
108 | 108 | | |
109 | 109 | | // Convenience test for debugging a single query. Unskip and set to the desired query. |
110 | 110 | | func TestSingleScript(t *testing.T) { |
111 | | - | t.Skip() |
112 | 111 | | var scripts = []queries.ScriptTest{ |
113 | 112 | | { |
114 | | - | Name: "trigger before update, with indexed update", |
| 113 | + | Name: "DELETE ME", |
115 | 114 | | SetUpScript: []string{ |
116 | | - | "create table a (x int primary key, y int, unique key (y))", |
117 | | - | "create table b (z int primary key)", |
118 | | - | "insert into a values (1,3), (10,20)", |
119 | | - | "create trigger insert_b before update on a for each row insert into b values (old.x * 10)", |
120 | | - | "update a set x = x + 1 where y = 20", |
| 115 | + | "create table parent (i int, index (i))", |
| 116 | + | "create table child (j int, foreign key (j) references parent (i))", |
| 117 | + | "alter table parent add primary key (i)", |
121 | 118 | | }, |
122 | 119 | | Assertions: []queries.ScriptTestAssertion{ |
123 | 120 | | { |
124 | | - | Query: "select x, y from a order by 1", |
125 | | - | Expected: []sql.Row{ |
126 | | - | {1, 3}, |
127 | | - | {11, 20}, |
128 | | - | }, |
129 | | - | }, |
130 | | - | { |
131 | | - | Query: "select z from b", |
132 | | - | Expected: []sql.Row{ |
133 | | - | {100}, |
134 | | - | }, |
| 121 | + | Query: "alter table parent drop index i", |
| 122 | + | Expected: []sql.Row{}, |
135 | 123 | | }, |
136 | 124 | | }, |
137 | 125 | | }, |
| skipped 3 lines |
141 | 129 | | for _, test := range scripts { |
142 | 130 | | enginetest.TestScript(t, harness, test) |
143 | 131 | | } |
| 132 | + | //t.Skip() |
| 133 | + | //var scripts = []queries.ScriptTest{ |
| 134 | + | // { |
| 135 | + | // Name: "trigger before update, with indexed update", |
| 136 | + | // SetUpScript: []string{ |
| 137 | + | // "create table a (x int primary key, y int, unique key (y))", |
| 138 | + | // "create table b (z int primary key)", |
| 139 | + | // "insert into a values (1,3), (10,20)", |
| 140 | + | // "create trigger insert_b before update on a for each row insert into b values (old.x * 10)", |
| 141 | + | // "update a set x = x + 1 where y = 20", |
| 142 | + | // }, |
| 143 | + | // Assertions: []queries.ScriptTestAssertion{ |
| 144 | + | // { |
| 145 | + | // Query: "select x, y from a order by 1", |
| 146 | + | // Expected: []sql.Row{ |
| 147 | + | // {1, 3}, |
| 148 | + | // {11, 20}, |
| 149 | + | // }, |
| 150 | + | // }, |
| 151 | + | // { |
| 152 | + | // Query: "select z from b", |
| 153 | + | // Expected: []sql.Row{ |
| 154 | + | // {100}, |
| 155 | + | // }, |
| 156 | + | // }, |
| 157 | + | // }, |
| 158 | + | // }, |
| 159 | + | //} |
| 160 | + | // |
| 161 | + | //harness := newDoltHarness(t) |
| 162 | + | //for _, test := range scripts { |
| 163 | + | // enginetest.TestScript(t, harness, test) |
| 164 | + | //} |
144 | 165 | | } |
145 | 166 | | |
146 | 167 | | func TestSingleQueryPrepared(t *testing.T) { |
| skipped 1552 lines |