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