diff --git a/constants/constants.js b/constants/constants.js index b489e24..c1d0a82 100644 --- a/constants/constants.js +++ b/constants/constants.js @@ -13,8 +13,6 @@ const TABLE_TYPE = { const INLINE_COMMENT = '--'; -const PERSENT = '__PERCENT__'; - const CONSTRAINT_POSTFIX = { primaryKey: 'pk', foreignKey: 'fk', @@ -28,6 +26,5 @@ module.exports = { ERROR_MESSAGE, TABLE_TYPE, INLINE_COMMENT, - PERSENT, CONSTRAINT_POSTFIX, }; diff --git a/shared/Db2Client/build.sh b/shared/Db2Client/build.sh old mode 100644 new mode 100755 diff --git a/shared/addons/Db2Client.jar b/shared/addons/Db2Client.jar index 364efc0..1ce2335 100644 Binary files a/shared/addons/Db2Client.jar and b/shared/addons/Db2Client.jar differ diff --git a/shared/helpers/queryHelper.js b/shared/helpers/queryHelper.js index 3897092..a65b788 100644 --- a/shared/helpers/queryHelper.js +++ b/shared/helpers/queryHelper.js @@ -1,4 +1,4 @@ -const { TABLE_TYPE, PERSENT } = require('../../constants/constants'); +const { TABLE_TYPE } = require('../../constants/constants'); /** * @param {{ query: string }} @@ -11,18 +11,14 @@ const cleanUpQuery = ({ query = '' }) => query.replaceAll(/\s+/g, ' '); * @returns {string} */ const getNonSystemSchemaWhereClause = ({ query, schemaNameKeyword }) => { - // On Windows (cmd.exe), environment variables can be referenced using syntax like %PATH%. - // When a command contains such patterns, cmd.exe automatically replaces them with the corresponding environment variable values. - // To prevent this automatic substitution, a placeholder string (PERSENT) is used here instead, - // which will later be replaced with the % symbol inside the Db2Client Java client. const whereClause = ` - WHERE ${schemaNameKeyword} NOT LIKE 'SYS${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}SYSCAT${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}SYSIBM${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}SYSSTAT${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}SYSTOOLS${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}NULLID${PERSENT}' - AND ${schemaNameKeyword} NOT LIKE '${PERSENT}SQLJ${PERSENT}';`; + WHERE ${schemaNameKeyword} NOT LIKE 'SYS%' + AND ${schemaNameKeyword} NOT LIKE '%SYSCAT%' + AND ${schemaNameKeyword} NOT LIKE '%SYSIBM%' + AND ${schemaNameKeyword} NOT LIKE '%SYSSTAT%' + AND ${schemaNameKeyword} NOT LIKE '%SYSTOOLS%' + AND ${schemaNameKeyword} NOT LIKE '%NULLID%' + AND ${schemaNameKeyword} NOT LIKE '%SQLJ%';`; const clause = query.includes('WHERE') ? whereClause.replace('WHERE', 'AND') : whereClause;