~percona-toolkit-dev/percona-toolkit/manual-for-pt-query-digest--type-binlog-is-ambiguous-1377888

« back to all changes in this revision

Viewing changes to t/lib/SlowLogParser.t

merged pt-table-checksum-deadlock-1287253

Show diffs side-by-side

added added

removed removed

Lines of Context:
1349
1349
   ],
1350
1350
);
1351
1351
 
 
1352
 
 
1353
# #############################################################################
 
1354
# pt-query-digest fails to parse Thread_id on 5.6 
 
1355
# https://bugs.launchpad.net/percona-toolkit/+bug/1299387
 
1356
# #############################################################################
 
1357
 
 
1358
# first test with a Percona 5.5 slow log (includes an explicit Thread_id line)
 
1359
# (MySQL 5.5 doesn't include thread id)
 
1360
test_log_parser(
 
1361
   parser => $p,
 
1362
   file   => "$sample/slow060.txt",
 
1363
   result => [
 
1364
      {  
 
1365
        Thread_id     => '1',     # here's our item
 
1366
        Bytes_sent    => '64',
 
1367
        Killed        => '0',
 
1368
        Last_errno    => '0',
 
1369
        Lock_time     => '0.000000',
 
1370
        Query_time    => '10.000373',
 
1371
        Rows_affected => '0',
 
1372
        Rows_examined => '0',
 
1373
        Rows_read     => '0',
 
1374
        Rows_sent     => '1',
 
1375
        arg           => 'select sleep(10)',
 
1376
        bytes         => 16,
 
1377
        cmd           => 'Query',
 
1378
        host          => 'localhost',
 
1379
        ip            => '127.0.0.1',
 
1380
        pos_in_log    => 0,
 
1381
        timestamp     => '1405358212',
 
1382
        ts            => '140714 14:16:52',
 
1383
        user          => 'root'
 
1384
      },
 
1385
   ],
 
1386
);
 
1387
 
 
1388
# now test with a Percona 5.6 slow log. Thread_id is now on the user@host line, and is called 'Id'.
 
1389
# (this is in line with MySQL 5.6)
 
1390
test_log_parser(
 
1391
   parser => $p,
 
1392
   file   => "$sample/slow061.txt",
 
1393
   result => [
 
1394
      {  
 
1395
         Thread_id     => 1,           # here's our item
 
1396
         Bytes_sent    => '64',
 
1397
         Lock_time     => '0.000000',
 
1398
         Query_time    => '11.013723',
 
1399
         Rows_affected => '0',
 
1400
         Rows_examined => '0',
 
1401
         Rows_sent     => '1',
 
1402
         arg           => 'select sleep(11)',
 
1403
         bytes         => 16,
 
1404
         cmd           => 'Query',
 
1405
         host          => 'localhost',
 
1406
         ip            => '127.0.0.1',
 
1407
         pos_in_log    => 0,
 
1408
         timestamp     => '1405360304',
 
1409
         ts            => '140714 14:51:44',
 
1410
         user          => 'root',
 
1411
      },
 
1412
   ],
 
1413
);
 
1414
 
 
1415
 
1352
1416
# #############################################################################
1353
1417
# Done.
1354
1418
# #############################################################################