<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>2.1_to_2.2_sql_schema.php applies changes too broadly</title> 
  <pubDate>Fri, 10 Apr 2026 16:31:12 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6308</link> 
  <atom:link rel="self" type="application/rss+xml" title="2.1_to_2.2_sql_schema.php applies changes too broadly" href="https://bugs.horde.org/ticket/6308/rss" /> 
  <description>2.1_to_2.2_sql_schema.php applies changes too broadly</description> 
 
   
   
  <item> 
   <title>This is related to this thread..



http://marc.info/?l=turb</title> 
   <description>This is related to this thread..



http://marc.info/?l=turba&amp;m=120179329503586&amp;w=2



2.1_to_2.2_sql_schema.php isn&#039;t specific enough when it mangles the data, converting from the 2.1 scheme to the 2.2 schema.



Consider the following situation..

user A has an addressbook entry for &quot;John Smith&quot;.  The script issues...



UPDATE turba_objects SET object_firstname = 

&#039;John&#039;, object_lastname = &#039;Smith&#039; WHERE object_lastname = &#039;John Smith&#039;



user B has an addressbook entry for &quot;Smith&quot; (No firstname, just &quot;Smith&quot;).  The script issues



UPDATE turba_objects SET object_firstname =

&#039;&#039;, object_lastname = &#039;Smith&#039; WHERE object_lastname = &#039;Smith&#039;



if User B&#039;s entry is converted after User A&#039;s entry, User A&#039;s entry also has it&#039;s firstname set to &#039;&#039;.  It&#039;s reset object_firstname for *any* entry with object_lastname = &quot;Smith&quot; that has already been converted.  This is super bad.



A similar flaw exists with the address entries.



So... I&#039;ve altered the SQL to take object_id into account.. which guaranties that we&#039;re updating the record we think we&#039;re updating.  It also has the added bonus of speeding the script up (since we&#039;re using the table&#039;s primary key).  Our turba_objects table has 1.5 million entries.  The original script took over five days to complete.  The updated script takes about an hour. </description> 
   <pubDate>Fri, 22 Feb 2008 22:06:51 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6308#t42767</link> 
  </item> 
   
  <item> 
   <title>Nice catch, committed and merged. 

Thanks!</title> 
   <description>Nice catch, committed and merged. 

Thanks!</description> 
   <pubDate>Sat, 23 Feb 2008 00:02:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6308#t42770</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
