sidorares / sidorares/node-mysql2
Possible issue with multiple queries sent in one go with manticorsearch
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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