You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
navigate to / -> /insert -> /update [refresh /update]
Watch table content
Actual result
Only the row with id 1 should be updated
Expected result
Only the row with id 1 should be updated
👍 Normal fine!
step 2
Step to reproduce
Now create a view matching exactly the table structure.
CREATEVIEW `member2` ASSELECT id, label, flag
FROM`member`;
update Member class to declare the view: $table='member2',
navigate to / -> /insert -> /update [refresh /update]
Actual result
All the rows are updated
Expected result
Only the row with id 1 should be updated
Notes
The sql dump show that in step2, the sql update ommit the where clause, which is why all rows are updated.
(0.8ms) SHOW columns FROM `geokrety`.`member2`
(0.3ms) SELECT `id`,`label`,`flag` FROM `member2` WHERE `label` = 'Doe'
(4.6ms) UPDATE `member2` SET `flag`='0'
Whereas in step1 the where condition exists
(0.6ms) SHOW columns FROM `geokrety`.`member`
(0.2ms) SELECT `id`,`label`,`flag` FROM `member` WHERE `label` = 'Doe'
(4.7ms) UPDATE `member` SET `flag`='1' WHERE `id`=1
The text was updated successfully, but these errors were encountered:
It's an "issue" in the F3 sql mapper, but it's a feature that I think cannot be implemented reliably, because the mapper/sql engine isnt able to get the primary key from a view schema. That's why you're not able to update a single record.. the information schema table doesn seem to give the correct data here, or the schema query need to be updated for it.. I'm not sure atm.
I'm working on rewriting an old application. I also wish to rename some tables and columns.
So I've created some views including the necessary changes and found that all table entries are updated.
Is this a bug or do I expect something that "can not work"?
Thanks
Here is a small example to demonstrate:
step 1
Step to reproduce
/
->/insert
->/update
[refresh/update
]Actual result
Only the row with id
1
should be updatedExpected result
Only the row with id
1
should be updated👍 Normal fine!
step 2
Step to reproduce
Member
class to declare the view:$table='member2',
/
->/insert
->/update
[refresh/update
]Actual result
All the rows are updated
Expected result
Only the row with id
1
should be updatedNotes
The sql dump show that in step2, the sql
update
ommit thewhere
clause, which is why all rows are updated.Whereas in step1 the
where
condition existsThe text was updated successfully, but these errors were encountered: