diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/sys_vars/r/autocommit_func.result | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/sys_vars/r/autocommit_func.result')
-rw-r--r-- | mysql-test/suite/sys_vars/r/autocommit_func.result | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func.result b/mysql-test/suite/sys_vars/r/autocommit_func.result new file mode 100644 index 00000000..1e7636e8 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/autocommit_func.result @@ -0,0 +1,118 @@ +drop table if exists t1; +## Creating new table ## +CREATE TABLE t1 +( +id INT NOT NULL auto_increment, +PRIMARY KEY (id), +name varchar(30) +) ENGINE = INNODB; +'#--------------------FN_DYNVARS_003_01-------------------------#' +## Setting variable's value to 0 i.e false ## +SET @@autocommit = 0; +'#--------------------FN_DYNVARS_003_02-------------------------#' +CONNECT test_con1,localhost,root,,; +connection test_con1; +## Checking value of variable after opening new connection ## +SELECT @@autocommit; +@@autocommit +1 +## Setting value of variable to zero and inserting some rows ## +SET @@autocommit = 0; +INSERT into t1(name) values('Record_1'); +INSERT into t1(name) values('Record_2'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +## Creating another connection and verifying records in table ## +CONNECT test_con2,localhost,root,,; +connection test_con2; +SELECT * from t1; +id name +'#--------------------FN_DYNVARS_003_03-------------------------#' +## Verifying behavior of variable by commiting rows in test_con1 ## +connection test_con1; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +COMMIT; +## Now verifying records in table from connection # 02 ## +connection test_con2; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +'#--------------------FN_DYNVARS_003_04-------------------------#' +connection test_con1; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +## Updating value of first row ## +UPDATE t1 set name = 'Record_12' where name = 'Record_1'; +SELECT * from t1; +id name +1 Record_12 +2 Record_2 +## Connecting to connecting # 02 and verifying effect of update query ## +connection test_con2; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +## Now connecting with connection # 01 and using ROLLBACK after it ## +connection test_con1; +ROLLBACK; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +'#--------------------FN_DYNVARS_003_05-------------------------#' +connection test_con1; +INSERT into t1(name) values('Record_3'); +## Now verifying records in table from connection # 02 and changing value ## +## of autocommit to true ## +connection test_con2; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +SET @@autocommit = 1; +INSERT into t1(name) values('Record_4'); +INSERT into t1(name) values('Record_5'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +4 Record_4 +5 Record_5 +## Connecting with connection # 01 and inserting few records ## +connection test_con1; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +3 Record_3 +INSERT into t1(name) values('Record_6'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +3 Record_3 +6 Record_6 +## Now verifying the effect of these new records in second connection ## +connection test_con2; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +4 Record_4 +5 Record_5 +## Commit changes +connection test_con1; +COMMIT; +## Dropping table t1 ## +DROP table t1; +disconnect test_con1; +disconnect test_con2; |