Skip to content

Commit bf6ef15

Browse files
committed
Don't attempt to destructure sets
Precision doesn't actually tell us about the type of a CHAR column. It simply tells us how many bytes the column has to hold data, which will vary for CHAR columns as well as ENUM and SET columns. We simply need to respond with the string and allow the caller to split results themselves.
1 parent 5c965d3 commit bf6ef15

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ function hydrateRecord (record, fields) {
4141
value = new Date(value + 'Z');
4242
break;
4343

44-
case 'CHAR':
45-
if (field.precision === 5) {
46-
// ENUM ?
47-
break;
48-
} else if (field.precision === 13) {
49-
// SET ?
50-
value = new Set(value.split(','));
51-
}
52-
break;
53-
5444
default:
5545
break;
5646
}

tests/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ module.exports = {
426426
blob: Buffer.from([98, 108, 111, 103]),
427427
text: 'test',
428428
enum: 'one',
429-
set: new Set(['one', 'two']),
429+
set: 'one,two',
430430
null: null,
431431
bool: true
432432
}

0 commit comments

Comments
 (0)