@@ -774,7 +774,7 @@ ClassMethod TableSize(tableName As %String = "", Output info, fast As %Boolean =
774
774
set sc = $$$OK
775
775
try {
776
776
777
- if '$system .SQL .Schema .TableExists (tableName , .metadata ) {
777
+ if ( '$system .SQL .Schema .TableExists (tableName , .metadata )) || ( $ld ( metadata , 3 )= " " ) {
778
778
set sc = $$$ERROR($$$TableDoesNotExist, tableName )
779
779
quit
780
780
}
@@ -786,8 +786,10 @@ ClassMethod TableSize(tableName As %String = "", Output info, fast As %Boolean =
786
786
if rs .%Next () && rs .%GetData (1 ) {
787
787
do Warn (" Table is involved in parent-child relationships. Result may not be accurate." )
788
788
}
789
-
790
- set storageName = ##class (%Dictionary.CompiledClass ).%OpenId (className ).StorageStrategy
789
+
790
+ set classs = ##class (%Dictionary.CompiledClass ).%OpenId (className )
791
+ goto :classs =" " end // silently end if there is no storage
792
+ set storageName = classs .StorageStrategy
791
793
set storage = ##class (%Dictionary.CompiledStorage ).%OpenId (className _" ||" _storageName )
792
794
if storage .Type '=" %Storage.Persistent" {
793
795
do Warn (" Table storage type '" _storage .Type _" ' is not fully supported. Result may not be accurate." )
@@ -847,8 +849,9 @@ ClassMethod TableSize(tableName As %String = "", Output info, fast As %Boolean =
847
849
}
848
850
}
849
851
850
- set info (" total" ," allocated" ) = totalAllocated ,
851
- info (" total" ," used" ) = totalUsed
852
+ end
853
+ set info (" total" ," allocated" ) = +$g (totalAllocated ),
854
+ info (" total" ," used" ) = +$g (totalUsed )
852
855
853
856
write :verbose !!," Total size: " _totalAllocated _" allocated, " _totalUsed _" used" ,!
854
857
0 commit comments