|
15 | 15 | package queries |
16 | 16 |
|
17 | 17 | import ( |
18 | | - "github.com/dolthub/vitess/go/mysql" |
19 | 18 | "math" |
20 | 19 | "time" |
21 | 20 |
|
@@ -123,105 +122,89 @@ type ScriptTestAssertion struct { |
123 | 122 | var ScriptTests = []ScriptTest{ |
124 | 123 | { |
125 | 124 | // https://github.com/dolthub/dolt/issues/9836 |
| 125 | + Skip: true, |
126 | 126 | Name: "Ordering by pk does not change the order of results", |
127 | 127 | SetUpScript: []string{ |
128 | 128 | "CREATE TABLE test_cast(pk VARCHAR(50) PRIMARY KEY)", |
129 | | - "INSERT INTO test_cast VALUES (' 3 12 4'), ('3. 12 4'), ('3.2 12 4'), ('-3.1234'), ('-3.1a'), ('-5+8'), ('+3.1234'), ('11-5'), ('1a1'), ('2,345'), ('4,12'), ('5.932887e+07'), ('5.932887e+07abc'), ('5.932887e7'), ('5.932887e7abc'), ('a1a1')", |
| 129 | + "INSERT INTO test_cast VALUES (' 3 12 4'), ('3. 12 4'), ('3.2 12 4'), ('-3.1234'), ('-3.1a'), ('-5+8'), ('+3.1234')", |
130 | 130 | }, |
131 | 131 | Assertions: []ScriptTestAssertion{ |
132 | 132 | { |
133 | | - Skip: true, |
134 | | - Query: "SELECT cast(pk as signed) FROM test_cast ORDER BY pk", |
135 | | - Expected: []sql.Row{{3}, {-3}, {-3}, {-5}, {3}, {11}, {1}, {2}, {3}, {3}, {4}, {5}, {5}, {5}, {5}, {0}}, |
136 | | - ExpectedWarningsCount: 16, |
137 | | - ExpectedWarning: mysql.ERTruncatedWrongValue, |
138 | | - }, |
139 | | - { |
140 | | - Skip: true, |
141 | | - Query: "SELECT cast(pk as unsigned) FROM test_cast ORDER BY pk", |
142 | | - Expected: []sql.Row{{uint64(3)}, {uint64(18446744073709551613)}, {uint64(18446744073709551613)}, {uint64(18446744073709551611)}, {uint64(3)}, {uint64(11)}, {uint64(1)}, {uint64(2)}, {uint64(3)}, {uint64(3)}, {uint64(4)}, {uint64(5)}, {uint64(5)}, {uint64(5)}, {uint64(5)}, {uint64(0)}}, |
143 | | - ExpectedWarningsCount: 19, |
144 | | - ExpectedWarning: mysql.ERTruncatedWrongValue, |
145 | | - }, |
146 | | - { |
147 | | - Skip: true, |
148 | | - Query: "SELECT cast(pk as double) FROM test_cast ORDER BY pk", |
149 | | - Expected: []sql.Row{{3.0}, {-3.1234}, {-3.1}, {-5.0}, {3.1234}, {11.0}, {1.0}, {2.0}, {3.0}, {3.2}, {4.0}, {59328870.0}, {59328870.0}, {59328870.0}, {59328870.0}, {0.0}}, |
150 | | - ExpectedWarningsCount: 9, |
151 | | - ExpectedWarning: mysql.ERTruncatedWrongValue, |
| 133 | + Query: "SELECT pk FROM test ORDER BY pk", |
| 134 | + Expected: []sql.Row{{" 3 12 4"}, {"-3.1234"}, {"-3.1a"}, {"-5+8"}, {"+3.1234"}, {"3. 12 4"}, {"3.2 12 4"}}, |
152 | 135 | }, |
153 | 136 | }, |
154 | 137 | }, |
155 | 138 | { |
156 | 139 | // https://github.com/dolthub/dolt/issues/9812 |
157 | | - Name: "String-to-number comparison operators should behave consistently", |
| 140 | + Name: "String-to-number comparison operators should behave consistently", |
158 | 141 | Assertions: []ScriptTestAssertion{ |
159 | 142 | { |
160 | | - Dialect: "mysql", |
| 143 | + Dialect: "mysql", |
161 | 144 | Query: "SELECT ('A') = (0)", |
162 | 145 | Expected: []sql.Row{{true}}, |
163 | 146 | //ExpectedWarningsCount: 1, |
164 | 147 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
165 | 148 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
166 | 149 | }, |
167 | 150 | { |
168 | | - Dialect: "mysql", |
| 151 | + Dialect: "mysql", |
169 | 152 | Query: "SELECT ('A') IN (0)", |
170 | 153 | Expected: []sql.Row{{true}}, |
171 | 154 | //ExpectedWarningsCount: 1, |
172 | 155 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
173 | 156 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
174 | 157 | }, |
175 | 158 | { |
176 | | - Dialect: "mysql", |
| 159 | + Dialect: "mysql", |
177 | 160 | Query: "SELECT ('A') != (0)", |
178 | 161 | Expected: []sql.Row{{false}}, |
179 | 162 | //ExpectedWarningsCount: 1, |
180 | 163 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
181 | 164 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
182 | 165 | }, |
183 | 166 | { |
184 | | - Dialect: "mysql", |
| 167 | + Dialect: "mysql", |
185 | 168 | Query: "SELECT ('A') <> (0)", |
186 | 169 | Expected: []sql.Row{{false}}, |
187 | 170 | //ExpectedWarningsCount: 1, |
188 | 171 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
189 | 172 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
190 | 173 | }, |
191 | 174 | { |
192 | | - Dialect: "mysql", |
| 175 | + Dialect: "mysql", |
193 | 176 | Query: "SELECT ('A') < (0)", |
194 | 177 | Expected: []sql.Row{{false}}, |
195 | 178 | //ExpectedWarningsCount: 1, |
196 | 179 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
197 | 180 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
198 | 181 | }, |
199 | 182 | { |
200 | | - Dialect: "mysql", |
| 183 | + Dialect: "mysql", |
201 | 184 | Query: "SELECT ('A') <= (0)", |
202 | 185 | Expected: []sql.Row{{true}}, |
203 | 186 | //ExpectedWarningsCount: 1, |
204 | 187 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
205 | 188 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
206 | 189 | }, |
207 | 190 | { |
208 | | - Dialect: "mysql", |
| 191 | + Dialect: "mysql", |
209 | 192 | Query: "SELECT ('A') > (0)", |
210 | 193 | Expected: []sql.Row{{false}}, |
211 | 194 | //ExpectedWarningsCount: 1, |
212 | 195 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
213 | 196 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
214 | 197 | }, |
215 | 198 | { |
216 | | - Dialect: "mysql", |
| 199 | + Dialect: "mysql", |
217 | 200 | Query: "SELECT ('A') >= (0)", |
218 | 201 | Expected: []sql.Row{{true}}, |
219 | 202 | //ExpectedWarningsCount: 1, |
220 | 203 | //ExpectedWarning: mysql.ERTruncatedWrongValue, |
221 | 204 | //ExpectedWarningMessageSubstring: "Truncated incorrect double value: A", |
222 | 205 | }, |
223 | 206 | { |
224 | | - Dialect: "mysql", |
| 207 | + Dialect: "mysql", |
225 | 208 | Query: "SELECT ('A') NOT IN (0)", |
226 | 209 | Expected: []sql.Row{{false}}, |
227 | 210 | //ExpectedWarningsCount: 1, |
|
0 commit comments