Skip to content

Commit 7bf7517

Browse files
author
otadmin
committed
fixed test
1 parent a41d218 commit 7bf7517

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<img src='https://i.imgur.com/AOfuTLA.png'>
88
</p>
99

10-
*Version 3.0.5* - [Github](https://github.com/Pamblam/mysql-import/) - [NPM](https://www.npmjs.com/package/mysql-import)
10+
*Version 3.0.6* - [Github](https://github.com/Pamblam/mysql-import/) - [NPM](https://www.npmjs.com/package/mysql-import)
1111

1212
[![Build Status](https://api.travis-ci.org/Pamblam/mysql-import.svg?branch=master)](https://travis-ci.org/Pamblam/mysql-import/) [![Coverage Status](https://coveralls.io/repos/github/Pamblam/mysql-import/badge.svg?branch=master)](https://coveralls.io/github/Pamblam/mysql-import?branch=master)
1313

mysql-import.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* mysql-import - v3.0.5
2+
* mysql-import - v3.0.6
33
* Import .sql into a MySQL database with Node.
44
* @author Rob Parham
55
* @website https://github.com/pamblam/mysql-import#readme
@@ -92,7 +92,7 @@ class importer{
9292

9393
}
9494

95-
importer.version = '3.0.5';
95+
importer.version = '3.0.6';
9696
importer.config = function(settings){
9797
const valid = settings.hasOwnProperty('host') && typeof settings.host === "string" &&
9898
settings.hasOwnProperty('user') && typeof settings.user === "string" &&
@@ -164,7 +164,10 @@ class queryParser{
164164

165165
// Are we currently seeking new delimiter
166166
this.seekingDelimiter = false;
167-
167+
168+
// Does the sql set change delimiter?
169+
this.hasDelimiter = queriesString.toLowerCase().includes('delimiter ');
170+
168171
// Iterate over each char in the string
169172
for (let i = 0; i < this.queriesString.length; i++) {
170173
let char = this.queriesString[i];
@@ -176,7 +179,11 @@ class queryParser{
176179
parseChar(char){
177180
this.checkEscapeChar();
178181
this.buffer.push(char);
179-
this.checkNewDelimiter(char);
182+
183+
if (this.hasDelimiter) {
184+
this.checkNewDelimiter(char);
185+
}
186+
180187
this.checkQuote(char);
181188
this.checkEndOfQuery();
182189
}
@@ -232,4 +239,4 @@ class queryParser{
232239
this.buffer = [];
233240
}
234241
}
235-
}
242+
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@
4242
"coverage": "node node_modules/.bin/istanbul cover _mocha -- -R spec",
4343
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls"
4444
},
45-
"version": "3.0.5"
45+
"version": "3.0.6"
4646
}

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RESET THEM TO '' BEFORE COMMITING CHANGES!
44
const mysql_host = '';
55
const mysql_user = '';
6-
const mysql_pass = 'ourtown1972';
6+
const mysql_pass = '';
77

88
const expect = require('chai').expect;
99
const {errorHandler,query,mysqlConnect,createTestDB,destroyTestDB} = require('./test-helpers.js');

0 commit comments

Comments
 (0)