github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/transaction/isolation_1.sql (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  
    10  -- @session:id=1{
    11  use isolation_1;
    12  begin;
    13  select * from test_11;
    14  -- @session}
    15  commit;
    16  
    17  select * from test_11;
    18  -- @session:id=1{
    19  commit;
    20  select * from test_11;
    21  -- @session}
    22  
    23  -- -------------------------------------------------------
    24  drop table if exists test_11;
    25  create table test_11 (c int primary key,d int);
    26  Insert into test_11 values(1,1);
    27  Insert into test_11 values(2,2);
    28  begin;
    29  Insert into test_11 values(3,1);
    30  Insert into test_11 values(4,2);
    31  select * from test_11;
    32  
    33  -- @session:id=1{
    34  begin;
    35  select * from test_11;
    36  -- @session}
    37  
    38  delete from test_11 where c =1;
    39  select * from test_11;
    40  -- @session:id=1{
    41  select * from test_11;
    42  -- @session}
    43  
    44  update test_11 set d = c +1 where c > 2;
    45  select * from test_11;
    46  -- @session:id=1{
    47  select * from test_11;
    48  -- @session}
    49  
    50  commit;
    51  select * from test_11;
    52  -- @session:id=1{
    53  commit;
    54  select * from test_11;
    55  -- @session}
    56  
    57  -- -------------------------------------------------------
    58  drop table if exists test_11;
    59  begin;
    60  create table test_11 (c int primary key,d int);
    61  Insert into test_11 values(1,1);
    62  Insert into test_11 values(2,2);
    63  select * from test_11;
    64  -- @session:id=1{
    65  begin;
    66  select * from test_11;
    67  -- @session}
    68  
    69  commit;
    70  select * from test_11;
    71  
    72  -- @session:id=1{
    73  commit;
    74  select * from test_11;
    75  -- @session}
    76  
    77  -- -------------------------------------------------------
    78  drop table if exists test_11;
    79  create table test_11 (c int primary key,d int);
    80  Insert into test_11 values(1,1);
    81  Insert into test_11 values(2,2);
    82  begin;
    83  Insert into test_11 values(3,1);
    84  Insert into test_11 values(4,2);
    85  select * from test_11;
    86  
    87  -- @session:id=1{
    88  begin;
    89  select * from test_11;
    90  Insert into test_11 values(5,4);
    91  select * from test_11;
    92  -- @session}
    93  
    94  select * from test_11;
    95  Insert into test_11 values(50,50);
    96  
    97  -- @session:id=1{
    98  Insert into test_11 values(51,50);
    99  select * from test_11;
   100  -- @session}
   101  
   102  select * from test_11;
   103  commit;
   104  
   105  -- @session:id=1{
   106  commit;
   107  select * from test_11;
   108  -- @session}
   109  
   110  select * from test_11;
   111  
   112  -- -------------------------------------------------------
   113  drop table if exists test_11;
   114  create table test_11 (c int primary key,d int);
   115  Insert into test_11 values(1,1);
   116  Insert into test_11 values(2,2);
   117  begin;
   118  Insert into test_11 values(3,1);
   119  Insert into test_11 values(4,2);
   120  select * from test_11;
   121  
   122  -- @session:id=1{
   123  begin;
   124  select * from test_11;
   125  Insert into test_11 values(5,4);
   126  select * from test_11;
   127  -- @session}
   128  
   129  select * from test_11;
   130  Insert into test_11 values(50,50);
   131  
   132  -- @session:id=1{
   133  Insert into test_11 values(50,50);
   134  select * from test_11;
   135  -- @session}
   136  
   137  select * from test_11;
   138  commit;
   139  
   140  -- @session:id=1{
   141  commit;
   142  select * from test_11;
   143  -- @session}
   144  
   145  select * from test_11;
   146  
   147  -- -------------------------------------------------------
   148  drop table if exists test_11;
   149  create table test_11 (c int primary key,d int);
   150  Insert into test_11 values(1,1);
   151  Insert into test_11 values(2,2);
   152  begin;
   153  select * from test_11;
   154  Insert into test_11 values(50,50);
   155  select * from test_11;
   156  -- @session:id=1{
   157  begin;
   158  select * from test_11;
   159  Insert into test_11 values(50,50);
   160  select * from test_11;
   161  -- @session}
   162  select * from test_11;
   163  
   164  -- @session:id=1{
   165  delete from test_11 where c = 50;
   166  select * from test_11;
   167  -- @session}
   168  select * from test_11;
   169  
   170  commit;
   171  -- @session:id=1{
   172  commit;
   173  select * from test_11;
   174  -- @session}
   175  select * from test_11;
   176  
   177  -- -------------------------------------------------------
   178  drop table if exists test_11;
   179  create table test_11 (c int primary key,d int);
   180  Insert into test_11 values(1,1);
   181  Insert into test_11 values(2,2);
   182  begin;
   183  select * from test_11;
   184  Insert into test_11 values(50,50);
   185  select * from test_11;
   186  -- @session:id=1{
   187  begin;
   188  select * from test_11;
   189  Insert into test_11 values(50,50);
   190  select * from test_11;
   191  -- @session}
   192  select * from test_11;
   193  
   194  -- @session:id=1{
   195  select * from test_11;
   196  update test_11 set c = 100 where d = 50;
   197  select * from test_11;
   198  -- @session}
   199  select * from test_11;
   200  Insert into test_11 values(100,50);
   201  
   202  commit;
   203  -- @session:id=1{
   204  commit;
   205  select * from test_11;
   206  -- @session}
   207  select * from test_11;
   208  
   209  -- -------------------------------------------------------
   210  drop table if exists test_11;
   211  create table test_11 (c int primary key,d int);
   212  Insert into test_11 values(1,1);
   213  Insert into test_11 values(2,2);
   214  begin;
   215  select * from test_11;
   216  Insert into test_11 values(50,50);
   217  select * from test_11;
   218  -- @session:id=1{
   219  begin;
   220  select * from test_11;
   221  Insert into test_11 values(50,50);
   222  select * from test_11;
   223  -- @session}
   224  select * from test_11;
   225  
   226  -- @session:id=1{
   227  select * from test_11;
   228  update test_11 set c = 100 where d = 50;
   229  select * from test_11;
   230  -- @session}
   231  select * from test_11;
   232  update test_11 set c = 101 where c = 50;
   233  
   234  commit;
   235  -- @session:id=1{
   236  commit;
   237  select * from test_11;
   238  -- @session}
   239  select * from test_11;
   240  
   241  -- -------------------------------------------------------
   242  drop table if exists test_11;
   243  create table test_11 (c int primary key,d int);
   244  Insert into test_11 values(1,1);
   245  Insert into test_11 values(2,2);
   246  begin;
   247  select * from test_11;
   248  Insert into test_11 values(50,50);
   249  select * from test_11;
   250  -- @session:id=1{
   251  begin;
   252  select * from test_11;
   253  Insert into test_11 values(50,50);
   254  select * from test_11;
   255  -- @session}
   256  select * from test_11;
   257  
   258  -- @session:id=1{
   259  select * from test_11;
   260  update test_11 set c = 100 where d = 50;
   261  select * from test_11;
   262  -- @session}
   263  select * from test_11;
   264  update test_11 set c = 100 where d = 50;
   265  
   266  commit;
   267  -- @session:id=1{
   268  commit;
   269  select * from test_11;
   270  -- @session}
   271  select * from test_11;
   272  
   273  
   274  -- -------------------------------------------------------
   275  drop table if exists test_11;
   276  begin;
   277  create table test_11 (c int primary key,d int);
   278  Insert into test_11 values(1,1);
   279  Insert into test_11 values(2,2);
   280  select * from test_11;
   281  -- @session:id=1{
   282  begin;
   283  select * from test_11;
   284  -- @session}
   285  
   286  commit;
   287  select * from test_11;
   288  -- @session:id=1{
   289  commit;
   290  select * from test_11;
   291  -- @session}
   292  
   293  -- -------------------------------------------------------
   294  drop table if exists test_11;
   295  create table test_11 (c int primary key,d int);
   296  Insert into test_11 values(1,1);
   297  Insert into test_11 values(2,2);
   298  select * from test_11;
   299  -- @session:id=1{
   300  begin;
   301  select * from test_11;
   302  -- @session}
   303  
   304  begin;
   305  drop table test_11;
   306  select * from test_11;
   307  -- @session:id=1{
   308  select * from test_11;
   309  -- @session}
   310  
   311  commit;
   312  select * from test_11;
   313  -- @session:id=1{
   314  commit;
   315  select * from test_11;
   316  -- @session}
   317  
   318  -- -------------------------------------------------------
   319  drop table if exists test_11;
   320  begin;
   321  create table test_11 (c int primary key,d int);
   322  Insert into test_11 values(1,1);
   323  Insert into test_11 values(2,2);
   324  select * from test_11;
   325  -- @session:id=1{
   326  begin;
   327  select * from test_11;
   328  -- @session}
   329  
   330  -- drop table test_11;
   331  select * from test_11;
   332  -- @session:id=1{
   333  select * from test_11;
   334  -- @session}
   335  commit;
   336  
   337  select * from test_11;
   338  -- @session:id=1{
   339  commit;
   340  select * from test_11;
   341  -- @session}
   342  
   343  drop table if exists test_11;
   344  
   345  
   346  
   347