sidorares / sidorares/node-mysql2

Possible issue with multiple queries sent in one go with manticorsearch

Open
#1,889 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

I'm using mysql2 to connect to Manticorsearch. It fas a feature where it sends back multiple resultsets for a query, for faceted search. Essentially multple groupby-like views of the main query. It's one SQL query. But in addition to this query type, I need to send another one in the same go, as it have optimizations if I do so, in case the queries have a common base. So I do the following:

SELECT id, this, that
FROM searchindex 
LIMIT 10 
FACET name 
FACET year 
FACET topic; 
SELECT id, something, andsuch 
FROM searchindex 
LIMIT 100

Generic MySQL client apps like HeidiSQL handle this correctly, I get 5 resultsets: main query, 3 facets plus one after the semicolon. Through mysql2 I also get 5, but only the first 4 are correct, the 5th is a single row, not 100, and not with the field I selected. Can help in testing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the semicolon-separated Manticoresearch query through mysql2 and compare the fifth resultset with the results from HeidiSQL. Trace how mysql2 handles multiple resultsets after the three FACET resultsets; done means the second query returns 100 rows with the selected fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.