I have a problem with column aliases (name()) from the result metadata. If I run the same query multiple times, sometimes the names returned from meta[x].name() is corrupted, and looks like something from a memory leak.
There seems to be a correlation between the problem and the size of the resultset, because if I set a limit in the query of fx 30 rows, there is no problem. In my case I only saw the problem when the result was more than about 300 rows.
Here is some of my code:
const r1 = await dbc.query(
Unknown macro: { rowsAsArray}
);
const cols = r1.meta.map(c => (
Unknown macro: { name}
));
I'm using connector @3.0.1 and MariaDB 10.6.7 on Ubuntu.
There seems to be no problems with version @2.5.6.
When the metadata is parsed, buffer that comes from socket chunk is saved to avoid unnecessarily buffer parsing. The problem is that this buffer can be reused by the socket, the metadata returning then erroneous data
Diego Dupin
added a comment - corrected with https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/6bdb463ca921cabca790dfe8f699bf77e1ca1ec6
When the metadata is parsed, buffer that comes from socket chunk is saved to avoid unnecessarily buffer parsing. The problem is that this buffer can be reused by the socket, the metadata returning then erroneous data
People
Diego Dupin
Diego Dupin
Votes:
0Vote for this issue
Watchers:
1Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":926.9000005722046,"ttfb":320.80000019073486,"pageVisibility":"visible","entityId":115202,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7f3930b6-4067-493c-8ef7-23aef02d2627","navigationType":0,"readyForUser":1026.2000007629395,"redirectCount":0,"resourceLoadedEnd":1029.2000007629395,"resourceLoadedStart":326.1000003814697,"resourceTiming":[{"duration":76.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":326.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":326.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":77.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":326.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":326.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":404.20000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":131.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":326.6000003814697,"connectEnd":326.6000003814697,"connectStart":326.6000003814697,"domainLookupEnd":326.6000003814697,"domainLookupStart":326.6000003814697,"fetchStart":326.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":326.6000003814697,"responseEnd":458,"responseStart":457.9000005722046,"secureConnectionStart":326.6000003814697},{"duration":216.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":326.80000019073486,"connectEnd":326.80000019073486,"connectStart":326.80000019073486,"domainLookupEnd":326.80000019073486,"domainLookupStart":326.80000019073486,"fetchStart":326.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":326.80000019073486,"responseEnd":543.3000001907349,"responseStart":543.3000001907349,"secureConnectionStart":326.80000019073486},{"duration":220.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":327,"connectEnd":327,"connectStart":327,"domainLookupEnd":327,"domainLookupStart":327,"fetchStart":327,"redirectEnd":0,"redirectStart":0,"requestStart":327,"responseEnd":547.5,"responseStart":547.5,"secureConnectionStart":327},{"duration":220.79999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":327.20000076293945,"connectEnd":327.20000076293945,"connectStart":327.20000076293945,"domainLookupEnd":327.20000076293945,"domainLookupStart":327.20000076293945,"fetchStart":327.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":327.20000076293945,"responseEnd":548,"responseStart":548,"secureConnectionStart":327.20000076293945},{"duration":221,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":327.4000005722046,"connectEnd":327.4000005722046,"connectStart":327.4000005722046,"domainLookupEnd":327.4000005722046,"domainLookupStart":327.4000005722046,"fetchStart":327.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":327.4000005722046,"responseEnd":548.4000005722046,"responseStart":548.4000005722046,"secureConnectionStart":327.4000005722046},{"duration":271.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":327.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":599.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":221.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":327.70000076293945,"connectEnd":327.70000076293945,"connectStart":327.70000076293945,"domainLookupEnd":327.70000076293945,"domainLookupStart":327.70000076293945,"fetchStart":327.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":327.70000076293945,"responseEnd":548.8000001907349,"responseStart":548.8000001907349,"secureConnectionStart":327.70000076293945},{"duration":271.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":327.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":599.2000007629395,"responseStart":0,"secureConnectionStart":0},{"duration":221.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":328.1000003814697,"connectEnd":328.1000003814697,"connectStart":328.1000003814697,"domainLookupEnd":328.1000003814697,"domainLookupStart":328.1000003814697,"fetchStart":328.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":328.1000003814697,"responseEnd":549.3000001907349,"responseStart":549.3000001907349,"secureConnectionStart":328.1000003814697},{"duration":421.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":328.80000019073486,"connectEnd":328.80000019073486,"connectStart":328.80000019073486,"domainLookupEnd":328.80000019073486,"domainLookupStart":328.80000019073486,"fetchStart":328.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":328.80000019073486,"responseEnd":750.5,"responseStart":750.5,"secureConnectionStart":328.80000019073486},{"duration":593.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":333.1000003814697,"connectEnd":333.1000003814697,"connectStart":333.1000003814697,"domainLookupEnd":333.1000003814697,"domainLookupStart":333.1000003814697,"fetchStart":333.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":333.1000003814697,"responseEnd":926.8000001907349,"responseStart":926.8000001907349,"secureConnectionStart":333.1000003814697},{"duration":159.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":610.6000003814697,"connectEnd":610.6000003814697,"connectStart":610.6000003814697,"domainLookupEnd":610.6000003814697,"domainLookupStart":610.6000003814697,"fetchStart":610.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":610.6000003814697,"responseEnd":769.7000007629395,"responseStart":769.7000007629395,"secureConnectionStart":610.6000003814697},{"duration":147.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true","startTime":882,"connectEnd":882,"connectStart":882,"domainLookupEnd":882,"domainLookupStart":882,"fetchStart":882,"redirectEnd":0,"redirectStart":0,"requestStart":882,"responseEnd":1029.2000007629395,"responseStart":1029.2000007629395,"secureConnectionStart":882},{"duration":132.89999961853027,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":920.2000007629395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":920.2000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.1000003814697,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":169,"responseStart":321,"responseEnd":328,"domLoading":324,"domInteractive":1071,"domContentLoadedEventStart":1071,"domContentLoadedEventEnd":1107,"domComplete":1612,"loadEventStart":1612,"loadEventEnd":1613,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1057.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1058.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1058.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1059.1000003814697},{"name":"activityTabFullyLoaded","time":1128.4000005722046}],"measures":[],"correlationId":"afa6af2079a16a","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":15,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
corrected with https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/6bdb463ca921cabca790dfe8f699bf77e1ca1ec6
When the metadata is parsed, buffer that comes from socket chunk is saved to avoid unnecessarily buffer parsing. The problem is that this buffer can be reused by the socket, the metadata returning then erroneous data