--- modules/taxonomy/taxonomy.module	Mon Jan 03 20:03:54 2011
+++ modules/taxonomy/taxonomy.module	Sat Apr 23 16:02:07 2011
@@ -858,7 +858,9 @@
 function taxonomy_get_children($tid, $vid = 0) {
   $children = &drupal_static(__FUNCTION__, array());
 
-  if ($tid && !isset($children[$tid])) {
+  $tid = (int) $tid;
+  $key = $tid !== 0 ? $tid : 'vid:' . $vid;
+  if (!isset($children[$key])) {
     $query = db_select('taxonomy_term_data', 't');
     $query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid');
     $query->addField('t', 'tid');
@@ -870,10 +872,10 @@
     $query->orderBy('t.weight');
     $query->orderBy('t.name');
     $tids = $query->execute()->fetchCol();
-    $children[$tid] = taxonomy_term_load_multiple($tids);
+    $children[$key] = taxonomy_term_load_multiple($tids);
   }
 
-  return isset($children[$tid]) ? $children[$tid] : array();
+  return isset($children[$key]) ? $children[$key] : array();
 }
 
 /**
