@@ -774,7 +774,7 @@ ClassMethod TableSize(tableName As %String = "", Output info, fast As %Boolean =
774774 set sc = $$$OK
775775 try {
776776
777- if '$system .SQL .Schema .TableExists (tableName , .metadata ) {
777+ if ( '$system .SQL .Schema .TableExists (tableName , .metadata )) || ( $ld ( metadata , 3 )= " " ) {
778778 set sc = $$$ERROR($$$TableDoesNotExist, tableName )
779779 quit
780780 }
@@ -786,8 +786,10 @@ ClassMethod TableSize(tableName As %String = "", Output info, fast As %Boolean =
786786 if rs .%Next () && rs .%GetData (1 ) {
787787 do Warn (" Table is involved in parent-child relationships. Result may not be accurate." )
788788 }
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
791793 set storage = ##class (%Dictionary.CompiledStorage ).%OpenId (className _" ||" _storageName )
792794 if storage .Type '=" %Storage.Persistent" {
793795 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 =
847849 }
848850 }
849851
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 )
852855
853856 write :verbose !!," Total size: " _totalAllocated _" allocated, " _totalUsed _" used" ,!
854857
0 commit comments