The following test is based on the test innodb_gis.alter_spatial_index.
For MDEV-11369 Instant ADD COLUMN, we want consistent behaviour in ALTER TABLE. No matter if the ALTER TABLE was implemented by ALGORITHM=COPY, non-instant ALGORITHM=INPLACE, or instant ALGORITHM=INPLACE, the result must be the same. The result should also be consistent with INSERT and UPDATE operations. Here it is not the case:
--source include/have_innodb.inc
|
--source include/have_geometry.inc
|
CREATE TABLE tab(c1 int PRIMARY KEY) ENGINE=InnoDB;
|
INSERT INTO tab SET c1=1;
|
ALTER TABLE tab add COLUMN c2 POINT NOT NULL;
|
SELECT * FROM tab;
|
INSERT INTO tab SET c1=2;
|
SELECT * FROM tab;
|
DROP TABLE tab;
|
Currently, the ALTER TABLE (no matter if ALGORITHM=COPY or ALGORITHM=INPLACE is specified) will insert the invalid value c2='' (the empty string). But, the INSERT is returning an error:
mysqltest: At line 7: query 'INSERT INTO tab SET c1=2' failed: 1364: Field 'c2' doesn't have a default value
|
The behaviour of ALTER TABLE and INSERT are inconsistent with each other.
appended by HF:
I came upon a crash that i think should be fixed along with this
MariaDB [test]> create table pt(g geometry);
|
Query OK, 0 rows affected (0.50 sec)
|
|
MariaDB [test]> insert into pt values (st_geometryfromtext("point(1 2)"));
|
Query OK, 1 row affected (0.05 sec)
|
MariaDB [test]> alter table pt add column g2 geometry default("123123");
|
ERROR 2013 (HY000): Lost connection to MySQL server during query
|
- relates to
-
MDEV-11369
Instant add column for InnoDB
-
-
Closed
{"report":{"fcp":834.6000003814697,"ttfb":205.30000019073486,"pageVisibility":"visible","entityId":63014,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3899cb48-3683-4232-aec6-fdac9b988b36","navigationType":0,"readyForUser":910.3000001907349,"redirectCount":0,"resourceLoadedEnd":856,"resourceLoadedStart":211.60000038146973,"resourceTiming":[{"duration":115.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":211.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":115.5,"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":211.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":168.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":212,"connectEnd":212,"connectStart":212,"domainLookupEnd":212,"domainLookupStart":212,"fetchStart":212,"redirectEnd":0,"redirectStart":0,"requestStart":212,"responseEnd":380.30000019073486,"responseStart":380.30000019073486,"secureConnectionStart":212},{"duration":256.1000003814697,"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":212.10000038146973,"connectEnd":212.10000038146973,"connectStart":212.10000038146973,"domainLookupEnd":212.10000038146973,"domainLookupStart":212.10000038146973,"fetchStart":212.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":212.10000038146973,"responseEnd":468.20000076293945,"responseStart":468.20000076293945,"secureConnectionStart":212.10000038146973},{"duration":259.6000003814697,"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":212.30000019073486,"connectEnd":212.30000019073486,"connectStart":212.30000019073486,"domainLookupEnd":212.30000019073486,"domainLookupStart":212.30000019073486,"fetchStart":212.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":212.30000019073486,"responseEnd":471.9000005722046,"responseStart":471.9000005722046,"secureConnectionStart":212.30000019073486},{"duration":260.1000003814697,"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":212.30000019073486,"connectEnd":212.30000019073486,"connectStart":212.30000019073486,"domainLookupEnd":212.30000019073486,"domainLookupStart":212.30000019073486,"fetchStart":212.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":212.30000019073486,"responseEnd":472.4000005722046,"responseStart":472.4000005722046,"secureConnectionStart":212.30000019073486},{"duration":260.70000076293945,"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":212.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":473.20000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":260.20000076293945,"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":212.5,"connectEnd":212.5,"connectStart":212.5,"domainLookupEnd":212.5,"domainLookupStart":212.5,"fetchStart":212.5,"redirectEnd":0,"redirectStart":0,"requestStart":212.5,"responseEnd":472.70000076293945,"responseStart":472.70000076293945,"secureConnectionStart":212.5},{"duration":260.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":212.70000076293945,"connectEnd":212.70000076293945,"connectStart":212.70000076293945,"domainLookupEnd":212.70000076293945,"domainLookupStart":212.70000076293945,"fetchStart":212.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":212.70000076293945,"responseEnd":473.20000076293945,"responseStart":473.20000076293945,"secureConnectionStart":212.70000076293945},{"duration":260.80000019073486,"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":212.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":473.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":260.80000019073486,"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":212.9000005722046,"connectEnd":212.9000005722046,"connectStart":212.9000005722046,"domainLookupEnd":212.9000005722046,"domainLookupStart":212.9000005722046,"fetchStart":212.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":212.9000005722046,"responseEnd":473.70000076293945,"responseStart":473.70000076293945,"secureConnectionStart":212.9000005722046},{"duration":357.8999996185303,"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":213.60000038146973,"connectEnd":213.60000038146973,"connectStart":213.60000038146973,"domainLookupEnd":213.60000038146973,"domainLookupStart":213.60000038146973,"fetchStart":213.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":213.60000038146973,"responseEnd":571.5,"responseStart":571.5,"secureConnectionStart":213.60000038146973},{"duration":642.2999992370605,"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":213.70000076293945,"connectEnd":213.70000076293945,"connectStart":213.70000076293945,"domainLookupEnd":213.70000076293945,"domainLookupStart":213.70000076293945,"fetchStart":213.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":213.70000076293945,"responseEnd":856,"responseStart":856,"secureConnectionStart":213.70000076293945},{"duration":67.90000057220459,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":537.5,"connectEnd":537.5,"connectStart":537.5,"domainLookupEnd":537.5,"domainLookupStart":537.5,"fetchStart":537.5,"redirectEnd":0,"redirectStart":0,"requestStart":537.5,"responseEnd":605.4000005722046,"responseStart":605.4000005722046,"secureConnectionStart":537.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":86,"responseStart":205,"responseEnd":207,"domLoading":209,"domInteractive":962,"domContentLoadedEventStart":962,"domContentLoadedEventEnd":1007,"domComplete":1297,"loadEventStart":1297,"loadEventEnd":1299,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":943.7000007629395},{"name":"bigPipe.sidebar-id.end","time":944.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":944.7000007629395},{"name":"bigPipe.activity-panel-pipe-id.end","time":947.3000001907349},{"name":"activityTabFullyLoaded","time":1018.4000005722046}],"measures":[],"correlationId":"4d1d92e91daf3b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":68,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}