b8fb6c5
commit e5f12ef57c75d37aa2e3444cc448598f3c32b0ea
b8fb6c5
Author: Daniel Black <daniel.black@openquery.com>
b8fb6c5
Date:   Tue Jun 17 11:45:13 2014 +1000
b8fb6c5
b8fb6c5
    Mariadb-10 show innodb status compatiblity
b8fb6c5
    
b8fb6c5
    show innodb status on mariadb-10 if in a transaction will show
b8fb6c5
    
b8fb6c5
    --------------
b8fb6c5
    ROW OPERATIONS
b8fb6c5
    --------------
b8fb6c5
    0 queries inside InnoDB, 0 queries in queue
b8fb6c5
    1 read views open inside InnoDB
b8fb6c5
    1 RW transactions active inside InnoDB
b8fb6c5
    0 RO transactions active inside InnoDB
b8fb6c5
    1 out of 1000 descriptors used
b8fb6c5
    ---OLDEST VIEW---
b8fb6c5
    Normal read view
b8fb6c5
    Read view low limit trx n:o 726056894
b8fb6c5
    Read view up limit trx id 726056894
b8fb6c5
    Read view low limit trx id 726056894
b8fb6c5
    Read view individually stored trx ids:
b8fb6c5
    -----------------
b8fb6c5
    Main thread process no. 13048, id 140163878000384, state: sleeping
b8fb6c5
    Number of rows inserted 0, updated 0, deleted 0, read 1666121005
b8fb6c5
    0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 17566.53 reads/s
b8fb6c5
    ------------
b8fb6c5
    
b8fb6c5
    In this patch we just skip sections like "Main thread process.." that we
b8fb6c5
    don't know about.
b8fb6c5
b8fb6c5
diff --git a/plugins/node.d/mysql_.in b/plugins/node.d/mysql_.in
b8fb6c5
index 9b6914b..1d83115 100644
b8fb6c5
--- a/plugins/node.d/mysql_.in
b8fb6c5
+++ b/plugins/node.d/mysql_.in
b8fb6c5
@@ -1102,8 +1102,12 @@ sub parse_innodb_status {
b8fb6c5
 	    last;
b8fb6c5
 	}
b8fb6c5
 
b8fb6c5
-	die "Unknown section: $1" unless exists $section_map{$sec};
b8fb6c5
-	die "Parse error. Expected a section separator" unless m/\G-+\n/gc;
b8fb6c5
+	if (exists $section_map{$sec}) {
b8fb6c5
+      $section_map{$sec}->();
b8fb6c5
+	} else {
b8fb6c5
+      #warn "Unknown section: $1";
b8fb6c5
+      skip();
b8fb6c5
+	}
b8fb6c5
 
b8fb6c5
 	$section_map{$sec}->();
b8fb6c5
     }