When invoking mysql --xml from the command line, the first part of the output is:
<?xml version="1.0"?>
|
|
<resultset ...
|
Note there is no encoding specified in the XML declaration.
As long as mysql is outputting UTF-8, this is technically correct because UTF-8 is the default (discussion here).
However, to avoid any possible confusion, perhaps the XML declaration should include an explicit declaration of the character encoding, e.g.:
<?xml version="1.0" encoding="UTF-8"?>
|
|
<resultset ...
|
Just a thought...
{"report":{"fcp":2708.699999809265,"ttfb":987.1999998092651,"pageVisibility":"visible","entityId":98647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"38635ba2-55a0-4f45-98a5-afc9d84de625","navigationType":0,"readyForUser":2780.5999999046326,"redirectCount":0,"resourceLoadedEnd":3120.699999809265,"resourceLoadedStart":997.6999998092651,"resourceTiming":[{"duration":880.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":997.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":997.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1878.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":880.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":998.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":998.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1878.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":918,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":998.3000001907349,"connectEnd":998.3000001907349,"connectStart":998.3000001907349,"domainLookupEnd":998.3000001907349,"domainLookupStart":998.3000001907349,"fetchStart":998.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":998.3000001907349,"responseEnd":1916.3000001907349,"responseStart":1916.3000001907349,"secureConnectionStart":998.3000001907349},{"duration":1205.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":998.9000000953674,"connectEnd":998.9000000953674,"connectStart":998.9000000953674,"domainLookupEnd":998.9000000953674,"domainLookupStart":998.9000000953674,"fetchStart":998.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":998.9000000953674,"responseEnd":2204,"responseStart":2204,"secureConnectionStart":998.9000000953674},{"duration":1208.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":999.0999999046326,"connectEnd":999.0999999046326,"connectStart":999.0999999046326,"domainLookupEnd":999.0999999046326,"domainLookupStart":999.0999999046326,"fetchStart":999.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":999.0999999046326,"responseEnd":2207.5,"responseStart":2207.5,"secureConnectionStart":999.0999999046326},{"duration":1208.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":999.3000001907349,"connectEnd":999.3000001907349,"connectStart":999.3000001907349,"domainLookupEnd":999.3000001907349,"domainLookupStart":999.3000001907349,"fetchStart":999.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":999.3000001907349,"responseEnd":2208,"responseStart":2208,"secureConnectionStart":999.3000001907349},{"duration":1208.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":999.4000000953674,"connectEnd":999.4000000953674,"connectStart":999.4000000953674,"domainLookupEnd":999.4000000953674,"domainLookupStart":999.4000000953674,"fetchStart":999.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":999.4000000953674,"responseEnd":2208.300000190735,"responseStart":2208.300000190735,"secureConnectionStart":999.4000000953674},{"duration":1223.5999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":999.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":999.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2223.199999809265,"responseStart":0,"secureConnectionStart":0},{"duration":1209.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":999.6999998092651,"connectEnd":999.6999998092651,"connectStart":999.6999998092651,"domainLookupEnd":999.6999998092651,"domainLookupStart":999.6999998092651,"fetchStart":999.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":999.6999998092651,"responseEnd":2208.800000190735,"responseStart":2208.800000190735,"secureConnectionStart":999.6999998092651},{"duration":1223.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":999.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":999.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2223.300000190735,"responseStart":0,"secureConnectionStart":0},{"duration":1210.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":1000,"connectEnd":1000,"connectStart":1000,"domainLookupEnd":1000,"domainLookupStart":1000,"fetchStart":1000,"redirectEnd":0,"redirectStart":0,"requestStart":1000,"responseEnd":2210.0999999046326,"responseStart":2210.0999999046326,"secureConnectionStart":1000},{"duration":2092.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":1008.3000001907349,"connectEnd":1008.3000001907349,"connectStart":1008.3000001907349,"domainLookupEnd":1008.3000001907349,"domainLookupStart":1008.3000001907349,"fetchStart":1008.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1008.3000001907349,"responseEnd":3100.4000000953674,"responseStart":3100.4000000953674,"secureConnectionStart":1008.3000001907349},{"duration":2088.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":1014.0999999046326,"connectEnd":1014.0999999046326,"connectStart":1014.0999999046326,"domainLookupEnd":1014.0999999046326,"domainLookupStart":1014.0999999046326,"fetchStart":1014.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1014.0999999046326,"responseEnd":3102.5999999046326,"responseStart":3102.5999999046326,"secureConnectionStart":1014.0999999046326},{"duration":188.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2096.699999809265,"connectEnd":2096.699999809265,"connectStart":2096.699999809265,"domainLookupEnd":2096.699999809265,"domainLookupStart":2096.699999809265,"fetchStart":2096.699999809265,"redirectEnd":0,"redirectStart":0,"requestStart":2096.699999809265,"responseEnd":2285.5999999046326,"responseStart":2285.5999999046326,"secureConnectionStart":2096.699999809265},{"duration":825.5999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":2295.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2295.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3120.699999809265,"responseStart":0,"secureConnectionStart":0},{"duration":811.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":2296.5999999046326,"connectEnd":2296.5999999046326,"connectStart":2296.5999999046326,"domainLookupEnd":2296.5999999046326,"domainLookupStart":2296.5999999046326,"fetchStart":2296.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":2296.5999999046326,"responseEnd":3107.800000190735,"responseStart":3107.800000190735,"secureConnectionStart":2296.5999999046326},{"duration":427.8999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2698.800000190735,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2698.800000190735,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3126.699999809265,"responseStart":0,"secureConnectionStart":0},{"duration":814.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":2300.300000190735,"connectEnd":2300.300000190735,"connectStart":2300.300000190735,"domainLookupEnd":2300.300000190735,"domainLookupStart":2300.300000190735,"fetchStart":2300.300000190735,"redirectEnd":0,"redirectStart":0,"requestStart":2300.300000190735,"responseEnd":3114.800000190735,"responseStart":3114.800000190735,"secureConnectionStart":2300.300000190735},{"duration":274.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":3128.800000190735,"connectEnd":3128.800000190735,"connectStart":3128.800000190735,"domainLookupEnd":3128.800000190735,"domainLookupStart":3128.800000190735,"fetchStart":3128.800000190735,"redirectEnd":0,"redirectStart":0,"requestStart":3128.800000190735,"responseEnd":3403.5,"responseStart":3403.5,"secureConnectionStart":3128.800000190735}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":817,"responseStart":987,"responseEnd":1008,"domLoading":991,"domInteractive":3230,"domContentLoadedEventStart":3230,"domContentLoadedEventEnd":3420,"domComplete":3574,"loadEventStart":3574,"loadEventEnd":3574,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3133.199999809265},{"name":"bigPipe.sidebar-id.end","time":3134.199999809265},{"name":"bigPipe.activity-panel-pipe-id.start","time":3134.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":3137},{"name":"activityTabFullyLoaded","time":3531.9000000953674}],"measures":[],"correlationId":"eda10afebde1d6","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":109,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
This seems to be an easy fix. I'd like to work on it.
I have created a fork (https://github.com/haidong/server) and started digging around. It looks line 3829 under client/mysql.cc is where the problem. See snippet below.
// Line 3829
static void
print_table_data_xml(MYSQL_RES *result)
{
MYSQL_ROW cur;
MYSQL_FIELD *fields;
mysql_field_seek(result,0);
tee_fputs("<?xml version=\"1.0\"?>\n\n<resultset statement=\"", PAGER); // I think this is our main problem!
xmlencode_print(glob_buffer.ptr(), (int)strlen(glob_buffer.ptr()));
tee_fputs("\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">",
PAGER);
Additionally, there are a few places, particularly files in tests, that could also benefit from this small change. For example, mysql-test/main/client_xml.result file has many places where this encoding info might be helpful.
I have read the contribution guide. I'll start hacking against my own forked repo. I'd appreciate any steps you want me to follow and suggestions/tips you can give.
Thanks!