cache and procedure
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- express, javascript, mysql, node.js
Research direction
Start by reproducing the reported behavior with the provided mysql.createPool and mysqlpool.query CALL example, varying the procedure parameters across requests. Read the mysql2 LRU-cache documentation and compare repeated procedure results; done means establishing whether the stale rows come from mysql2 or the procedure/database and recording a clear resolution.
Written by the indexing model from the issue text.
Description
Dear developers
i am use mysql2 lib with PoolConnection on ExpressJS.
When I make a two request (changing the parameters of the request), I get old (cached) data sometimes (reloading the page). Is it somehow connected with Lru cached, but it is impossible to disable it through the connection parameters or it bug?
in docunetation say:
// If you execute same statement again, it will be picked from a LRU cache
// which will save query preparation time and give better performance
but i use Procedure and PoolQuery . Patching my CALL procedure added Math.Random but it had no effect
my source code
const mysql = require('mysql2');
const mysqlpool = mysql.createPool({
host: 'localhost',
user: 'root',
database: 'base_test',
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0,
multipleStatements: false,
//caching: true
});
module.exports.getQuery = function (str,brand,resout) {
let rnd = Math.random();
let sqlProcedure = 'CALL alfaquery_v2(?,?);';
mysqlpool.query(
sqlProcedure,[str,rnd],
function(err, rows) {
if (err) {
console.log(err);
resout.send([]);
}
console.log(rows[0]);
resout.send(rows[0]);
});
}
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
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.
More from sidorares/node-mysql2
-
Bun Error.prepareStackTrace throw's error "Caused by: First argument must be an Error object failed" Openbun needs reproduction
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sidorares/node-mysql2#4480 ·
-
needs discussion typescript
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sidorares/node-mysql2#4275 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sidorares/node-mysql2#1367 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
sidorares/node-mysql2#745 · 7 comments · 1 reaction ·
-
enhancement performance
Difficulty 5/5 Over a week Newbie friendliness 35/100
sidorares/node-mysql2#4523 ·
All issues in sidorares/node-mysql2
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·