@@ -200,24 +200,103 @@ func TestSingleQueryPrepared(t *testing.T) {
200200
201201// Convenience test for debugging a single query. Unskip and set to the desired query.
202202func TestSingleScript (t * testing.T ) {
203- t .Skip ()
203+ // t.Skip()
204204 var scripts = []queries.ScriptTest {
205205 {
206- Name : "AS OF propagates to nested CALLs " ,
206+ Name : "Reproduction test for issue 9872: TEXT(m) syntax support " ,
207207 SetUpScript : []string {},
208208 Assertions : []queries.ScriptTestAssertion {
209209 {
210- Query : "create procedure create_proc() create table t (i int primary key, j int);" ,
210+ // https://github.com/dolthub/dolt/issues/9872 - Support for mysql `Text(m)` syntax
211+ Query : "CREATE TABLE task_instance_note (ti_id VARCHAR(36) NOT NULL, user_id VARCHAR(128), content TEXT(1000), created_at TIMESTAMP(6) NOT NULL, updated_at TIMESTAMP(6) NOT NULL, CONSTRAINT task_instance_note_pkey PRIMARY KEY (ti_id))" ,
212+ Expected : []sql.Row {
213+ {types .NewOkResult (0 )},
214+ },
215+ },
216+ {
217+ Query : "CREATE TABLE test_text_small (id INT PRIMARY KEY, small_text TEXT(255))" ,
218+ Expected : []sql.Row {
219+ {types .NewOkResult (0 )},
220+ },
221+ },
222+ {
223+ Query : "CREATE TABLE test_text_large (id INT PRIMARY KEY, large_text TEXT(65535))" ,
224+ Expected : []sql.Row {
225+ {types .NewOkResult (0 )},
226+ },
227+ },
228+ {
229+ Query : "CREATE TABLE test_text_medium (id INT PRIMARY KEY, medium_text TEXT(16777215))" ,
230+ Expected : []sql.Row {
231+ {types .NewOkResult (0 )},
232+ },
233+ },
234+ {
235+ Query : "CREATE TABLE test_text_10k (id INT PRIMARY KEY, text_10k TEXT(10000))" ,
211236 Expected : []sql.Row {
212237 {types .NewOkResult (0 )},
213238 },
214239 },
215240 {
216- Query : "call create_proc( )" ,
241+ Query : "CREATE TABLE test_text_100k (id INT PRIMARY KEY, text_100k TEXT(100000) )" ,
217242 Expected : []sql.Row {
218243 {types .NewOkResult (0 )},
219244 },
220245 },
246+ {
247+ Query : "CREATE TABLE test_text_1m (id INT PRIMARY KEY, text_1m TEXT(1000000))" ,
248+ Expected : []sql.Row {
249+ {types .NewOkResult (0 )},
250+ },
251+ },
252+ {
253+ Query : "CREATE TABLE test_text_no_length (id INT PRIMARY KEY, text_no_length TEXT)" ,
254+ Expected : []sql.Row {
255+ {types .NewOkResult (0 )},
256+ },
257+ },
258+ {
259+ Query : "DESCRIBE test_text_small" ,
260+ Expected : []sql.Row {
261+ {"id" , "int" , "NO" , "PRI" , nil , "" },
262+ {"small_text" , "text" , "YES" , "" , nil , "" },
263+ },
264+ },
265+ {
266+ Query : "DESCRIBE test_text_large" ,
267+ Expected : []sql.Row {
268+ {"id" , "int" , "NO" , "PRI" , nil , "" },
269+ {"large_text" , "mediumtext" , "YES" , "" , nil , "" },
270+ },
271+ },
272+ {
273+ Query : "DESCRIBE test_text_medium" ,
274+ Expected : []sql.Row {
275+ {"id" , "int" , "NO" , "PRI" , nil , "" },
276+ {"medium_text" , "longtext" , "YES" , "" , nil , "" },
277+ },
278+ },
279+ {
280+ Query : "DESCRIBE test_text_10k" ,
281+ Expected : []sql.Row {
282+ {"id" , "int" , "NO" , "PRI" , nil , "" },
283+ {"text_10k" , "text" , "YES" , "" , nil , "" },
284+ },
285+ },
286+ {
287+ Query : "DESCRIBE test_text_100k" ,
288+ Expected : []sql.Row {
289+ {"id" , "int" , "NO" , "PRI" , nil , "" },
290+ {"text_100k" , "mediumtext" , "YES" , "" , nil , "" },
291+ },
292+ },
293+ {
294+ Query : "DESCRIBE test_text_1m" ,
295+ Expected : []sql.Row {
296+ {"id" , "int" , "NO" , "PRI" , nil , "" },
297+ {"text_1m" , "mediumtext" , "YES" , "" , nil , "" },
298+ },
299+ },
221300 },
222301 },
223302 }
0 commit comments