@vlasky/zongji 0.5.7 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -87,6 +87,7 @@ ZongJi.prototype._isChecksumEnabled = function(next) {
87
87
  .then(rows => {
88
88
  if (rows[0].checksum === 'NONE') {
89
89
  checksumEnabled = false;
90
+ return query(this.connection, 'SELECT 1');
90
91
  }
91
92
 
92
93
  if (checksumEnabled) {
package/lib/common.js CHANGED
@@ -440,8 +440,17 @@ exports.readMysqlValue = function(
440
440
  // e.g. TINYTEXT, MEDIUMTEXT, LONGTEXT, TEXT data types
441
441
  if (column.charset !== null) {
442
442
  // Javascript UTF8 always allows up to 4 bytes per character
443
- column.charset = column.charset === 'utf8mb4' ? 'utf8' : column.charset;
444
- result = iconv.decode(result, column.charset);
443
+ switch (column.charset) {
444
+ case 'utf8mb3':
445
+ case 'utf8mb4':
446
+ column.charset = 'utf8';
447
+ break;
448
+ }
449
+ try {
450
+ result = iconv.decode(result, column.charset);
451
+ } catch (err) {
452
+ console.warn(err);
453
+ }
445
454
  }
446
455
  break;
447
456
  case MysqlTypes.JSON:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vlasky/zongji",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "A MySQL 8.0-compatible fork of ZongJi - a MySQL binlog listener for Node.js.",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -24,7 +24,9 @@
24
24
  "numtel <ben@latenightsketches.com> (https://github.com/numtel)",
25
25
  "rfanth <rfa@rfanth.com> (https://github.com/rfanth)",
26
26
  "Alexander Radyushin <alexander@fjedi.com> (https://github.com/fjedi)",
27
- "Yousef El-Dardiry <yousefdardiry@gmail.com> (https://github.com/YousefED)"
27
+ "Yousef El-Dardiry <yousefdardiry@gmail.com> (https://github.com/YousefED)",
28
+ "Roopendra Talekar <roopendratalekar@gmail.com> (https://github.com/roopen219)",
29
+ "Juan Ferrer Toribio (https://github.com/juan-ferrer-toribio)"
28
30
  ],
29
31
  "license": "MIT",
30
32
  "engines": {
@@ -35,8 +37,8 @@
35
37
  "tap": "14.10.7"
36
38
  },
37
39
  "dependencies": {
38
- "big-integer": "1.6.48",
39
- "iconv-lite": "0.6.2",
40
- "@vlasky/mysql": "^2.18.5"
40
+ "big-integer": "1.6.51",
41
+ "iconv-lite": "0.6.3",
42
+ "@vlasky/mysql": "^2.18.6"
41
43
  }
42
44
  }