Skip to content

Commit 28d8af1

Browse files
ruiquelhasnwoltman
authored andcommitted
tests: fix local_infile breaking change on MySQL 8
1 parent 99d6f78 commit 28d8af1

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,14 @@ The following flags are sent by default on a new connection:
13991399
- `SECURE_CONNECTION` - Support native 4.1 authentication.
14001400
- `TRANSACTIONS` - Asks for the transaction status flags.
14011401

1402+
The `local_infile` system variable is disabled by default since MySQL 8.0.2, which
1403+
means the `LOCAL_FILES` flag will only make sense if the feature is explicitely
1404+
enabled on the server.
1405+
1406+
```sql
1407+
SET GLOBAL local_infile = true;
1408+
```
1409+
14021410
In addition, the following flag will be sent if the option `multipleStatements`
14031411
is set to `true`:
14041412

test/integration/connection/test-load-data-infile.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ common.getTestConnection(function (err, connection) {
1111

1212
common.useTestDb(connection);
1313

14+
// "LOAD DATA LOCAL" is not allowed on MySQL 8 by default
15+
connection.query('SET GLOBAL local_infile = true', assert.ifError);
16+
1417
connection.query([
1518
'CREATE TEMPORARY TABLE ?? (',
1619
'`id` int(11) unsigned NOT NULL AUTO_INCREMENT,',

test/integration/connection/test-multiple-statements-load-data-infile.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ common.getTestConnection({multipleStatements: true}, function (err, connection)
1010

1111
common.useTestDb(connection);
1212

13+
connection.query('SET GLOBAL local_infile = true', assert.ifError);
14+
1315
connection.query([
1416
'CREATE TEMPORARY TABLE ?? (',
1517
'`id` int(11) unsigned NOT NULL AUTO_INCREMENT,',

0 commit comments

Comments
 (0)