I am using C# (.NET 5.0) and ADO.NET to execute statements on MariaDb. For this, I am using the MySql connector (current version: 8.0.26) to run statements on the database.
I am trying to execute the following statement to create a table that has a primary key. The primary key has a constraint name.
string sql = $@"CREATE TABLE `test` (
`id` INT NOT NULL
, CONSTRAINT `pk1` PRIMARY KEY (`id`)
)";
MySqlCommand cmd = new MySqlCommand(sql, conn);
cmd.ExecuteNonQuery();
Though the table is created, this code throws an exception with MariaDb 10.6.4:
System.NotSupportedException: 'Character set 'utf8mb3' is not supported by .Net Framework.'
It worked fine on MariaDb 10.5.12. When I create named unique and foreign key constraints I don't get an exception.
I am guessing it is related to the switch to utf8mb4 as default collation introduced with 10.6.
See attached file for the full example code in C#.
The behavior of MariaDb is now aligned with MySql.
E.g. the following Sql will work:
```
CREATE TABLE `test` (
`id` INT NOT NULL
, CONSTRAINT `pk1` PRIMARY KEY (`id`)
)
```
But the name of the primary key will always be `PRIMARY`.
The issue with the different encoding seems to be resolved with 11.4 (and potential previous version).
This ticket can be closed now.
Andreas Lennartz
added a comment - The behavior of MariaDb is now aligned with MySql.
E.g. the following Sql will work:
```
CREATE TABLE `test` (
`id` INT NOT NULL
, CONSTRAINT `pk1` PRIMARY KEY (`id`)
)
```
But the name of the primary key will always be `PRIMARY`.
The issue with the different encoding seems to be resolved with 11.4 (and potential previous version).
This ticket can be closed now.
People
Unassigned
Andreas Lennartz
Votes:
0Vote for this issue
Watchers:
1Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":972.8000001907349,"ttfb":160.7000002861023,"pageVisibility":"visible","entityId":102745,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"5cb4279a-4662-4131-8d72-4ff263458fbc","navigationType":0,"readyForUser":1047.8000001907349,"redirectCount":0,"resourceLoadedEnd":725.5,"resourceLoadedStart":165.7000002861023,"resourceTiming":[{"duration":169.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":165.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":335.5,"responseStart":0,"secureConnectionStart":0},{"duration":170,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":166,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":336,"responseStart":0,"secureConnectionStart":0},{"duration":421.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/c54b129276d75dc2a3460e1d78f37913-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":166.10000038146973,"connectEnd":166.10000038146973,"connectStart":166.10000038146973,"domainLookupEnd":166.10000038146973,"domainLookupStart":166.10000038146973,"fetchStart":166.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":338.80000019073486,"responseEnd":587.5,"responseStart":362.30000019073486,"secureConnectionStart":166.10000038146973},{"duration":532.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/f867843cd2fdb209d4d1d4f760f86346-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":166.2000002861023,"connectEnd":166.2000002861023,"connectStart":166.2000002861023,"domainLookupEnd":166.2000002861023,"domainLookupStart":166.2000002861023,"fetchStart":166.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":339.6000003814697,"responseEnd":698.8000001907349,"responseStart":365.40000009536743,"secureConnectionStart":166.2000002861023},{"duration":192.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/ffdb17665775c5b4d6f097f3974ee359-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":166.40000009536743,"connectEnd":166.40000009536743,"connectStart":166.40000009536743,"domainLookupEnd":166.40000009536743,"domainLookupStart":166.40000009536743,"fetchStart":166.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":341.80000019073486,"responseEnd":359.2000002861023,"responseStart":357.6000003814697,"secureConnectionStart":166.40000009536743},{"duration":194.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":166.40000009536743,"connectEnd":166.40000009536743,"connectStart":166.40000009536743,"domainLookupEnd":166.40000009536743,"domainLookupStart":166.40000009536743,"fetchStart":166.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":343.30000019073486,"responseEnd":361,"responseStart":359.90000009536743,"secureConnectionStart":166.40000009536743},{"duration":197.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":166.60000038146973,"connectEnd":166.60000038146973,"connectStart":166.60000038146973,"domainLookupEnd":166.60000038146973,"domainLookupStart":166.60000038146973,"fetchStart":166.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":344.30000019073486,"responseEnd":363.80000019073486,"responseStart":361.2000002861023,"secureConnectionStart":166.60000038146973},{"duration":176.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":166.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":343.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":234.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":166.7000002861023,"connectEnd":166.7000002861023,"connectStart":166.7000002861023,"domainLookupEnd":166.7000002861023,"domainLookupStart":166.7000002861023,"fetchStart":166.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":345.90000009536743,"responseEnd":401.2000002861023,"responseStart":400.30000019073486,"secureConnectionStart":166.7000002861023},{"duration":177.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":166.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":344.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":206,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":166.90000009536743,"connectEnd":166.90000009536743,"connectStart":166.90000009536743,"domainLookupEnd":166.90000009536743,"domainLookupStart":166.90000009536743,"fetchStart":166.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":347.7000002861023,"responseEnd":372.90000009536743,"responseStart":371.5,"secureConnectionStart":166.90000009536743},{"duration":537.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":187.10000038146973,"connectEnd":187.10000038146973,"connectStart":187.10000038146973,"domainLookupEnd":187.10000038146973,"domainLookupStart":187.10000038146973,"fetchStart":187.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":414.7000002861023,"responseEnd":724.3000001907349,"responseStart":715.6000003814697,"secureConnectionStart":187.10000038146973},{"duration":536.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":188.80000019073486,"connectEnd":188.80000019073486,"connectStart":188.80000019073486,"domainLookupEnd":188.80000019073486,"domainLookupStart":188.80000019073486,"fetchStart":188.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":416.7000002861023,"responseEnd":725.5,"responseStart":718.4000000953674,"secureConnectionStart":188.80000019073486},{"duration":119,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":733.2000002861023,"connectEnd":733.2000002861023,"connectStart":733.2000002861023,"domainLookupEnd":733.2000002861023,"domainLookupStart":733.2000002861023,"fetchStart":733.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":820.9000000953674,"responseEnd":852.2000002861023,"responseStart":851.5,"secureConnectionStart":733.2000002861023},{"duration":118.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":966.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":966.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1084.5,"responseStart":0,"secureConnectionStart":0},{"duration":153.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":972.8000001907349,"connectEnd":972.8000001907349,"connectStart":972.8000001907349,"domainLookupEnd":972.8000001907349,"domainLookupStart":972.8000001907349,"fetchStart":972.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1088.4000000953674,"responseEnd":1126.4000000953674,"responseStart":1125.1000003814697,"secureConnectionStart":972.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":32,"responseStart":161,"responseEnd":189,"domLoading":164,"domInteractive":1140,"domContentLoadedEventStart":1140,"domContentLoadedEventEnd":1181,"domComplete":1396,"loadEventStart":1396,"loadEventEnd":1397,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1117.7000002861023},{"name":"bigPipe.sidebar-id.end","time":1118.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1118.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1119.4000000953674},{"name":"activityTabFullyLoaded","time":1196.4000000953674}],"measures":[],"correlationId":"3687501880247b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":72,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The behavior of MariaDb is now aligned with MySql.
E.g. the following Sql will work:
```
CREATE TABLE `test` (
`id` INT NOT NULL
, CONSTRAINT `pk1` PRIMARY KEY (`id`)
)
```
But the name of the primary key will always be `PRIMARY`.
The issue with the different encoding seems to be resolved with 11.4 (and potential previous version).
This ticket can be closed now.