github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/optimistic/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  select * from test_11;
   116  SQL parser error: table "test_11" does not exist
   117  commit;
   118  select * from test_11;
   119  SQL parser error: table "test_11" does not exist
   120  select * from test_11;
   121  SQL parser error: table "test_11" does not exist
   122  drop table if exists test_11;
   123  create table test_11 (c int primary key,d int);
   124  Insert into test_11 values(1,1);
   125  Insert into test_11 values(2,2);
   126  begin;
   127  Insert into test_11 values(3,1);
   128  Insert into test_11 values(4,2);
   129  select * from test_11;
   130  c    d
   131  3    1
   132  4    2
   133  1    1
   134  2    2
   135  select * from test_11;
   136  c    d
   137  1    1
   138  2    2
   139  Insert into test_11 values(5,4);
   140  select * from test_11;
   141  c    d
   142  1    1
   143  2    2
   144  5    4
   145  select * from test_11;
   146  c    d
   147  3    1
   148  4    2
   149  1    1
   150  2    2
   151  Insert into test_11 values(50,50);
   152  Insert into test_11 values(50,50);
   153  select * from test_11;
   154  c    d
   155  1    1
   156  2    2
   157  5    4
   158  50    50
   159  select * from test_11;
   160  c    d
   161  3    1
   162  4    2
   163  50    50
   164  1    1
   165  2    2
   166  commit;
   167  w-w conflict
   168  select * from test_11;
   169  c    d
   170  1    1
   171  2    2
   172  5    4
   173  50    50
   174  select * from test_11;
   175  c    d
   176  1    1
   177  2    2
   178  5    4
   179  50    50
   180  drop table if exists test_11;
   181  create table test_11 (c int primary key,d int);
   182  Insert into test_11 values(1,1);
   183  Insert into test_11 values(2,2);
   184  begin;
   185  select * from test_11;
   186  c    d
   187  1    1
   188  2    2
   189  select * from test_11;
   190  c    d
   191  1    1
   192  2    2
   193  Insert into test_11 values(50,50);
   194  select * from test_11;
   195  c    d
   196  1    1
   197  2    2
   198  50    50
   199  Insert into test_11 values(50,50);
   200  select * from test_11;
   201  c    d
   202  50    50
   203  1    1
   204  2    2
   205  commit;
   206  w-w conflict
   207  select * from test_11;
   208  c    d
   209  1    1
   210  2    2
   211  50    50
   212  select * from test_11;
   213  c    d
   214  1    1
   215  2    2
   216  50    50
   217  drop table if exists test_11;
   218  create table test_11 (c int primary key,d int);
   219  Insert into test_11 values(1,1);
   220  Insert into test_11 values(2,2);
   221  begin;
   222  select * from test_11;
   223  c    d
   224  1    1
   225  2    2
   226  Insert into test_11 values(50,50);
   227  select * from test_11;
   228  c    d
   229  50    50
   230  1    1
   231  2    2
   232  select * from test_11;
   233  c    d
   234  1    1
   235  2    2
   236  Insert into test_11 values(50,50);
   237  select * from test_11;
   238  c    d
   239  1    1
   240  2    2
   241  50    50
   242  select * from test_11;
   243  c    d
   244  50    50
   245  1    1
   246  2    2
   247  select * from test_11;
   248  c    d
   249  1    1
   250  2    2
   251  50    50
   252  delete from test_11 where c = 50;
   253  select * from test_11;
   254  c    d
   255  1    1
   256  2    2
   257  select * from test_11;
   258  c    d
   259  50    50
   260  1    1
   261  2    2
   262  commit;
   263  w-w conflict
   264  select * from test_11;
   265  c    d
   266  1    1
   267  2    2
   268  select * from test_11;
   269  c    d
   270  1    1
   271  2    2
   272  drop table if exists test_11;
   273  create table test_11 (c int primary key,d int);
   274  Insert into test_11 values(1,1);
   275  Insert into test_11 values(2,2);
   276  begin;
   277  select * from test_11;
   278  c    d
   279  1    1
   280  2    2
   281  Insert into test_11 values(50,50);
   282  select * from test_11;
   283  c    d
   284  50    50
   285  1    1
   286  2    2
   287  select * from test_11;
   288  c    d
   289  1    1
   290  2    2
   291  Insert into test_11 values(50,50);
   292  select * from test_11;
   293  c    d
   294  1    1
   295  2    2
   296  50    50
   297  select * from test_11;
   298  c    d
   299  50    50
   300  1    1
   301  2    2
   302  select * from test_11;
   303  c    d
   304  1    1
   305  2    2
   306  50    50
   307  update test_11 set c = 100 where d = 50;
   308  select * from test_11;
   309  c    d
   310  1    1
   311  2    2
   312  100    50
   313  select * from test_11;
   314  c    d
   315  50    50
   316  1    1
   317  2    2
   318  Insert into test_11 values(100,50);
   319  commit;
   320  w-w conflict
   321  select * from test_11;
   322  c    d
   323  1    1
   324  2    2
   325  100    50
   326  select * from test_11;
   327  c    d
   328  1    1
   329  2    2
   330  100    50
   331  drop table if exists test_11;
   332  create table test_11 (c int primary key,d int);
   333  Insert into test_11 values(1,1);
   334  Insert into test_11 values(2,2);
   335  begin;
   336  select * from test_11;
   337  c    d
   338  1    1
   339  2    2
   340  Insert into test_11 values(50,50);
   341  select * from test_11;
   342  c    d
   343  50    50
   344  1    1
   345  2    2
   346  select * from test_11;
   347  c    d
   348  1    1
   349  2    2
   350  Insert into test_11 values(50,50);
   351  select * from test_11;
   352  c    d
   353  1    1
   354  2    2
   355  50    50
   356  select * from test_11;
   357  c    d
   358  50    50
   359  1    1
   360  2    2
   361  select * from test_11;
   362  c    d
   363  1    1
   364  2    2
   365  50    50
   366  update test_11 set c = 100 where d = 50;
   367  select * from test_11;
   368  c    d
   369  1    1
   370  2    2
   371  100    50
   372  select * from test_11;
   373  c    d
   374  50    50
   375  1    1
   376  2    2
   377  update test_11 set c = 101 where c = 50;
   378  commit;
   379  select * from test_11;
   380  c    d
   381  1    1
   382  2    2
   383  100    50
   384  101    50
   385  select * from test_11;
   386  c    d
   387  1    1
   388  2    2
   389  100    50
   390  101    50
   391  drop table if exists test_11;
   392  create table test_11 (c int primary key,d int);
   393  Insert into test_11 values(1,1);
   394  Insert into test_11 values(2,2);
   395  begin;
   396  select * from test_11;
   397  c    d
   398  1    1
   399  2    2
   400  Insert into test_11 values(50,50);
   401  select * from test_11;
   402  c    d
   403  50    50
   404  1    1
   405  2    2
   406  select * from test_11;
   407  c    d
   408  1    1
   409  2    2
   410  Insert into test_11 values(50,50);
   411  select * from test_11;
   412  c    d
   413  1    1
   414  2    2
   415  50    50
   416  select * from test_11;
   417  c    d
   418  50    50
   419  1    1
   420  2    2
   421  select * from test_11;
   422  c    d
   423  1    1
   424  2    2
   425  50    50
   426  update test_11 set c = 100 where d = 50;
   427  select * from test_11;
   428  c    d
   429  1    1
   430  2    2
   431  100    50
   432  select * from test_11;
   433  c    d
   434  50    50
   435  1    1
   436  2    2
   437  update test_11 set c = 100 where d = 50;
   438  commit;
   439  w-w conflict
   440  select * from test_11;
   441  c    d
   442  1    1
   443  2    2
   444  100    50
   445  select * from test_11;
   446  c    d
   447  1    1
   448  2    2
   449  100    50
   450  drop table if exists test_11;
   451  begin;
   452  create table test_11 (c int primary key,d int);
   453  Insert into test_11 values(1,1);
   454  Insert into test_11 values(2,2);
   455  select * from test_11;
   456  c    d
   457  1    1
   458  2    2
   459  select * from test_11;
   460  SQL parser error: table "test_11" does not exist
   461  commit;
   462  select * from test_11;
   463  c    d
   464  1    1
   465  2    2
   466  select * from test_11;
   467  c    d
   468  1    1
   469  2    2
   470  drop table if exists test_11;
   471  create table test_11 (c int primary key,d int);
   472  Insert into test_11 values(1,1);
   473  Insert into test_11 values(2,2);
   474  select * from test_11;
   475  c    d
   476  1    1
   477  2    2
   478  select * from test_11;
   479  c    d
   480  1    1
   481  2    2
   482  begin;
   483  drop table test_11;
   484  select * from test_11;
   485  SQL parser error: table "test_11" does not exist
   486  select * from test_11;
   487  c    d
   488  1    1
   489  2    2
   490  commit;
   491  select * from test_11;
   492  SQL parser error: table "test_11" does not exist
   493  select * from test_11;
   494  SQL parser error: table "test_11" does not exist
   495  drop table if exists test_11;
   496  begin;
   497  create table test_11 (c int primary key,d int);
   498  Insert into test_11 values(1,1);
   499  Insert into test_11 values(2,2);
   500  select * from test_11;
   501  c    d
   502  1    1
   503  2    2
   504  select * from test_11;
   505  SQL parser error: table "test_11" does not exist
   506  select * from test_11;
   507  c    d
   508  1    1
   509  2    2
   510  select * from test_11;
   511  SQL parser error: table "test_11" does not exist
   512  commit;
   513  select * from test_11;
   514  c    d
   515  1    1
   516  2    2
   517  select * from test_11;
   518  c    d
   519  1    1
   520  2    2
   521  drop table if exists test_11;
   522  drop table if exists t1;
   523  create table t1 (a int not null, b int);
   524  insert into t1 values (1, 1);
   525  begin;
   526  select * from t1;
   527  a    b
   528  1    1
   529  update t1 set a=null where b=1;
   530  constraint violation: Column 'a' cannot be null
   531  select * from t1;
   532  a    b
   533  1    1
   534  commit;
   535  drop table if exists t1;