To get metadata information for the binary protocol (prepared statements), a resultset handle must be allocated via mysql_stmt_result_metadata() which contains a pointer to stmt-> fields. Afterwards this handle must be released via mysql_free_result().
Instead of allocating and freeing memory it would be much simpler to have an additional API function mariadb_stmt_fetch_fields() which just returns stmt->fields:
Are you sure that you should do the same in mysql_stmt_result_metadata? i.e. only copy pointer to fields from stmt. What if application somehow stores and uses that MYSQL_RES structure after stmt handler somehow changed? well, probably effectively means closed. I can't think of any good reason for that, but still.
Currently, C/ODBC can use only new mariadb_stmt_fetch_fields. Thus it won't lose much, if mysql_stmt_result_metadata stays as is.
Lawrin Novitsky
added a comment - Are you sure that you should do the same in mysql_stmt_result_metadata? i.e. only copy pointer to fields from stmt. What if application somehow stores and uses that MYSQL_RES structure after stmt handler somehow changed? well, probably effectively means closed. I can't think of any good reason for that, but still.
Currently, C/ODBC can use only new mariadb_stmt_fetch_fields. Thus it won't lose much, if mysql_stmt_result_metadata stays as is.
People
Georg Richter
Georg Richter
Votes:
0Vote for this issue
Watchers:
5Start 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":843.2999999523163,"ttfb":248.20000004768372,"pageVisibility":"visible","entityId":68857,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"dd7462e2-f7c4-46bb-a09d-5ec275ee4bc8","navigationType":0,"readyForUser":908.7000000476837,"redirectCount":0,"resourceLoadedEnd":933.3999998569489,"resourceLoadedStart":253.29999995231628,"resourceTiming":[{"duration":132.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":253.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":253.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":131.89999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":253.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":253.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":146.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":253.59999990463257,"connectEnd":253.59999990463257,"connectStart":253.59999990463257,"domainLookupEnd":253.59999990463257,"domainLookupStart":253.59999990463257,"fetchStart":253.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":253.59999990463257,"responseEnd":399.7000000476837,"responseStart":399.7000000476837,"secureConnectionStart":253.59999990463257},{"duration":227.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":253.70000004768372,"connectEnd":253.70000004768372,"connectStart":253.70000004768372,"domainLookupEnd":253.70000004768372,"domainLookupStart":253.70000004768372,"fetchStart":253.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":253.70000004768372,"responseEnd":481.39999985694885,"responseStart":481.39999985694885,"secureConnectionStart":253.70000004768372},{"duration":231.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":253.79999995231628,"connectEnd":253.79999995231628,"connectStart":253.79999995231628,"domainLookupEnd":253.79999995231628,"domainLookupStart":253.79999995231628,"fetchStart":253.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":253.79999995231628,"responseEnd":485.2000000476837,"responseStart":485.2000000476837,"secureConnectionStart":253.79999995231628},{"duration":231.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":253.89999985694885,"connectEnd":253.89999985694885,"connectStart":253.89999985694885,"domainLookupEnd":253.89999985694885,"domainLookupStart":253.89999985694885,"fetchStart":253.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":253.89999985694885,"responseEnd":485.59999990463257,"responseStart":485.59999990463257,"secureConnectionStart":253.89999985694885},{"duration":232.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":254,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":254,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":486.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":232,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":254,"connectEnd":254,"connectStart":254,"domainLookupEnd":254,"domainLookupStart":254,"fetchStart":254,"redirectEnd":0,"redirectStart":0,"requestStart":254,"responseEnd":486,"responseStart":486,"secureConnectionStart":254},{"duration":232.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":254.09999990463257,"connectEnd":254.09999990463257,"connectStart":254.09999990463257,"domainLookupEnd":254.09999990463257,"domainLookupStart":254.09999990463257,"fetchStart":254.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":254.09999990463257,"responseEnd":486.39999985694885,"responseStart":486.39999985694885,"secureConnectionStart":254.09999990463257},{"duration":232.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":254.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":254.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":486.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":232.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":254.39999985694885,"connectEnd":254.39999985694885,"connectStart":254.39999985694885,"domainLookupEnd":254.39999985694885,"domainLookupStart":254.39999985694885,"fetchStart":254.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":254.39999985694885,"responseEnd":487,"responseStart":487,"secureConnectionStart":254.39999985694885},{"duration":340.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":259.59999990463257,"connectEnd":259.59999990463257,"connectStart":259.59999990463257,"domainLookupEnd":259.59999990463257,"domainLookupStart":259.59999990463257,"fetchStart":259.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":259.59999990463257,"responseEnd":600.2000000476837,"responseStart":600.0999999046326,"secureConnectionStart":259.59999990463257},{"duration":603.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":259.59999990463257,"connectEnd":259.59999990463257,"connectStart":259.59999990463257,"domainLookupEnd":259.59999990463257,"domainLookupStart":259.59999990463257,"fetchStart":259.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":259.59999990463257,"responseEnd":863.2000000476837,"responseStart":863.2000000476837,"secureConnectionStart":259.59999990463257},{"duration":48.89999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":552.5,"connectEnd":552.5,"connectStart":552.5,"domainLookupEnd":552.5,"domainLookupStart":552.5,"fetchStart":552.5,"redirectEnd":0,"redirectStart":0,"requestStart":552.5,"responseEnd":601.3999998569489,"responseStart":601.3999998569489,"secureConnectionStart":552.5},{"duration":168.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":765,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":765,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":933.3999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":82,"responseStart":249,"responseEnd":256,"domLoading":252,"domInteractive":957,"domContentLoadedEventStart":957,"domContentLoadedEventEnd":997,"domComplete":1253,"loadEventStart":1253,"loadEventEnd":1254,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":937.2000000476837},{"name":"bigPipe.sidebar-id.end","time":938},{"name":"bigPipe.activity-panel-pipe-id.start","time":938.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":939.2999999523163},{"name":"activityTabFullyLoaded","time":1009}],"measures":[],"correlationId":"5dd37f17ee8ac9","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":115,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Hi, can you please review - implementation can be found in cc_python branch.