Index: kernel/classes/ezcontentobjecttreenode.php
===================================================================
--- kernel/classes/ezcontentobjecttreenode.php	(revision 21405)
+++ kernel/classes/ezcontentobjecttreenode.php	(working copy)
@@ -2255,10 +2255,8 @@
 
             $fromNode = $nodeID;
             $childrensPath = $nodePath;
-            $pathLength = strlen( $childrensPath );
 
             $db = eZDB::instance();
-            $subStringString = $db->subString( 'path_string', 1, $pathLength );
             $pathString = " ezcontentobject_tree.path_string like '$childrensPath%' and ";
 
             $notEqParentString = "ezcontentobject_tree.node_id != $fromNode AND";
@@ -2943,10 +2941,8 @@
         $nodeDepth = $this->attribute( 'depth' );
 
         $childrensPath = $nodePath ;
-        $pathLength = strlen( $childrensPath );
 
         $db = eZDB::instance();
-        $subStringString = $db->subString( 'path_string', 1, $pathLength );
         $pathString = " path_string like '$childrensPath%' and ";
         $depthCond = '';
         $nodeDepth = $this->Depth + 1;
@@ -3114,7 +3110,6 @@
         $nodePath =  $node->attribute( 'path_string' );
 
         $sectionID =(int) $sectionID;
-//        $subStringString = $db->subString( 'path_string', 1, strlen( $nodePath ) );
 
         $pathString = " path_string like '$nodePath%' AND ";
 
@@ -4053,13 +4048,9 @@
 
         $nodePath = $this->attribute( 'path_string' );
         $childrensPath = $nodePath ;
-        $pathLength = strlen( $childrensPath );
 
         $pathString = " path_string like '$childrensPath%' ";
 
-
-        $subStringString = $db->subString( 'path_string', 1, $pathLength );
-
         $urlAlias = $this->attribute( 'url_alias' );
 
         // Remove static cache
@@ -4487,10 +4478,8 @@
         }
 
         $childPath = $nodePath;
-        $pathLength = strlen( $childPath );
 
         $db = eZDB::instance();
-        $subStringString = $db->subString( 'path_string', 1, $pathLength );
         $pathString = " ezcot.path_string like '$childPath%' and ";
 
         $notEqParentString = "ezcot.node_id != $fromNode";
@@ -4580,15 +4569,14 @@
                           WHERE
                                  node_id = $nodeID";
             $db = eZDB::instance();
-            $subStringString = $db->subString( 'path_string', 1, $oldPathLength );
-            $subStringString2 =  $db->subString( 'path_string', $oldPathLength );
+            $subStringString =  $db->subString( 'path_string', $oldPathLength );
             $moveQuery1 = "UPDATE
                                  ezcontentobject_tree
                            SET
-                                 path_string = " . $db->concatString( array( "'$newPath'" , "'$nodeID'",$subStringString2 ) ) . " ,
+                                 path_string = " . $db->concatString( array( "'$newPath'" , "'$nodeID'",$subStringString ) ) . " ,
                                  depth = depth + $newParentDepth - $oldDepth + 1
                            WHERE
-                                 $subStringString = '$childrensPath' OR
+                                 path_string like '$childrensPath%' OR
                                  path_string = '$oldPath' ";
             $db->begin();
             $db->query( $moveQuery );
@@ -4603,8 +4591,7 @@
                 //include_once( "kernel/classes/ezrole.php" );
                 $limitationIDString = implode( ',', $limitationsToFix );
                 $limitationIDString = " limitation_id in ( $limitationIDString ) ";
-                $subStringString = $db->subString( 'value', 1, $oldPathLength );
-                $subStringString2 =  $db->subString( 'value', $oldPathLength );
+                $subStringString =  $db->subString( 'value', $oldPathLength );
 
                 $query = "UPDATE
                                  ezpolicy_limitation_value
@@ -4609,9 +4596,9 @@
                 $query = "UPDATE
                                  ezpolicy_limitation_value
                           SET
-                                 value = " . $db->concatString( array( "'$newPath'" , "'$nodeID'",$subStringString2 ) ) . "
+                                 value = " . $db->concatString( array( "'$newPath'" , "'$nodeID'",$subStringString ) ) . "
                           WHERE
-                                ( $subStringString = '$childrensPath' OR
+                                ( value like '$childrensPath%' OR
                                  value = '$oldPath' ) AND  $limitationIDString";
 
                 $db->query( $query );
Index: kernel/search/plugins/ezsearchengine/ezsearchengine.php
===================================================================
--- kernel/search/plugins/ezsearchengine/ezsearchengine.php	(revision 21405)
+++ kernel/search/plugins/ezsearchengine/ezsearchengine.php	(working copy)
@@ -767,10 +767,7 @@
                     foreach ( $nodeArray as $node )
                     {
                         $pathString = $node['path_string'];
-
-                        $subStringString = $db->subString( 'ezcontentobject_tree.path_string', 1, strlen( $pathString ) );
-
-                        $subTreeSQL .= " $subStringString = '$pathString' ";
+                        $subTreeSQL .= " ezcontentobject_tree.path_string like '$pathString%' ";
 
                         if ( $i < ( count( $nodeArray ) -1 ) )
                             $subTreeSQL .= " OR ";
