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

     1  drop table if exists test_11;
     2  create table test_11 (c int primary key,d int);
     3  Insert into test_11 values(1,1);
     4  Insert into test_11 values(2,2);
     5  begin;
     6  Insert into test_11 values(3,1);
     7  Insert into test_11 values(4,2);
     8  select * from test_11;
     9  c    d
    10  3    1
    11  4    2
    12  1    1
    13  2    2
    14  use isolation;
    15  select * from test_11;
    16  c    d
    17  1    1
    18  2    2
    19  commit;
    20  select * from test_11;
    21  c    d
    22  1    1
    23  2    2
    24  3    1
    25  4    2
    26  select * from test_11;
    27  c    d
    28  1    1
    29  2    2
    30  3    1
    31  4    2
    32  drop table if exists test_11;
    33  create table test_11 (c int primary key,d int);
    34  Insert into test_11 values(1,1);
    35  Insert into test_11 values(2,2);
    36  begin;
    37  Insert into test_11 values(3,1);
    38  Insert into test_11 values(4,2);
    39  select * from test_11;
    40  c    d
    41  3    1
    42  4    2
    43  1    1
    44  2    2
    45  select * from test_11;
    46  c    d
    47  1    1
    48  2    2
    49  delete from test_11 where c =1;
    50  select * from test_11;
    51  c    d
    52  3    1
    53  4    2
    54  2    2
    55  select * from test_11;
    56  c    d
    57  1    1
    58  2    2
    59  update test_11 set d = c +1 where c > 2;
    60  select * from test_11;
    61  c    d
    62  3    4
    63  4    5
    64  2    2
    65  select * from test_11;
    66  c    d
    67  1    1
    68  2    2
    69  commit;
    70  select * from test_11;
    71  c    d
    72  2    2
    73  3    4
    74  4    5
    75  select * from test_11;
    76  c    d
    77  2    2
    78  3    4
    79  4    5
    80  drop table if exists test_11;
    81  begin;
    82  create table test_11 (c int primary key,d int);
    83  Insert into test_11 values(1,1);
    84  Insert into test_11 values(2,2);
    85  select * from test_11;
    86  c    d
    87  1    1
    88  2    2
    89  select * from test_11;
    90  SQL parser error: table "test_11" does not exist
    91  commit;
    92  select * from test_11;
    93  c    d
    94  1    1
    95  2    2
    96  select * from test_11;
    97  c    d
    98  1    1
    99  2    2
   100  drop table if exists test_11;
   101  begin;
   102  create table test_11 (c int primary key,d int);
   103  Insert into test_11 values(1,1);
   104  Insert into test_11 values(2,2);
   105  select * from test_11;
   106  c    d
   107  1    1
   108  2    2
   109  delete from test_11 where c = 1;
   110  no such table isolation.test_11
   111  select * from test_11;
   112  SQL parser error: table "test_11" does not exist
   113  Insert into test_11 values(1,1);
   114  Duplicate entry '1' for key 'c'
   115  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   116  select * from test_11;
   117  SQL parser error: table "test_11" does not exist
   118  commit;
   119  select * from test_11;
   120  SQL parser error: table "test_11" does not exist
   121  select * from test_11;
   122  SQL parser error: table "test_11" does not exist
   123  drop table if exists test_11;
   124  create table test_11 (c int primary key,d int);
   125  Insert into test_11 values(1,1);
   126  Insert into test_11 values(2,2);
   127  begin;
   128  Insert into test_11 values(3,1);
   129  Insert into test_11 values(4,2);
   130  select * from test_11;
   131  c    d
   132  3    1
   133  4    2
   134  1    1
   135  2    2
   136  select * from test_11;
   137  c    d
   138  1    1
   139  2    2
   140  Insert into test_11 values(5,4);
   141  select * from test_11;
   142  c    d
   143  1    1
   144  2    2
   145  5    4
   146  select * from test_11;
   147  c    d
   148  3    1
   149  4    2
   150  1    1
   151  2    2
   152  Insert into test_11 values(50,50);
   153  Insert into test_11 values(50,50);
   154  select * from test_11;
   155  c    d
   156  1    1
   157  2    2
   158  5    4
   159  50    50
   160  select * from test_11;
   161  c    d
   162  3    1
   163  4    2
   164  50    50
   165  1    1
   166  2    2
   167  commit;
   168  w-w conflict
   169  select * from test_11;
   170  c    d
   171  1    1
   172  2    2
   173  5    4
   174  50    50
   175  select * from test_11;
   176  c    d
   177  1    1
   178  2    2
   179  5    4
   180  50    50
   181  drop table if exists test_11;
   182  create table test_11 (c int primary key,d int);
   183  Insert into test_11 values(1,1);
   184  Insert into test_11 values(2,2);
   185  begin;
   186  select * from test_11;
   187  c    d
   188  1    1
   189  2    2
   190  select * from test_11;
   191  c    d
   192  1    1
   193  2    2
   194  Insert into test_11 values(50,50);
   195  select * from test_11;
   196  c    d
   197  1    1
   198  2    2
   199  50    50
   200  Insert into test_11 values(50,50);
   201  select * from test_11;
   202  c    d
   203  50    50
   204  1    1
   205  2    2
   206  commit;
   207  w-w conflict
   208  select * from test_11;
   209  c    d
   210  1    1
   211  2    2
   212  50    50
   213  select * from test_11;
   214  c    d
   215  1    1
   216  2    2
   217  50    50
   218  drop table if exists test_11;
   219  create table test_11 (c int primary key,d int);
   220  Insert into test_11 values(1,1);
   221  Insert into test_11 values(2,2);
   222  begin;
   223  select * from test_11;
   224  c    d
   225  1    1
   226  2    2
   227  Insert into test_11 values(50,50);
   228  select * from test_11;
   229  c    d
   230  50    50
   231  1    1
   232  2    2
   233  select * from test_11;
   234  c    d
   235  1    1
   236  2    2
   237  Insert into test_11 values(50,50);
   238  select * from test_11;
   239  c    d
   240  1    1
   241  2    2
   242  50    50
   243  select * from test_11;
   244  c    d
   245  50    50
   246  1    1
   247  2    2
   248  select * from test_11;
   249  c    d
   250  1    1
   251  2    2
   252  50    50
   253  delete from test_11 where c = 50;
   254  select * from test_11;
   255  c    d
   256  1    1
   257  2    2
   258  select * from test_11;
   259  c    d
   260  50    50
   261  1    1
   262  2    2
   263  commit;
   264  w-w conflict
   265  select * from test_11;
   266  c    d
   267  1    1
   268  2    2
   269  select * from test_11;
   270  c    d
   271  1    1
   272  2    2
   273  drop table if exists test_11;
   274  create table test_11 (c int primary key,d int);
   275  Insert into test_11 values(1,1);
   276  Insert into test_11 values(2,2);
   277  begin;
   278  select * from test_11;
   279  c    d
   280  1    1
   281  2    2
   282  Insert into test_11 values(50,50);
   283  select * from test_11;
   284  c    d
   285  50    50
   286  1    1
   287  2    2
   288  select * from test_11;
   289  c    d
   290  1    1
   291  2    2
   292  Insert into test_11 values(50,50);
   293  select * from test_11;
   294  c    d
   295  1    1
   296  2    2
   297  50    50
   298  select * from test_11;
   299  c    d
   300  50    50
   301  1    1
   302  2    2
   303  select * from test_11;
   304  c    d
   305  1    1
   306  2    2
   307  50    50
   308  update test_11 set c = 100 where d = 50;
   309  select * from test_11;
   310  c    d
   311  1    1
   312  2    2
   313  100    50
   314  select * from test_11;
   315  c    d
   316  50    50
   317  1    1
   318  2    2
   319  Insert into test_11 values(100,50);
   320  commit;
   321  w-w conflict
   322  select * from test_11;
   323  c    d
   324  1    1
   325  2    2
   326  100    50
   327  select * from test_11;
   328  c    d
   329  1    1
   330  2    2
   331  100    50
   332  drop table if exists test_11;
   333  create table test_11 (c int primary key,d int);
   334  Insert into test_11 values(1,1);
   335  Insert into test_11 values(2,2);
   336  begin;
   337  select * from test_11;
   338  c    d
   339  1    1
   340  2    2
   341  Insert into test_11 values(50,50);
   342  select * from test_11;
   343  c    d
   344  50    50
   345  1    1
   346  2    2
   347  select * from test_11;
   348  c    d
   349  1    1
   350  2    2
   351  Insert into test_11 values(50,50);
   352  select * from test_11;
   353  c    d
   354  1    1
   355  2    2
   356  50    50
   357  select * from test_11;
   358  c    d
   359  50    50
   360  1    1
   361  2    2
   362  select * from test_11;
   363  c    d
   364  1    1
   365  2    2
   366  50    50
   367  update test_11 set c = 100 where d = 50;
   368  select * from test_11;
   369  c    d
   370  1    1
   371  2    2
   372  100    50
   373  select * from test_11;
   374  c    d
   375  50    50
   376  1    1
   377  2    2
   378  update test_11 set c = 101 where c = 50;
   379  commit;
   380  select * from test_11;
   381  c    d
   382  1    1
   383  2    2
   384  100    50
   385  101    50
   386  select * from test_11;
   387  c    d
   388  1    1
   389  2    2
   390  100    50
   391  101    50
   392  drop table if exists test_11;
   393  create table test_11 (c int primary key,d int);
   394  Insert into test_11 values(1,1);
   395  Insert into test_11 values(2,2);
   396  begin;
   397  select * from test_11;
   398  c    d
   399  1    1
   400  2    2
   401  Insert into test_11 values(50,50);
   402  select * from test_11;
   403  c    d
   404  50    50
   405  1    1
   406  2    2
   407  select * from test_11;
   408  c    d
   409  1    1
   410  2    2
   411  Insert into test_11 values(50,50);
   412  select * from test_11;
   413  c    d
   414  1    1
   415  2    2
   416  50    50
   417  select * from test_11;
   418  c    d
   419  50    50
   420  1    1
   421  2    2
   422  select * from test_11;
   423  c    d
   424  1    1
   425  2    2
   426  50    50
   427  update test_11 set c = 100 where d = 50;
   428  select * from test_11;
   429  c    d
   430  1    1
   431  2    2
   432  100    50
   433  select * from test_11;
   434  c    d
   435  50    50
   436  1    1
   437  2    2
   438  update test_11 set c = 100 where d = 50;
   439  commit;
   440  w-w conflict
   441  select * from test_11;
   442  c    d
   443  1    1
   444  2    2
   445  100    50
   446  select * from test_11;
   447  c    d
   448  1    1
   449  2    2
   450  100    50
   451  drop table if exists test_11;
   452  begin;
   453  create table test_11 (c int primary key,d int);
   454  Insert into test_11 values(1,1);
   455  Insert into test_11 values(2,2);
   456  select * from test_11;
   457  c    d
   458  1    1
   459  2    2
   460  select * from test_11;
   461  SQL parser error: table "test_11" does not exist
   462  commit;
   463  select * from test_11;
   464  c    d
   465  1    1
   466  2    2
   467  select * from test_11;
   468  c    d
   469  1    1
   470  2    2
   471  drop table if exists test_11;
   472  create table test_11 (c int primary key,d int);
   473  Insert into test_11 values(1,1);
   474  Insert into test_11 values(2,2);
   475  select * from test_11;
   476  c    d
   477  1    1
   478  2    2
   479  select * from test_11;
   480  c    d
   481  1    1
   482  2    2
   483  begin;
   484  drop table test_11;
   485  internal error: Only CREATE of DDL is supported in transactions
   486  select * from test_11;
   487  c    d
   488  1    1
   489  2    2
   490  select * from test_11;
   491  c    d
   492  1    1
   493  2    2
   494  commit;
   495  select * from test_11;
   496  c    d
   497  1    1
   498  2    2
   499  select * from test_11;
   500  c    d
   501  1    1
   502  2    2
   503  drop table if exists test_11;
   504  begin;
   505  create table test_11 (c int primary key,d int);
   506  Insert into test_11 values(1,1);
   507  Insert into test_11 values(2,2);
   508  select * from test_11;
   509  c    d
   510  1    1
   511  2    2
   512  select * from test_11;
   513  SQL parser error: table "test_11" does not exist
   514  select * from test_11;
   515  c    d
   516  1    1
   517  2    2
   518  select * from test_11;
   519  SQL parser error: table "test_11" does not exist
   520  commit;
   521  select * from test_11;
   522  c    d
   523  1    1
   524  2    2
   525  select * from test_11;
   526  c    d
   527  1    1
   528  2    2
   529  drop table if exists test_11;
   530  drop table if exists t1;
   531  create table t1 (a int not null, b int);
   532  insert into t1 values (1, 1);
   533  begin;
   534  select * from t1;
   535  a    b
   536  1    1
   537  update t1 set a=null where b=1;
   538  constraint violation: Column 'a' cannot be null
   539  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   540  select * from t1;
   541  a    b
   542  1    1
   543  commit;
   544  drop table if exists t1;