6.0.0-beta1
7/4/25

[#7527] uncatched failed prepare statements in convert_datatree_shares_to_sql
Summary uncatched failed prepare statements in convert_datatree_shares_to_sql
Queue Kronolith
Queue Version 2.3
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester michael.menge (at) zdv (dot) uni-tuebingen (dot) de
Created 10/21/2008 (6100 days ago)
Due
Updated 10/23/2008 (6098 days ago)
Assigned
Resolved 10/23/2008 (6098 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
10/23/2008 03:45:02 PM Jan Schneider Comment #2
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Tweaked and committed, thanks
- This patch requieres the database to support transactions. I don't know if
   Horde supports any database that don't support transactions, but it should
   be cecked.
This is not a problem, MDB2 knows whether a RDBMS supports 
transactions or not.
10/21/2008 08:13:41 AM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #1
Priority ⇒ 1. Low
New Attachment: kronolith_convert_datatree_shares_to_sql.patch Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Kronolith
Summary ⇒ uncatched failed prepare statements in convert_datatree_shares_to_sql
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
All convert_datatree_shares_to_sql scripts don't catch failed prepare 
statements,

which may lead to an inconsistent database and cause a fatal php error,

trying to call the non existing function "execute" on a MDB2_Error object.



This is a patch for kronolith-h3-2.3

It catches the failed prepare statement on write sql statements 
(INSERT and DELETE)

and encapsulate them in a transaction to rollback on error. This is to 
keep the

database in an consistent state and to allow to rerun the script on 
errors with out

loosing or dublicating any shares. This patch also returns more 
informations as

"Unkown Error" is not a very usefull.



The following problems are still open as i did not need them to solve for me.



- This patch requieres the database to support transactions. I don't know if

   Horde supports any database that don't support transactions, but it should

   be cecked.



- This patch does not catch failed prepare statements on SELECT statements.

   This may result in the same fatal error.






Saved Queries