Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0011749 | Openbravo ERP | Y. DBSourceManager | public | 2009-12-11 17:53 | 2010-06-29 13:37 |
|
Reporter | marvintm | |
Assigned To | marvintm | |
Priority | immediate | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | 2.50MP10 | Fixed in Version | | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0011749: Remove invalid rows process uses incorrect NOT IN syntax, which could lead to data loss |
Description | In update.database, there is a process which removes rows of tables with an on delete cascade foreign key, which point to a non-existing row of another table.
This process creates sql statements which have the form:
DELETE FROM table1 WHERE column1 NOT IN (SELECT column2 FROM table2);
This sql statement is correct except in the case that the column can be nullable. If this happens (that is, if there is at least one row in table1 whose value in column1 is null), and the table2 is empty, then all the rows in table1 will be deleted. |
Steps To Reproduce | - Make sure you have at least one M_PRODUCT entry with M_ATTRIBUTESET_ID null.
- Delete all entries in M_ATTRIBUTESET table
- Run update.database. This will delete all M_PRODUCT entries. |
Proposed Solution | DBSourceManager needs to be changed. The syntax should probably use NOT EXISTS instead of NOT IN. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | design defect | 0011750 | | scheduled | Triage Platform Base | Check for incorrect NOT IN syntax, which could lead to data loss | depends on | backport | 0011770 | 2.50MP10 | closed | marvintm | Remove invalid rows process uses incorrect NOT IN syntax, which could lead to data loss |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2009-12-11 17:53 | marvintm | New Issue | |
2009-12-11 17:53 | marvintm | Assigned To | => marvintm |
2009-12-11 17:57 | shuehner | Issue Monitored: shuehner | |
2009-12-11 17:59 | shuehner | Relationship added | related to 0011750 |
2009-12-14 18:42 | marvintm | Status | new => scheduled |
2009-12-14 18:42 | marvintm | fix_in_branch | => pi |
2009-12-14 20:06 | hgbot | Checkin | |
2009-12-14 20:06 | hgbot | Note Added: 0022775 | |
2009-12-14 20:06 | hgbot | Status | scheduled => resolved |
2009-12-14 20:06 | hgbot | Resolution | open => fixed |
2009-12-14 20:06 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/acc8c3be67a637e2802c5647b7d62885dc5803df [^] |
2009-12-16 16:46 | hudsonbot | Checkin | |
2009-12-16 16:46 | hudsonbot | Note Added: 0022866 | |
2010-01-22 18:25 | shuehner | Note Added: 0023767 | |
2010-01-22 18:25 | shuehner | Status | resolved => closed |
2010-01-23 00:00 | anonymous | sf_bug_id | 0 => 2937522 |
2010-06-29 13:37 | rafaroda | Issue Monitored: rafaroda | |