@@ -131,6 +131,7 @@ func (s *testTableSuite) TestInfoschemaFieldValue(c *C) {
131
131
User : "root" ,
132
132
Host : "127.0.0.1" ,
133
133
Command : mysql .ComQuery ,
134
+ StmtCtx : tk .Se .GetSessionVars ().StmtCtx ,
134
135
}
135
136
tk .Se .SetSessionManager (sm )
136
137
tk .MustQuery ("SELECT user,host,command FROM information_schema.processlist;" ).Check (testkit .Rows ("root 127.0.0.1 Query" ))
@@ -342,19 +343,35 @@ func (s *testTableSuite) TestSomeTables(c *C) {
342
343
DB : "information_schema" ,
343
344
Command : byte (1 ),
344
345
State : 1 ,
345
- Info : "do something" }
346
+ Info : "do something" ,
347
+ StmtCtx : tk .Se .GetSessionVars ().StmtCtx ,
348
+ }
346
349
sm .processInfoMap [2 ] = & util.ProcessInfo {
347
350
ID : 2 ,
348
351
User : "user-2" ,
349
352
Host : "localhost" ,
350
353
DB : "test" ,
351
354
Command : byte (2 ),
352
355
State : 2 ,
353
- Info : "do something" }
356
+ Info : strings .Repeat ("x" , 101 ),
357
+ StmtCtx : tk .Se .GetSessionVars ().StmtCtx ,
358
+ }
354
359
tk .Se .SetSessionManager (sm )
355
- tk .MustQuery ("select * from information_schema.PROCESSLIST order by ID;" ).Check (
356
- testkit .Rows ("1 user-1 localhost information_schema Quit 9223372036 1 do something" ,
357
- "2 user-2 localhost test Init DB 9223372036 2 do something" ))
360
+ tk .MustQuery ("select * from information_schema.PROCESSLIST order by ID;" ).Sort ().Check (
361
+ testkit .Rows (
362
+ fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s 0" , "do something" ),
363
+ fmt .Sprintf ("2 user-2 localhost test Init DB 9223372036 2 %s 0" , strings .Repeat ("x" , 101 )),
364
+ ))
365
+ tk .MustQuery ("SHOW PROCESSLIST;" ).Sort ().Check (
366
+ testkit .Rows (
367
+ fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s" , "do something" ),
368
+ fmt .Sprintf ("2 user-2 localhost test Init DB 9223372036 2 %s" , strings .Repeat ("x" , 100 )),
369
+ ))
370
+ tk .MustQuery ("SHOW FULL PROCESSLIST;" ).Sort ().Check (
371
+ testkit .Rows (
372
+ fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s" , "do something" ),
373
+ fmt .Sprintf ("2 user-2 localhost test Init DB 9223372036 2 %s" , strings .Repeat ("x" , 101 )),
374
+ ))
358
375
359
376
sm = & mockSessionManager {make (map [uint64 ]* util.ProcessInfo , 2 )}
360
377
sm .processInfoMap [1 ] = & util.ProcessInfo {
@@ -380,8 +397,8 @@ func (s *testTableSuite) TestSomeTables(c *C) {
380
397
tk .Se .SetSessionManager (sm )
381
398
tk .MustQuery ("select * from information_schema.PROCESSLIST order by ID;" ).Check (
382
399
testkit .Rows (
383
- fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s" , "<nil>" ),
384
- fmt .Sprintf ("2 user-2 localhost <nil> Init DB 9223372036 2 %s" , strings .Repeat ("x" , 101 )),
400
+ fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s 0 " , "<nil>" ),
401
+ fmt .Sprintf ("2 user-2 localhost <nil> Init DB 9223372036 2 %s 0 " , strings .Repeat ("x" , 101 )),
385
402
))
386
403
tk .MustQuery ("SHOW PROCESSLIST;" ).Sort ().Check (
387
404
testkit .Rows (
@@ -395,11 +412,11 @@ func (s *testTableSuite) TestSomeTables(c *C) {
395
412
))
396
413
tk .MustQuery ("select * from information_schema.PROCESSLIST where db is null;" ).Check (
397
414
testkit .Rows (
398
- fmt .Sprintf ("2 user-2 localhost <nil> Init DB 9223372036 2 %s" , strings .Repeat ("x" , 101 )),
415
+ fmt .Sprintf ("2 user-2 localhost <nil> Init DB 9223372036 2 %s 0 " , strings .Repeat ("x" , 101 )),
399
416
))
400
417
tk .MustQuery ("select * from information_schema.PROCESSLIST where Info is null;" ).Check (
401
418
testkit .Rows (
402
- fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s" , "<nil>" ),
419
+ fmt .Sprintf ("1 user-1 localhost information_schema Quit 9223372036 1 %s 0 " , "<nil>" ),
403
420
))
404
421
}
405
422
0 commit comments