Project

General

Profile

6928.patch

Radu Apetrii, 01/25/2023 10:21 AM

Download (2.24 KB)

View differences:

new/src/main/org/h2/command/dml/Update.java 2023-01-25 15:00:22 +0000
16 16
import org.h2.api.Trigger;
17 17
import org.h2.command.CommandInterface;
18 18
import org.h2.command.Prepared;
19
import org.h2.engine.DbObject;
20
import org.h2.engine.Right;
21
import org.h2.engine.Session;
19
import org.h2.engine.*;
22 20
import org.h2.expression.Expression;
23 21
import org.h2.expression.ExpressionVisitor;
24 22
import org.h2.expression.Parameter;
......
341 339
                  // copy the old row to new, as no index is affected
342 340
                  Row o = inMemRows.next();
343 341
                  Row n = inMemRows.next();
342
                  Row oldRowCopy = null;
343
                  oldRowCopy = table.getTemplateRow();
344
                  oldRowCopy.copy(o);
345
                  oldRowCopy.setKey(o.getKey());
346
                  
347
                  session.log(table, UndoLogRecord.DELETE, oldRowCopy);
348
                  session.log(table, UndoLogRecord.INSERT, n);
344 349
                  o.copy(n);
350
                  
351
                  table.updateMaxDataModificationId();
345 352
              }
346 353
            }
347 354

  
new/src/main/org/h2/pagestore/db/PageStoreTable.java 2023-01-25 15:00:55 +0000
538 538
    public long getMaxDataModificationId() {
539 539
        return lastModificationId;
540 540
    }
541
    
542
    @Override
543
    public void updateMaxDataModificationId() {
544
        lastModificationId = database.getNextModificationDataId();
545
    }
541 546

  
542 547
    @Override
543 548
    public long getRowCountApproximation() {
new/src/main/org/h2/table/Table.java 2023-01-25 15:01:53 +0000
351 351
     * @return the modification id
352 352
     */
353 353
    public abstract long getMaxDataModificationId();
354
    
355
    /**
356
     * Update the last data modification id.
357
     */
358
    public void updateMaxDataModificationId()
359
    {
360
       
361
    }
354 362

  
355 363
    /**
356 364
     * Check if the table is deterministic.