@@ -293,74 +293,6 @@ b (2/6 partitions)
293293 require .ElementsMatch (expected , rows )
294294}
295295
296- // TODO: this was an analyzer test, but we don't have a mock process list for it to use, so it has to be here
297- func TestTrackProcess (t * testing.T ) {
298- require := require .New (t )
299- db := memory .NewDatabase ("db" )
300- provider := memory .NewDBProvider (db )
301- a := analyzer .NewDefault (provider )
302- sess := memory .NewSession (sql .NewBaseSession (), provider )
303-
304- node := plan .NewInnerJoin (
305- plan .NewResolvedTable (& nonIndexableTable {memory .NewPartitionedTable (db .BaseDatabase , "foo" , sql.PrimaryKeySchema {}, nil , 2 )}, nil , nil ),
306- plan .NewResolvedTable (memory .NewPartitionedTable (db .BaseDatabase , "bar" , sql.PrimaryKeySchema {}, nil , 4 ), nil , nil ),
307- expression .NewLiteral (int64 (1 ), types .Int64 ),
308- )
309-
310- pl := sqle .NewProcessList ()
311-
312- ctx := sql .NewContext (context .Background (), sql .WithPid (1 ), sql .WithProcessList (pl ), sql .WithSession (sess ))
313- pl .AddConnection (ctx .Session .ID (), "localhost" )
314- pl .ConnectionReady (ctx .Session )
315- ctx , err := ctx .ProcessList .BeginQuery (ctx , "SELECT foo" )
316- require .NoError (err )
317-
318- rule := getRuleFrom (analyzer .OnceAfterAll , analyzer .TrackProcessId )
319- result , _ , err := rule .Apply (ctx , a , node , nil , analyzer .DefaultRuleSelector , nil )
320- require .NoError (err )
321-
322- processes := ctx .ProcessList .Processes ()
323- require .Len (processes , 1 )
324- require .Equal ("SELECT foo" , processes [0 ].Query )
325- require .Equal (
326- map [string ]sql.TableProgress {
327- "foo" : sql.TableProgress {
328- Progress : sql.Progress {Name : "foo" , Done : 0 , Total : 2 },
329- PartitionsProgress : map [string ]sql.PartitionProgress {}},
330- "bar" : sql.TableProgress {
331- Progress : sql.Progress {Name : "bar" , Done : 0 , Total : 4 },
332- PartitionsProgress : map [string ]sql.PartitionProgress {}},
333- },
334- processes [0 ].Progress )
335-
336- proc , ok := result .(* plan.QueryProcess )
337- require .True (ok )
338-
339- join , ok := proc .Child ().(* plan.JoinNode )
340- require .True (ok )
341- require .Equal (join .JoinType (), plan .JoinTypeInner )
342-
343- lhs , ok := join .Left ().(* plan.ResolvedTable )
344- require .True (ok )
345- _ , ok = lhs .Table .(* plan.ProcessTable )
346- require .True (ok )
347-
348- rhs , ok := join .Right ().(* plan.ResolvedTable )
349- require .True (ok )
350- _ , ok = rhs .Table .(* plan.ProcessTable )
351- require .True (ok )
352-
353- iter , err := rowexec .DefaultBuilder .Build (ctx , proc , nil )
354- require .NoError (err )
355- _ , err = sql .RowIterToRows (ctx , iter )
356- require .NoError (err )
357-
358- procs := ctx .ProcessList .Processes ()
359- require .Len (procs , 1 )
360- require .Equal (procs [0 ].Command , sql .ProcessCommandSleep )
361- require .Error (ctx .Err ())
362- }
363-
364296func TestConcurrentProcessList (t * testing.T ) {
365297 enginetest .TestConcurrentProcessList (t , enginetest .NewDefaultMemoryHarness ())
366298}
@@ -515,7 +447,6 @@ func TestAnalyzer_Exp(t *testing.T) {
515447 require .NoError (t , err )
516448
517449 analyzed , err := e .EngineAnalyzer ().Analyze (ctx , parsed , nil , nil )
518- analyzed = analyzer .StripPassthroughNodes (analyzed )
519450 if tt .err != nil {
520451 require .Error (t , err )
521452 assert .True (t , tt .err .Is (err ))
@@ -527,10 +458,6 @@ func TestAnalyzer_Exp(t *testing.T) {
527458}
528459
529460func assertNodesEqualWithDiff (t * testing.T , expected , actual sql.Node ) {
530- if x , ok := actual .(* plan.QueryProcess ); ok {
531- actual = x .Child ()
532- }
533-
534461 if ! assert .Equal (t , expected , actual ) {
535462 expectedStr := sql .DebugString (expected )
536463 actualStr := sql .DebugString (actual )
0 commit comments