[Camps-users] Bug: Installing camps using MySQL backend halts on errors [patch included]

Adam Vollrath adam at endpoint.com
Tue Feb 17 17:11:59 UTC 2009


To reproduce: Install camps on a fresh system, using MySQL as its  
backend (i.e. using a dsn containing 'mysql' in camp-db-config.)  Part  
of this install process requires executing schema/mysql.sql to create  
tables in a new database for use by camps.

Present behavior: The first few lines of this script drop tables that  
the script will later [re]create.  However if these tables do not yet  
exist, the mysql client will halt with an error (unless errors are  
explicitly ignored.)

Desired behavior: Drop tables if they exist, otherwise proceed without  
error.

The following patch changes this script to produce this desired  
behavior:

diff --git a/schema/mysql.sql b/schema/mysql.sql
index c20ba17..4296b0d 100644
--- a/schema/mysql.sql
+++ b/schema/mysql.sql
@@ -1,8 +1,8 @@
-DROP TABLE IF EXISTS camp_numbers;
-DROP TABLE IF EXISTS camps;
-DROP TABLE IF EXISTS vcs_types;
-DROP TABLE IF EXISTS camp_users;
-DROP TABLE IF EXISTS camp_types;
+DROP TABLE camp_numbers;
+DROP TABLE camps;
+DROP TABLE vcs_types;
+DROP TABLE camp_users;
+DROP TABLE camp_types;

  CREATE TABLE camp_users (
         username        VARCHAR(32) PRIMARY KEY,


More information about the Camps-users mailing list