[Lsb-infrastructure] Update: New database up - partly / problems

Denis Silakov silakov at ispras.ru
Thu Apr 3 23:43:30 PDT 2008


Wichmann, Mats D wrote:
> However, the create_triggers.sql script failed,
> complaining of a syntax error in the SQL.  The line
> complaining is this one (line 7):
>
> DROP TRIGGER IF EXISTS int_insert |
>
>
> Is it possible this is not supported by the LF's version
> of mysql?  Yes... looks like the ability to qualify with
> IF EXSITS specifically on DROP TRIGGER was missing, and was
> not added until 5.0.32.  The LF db server is running 5.0.22,
> and so is too old.  Grumble mumble.
>
> http://dev.mysql.com/doc/refman/5.0/en/drop-trigger.html
>
> I'm open to suggestions here.
>
>   
Since it's the first time the triggers are created, there is no actual
need to drop them at the moment. So I suggest the following:

sed -i.bak s/DROP\ TRIGGER/--DROP\ TRIGGER/ create_triggers.sql

Now finalize 'restoreall' process - there is no need to perform it from
scratch, only these two small steps left:

mysql [necessary_options] <create_triggers.sql
mysql [necessary_options] <dbperms.sql

Finally, I think we should not keep modified create_triggers.sql:

mv create_triggers.sql.bak create_triggers.sql

If it's difficult to upgrade mysql, we can emulate 'drop if exists'
behavior using shell and mysql, indeed (maybe we should do this in any
case? Many enterprise distributions still don't have fresh enough mysql,
so I guess other people using the database can also experience problems).

-- 
Regards,
Denis.



More information about the lsb-infrastructure mailing list