red-soft-ru / redexpert

GNU General Public License v3.0
15 stars 18 forks source link

META_TYPES[DDL_TRIGGER] doesn't exist in old FB servers #11

Open madmak2005 opened 1 month ago

madmak2005 commented 1 month ago

There is a problem in SQLUtils.java. Function generateNameForDBObject assume all FB databases have DDL_TRIGGER.

if (Objects.equals(type, META_TYPES[TRIGGER])) {
            databaseObjects.addAll(databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]));
            databaseObjects.addAll(databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DDL_TRIGGER]));
}

For old firebirds (I believe <3) this gives null: databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DDL_TRIGGER])

romansimakov commented 1 month ago

What do you expect to get in this case? FB servers before 3 don't have DDL triggers.

madmak2005 commented 1 month ago

For now I just did as you can see below. Original code gives me a null pointer exception when using FB 2.5 and trying to just open an table trigger.

if (Objects.equals(type, META_TYPES[TRIGGER])) { List dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); }

pt., 9 sie 2024 o 15:21 Roman Simakov @.***> napisał(a):

What do you expect to get in this case? FB servers before 3 don't have DDL triggers.

— Reply to this email directly, view it on GitHub https://github.com/red-soft-ru/redexpert/issues/11#issuecomment-2277934018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCU675JPCN7QAFA3WK33CLZQS66HAVCNFSM6AAAAABMINGX42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXHEZTIMBRHA . You are receiving this because you authored the thread.Message ID: @.***>

romansimakov commented 1 month ago

Ah, you mean Null Pointer Exception when said null. Ok. It's definitely a bug. Thanks.

madmak2005 commented 1 month ago

sorry, there was a copy-past error. I mean:

if (Objects.equals(type, META_TYPES[TRIGGER])) { List dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DDL_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); }

pt., 9 sie 2024 o 15:53 Tomasz Makowski @.***> napisał(a):

For now I just did as you can see below. Original code gives me a null pointer exception when using FB 2.5 and trying to just open an table trigger.

if (Objects.equals(type, META_TYPES[TRIGGER])) { List dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); dbo = databaseHost.getDatabaseObjectsForMetaTag(META_TYPES[DATABASE_TRIGGER]); if (dbo != null) databaseObjects.addAll(dbo); }

pt., 9 sie 2024 o 15:21 Roman Simakov @.***> napisał(a):

What do you expect to get in this case? FB servers before 3 don't have DDL triggers.

— Reply to this email directly, view it on GitHub https://github.com/red-soft-ru/redexpert/issues/11#issuecomment-2277934018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCU675JPCN7QAFA3WK33CLZQS66HAVCNFSM6AAAAABMINGX42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXHEZTIMBRHA . You are receiving this because you authored the thread.Message ID: @.***>

mikhan808 commented 2 days ago

fixed in 2024.09