Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
N/A
Note: I couldn't find a test so I don't know whether it should work. If not, probably the attempt should cause a warning (not the one described below, but a normal one, "not supported" or something).
Results of the test case below
create table t1 (i int ) engine=InnoDB;
set autocommit = 1;
# Insert '1' with autocommit enabled
insert into t1 values (1);
connect con1,localhost,root,,;
set session transaction isolation level read committed ;
# Make sure the value '1' is visible right away
select * from t1;
i
1
connection default ;
# Disable autocommit for inserting the value '2'
set statement autocommit=0 for insert into t1 values (2);
connection con1;
# The value '2' should not be visible
select * from t1;
i
1
2
# ... but it is
connection default ;
# Disable autocommit in general
set autocommit = 0;
# Insert '3' with autocommit disabled
insert into t1 values (3);
connection con1;
# Make sure the value '3' is not visible
select * from t1;
i
1
2
connection default ;
rollback ;
# Enable autocommit for inserting the value '4'
set statement autocommit=1 for insert into t1 values (4);
connection con1;
# The value '4' should be visible
select * from t1;
i
1
2
# ... but it is not .
disconnect con1;
The part SET STATEMENT autocommit=1 FOR .. also causes warnings in the error log:
[Warning] MySQL is closing a connection that has an active InnoDB transaction. 1 row modifications will roll back.
Test case
--enable_connect_log
--source include/have_innodb.inc
create table t1 (i int ) engine=InnoDB;
set autocommit = 1;
--echo # Insert '1' with autocommit enabled
insert into t1 values (1);
--connect (con1,localhost,root,,)
set session transaction isolation level read committed ;
--echo # Make sure the value '1' is visible right away
select * from t1;
--connection default
--echo # Disable autocommit for inserting the value '2'
set statement autocommit=0 for insert into t1 values (2);
--connection con1
--echo # The value '2' should not be visible
select * from t1;
--echo # ... but it is
--connection default
--echo # Disable autocommit in general
set autocommit = 0;
--echo # Insert '3' with autocommit disabled
insert into t1 values (3);
--connection con1
--echo # Make sure the value '3' is not visible
select * from t1;
--connection default
rollback ;
--echo # Enable autocommit for inserting the value '4'
set statement autocommit=1 for insert into t1 values (4);
--connection con1
--echo # The value '4' should be visible
select * from t1;
--echo # ... but it is not.
# Cleanup
--disconnect con1
It's all the same in Percona server.
Elena Stepanova
made changes -
2014-10-25 13:57
Remote Link
This issue links to "Bug#1385634 - SET STATEMENT autocommit=... has no effect and causes warnings in the error log (Web Link)"
[ 20801
]
Oleksandr Byelkin
made changes -
2014-10-26 17:30
Status
Open
[ 1
]
In Progress
[ 3
]
Oleksandr Byelkin
made changes -
2014-10-26 17:40
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Oleksandr Byelkin
made changes -
2014-10-27 10:08
Status
Stalled
[ 10000
]
In Progress
[ 3
]
Oleksandr Byelkin
made changes -
2014-10-27 11:29
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Oleksandr Byelkin
made changes -
2014-10-27 14:11
Status
Stalled
[ 10000
]
In Progress
[ 3
]
Oleksandr Byelkin
made changes -
2014-10-29 11:29
Fix Version/s
10.1.2
[ 15801
]
Fix Version/s
10.1
[ 16100
]
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2015-02-02 21:46
Component/s
Admin statements
[ 11400
]
Component/s
OTHER
[ 10125
]
Sergei Golubchik
made changes -
2021-12-06 21:40
Workflow
MariaDB v3
[ 65146
]
MariaDB v4
[ 148353
]
{"report":{"fcp":1205.8999996185303,"ttfb":489.6000003814697,"pageVisibility":"visible","entityId":46802,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"56ac9b12-14f6-49fb-979e-5ff8d7aac003","navigationType":0,"readyForUser":1329.8999996185303,"redirectCount":0,"resourceLoadedEnd":1426.6000003814697,"resourceLoadedStart":503.6000003814697,"resourceTiming":[{"duration":201,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":503.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":503.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":201,"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":503.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":503.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":210.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":504.1000003814697,"connectEnd":504.1000003814697,"connectStart":504.1000003814697,"domainLookupEnd":504.1000003814697,"domainLookupStart":504.1000003814697,"fetchStart":504.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":504.1000003814697,"responseEnd":714.3000001907349,"responseStart":714.3000001907349,"secureConnectionStart":504.1000003814697},{"duration":271.69999980926514,"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":504.30000019073486,"connectEnd":504.30000019073486,"connectStart":504.30000019073486,"domainLookupEnd":504.30000019073486,"domainLookupStart":504.30000019073486,"fetchStart":504.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":504.30000019073486,"responseEnd":776,"responseStart":776,"secureConnectionStart":504.30000019073486},{"duration":275.19999980926514,"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":504.6000003814697,"connectEnd":504.6000003814697,"connectStart":504.6000003814697,"domainLookupEnd":504.6000003814697,"domainLookupStart":504.6000003814697,"fetchStart":504.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":504.6000003814697,"responseEnd":779.8000001907349,"responseStart":779.8000001907349,"secureConnectionStart":504.6000003814697},{"duration":275.5,"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":504.80000019073486,"connectEnd":504.80000019073486,"connectStart":504.80000019073486,"domainLookupEnd":504.80000019073486,"domainLookupStart":504.80000019073486,"fetchStart":504.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":504.80000019073486,"responseEnd":780.3000001907349,"responseStart":780.3000001907349,"secureConnectionStart":504.80000019073486},{"duration":275.80000019073486,"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":504.8999996185303,"connectEnd":504.8999996185303,"connectStart":504.8999996185303,"domainLookupEnd":504.8999996185303,"domainLookupStart":504.8999996185303,"fetchStart":504.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":504.8999996185303,"responseEnd":780.6999998092651,"responseStart":780.6999998092651,"secureConnectionStart":504.8999996185303},{"duration":355.5,"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":505.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":505.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":860.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":275.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":505.19999980926514,"connectEnd":505.19999980926514,"connectStart":505.19999980926514,"domainLookupEnd":505.19999980926514,"domainLookupStart":505.19999980926514,"fetchStart":505.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":505.19999980926514,"responseEnd":781.1000003814697,"responseStart":781.1000003814697,"secureConnectionStart":505.19999980926514},{"duration":355.4000005722046,"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":505.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":505.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":860.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":276,"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":505.6000003814697,"connectEnd":505.6000003814697,"connectStart":505.6000003814697,"domainLookupEnd":505.6000003814697,"domainLookupStart":505.6000003814697,"fetchStart":505.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":505.6000003814697,"responseEnd":781.6000003814697,"responseStart":781.6000003814697,"secureConnectionStart":505.6000003814697},{"duration":430.9000005722046,"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":506.69999980926514,"connectEnd":506.69999980926514,"connectStart":506.69999980926514,"domainLookupEnd":506.69999980926514,"domainLookupStart":506.69999980926514,"fetchStart":506.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":506.69999980926514,"responseEnd":937.6000003814697,"responseStart":937.6000003814697,"secureConnectionStart":506.69999980926514},{"duration":910.4000005722046,"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":506.8999996185303,"connectEnd":506.8999996185303,"connectStart":506.8999996185303,"domainLookupEnd":506.8999996185303,"domainLookupStart":506.8999996185303,"fetchStart":506.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":506.8999996185303,"responseEnd":1417.3000001907349,"responseStart":1417.3000001907349,"secureConnectionStart":506.8999996185303},{"duration":95.29999923706055,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":889.6000003814697,"connectEnd":889.6000003814697,"connectStart":889.6000003814697,"domainLookupEnd":889.6000003814697,"domainLookupStart":889.6000003814697,"fetchStart":889.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":889.6000003814697,"responseEnd":984.8999996185303,"responseStart":984.8999996185303,"secureConnectionStart":889.6000003814697},{"duration":276,"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":1150.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1150.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1426.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":273.5,"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":1151.5,"connectEnd":1151.5,"connectStart":1151.5,"domainLookupEnd":1151.5,"domainLookupStart":1151.5,"fetchStart":1151.5,"redirectEnd":0,"redirectStart":0,"requestStart":1151.5,"responseEnd":1425,"responseStart":1425,"secureConnectionStart":1151.5},{"duration":339.30000019073486,"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":1152,"connectEnd":1152,"connectStart":1152,"domainLookupEnd":1152,"domainLookupStart":1152,"fetchStart":1152,"redirectEnd":0,"redirectStart":0,"requestStart":1152,"responseEnd":1491.3000001907349,"responseStart":1491.3000001907349,"secureConnectionStart":1152},{"duration":339.9000005722046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1196.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1196.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1536.3000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":226,"responseStart":490,"responseEnd":495,"domLoading":500,"domInteractive":1482,"domContentLoadedEventStart":1482,"domContentLoadedEventEnd":1535,"domComplete":1909,"loadEventStart":1909,"loadEventEnd":1909,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1442.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1443.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1443.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1447.8000001907349},{"name":"activityTabFullyLoaded","time":1554.1999998092651}],"measures":[],"correlationId":"114ab955b6f964","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":155,"dbReadsTimeInMs":25,"dbConnsTimeInMs":37,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}