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

Advanced Search Plugin: Analytics with MySQL throws error in your SQL syntax #33

Open
martijnvdbrug opened this issue Jul 17, 2024 · 2 comments

Comments

@martijnvdbrug
Copy link

  1. Install the Advanced Search Plugin
  2. Configure the analyticsStrategy: new SqlAnalyticsStrategy(),
  3. Go to Dashboard > Analytics and then the Event Log tab
  4. See error:
[Vendure Server] ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND `e`.`createdAt` <= ?)
           ) as t3
           ORDER BY time DESC
   ' at line 4
QueryFailedError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND `e`.`createdAt` <= ?)
           ) as t3
           ORDER BY time DESC
   ' at line 4
    at Query.<anonymous> (/home/martijn/git/huidpraktijkshop/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:165:37)
    at Query.<anonymous> (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/Connection.js:526:10)
    at Query._callback (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/Connection.js:488:16)
    at Sequence.end (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
    at Query.ErrorPacket (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/sequences/Query.js:92:8)
    at Protocol._parsePacket (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/home/martijn/git/huidpraktijkshop/node_modules/mysql/lib/Connection.js:88:28) 

image

We haven't logged any searches yet, so there are no events in our DB.

@michaelbromley
Copy link
Member

Hi,

Thanks for the report. Do you know if this error goes away once there is some data in the events table?

@martijnvdbrug
Copy link
Author

Hi,

Thanks for the report. Do you know if this error goes away once there is some data in the events table?

Good question, haven't tested that yet. We currently query Typesense directly, skipping any analytics, but we will start querying via Vendure soon.

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