~stewart/drizzle/embedded-innodb-rnd-read

« back to all changes in this revision

Viewing changes to tests/lib/mtr_report.pl

  • Committer: Stewart Smith
  • Date: 2010-04-01 04:50:06 UTC
  • mfrom: (1310.1.40)
  • Revision ID: stewart@flamingspork.com-20100401045006-z537qbrw1ojt6jdb
Merged embedded-innodb-write-row into embedded-innodb-rnd-read.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
               time - $BASETIME, "seconds executing testcases");
238
238
  }
239
239
 
240
 
  # ----------------------------------------------------------------------
241
 
  # If a debug run, there might be interesting information inside
242
 
  # the "var/log/*.err" files. We save this info in "var/log/warnings"
243
 
  # ----------------------------------------------------------------------
244
 
 
245
 
  if ( ! $::glob_use_running_server )
246
 
  {
247
 
    # Save and report if there was any fatal warnings/errors in err logs
248
 
 
249
 
    my $warnlog= "$::opt_vardir/log/warnings";
250
 
 
251
 
    unless ( open(WARN, ">$warnlog") )
252
 
    {
253
 
      mtr_warning("can't write to the file \"$warnlog\": $!");
254
 
    }
255
 
    else
256
 
    {
257
 
      # We report different types of problems in order
258
 
      foreach my $pattern ( "^Warning:",
259
 
                            "\\[Warning\\]",
260
 
                            "\\[ERROR\\]",
261
 
                            "^Error:", "^==.* at 0x",
262
 
                            "InnoDB: Warning",
263
 
                            "InnoDB: Error",
264
 
                            "^safe_mutex:",
265
 
                            "missing DBUG_RETURN",
266
 
                            "mysqld: Warning",
267
 
                            "allocated at line",
268
 
                            "Attempting backtrace", "Assertion .* failed" )
269
 
      {
270
 
        foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
271
 
        {
272
 
          my $testname= "";
273
 
          unless ( open(ERR, $errlog) )
274
 
          {
275
 
            mtr_warning("can't read $errlog");
276
 
            next;
277
 
          }
278
 
          my $leak_reports_expected= undef;
279
 
          while ( <ERR> )
280
 
          {
281
 
            # There is a test case that purposely provokes a
282
 
            # SAFEMALLOC leak report, even though there is no actual
283
 
            # leak. We need to detect this, and ignore the warning in
284
 
            # that case.
285
 
            if (/Begin safemalloc memory dump:/) {
286
 
              $leak_reports_expected= 1;
287
 
            } elsif (/End safemalloc memory dump./) {
288
 
              $leak_reports_expected= undef;
289
 
            }
290
 
 
291
 
            # Skip some non fatal warnings from the log files
292
 
            if (
293
 
                /\"SELECT UNIX_TIMESTAMP\(\)\" failed on master/ or
294
 
                /Aborted connection/ or
295
 
                /Client requested master to start replication from impossible position/ or
296
 
                /Could not find first log file name in binary log/ or
297
 
                /Enabling keys got errno/ or
298
 
                /Error reading master configuration/ or
299
 
                /Error reading packet/ or
300
 
                /Event Scheduler/ or
301
 
                /Failed to open log/ or
302
 
                /Failed to open the existing master info file/ or
303
 
                /Forcing shutdown of [0-9]* plugins/ or
304
 
                /Can't open shared library .*\bha_example\b/ or
305
 
                /Couldn't load plugin .*\bha_example\b/ or
306
 
 
307
 
                # Due to timing issues, it might be that this warning
308
 
                # is printed when the server shuts down and the
309
 
                # computer is loaded.
310
 
                /Forcing close of thread \d+  user: '.*?'/ or
311
 
 
312
 
                /Got error [0-9]* when reading table/ or
313
 
                /Incorrect definition of table/ or
314
 
                /Incorrect information in file/ or
315
 
                /InnoDB: Warning: we did not need to do crash recovery/ or
316
 
                /Invalid \(old\?\) table or database name/ or
317
 
                /Lock wait timeout exceeded/ or
318
 
                /Log entry on master is longer than max_allowed_packet/ or
319
 
                /unknown option '--loose-/ or
320
 
                /unknown variable 'loose-/ or
321
 
                /You have forced lower_case_table_names to 0 through a command-line option/ or
322
 
                /Setting lower_case_table_names=2/ or
323
 
                /NDB Binlog:/ or
324
 
                /NDB: failed to setup table/ or
325
 
                /NDB: only row based binary logging/ or
326
 
                /Neither --relay-log nor --relay-log-index were used/ or
327
 
                /Query partially completed/ or
328
 
                /Slave I.O thread aborted while waiting for relay log/ or
329
 
                /Slave SQL thread is stopped because UNTIL condition/ or
330
 
                /Slave SQL thread retried transaction/ or
331
 
                /Slave \(additional info\)/ or
332
 
                /Slave: .*Duplicate column name/ or
333
 
                /Slave: .*master may suffer from/ or
334
 
                /Slave: According to the master's version/ or
335
 
                /Slave: Column [0-9]* type mismatch/ or
336
 
                /Slave: Can't DROP 'c7'; check that column.key exists Error_code: 1091/ or
337
 
                /Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or
338
 
                /Slave: Key column 'c6' doesn't exist in table Error_code: 1072/ or
339
 
                /Slave: Error .* doesn't exist/ or
340
 
                /Slave: Error .*Deadlock found/ or
341
 
                /Slave: Error .*Unknown table/ or
342
 
                /Slave: Error in Write_rows event: / or
343
 
                /Slave: Field .* of table .* has no default value/ or
344
 
                /Slave: Field .* doesn't have a default value/ or
345
 
                /Slave: Query caused different errors on master and slave/ or
346
 
                /Slave: Table .* doesn't exist/ or
347
 
                /Slave: Table width mismatch/ or
348
 
                /Slave: The incident LOST_EVENTS occured on the master/ or
349
 
                /Slave: Unknown error.* 1105/ or
350
 
                /Slave: Can't drop database.* database doesn't exist/ or
351
 
                /Slave SQL:.*(?:Error_code: \d+|Query:.*)/ or
352
 
                
353
 
                # backup_errors test is supposed to trigger lots of backup related errors
354
 
                ($testname eq 'main.backup_errors') and
355
 
                (
356
 
                  /Backup:/ or /Restore:/ or /Can't open the online backup progress tables/
357
 
                ) or
358
 
                # The tablespace test triggers error below on purpose
359
 
                ($testname eq 'main.backup_tablespace') and
360
 
                (
361
 
                  /Restore: Tablespace .* needed by tables being restored has changed on the server/
362
 
                ) or
363
 
                
364
 
                /Sort aborted/ or
365
 
                /Time-out in NDB/ or
366
 
                /One can only use the --user.*root/ or
367
 
                /Setting lower_case_table_names=2/ or
368
 
                /Table:.* on (delete|rename)/ or
369
 
                /You have an error in your SQL syntax/ or
370
 
                /deprecated/ or
371
 
                /description of time zone/ or
372
 
                /equal MySQL server ids/ or
373
 
                /error .*connecting to master/ or
374
 
                /error reading log entry/ or
375
 
                /lower_case_table_names is set/ or
376
 
                /skip-name-resolve mode/ or
377
 
                /slave SQL thread aborted/ or
378
 
                /Slave: .*Duplicate entry/ or
379
 
                # Special case for Bug #26402 in show_check.test
380
 
                # Question marks are not valid file name parts
381
 
                # on Windows platforms. Ignore this error message. 
382
 
                /\QCan't find file: '.\test\????????.frm'\E/ or
383
 
                # Special case, made as specific as possible, for:
384
 
                # Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
385
 
                #             server coredump
386
 
                /\QError in Log_event::read_log_event(): 'Sanity check failed', data_len: 258, event_type: 49\E/ or
387
 
                /Statement is not safe to log in statement format/ or
388
 
 
389
 
                # test case for Bug#bug29807 copies a stray frm into database
390
 
                /InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal/ or
391
 
                /Cannot find or open table test\/bug29807 from/ or
392
 
 
393
 
                # innodb foreign key tests that fail in ALTER or RENAME produce this
394
 
                /InnoDB: Error: in ALTER TABLE `test`.`t[12]`/ or
395
 
                /InnoDB: Error: in RENAME TABLE table `test`.`t1`/ or
396
 
                /InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal/ or
397
 
 
398
 
                # Test case for Bug#14233 produces the following warnings:
399
 
                /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or
400
 
                /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or
401
 
                /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or
402
 
 
403
 
                # BUG#29839 - lowercase_table3.test: Cannot find table test/T1
404
 
                #             from the internal data dictiona
405
 
                /Cannot find table test\/BUG29839 from the internal data dictionary/ or
406
 
                # BUG#32080 - Excessive warnings on Solaris: setrlimit could not
407
 
                #             change the size of core files
408
 
                /setrlimit could not change the size of core files to 'infinity'/ or
409
 
 
410
 
                # rpl_ndb_basic expects this error
411
 
                /Slave: Got error 146 during COMMIT Error_code: 1180/ or
412
 
 
413
 
                # rpl_extrColmaster_*.test, the slave thread produces warnings
414
 
                # when it get updates to a table that has more columns on the
415
 
                # master
416
 
                /Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or
417
 
                /Slave: Can't DROP 'c7'.* 1091/ or
418
 
                /Slave: Key column 'c6'.* 1072/ or
419
 
 
420
 
                # BUG#32080 - Excessive warnings on Solaris: setrlimit could not
421
 
                #             change the size of core files
422
 
                /setrlimit could not change the size of core files to 'infinity'/ or
423
 
                # rpl_idempotency.test produces warnings for the slave.
424
 
                ($testname eq 'rpl.rpl_idempotency' and
425
 
                 (/Slave: Can\'t find record in \'t1\' Error_code: 1032/ or
426
 
                  /Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452/
427
 
                 )) or
428
 
 
429
 
                # These tests does "kill" on queries, causing sporadic errors when writing to logs
430
 
                (($testname eq 'rpl.rpl_skip_error' or
431
 
                  $testname eq 'rpl.rpl_err_ignoredtable' or
432
 
                  $testname eq 'binlog.binlog_killed_simulate' or
433
 
                  $testname eq 'binlog.binlog_killed') and
434
 
                 (/Failed to write to mysql\.\w+_log/
435
 
                 )) or
436
 
 
437
 
                # rpl_bug33931 has deliberate failures
438
 
                ($testname eq 'rpl.rpl_bug33931' and
439
 
                 (/Failed during slave.*thread initialization/
440
 
                  )) or
441
 
 
442
 
                # rpl_temporary has an error on slave that can be ignored
443
 
                ($testname eq 'rpl.rpl_temporary' and
444
 
                 (/Slave: Can\'t find record in \'user\' Error_code: 1032/
445
 
                 )) or
446
 
 
447
 
                # Test case for Bug#31590 produces the following error:
448
 
                /Out of sort memory; increase server sort buffer size/
449
 
                )
450
 
            {
451
 
              next;                       # Skip these lines
452
 
            }
453
 
            if ( /CURRENT_TEST: (.*)/ )
454
 
            {
455
 
              $testname= $1;
456
 
            }
457
 
            if ( /$pattern/ )
458
 
            {
459
 
              if ($leak_reports_expected) {
460
 
                next;
461
 
              }
462
 
              $found_problems= 1;
463
 
              print WARN basename($errlog) . ": $testname: $_";
464
 
            }
465
 
          }
466
 
        }
467
 
      }
468
 
 
469
 
      if ( $::opt_check_testcases )
470
 
      {
471
 
        # Look for warnings produced by mysqltest in testname.warnings
472
 
        foreach my $test_warning_file
473
 
          ( glob("$::glob_mysql_test_dir/r/*.warnings") )
474
 
        {
475
 
          $found_problems= 1;
476
 
          print WARN "Check myqltest warnings in $test_warning_file\n";
477
 
        }
478
 
      }
479
 
 
480
 
      if ( $found_problems )
481
 
      {
482
 
        mtr_warning("Got errors/warnings while running tests, please examine",
483
 
                    "\"$warnlog\" for details.");
484
 
      }
485
 
    }
486
 
  }
487
 
 
488
240
  print "\n";
489
241
 
490
242
  # Print a list of testcases that failed