Skip to content

Unable to edit a field for a view with trigger #2089

@danny0838

Description

@danny0838

Details for the issue

What did you do?

1. Create a new database.

2. Run below SQL:

CREATE TABLE main (
       id INTEGER,
       value TEXT,
       PRIMARY KEY (id)
);

INSERT INTO main
VALUES (1, 'test'), (2, 'test2'), (3, 'test3');

CREATE VIEW v_main AS
SELECT rowid AS rid, *
  FROM main
 WHERE id < 3;

 CREATE TRIGGER v_main
INSTEAD OF UPDATE OF id, value ON v_main
  BEGIN
        UPDATE main
           SET id = NEW.id,
               value = NEW.value
         WHERE id = OLD.id;
   END;

3. Switch to "v_main" in the Browser Data tab.

4. Try to modify the "id" or "value" field.

What did you expect to see?

I should be able to modify the "id" or "value" filed via clicking on a field and input a value in the "Browse Data" tab, and be able to modify the value using the "Edit Database Cell" after clicking on a field. (According to #1756)

What did you see instead?

I can modify the "id" or "value" filed in the "Browse Data" tab, but it doesn't apply after I input a new value and press Enter.

The content field and the "Apply" button are always in disabled status when I click on the "id" or "value" field in the "v_main" view in the "Browse Data" tab.

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: Windows 7 SP1 )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • 3.11.2
  • 3.11.1
  • 3.10.1
  • Other: ___

Did you also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions