Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIME format 00:00:00 return 102278627328:00:34 #262

Closed
Gabilabrebi opened this issue Nov 27, 2023 · 1 comment
Closed

TIME format 00:00:00 return 102278627328:00:34 #262

Gabilabrebi opened this issue Nov 27, 2023 · 1 comment

Comments

@Gabilabrebi
Copy link

Gabilabrebi commented Nov 27, 2023

When using TIME format and storing "00:00:00", the time retrieved when using SELECT is "102278627328:00:34"

For whatever reason, in a more complex query like the one bellow, it even crashes node.

SELECT
    boxes.id,
    boxes.title,
    boxes.active,
    boxes.startDate,
    boxes.endDate,
    boxes.monday,
    boxes.tuesday,
    boxes.wednesday,
    boxes.thursday,
    boxes.friday,
    boxes.saturday,
    boxes.sunday,
    boxes.startHour,
    boxes.endHour,
    IF(COUNT(boxes_contents.id) = 0, JSON_ARRAY(), JSON_ARRAYAGG(JSON_OBJECT("type", boxes_contents.type, "id", boxes_contents.refId, "level",boxes_contents.level) ORDER BY sort)) AS content
FROM boxes
LEFT JOIN boxes_contents ON boxes_contents.boxe = boxes.id
WHERE boxes.userId = ?
GROUP BY boxes.id

undefined:1
e": "category", "id": 1, "level": 1},{"type": "item", "id": 1, "level": null},{"type": "item", "id": 2, "level":
^

SyntaxError: Unexpected token 'e', "e": "categ"... is not valid JSON
    at JSON.parse (<anonymous>)
    at Array.readJsonBinary (C:\Users\Gabi\Documents\Web\menu\node_modules\mariadb\lib\cmd\decoder\binary-decoder.js:268:49)
    at Execute.parseRowStdBinary (C:\Users\Gabi\Documents\Web\menu\node_modules\mariadb\lib\cmd\parser.js:530:56)
    at Execute.readResultSetRow (C:\Users\Gabi\Documents\Web\menu\node_modules\mariadb\lib\cmd\parser.js:428:29)
    at PacketInputStream.receivePacketBasic (C:\Users\Gabi\Documents\Web\menu\node_modules\mariadb\lib\io\packet-input-stream.js:85:9)
    at PacketInputStream.onData (C:\Users\Gabi\Documents\Web\menu\node_modules\mariadb\lib\io\packet-input-stream.js:145:26)
    at Socket.emit (node:events:515:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5)

Node.js v21.1.0
[nodemon] app crashed - waiting for file changes before starting...

Obviously the same SELECT works fine with every other TIME than 00:00:00

@Gabilabrebi Gabilabrebi changed the title Time format 00:00:00 return 102278627328:00:34 TIME format 00:00:00 return 102278627328:00:34 Nov 27, 2023
@rusher
Copy link
Collaborator

rusher commented Nov 29, 2023

Thanks for reporting it.
Problem reside in binary encoded of TIME with exact value of '00:00:00' as indicated.
This will be corrected in 3.2.3

@rusher rusher closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants