mysql-live-select
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -84,4 +84,2 @@ /* mysql-live-select, MIT License ben@latenightsketches.com | ||
self.zongji.set(self.zongjiSettings); | ||
var newSelect = new LiveMysqlSelect(query, triggers, this); | ||
@@ -88,0 +86,0 @@ self._select.push(newSelect); |
@@ -53,7 +53,2 @@ /* mysql-live-select, MIT License ben@latenightsketches.com | ||
if(triggerDatabase === undefined){ | ||
self.emit('error', new Error('no database selected on trigger')); | ||
return false; | ||
} | ||
if(triggerDatabase === tableMap.parentSchema && | ||
@@ -60,0 +55,0 @@ trigger.table === tableMap.tableName){ |
{ | ||
"name": "mysql-live-select", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Live updating MySQL SELECT statements", | ||
@@ -5,0 +5,0 @@ "main": "lib/LiveMysql.js", |
@@ -157,3 +157,4 @@ var mysql = require('mysql'); | ||
if(error) return self.emit('error', error); | ||
if(event === undefined) return; // Filtered out | ||
// Do not emit events that have been filtered out | ||
if(event === undefined || event._filtered === true) return; | ||
@@ -160,0 +161,0 @@ if (event.getTypeName() === 'TableMap') { |
@@ -116,3 +116,3 @@ var util = require('util'); | ||
function TableMap(parser, options) { | ||
function TableMap(parser, options, zongji) { | ||
BinlogEvent.apply(this, arguments); | ||
@@ -132,10 +132,17 @@ this.tableMap = options.tableMap; | ||
this.tableName = parser.parseString(tableNameLength); | ||
parser.parseUnsignedNumber(1); | ||
this.columnCount = parser.parseLengthCodedNumber(); | ||
this.columnTypes = Common.parseBytesArray(parser, this.columnCount); | ||
// column meta data length | ||
parser.parseLengthCodedNumber(); | ||
this._readColumnMetadata(parser); | ||
// ignore the rest | ||
if(zongji._skipSchema(this.schemaName, this.tableName)){ | ||
// This event has been filtered out because of its database/table | ||
parser._offset = parser._packetEnd; | ||
this._filtered = true; | ||
}else{ | ||
parser.parseUnsignedNumber(1); | ||
this.columnCount = parser.parseLengthCodedNumber(); | ||
this.columnTypes = Common.parseBytesArray(parser, this.columnCount); | ||
// column meta data length | ||
parser.parseLengthCodedNumber(); | ||
this._readColumnMetadata(parser); | ||
// ignore the rest | ||
} | ||
} | ||
@@ -142,0 +149,0 @@ |
@@ -35,8 +35,10 @@ var util = require('util'); | ||
var database = this.tableMap[this.tableId].parentSchema; | ||
var table = this.tableMap[this.tableId].tableName; | ||
if(zongji._skipSchema(database, table)){ | ||
// This event has been filtered out because of its database/table | ||
var tableData = this.tableMap[this.tableId]; | ||
if(tableData === undefined){ | ||
// TableMap event was filtered | ||
parser._offset = parser._packetEnd; | ||
this._filtered = true; | ||
}else{ | ||
var database = tableData.parentSchema; | ||
var table = tableData.tableName; | ||
var columnsPresentBitmapSize = Math.floor((this.numberOfColumns + 7) / 8); | ||
@@ -43,0 +45,0 @@ // Columns present bitmap exceeds 4 bytes with >32 rows |
74591
1818