2020from lib .core .common import pushValue
2121from lib .core .common import readInput
2222from lib .core .common import safeSQLIdentificatorNaming
23+ from lib .core .common import singleTimeWarnMessage
2324from lib .core .common import unArrayizeValue
2425from lib .core .common import unsafeSQLIdentificatorNaming
2526from lib .core .data import conf
@@ -62,6 +63,12 @@ def getCurrentDb(self):
6263 if not kb .data .currentDb :
6364 kb .data .currentDb = unArrayizeValue (inject .getValue (query , safeCharEncode = False ))
6465
66+ if Backend .getIdentifiedDbms () in (DBMS .ORACLE , DBMS .DB2 , DBMS .PGSQL ):
67+ warnMsg = "on %s you'll need to use " % Backend .getIdentifiedDbms ()
68+ warnMsg += "schema names for enumeration as the counterpart to database "
69+ warnMsg += "names on other DBMSes"
70+ singleTimeWarnMessage (warnMsg )
71+
6572 return kb .data .currentDb
6673
6774 def getDbs (self ):
@@ -76,20 +83,14 @@ def getDbs(self):
7683 warnMsg += "names will be fetched from 'mysql' database"
7784 logger .warn (warnMsg )
7885
79- elif Backend .isDbms ( DBMS .ORACLE ):
80- warnMsg = "schema names are going to be used on Oracle "
86+ elif Backend .getIdentifiedDbms () in ( DBMS .ORACLE , DBMS . DB2 , DBMS . PGSQL ):
87+ warnMsg = "schema names are going to be used on %s " % Backend . getIdentifiedDbms ()
8188 warnMsg += "for enumeration as the counterpart to database "
8289 warnMsg += "names on other DBMSes"
8390 logger .warn (warnMsg )
8491
8592 infoMsg = "fetching database (schema) names"
86- elif Backend .isDbms (DBMS .DB2 ):
87- warnMsg = "schema names are going to be used on IBM DB2 "
88- warnMsg += "for enumeration as the counterpart to database "
89- warnMsg += "names on other DBMSes"
90- logger .warn (warnMsg )
9193
92- infoMsg = "fetching database (schema) names"
9394 else :
9495 infoMsg = "fetching database names"
9596
0 commit comments