github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/transaction/autocommit_1.result (about)

     1  SELECT @@session.autocommit;
     2  @@autocommit
     3  1
     4  SET @@session.autocommit=1;
     5  SELECT @@session.autocommit;
     6  @@autocommit
     7  1
     8  SET @@session.autocommit= 0;
     9  SELECT @@session.autocommit;
    10  @@autocommit
    11  0
    12  SET @@session.autocommit=OFF;
    13  SELECT @@session.autocommit;
    14  @@autocommit
    15  0
    16  SET @@session.autocommit=ON;
    17  SELECT @@session.autocommit;
    18  @@autocommit
    19  1
    20  SET @@session.autocommit=foo;
    21  internal error: convert to the system variable bool type failed
    22  SELECT @@session.autocommit;
    23  @@autocommit
    24  1
    25  commit;
    26  SET @@session.autocommit=OFF;
    27  SELECT @@session.autocommit;
    28  @@autocommit
    29  0
    30  commit;
    31  SET @@session.autocommit=ON;
    32  SELECT @@session.autocommit;
    33  @@autocommit
    34  1
    35  commit;
    36  SET @@session.autocommit=foo;
    37  internal error: convert to the system variable bool type failed
    38  SELECT @@session.autocommit;
    39  @@autocommit
    40  1
    41  commit;
    42  set autocommit=0;
    43  select @@autocommit;
    44  @@autocommit
    45  0
    46  commit;
    47  drop database if exists db;
    48  create database db;
    49  show databases like 'db';
    50  Database
    51  db
    52  use db;
    53  create table tab1(a int, b int);
    54  create view view_tab1 as select * from tab1;
    55  insert into tab1 values (2000, 3000);
    56  rollback;
    57  select * from tab1;
    58  SQL parser error: table "tab1" does not exist
    59  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
    60  commit;
    61  drop database if exists db;
    62  create database db;
    63  show databases like 'db';
    64  Database
    65  db
    66  use db;
    67  create table tab1(a int, b int);
    68  insert into tab1 values (2000, 3000);
    69  insert into tab1 values (10, 10);
    70  commit;
    71  select * from tab1;
    72  a    b
    73  2000    3000
    74  10    10
    75  update tab1 set a=100000 where b=3000;
    76  select * from tab1;
    77  a    b
    78  100000    3000
    79  10    10
    80  rollback;
    81  select * from tab1;
    82  a    b
    83  2000    3000
    84  10    10
    85  update tab1 set a=100000 where b=3000;
    86  commit;
    87  select * from tab1;
    88  a    b
    89  10    10
    90  100000    3000
    91  delete from tab1 where a=10;
    92  rollback;
    93  select * from tab1;
    94  a    b
    95  10    10
    96  100000    3000
    97  delete from tab1 where a=10;
    98  commit;
    99  select * from tab1;
   100  a    b
   101  100000    3000
   102  create view view_tab1 as select * from tab1;
   103  select * from view_tab1;
   104  a    b
   105  100000    3000
   106  commit;
   107  insert into view_tab1 values (200, 300);
   108  invalid input: cannot insert/update/delete from view
   109  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   110  commit;
   111  drop database db;
   112  use autocommit_1;
   113  commit;
   114  drop table if exists t1;
   115  create table t1(col1 varchar(255));
   116  insert into t1 values ('helloworld');
   117  rollback;
   118  select * from t1;
   119  SQL parser error: table "t1" does not exist
   120  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   121  commit;
   122  drop table if exists t2;
   123  create table t2 (a varchar(255));
   124  insert into t2 values ('hello');
   125  commit;
   126  select * from t2;
   127  a
   128  hello
   129  commit;
   130  drop table t2;
   131  drop table if exists t3;
   132  create table t3(a int);
   133  insert into t3 values (10),(20),(30);
   134  set @@autocommit=ON;
   135  internal error: Uncommitted transaction exists. Please commit or rollback first.
   136  select @@autocommit;
   137  @@autocommit
   138  0
   139  set @@autocommit=OFF;
   140  internal error: Uncommitted transaction exists. Please commit or rollback first.
   141  select @@autocommit;
   142  @@autocommit
   143  0
   144  set @@autocommit=1;
   145  internal error: Uncommitted transaction exists. Please commit or rollback first.
   146  select @@autocommit;
   147  @@autocommit
   148  0
   149  set @@autocommit=0;
   150  internal error: Uncommitted transaction exists. Please commit or rollback first.
   151  select @@autocommit;
   152  @@autocommit
   153  0
   154  rollback;
   155  drop table if exists tab3;
   156  create table tab3 (a int, b varchar(25));
   157  insert into tab3 values (10, 'aa'),(20, 'bb'),(30, 'cc');
   158  set @@autocommit=ON;
   159  internal error: Uncommitted transaction exists. Please commit or rollback first.
   160  select @@autocommit;
   161  @@autocommit
   162  0
   163  set @@autocommit=OFF;
   164  internal error: Uncommitted transaction exists. Please commit or rollback first.
   165  select @@autocommit;
   166  @@autocommit
   167  0
   168  set @@autocommit=1;
   169  internal error: Uncommitted transaction exists. Please commit or rollback first.
   170  select @@autocommit;
   171  @@autocommit
   172  0
   173  set @@autocommit=0;
   174  internal error: Uncommitted transaction exists. Please commit or rollback first.
   175  commit;
   176  select * from tab3;
   177  a    b
   178  10    aa
   179  20    bb
   180  30    cc
   181  update tab3 set a=1000 where b='aa';
   182  select * from tab3;
   183  a    b
   184  1000    aa
   185  20    bb
   186  30    cc
   187  rollback;
   188  delete from tab3 where b='cc';
   189  select * from tab3;
   190  a    b
   191  10    aa
   192  20    bb
   193  commit;
   194  select * from tab3;
   195  a    b
   196  10    aa
   197  20    bb
   198  commit;
   199  drop table tab3;
   200  drop table if exists t4;
   201  create table t4(a varchar(225), b int);
   202  insert into t4 values ('aa', 1000),('bb', 2000);
   203  begin;
   204  select * from t4;
   205  a    b
   206  aa    1000
   207  bb    2000
   208  update t4 set a='xxxx' where b=1000;
   209  select * from t4;
   210  a    b
   211  xxxx    1000
   212  bb    2000
   213  rollback;
   214  select * from t4;
   215  a    b
   216  aa    1000
   217  bb    2000
   218  update t4 set a='xxxx' where b=1000;
   219  select * from t4;
   220  a    b
   221  xxxx    1000
   222  bb    2000
   223  commit;
   224  select * from t4;
   225  a    b
   226  bb    2000
   227  xxxx    1000
   228  create view view_t4 as select * from t4;
   229  begin;
   230  select * from view_t4;
   231  a    b
   232  bb    2000
   233  xxxx    1000
   234  delete from t4 where a='bb';
   235  rollback;
   236  select * from t4;
   237  a    b
   238  bb    2000
   239  xxxx    1000
   240  select * from view_t4;
   241  a    b
   242  bb    2000
   243  xxxx    1000
   244  commit;
   245  set autocommit=1;
   246  select @@autocommit;
   247  @@autocommit
   248  1
   249  drop database if exists test_xx;
   250  begin;
   251  create database test_xx;
   252  SET @@session.autocommit=1;
   253  internal error: Uncommitted transaction exists. Please commit or rollback first.
   254  SELECT @@session.autocommit;
   255  @@autocommit
   256  1
   257  SET @@session.autocommit= 0;
   258  internal error: Uncommitted transaction exists. Please commit or rollback first.
   259  SELECT @@session.autocommit;
   260  @@autocommit
   261  1
   262  SET @@session.autocommit=OFF;
   263  internal error: Uncommitted transaction exists. Please commit or rollback first.
   264  SELECT @@session.autocommit;
   265  @@autocommit
   266  1
   267  SET @@session.autocommit=ON;
   268  internal error: Uncommitted transaction exists. Please commit or rollback first.
   269  SELECT @@session.autocommit;
   270  @@autocommit
   271  1
   272  commit;
   273  show databases like 'test_xx';
   274  Database
   275  test_xx
   276  commit;
   277  drop database test_xx;
   278  drop database if exists db;
   279  begin;
   280  create database db;
   281  show databases like 'db';
   282  Database
   283  db
   284  use db;
   285  create table table3(a int, b int);
   286  insert into table3 values (2000, 3000);
   287  create view view_table3 as select * from table3;
   288  select * from table3;
   289  a    b
   290  2000    3000
   291  select * from view_table3;
   292  a    b
   293  2000    3000
   294  rollback;
   295  select * from table3;
   296  SQL parser error: table "table3" does not exist
   297  select * from view_table3;
   298  SQL parser error: table "view_table3" does not exist
   299  drop database if exists db;
   300  begin;
   301  create database db;
   302  show databases like 'db';
   303  Database
   304  db
   305  use db;
   306  create table table3(a int, b int);
   307  insert into table3 values (2000, 3000);
   308  insert into table3 values (10, 10);
   309  commit;
   310  select * from table3;
   311  a    b
   312  2000    3000
   313  10    10
   314  begin;
   315  update table3 set a=100000 where b=3000;
   316  select * from table3;
   317  a    b
   318  100000    3000
   319  10    10
   320  rollback;
   321  select * from table3;
   322  a    b
   323  2000    3000
   324  10    10
   325  begin;
   326  update table3 set a=100000 where b=3000;
   327  commit;
   328  select * from table3;
   329  a    b
   330  10    10
   331  100000    3000
   332  begin;
   333  delete from table3 where a=10;
   334  rollback;
   335  select * from table3;
   336  a    b
   337  10    10
   338  100000    3000
   339  begin;
   340  delete from table3 where a=10;
   341  commit;
   342  select * from table3;
   343  a    b
   344  100000    3000
   345  drop table if exists t3;
   346  start transaction;
   347  create table t3 (b varchar(255));
   348  insert into t3 values ('helloworld');
   349  rollback ;
   350  select * from t3;
   351  SQL parser error: table "t3" does not exist
   352  drop table if exists t4;
   353  start transaction;
   354  create table t4 (a int);
   355  insert into t4 values (10),(20);
   356  commit;
   357  select * from t4;
   358  a
   359  10
   360  20
   361  drop table t4;
   362  drop table if exists t5;
   363  start transaction;
   364  create table t5(a int);
   365  insert into t5 values(10),(20),(30);
   366  drop table t5;
   367  internal error: Only CREATE of DDL is supported in transactions
   368  start transaction;
   369  insert into t5 values(100),(2000),(3000);
   370  set @autocommit=0;
   371  internal error: Uncommitted transaction exists. Please commit or rollback first.
   372  begin;
   373  select * from t5;
   374  a
   375  10
   376  20
   377  30
   378  100
   379  2000
   380  3000
   381  insert into t5 values(1),(2),(3);
   382  rollback;
   383  select * from t5;
   384  a
   385  10
   386  20
   387  30
   388  100
   389  2000
   390  3000
   391  begin;
   392  select * from t5;
   393  a
   394  10
   395  20
   396  30
   397  100
   398  2000
   399  3000
   400  insert into t5 values(100),(2000),(3000);
   401  delete from t5;
   402  begin;
   403  select * from t5;
   404  a
   405  rollback;
   406  select * from t5;
   407  a
   408  drop table t5
   409  start transaction;
   410  SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 2 column 6 near "
   411  start transaction;";
   412  set @@a=0;
   413  internal error: the system variable does not exist
   414  rollback;
   415  set @@b=0;
   416  internal error: the system variable does not exist
   417  commit;
   418  select @@b;
   419  internal error: the system variable does not exist
   420  drop database if exists db;
   421  create database db;
   422  show databases like 'db';
   423  Database
   424  db
   425  use db;
   426  create table t6(a int, b int);
   427  insert into t6 values (2000, 3000);
   428  insert into t6 values (10, 10);
   429  select * from t6;
   430  a    b
   431  2000    3000
   432  10    10
   433  update t6 set a=100000 where b=3000;
   434  select * from t6;
   435  a    b
   436  10    10
   437  100000    3000
   438  delete from t6 where a=10;
   439  select * from t6;
   440  a    b
   441  100000    3000
   442  create view view_t6 as select * from t6;
   443  select * from view_t6;
   444  a    b
   445  100000    3000
   446  insert into view_t6 values (200, 300);
   447  invalid input: cannot insert/update/delete from view
   448  insert into view_t6 values (10, 10);
   449  invalid input: cannot insert/update/delete from view
   450  select * from view_t6;
   451  a    b
   452  100000    3000
   453  update view_t6 set a=100000 where b=3000;
   454  invalid input: cannot insert/update/delete from view
   455  select * from view_t6;
   456  a    b
   457  100000    3000
   458  delete from view_t6 where a=10;
   459  invalid input: cannot insert/update/delete from view
   460  select * from view_t6;
   461  a    b
   462  100000    3000
   463  drop database db;
   464  use autocommit_1;
   465  set @@autocommit=0;
   466  select @@autocommit;
   467  @@autocommit
   468  0
   469  create table t7(a int);
   470  insert into t7 values (500);
   471  commit;
   472  begin;
   473  insert into t7 values (1000);
   474  commit;
   475  insert into t7 values (2000);
   476  rollback;
   477  select * from t7;
   478  a
   479  500
   480  1000
   481  drop table t7;
   482  internal error: Only CREATE of DDL is supported in transactions
   483  commit;
   484  drop table t7;
   485  create table t8(a int);
   486  insert into t8 values (500);
   487  rollback;
   488  begin;
   489  insert into t8 values (1000);
   490  no such table autocommit_1.t8
   491  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   492  create table t9 (a char(25));
   493  commit;
   494  insert into t9 values ('hello');
   495  rollback;
   496  select * from t9;
   497  a
   498  commit;
   499  drop table t9;
   500  set @@autocommit=on;