Skip to content

Commit 6efbc00

Browse files
build - v1.12.2
1 parent b8042e1 commit 6efbc00

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Download with your package manager of choice. The package name is `mysql-memory-
1717
- ```mysql-memory-server``` can run MySQL versions 5.7.19 and newer (if the version is already installed on your system)
1818
- ```mysql-memory-server``` can download and run MySQL versions (inclusive) 5.7.19 - 5.7.44, 8.0.0 - 8.0.43, 8.1.0 - 8.4.6, and 9.0.1 - 9.4.0 (if the version is not already installed on your system)
1919

20-
Extra system requirements apply when ```mysql-memory-server``` is downloading MySQL instead of running a version of MySQL that is already installed on the system. To see the requirements and learn more about the supported versions for download, [read the doc](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md)
20+
Extra system requirements apply when ```mysql-memory-server``` is downloading MySQL instead of running a version of MySQL that is already installed on the system. To see the requirements and learn more about the supported versions for download, [read the doc](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md)
2121

2222
## Example Usage - Application Code
2323

@@ -102,11 +102,11 @@ Description: Version of MySQL to use for the database. Uses semver for getting t
102102

103103
If left undefined:
104104
- If the system has MySQL installed, the system-installed version will be used. If the installed version is not supported by this package (currently <5.7.19), an error will be thrown unless `ignoreUnsupportedSystemVersion` is set to `true`.
105-
- If the system does not have MySQL installed, the latest version of MySQL that [this package supports downloading](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md) will be downloaded.
105+
- If the system does not have MySQL installed, the latest version of MySQL that [this package supports downloading](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md) will be downloaded.
106106

107107
If defined:
108108
- If the version is older than 5.7.19, an error will be thrown as this package does not currently support those versions of MySQL.
109-
- If the desired version of MySQL is already installed on the system, the installed version will be used. Otherwise the selected version will be downloaded as long as this package [supports downloading it](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md). If this package does not support downloading the selected version, or your system does not [meet the requirements](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md) for that version to be ran, an error will be thrown.
109+
- If the desired version of MySQL is already installed on the system, the installed version will be used. Otherwise the selected version will be downloaded as long as this package [supports downloading it](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md). If this package does not support downloading the selected version, or your system does not [meet the requirements](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md) for that version to be ran, an error will be thrown.
110110

111111
- `dbName: string`
112112

dist/src/libraries/Executor.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,18 @@ _Executor_instances = new WeakSet(), _Executor_executeFile = function _Executor_
198198
resolve({ error, stdout, stderr });
199199
});
200200
});
201-
}, _Executor_killProcess = async function _Executor_killProcess(process) {
201+
}, _Executor_killProcess = async function _Executor_killProcess(childProcess) {
202202
// If the process has already been killed, return true
203-
if (process.kill(0) === false) {
204-
this.logger.warn('Called #killProcess to kill mysqld but it has already been killed.');
203+
const pid = childProcess.pid;
204+
try {
205+
process.kill(pid, 0);
206+
}
207+
catch (e) {
208+
this.logger.warn('#killProcess got called to kill mysqld but it is not running:', e);
205209
return true;
206210
}
207211
if (os.platform() === 'win32') {
208-
const { error, stderr } = await __classPrivateFieldGet(this, _Executor_instances, "m", _Executor_executeFile).call(this, 'taskkill', ['/pid', String(process.pid), '/t', '/f']);
212+
const { error, stderr } = await __classPrivateFieldGet(this, _Executor_instances, "m", _Executor_executeFile).call(this, 'taskkill', ['/pid', String(pid), '/t', '/f']);
209213
const message = error || stderr;
210214
if (!message) {
211215
return true;
@@ -217,7 +221,7 @@ _Executor_instances = new WeakSet(), _Executor_executeFile = function _Executor_
217221
this.logger.error(message, '| Error toString:', message.toString());
218222
return false;
219223
}
220-
return process.kill('SIGKILL');
224+
return process.kill(pid, 'SIGKILL');
221225
}, _Executor_returnBinaryPathToDelete = function _Executor_returnBinaryPathToDelete(binaryFilepath, options) {
222226
if (binaryFilepath.includes(os.tmpdir()) && !options.downloadBinaryOnce) {
223227
const splitPath = binaryFilepath.split(os.platform() === 'win32' ? '\\' : '/');
@@ -351,7 +355,7 @@ _Executor_instances = new WeakSet(), _Executor_executeFile = function _Executor_
351355
if (code) {
352356
let errorMessage = '';
353357
if (os.platform() === 'win32' && code === 3221225781) {
354-
errorMessage = `The MySQL database exited early with code 3221225781. A possible cause is that the Microsoft Visual C++ Redistributable Package is not installed. Please refer to the following link for this package's requirements on your system - this may help solve this error: https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md#required-dependencies. If you are sure you have this installed, check the following for more details: The error log was:\n${errorLog}\nThe error string was: "${errorString}".`;
358+
errorMessage = `The MySQL database exited early with code 3221225781. A possible cause is that the Microsoft Visual C++ Redistributable Package is not installed. Please refer to the following link for this package's requirements on your system - this may help solve this error: https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md#required-dependencies. If you are sure you have this installed, check the following for more details: The error log was:\n${errorLog}\nThe error string was: "${errorString}".`;
355359
}
356360
else {
357361
errorMessage = `The database exited early with code ${code}. The error log was:\n${errorLog}\nThe error string was: "${errorString}".`;

docs/SUPPORTED_MYSQL_DOWNLOADS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ Fedora Linux: ```libaio1``` package and ```tar``` package
9292

9393
Alpine Linux: ```libstdc++``` package, ```libaio``` package, and ```tar``` package
9494

95-
*Document last updated in v1.12.1*
95+
*Document last updated in v1.12.2*

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mysql-memory-server",
3-
"version": "1.12.1",
3+
"version": "1.12.2",
44
"description": "Spin up an ephemeral MySQL database from your JavaScript code",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",

src/libraries/Executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class Executor {
216216
let errorMessage: string = ''
217217

218218
if (os.platform() === 'win32' && code === 3221225781) {
219-
errorMessage = `The MySQL database exited early with code 3221225781. A possible cause is that the Microsoft Visual C++ Redistributable Package is not installed. Please refer to the following link for this package's requirements on your system - this may help solve this error: https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.1/docs/SUPPORTED_MYSQL_DOWNLOADS.md#required-dependencies. If you are sure you have this installed, check the following for more details: The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
219+
errorMessage = `The MySQL database exited early with code 3221225781. A possible cause is that the Microsoft Visual C++ Redistributable Package is not installed. Please refer to the following link for this package's requirements on your system - this may help solve this error: https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.2/docs/SUPPORTED_MYSQL_DOWNLOADS.md#required-dependencies. If you are sure you have this installed, check the following for more details: The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
220220
} else {
221221
errorMessage = `The database exited early with code ${code}. The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
222222
}

0 commit comments

Comments
 (0)