Skip to content

Commit dcc7402

Browse files
committed
ignore projected collections in TableSize()
1 parent 59ed053 commit dcc7402

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/cls/bdb/sql/StorageUtils.cls

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)