Bugs item #1604873, was opened at 2006-11-28 14:37
Message generated for change (Comment added) made by robmen
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1604873&group_id=105970

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: extensions
Group: v3.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Rob (rmacfadyen)
>Assigned to: Rob Mensching (robmen)
Summary: SqlExtension will incorrectly drop an existing database!

Initial Comment:
The SqlExtension will delete an existing database on rollback (this is an 
existing bug). However... if the ConfirmOverwrite attribute is set to "yes" and 
the user answers "No" to the prompt "Database X already exists do you wish to 
continue" the install is halted and _rolled back_.

This results in the database being deleted!

Here's the xml:

<Sql:SqlDatabase Id="db01" 
  Server="." Database="Payroll"
  CreateOnInstall="yes" ConfirmOverwrite="yes"
  DropOnUninstall="no"
/>

Deleting an existing database without explicit instructions to do so is a 
_very_ bad thing. On a production SQL server the database could be quite 
important (eg. DeveloperPayrollDb) and possibly not backed up. This could 
result in a serious data loss situation (just an ugly scenario).

The SQL extension may need to record its intention to create a database, and 
then the rollback "drop database" would only be invoked if there was an 
intention to create a database. Maybe this means the check of an existing 
database and confirm overwrite will need to move into an earlier phase (where 
it can write a property).


----------------------------------------------------------------------

>Comment By: Rob Mensching (robmen)
Date: 2007-01-08 16:44

Message:
Logged In: YES 
user_id=991639
Originator: NO

This has been fixed in WiX v2 by only scheduling the rollback of the
database, if the database does not exist before the install.  Dropping a
database that existed before the install of the same database is a great
way to lose data.

Anyway, this will be fixed when I port all the WiX v2 fixes up to WiX v3.

----------------------------------------------------------------------

Comment By: Michael Osmond (mosmond)
Date: 2006-12-17 17:55

Message:
Logged In: YES 
user_id=1463519
Originator: NO

Need to add here that this also effects Major Upgrades.  At the moment
when you are doing the install part of the upgrade and there is some sort
of error and rollback, the SQL Custom action will drop the database, that
it was meant to upgrade.

At the moment I have modified the CA and commented out the call to
schedule the drop database on rollback.  

Recommendation - given the number of scenarios that exist for the rollback
of a database on install being possible; ie: clean install with existing
target, clean instal with no database, install phase of a major upgrade; I
think it would be best that the drop on rollback be controlled by a
property that the author could control.   

Or perhaps - there are options for DropDatabaseOnRollback that include
"never,onlyOnCreate,prompt,always"  (onlyOnCreate would be where the CA
actually performed the Create statement).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1604873&group_id=105970

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to