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

Bug: Incorrect arguments to mysqld_stmt_execute #674

Closed
AvaN0x opened this issue Mar 20, 2022 · 1 comment
Closed

Bug: Incorrect arguments to mysqld_stmt_execute #674

AvaN0x opened this issue Mar 20, 2022 · 1 comment
Labels
New Issue New Issue to the repo. Priority Requires the utmost attention.

Comments

@AvaN0x
Copy link
Contributor

AvaN0x commented Mar 20, 2022

Development Issue

No

Phone Version

1.2.1

Issue Description

Issue caused by MySQL version 8.0.22 and above (currently using 8.0.27). Whenever a query has a LIMIT ? there is the error "Incorrect arguments to mysqld_stmt_execute".

This issue has a fix that you can find here sidorares/node-mysql2#1239 (comment).
Basically, every time there is a LIMIT ? with a number as value there will be the error. Having it passed as a string fixes it. (Same issue for the OFFSET ?)

So for example here :

const [results] = await DbInterface._rawExec(query, [
dto.conversationId,
MESSAGES_PER_PAGE,
offset,
]);

Having this would fix the error :

    const [results] = await DbInterface._rawExec(query, [
      dto.conversationId,
      MESSAGES_PER_PAGE + "",
      offset + "",
    ]);

Issue Reproduction

  1. Update your mysql to 8.0.22 or above
  2. Create a conversation
  3. Try to open the conversation, you should get an error saying "Impossible to find messages"
    image
    And the server console should show these :
    image
    image
@AvaN0x AvaN0x added the New Issue New Issue to the repo. label Mar 20, 2022
@itschip itschip added the Priority Requires the utmost attention. label Mar 22, 2022
@itschip
Copy link
Member

itschip commented Mar 27, 2022

Fixed in 14c82ee and 90133a6

@itschip itschip closed this as completed Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Issue New Issue to the repo. Priority Requires the utmost attention.
Projects
None yet
Development

No branches or pull requests

2 participants