#1  
Old 16th August 2022, 12:44 AM
Uwe Uwe is offline
Junior Member
 
Join Date: May 2009
Posts: 19
Default Cannot DROP tables / stored procedures [4.50.28]

When executing a DROP TABLE statement in NexusDB V 4.50.28 I get a strange exception:

Quote:
Time: [255091343] 2022-08-15 15:20:46.737
ExceptionInfo: nil
Exception: EVariantInvalidArgError
Message: Invalid argument
Version: 4,5028
AWE Enabled: False
Query: Drop Table if exists "1_SyncInfo";
The exception log pointed to
Code:
function TnxSqlPSMDictionary.FunctionLoadBegin(
  const FunctionName: string): TStream;
[...]
V := FunctionTable.FieldByName('Code').GetBlobValue;
VPtr := VarArrayLock(V);
and raises an exception when V is Null. While debugging I noticed it happens while checking stored procedures for whatever reasons.
I then tried to delete all the stored procedures in the Enterprise Manager, but the same exception hit me again.

Quote:
Time: [255091343] 2022-08-15 15:20:46.737
ExceptionInfo: nil
Exception: EVariantInvalidArgError
Message: Invalid argument
Version: 4,5028
AWE Enabled: False
Query: DROP ROUTINE IF EXISTS "GetGesperrteWMDokuAktenForUserOID";
--------------------------------------------------------------
Callstack (Frames):
[000000000062AE21] JclDebug.TJclStackInfoList.Create (Line 5509, "JclDebug.pas")
[000000000062A942] JclDebug.JclCreateStackList (Line 5351, "JclDebug.pas")
[000000000062A89B] JclDebug.DoExceptionStackTrace (Line 5292, "JclDebug.pas")
[000000000062DBBC] JclDebug.DoExceptNotify (Line 6741, "JclDebug.pas")
[000000000061B6B2] JclHookExcept.TNotifierItem.DoNotify (Line 272, "JclHookExcept.pas")
[000000000061B98D] JclHookExcept.DoExceptNotify (Line 347, "JclHookExcept.pas")
[000000000061BA90] JclHookExcept.HookedRaiseException (Line 381, "JclHookExcept.pas")
[0000000000412C83] System.@RaiseAtExcept (Line 22019, "System.pas")
[0000000000412CA1] System.@RaiseExcept (Line 22108, "System.pas")
[000000000047095F] System.Variants.TranslateResult (Line 735, "System.Variants.pas")
[0000000000470A6D] System.Variants.VarResultCheck (Line 747, "System.Variants.pas")
[000000000047C8EB] System.Variants.VarArrayAsPSafeArray (Line 5597, "System.Variants.pas")
[000000000047C9AD] System.Variants.VarArrayLock (Line 5622, "System.Variants.pas")
[0000000000DE01C7] nxsqlProxies.TnxSqlPSMDictionary.FunctionLoadBegin (Line 10722, "nxsqlProxies.pas")
[0000000000DE8260] nxsqlProxies.TnxSqlPSMDictionary.AnyFunctionRefers To (Line 11797, "nxsqlProxies.pas")
[0000000000C39C96] nxsqlPSM.TnxSqlDROPROUTINE.CheckForReferences (Line 4481, "nxSQLPSM.pas")
[0000000000C39F29] nxsqlPSM.TnxSqlDROPROUTINE.Execute (Line 4513, "nxSQLPSM.pas")
[0000000000E0322A] nxsqlBase.TnxSqlBlock.Execute (Line 1993, "nxsqlBase.pas")
[0000000000E11EC9] nxsqlEngine.TnxSqlStatement.ssExec (Line 408, "nxsqlEngine.pas")
[0000000000A7C4FF] nxsrServerEngine.TnxServerDatabase.sdStatementExec Direct (Line 6358, "nxsrServerEngine.pas")
[0000000000A800AE] nxsrServerEngine.TnxServerDatabase.StatementExecDi rect (Line 7203, "nxsrServerEngine.pas")
[0000000000B43FAF] nxchCommandHandler.TnxServerCommandHandler.nmDatab aseStatementExecDirect (Line 4652, "nxchCommandHandler.pas")
[0000000000410F35] System.TObject.Dispatch (Line 18813, "System.pas")
[0000000000B29A93] nxchCommandHandler.TnxServerCommandHandler.bchProc ess (Line 653, "nxchCommandHandler.pas")
[0000000000912B19] nxllTransport.TnxBaseTransport.btProcess (Line 1846, "nxllTransport.pas")
[0000000000AC0C80] nxptBasePooledTransport.TnxBasePooledTransport.btP ayloadReceived (Line 3446, "nxptBasePooledTransport.pas")
[0000000000AC068B] nxptBasePooledTransport.TnxBasePooledTransport.btM essageReceived (Line 3321, "nxptBasePooledTransport.pas")
[0000000000ACFE1A] nxtwWinsockTransport.TnxWinsockServerConnection.Io Completed (Line 692, "nxtwWinsockTransport.pas")
[0000000000ACFD39] nxtwWinsockTransport.TnxWinsockServerConnection.Io Completed (Line 676, "nxtwWinsockTransport.pas")
[0000000000ABCFD1] nxptBasePooledTransport.TnxBaseServerThread.InnerE xecute (Line 2383, "nxptBasePooledTransport.pas")
[000000000069FB72] nxllThread.TnxInternalInitThread.DoExecute (Line 653, "nxllThread.pas")
[000000000069F799] nxllThread.TnxThread.Execute (Line 486, "nxllThread.pas")
[0000000000565A13] System.Classes.ThreadProc (Line 15573, "System.Classes.pas")
[000000000041385D] System.ThreadWrapper (Line 25380, "System.pas")
[00007FFD90C07034] BaseThreadInitThunk
[00007FFD91DE2651] RtlUserThreadStart
================================================== ============
In V4.11 there is no exception at all, neither in V4.50.28 with freshly created stored procedures. I'm afraid the reason are old (but still used) stored procedures in my database that now couldn't be deleted or recreated. What can I do?

Uwe
  #2  
Old 16th August 2022, 07:26 AM
Thorsten Engler [NDA]
 
Posts: n/a
Default Re: Cannot DROP tables / stored procedures [4.50.28]

An SP with a NULL Code BLOB should never occur.

This appears to be a case of corrupted system tables.

Given that this is the first time anyone has ever reported this issue AFAIK,
the circumstances that lead to it must be exceedingly rare.

My recommendation is to delete the $SQL$ table files (while the database is not
in use) and add all your stored procedures again, as it's impossible to say if
that's the only problem with these tables.

Uwe wrote:

>
> When executing a DROP TABLE statement in NexusDB V 4.50.28 I get a
> strange exception:
>
> > Time: [255091343] 2022-08-15 15:20:46.737
> > ExceptionInfo: nil
> > Exception: EVariantInvalidArgError
> > Message: Invalid argument
> > Version: 4,5028
> > AWE Enabled: False
> > Query: *Drop Table if exists "1_SyncInfo";*
> >

> The exception log pointed to
>
> Code:
> --------------------
> function TnxSqlPSMDictionary.FunctionLoadBegin(
> const FunctionName: string): TStream;
> [...]
> V := FunctionTable.FieldByName('Code').GetBlobValue;
> VPtr := VarArrayLock(V);
> --------------------
>
>
> and raises an exception when V is Null. While debugging I noticed it
> happens while checking stored procedures for whatever reasons.
> I then tried to delete all the stored procedures in the Enterprise
> Manager, but the same exception hit me again.
>
> > Time: [255091343] 2022-08-15 15:20:46.737
> > ExceptionInfo: nil
> > Exception: EVariantInvalidArgError
> > Message: Invalid argument
> > Version: 4,5028
> > AWE Enabled: False
> > Query: *DROP ROUTINE IF EXISTS "GetGesperrteWMDokuAktenForUserOID";*
> > --------------------------------------------------------------
> > Callstack (Frames):
> > [000000000062AE21] JclDebug.TJclStackInfoList.Create (Line 5509,
> > "JclDebug.pas")
> > [000000000062A942] JclDebug.JclCreateStackList (Line 5351,
> > "JclDebug.pas")
> > [000000000062A89B] JclDebug.DoExceptionStackTrace (Line 5292,
> > "JclDebug.pas")
> > [000000000062DBBC] JclDebug.DoExceptNotify (Line 6741, "JclDebug.pas")
> > [000000000061B6B2] JclHookExcept.TNotifierItem.DoNotify (Line 272,
> > "JclHookExcept.pas")
> > [000000000061B98D] JclHookExcept.DoExceptNotify (Line 347,
> > "JclHookExcept.pas")
> > [000000000061BA90] JclHookExcept.HookedRaiseException (Line 381,
> > "JclHookExcept.pas")
> > [0000000000412C83] System.@RaiseAtExcept (Line 22019, "System.pas")
> > [0000000000412CA1] System.@RaiseExcept (Line 22108, "System.pas")
> > [000000000047095F] System.Variants.TranslateResult (Line 735,
> > "System.Variants.pas")
> > [0000000000470A6D] System.Variants.VarResultCheck (Line 747,
> > "System.Variants.pas")
> > [000000000047C8EB] System.Variants.VarArrayAsPSafeArray (Line 5597,
> > "System.Variants.pas")
> > [000000000047C9AD] System.Variants.VarArrayLock (Line 5622,
> > "System.Variants.pas")
> > [0000000000DE01C7] nxsqlProxies.TnxSqlPSMDictionary.FunctionLoadBegin
> > (Line 10722, "nxsqlProxies.pas")
> > [0000000000DE8260] nxsqlProxies.TnxSqlPSMDictionary.AnyFunctionRefers To
> > (Line 11797, "nxsqlProxies.pas")
> > [0000000000C39C96] nxsqlPSM.TnxSqlDROPROUTINE.CheckForReferences (Line
> > 4481, "nxSQLPSM.pas")
> > [0000000000C39F29] nxsqlPSM.TnxSqlDROPROUTINE.Execute (Line 4513,
> > "nxSQLPSM.pas")
> > [0000000000E0322A] nxsqlBase.TnxSqlBlock.Execute (Line 1993,
> > "nxsqlBase.pas")
> > [0000000000E11EC9] nxsqlEngine.TnxSqlStatement.ssExec (Line 408,
> > "nxsqlEngine.pas")
> > [0000000000A7C4FF]
> > nxsrServerEngine.TnxServerDatabase.sdStatementExec Direct (Line 6358,
> > "nxsrServerEngine.pas")
> > [0000000000A800AE]
> > nxsrServerEngine.TnxServerDatabase.StatementExecDi rect (Line 7203,
> > "nxsrServerEngine.pas")
> > [0000000000B43FAF]
> > nxchCommandHandler.TnxServerCommandHandler.nmDatab aseStatementExecDirect
> > (Line 4652, "nxchCommandHandler.pas")
> > [0000000000410F35] System.TObject.Dispatch (Line 18813, "System.pas")
> > [0000000000B29A93] nxchCommandHandler.TnxServerCommandHandler.bchProc ess
> > (Line 653, "nxchCommandHandler.pas")
> > [0000000000912B19] nxllTransport.TnxBaseTransport.btProcess (Line 1846,
> > "nxllTransport.pas")
> > [0000000000AC0C80]
> > nxptBasePooledTransport.TnxBasePooledTransport.btP ayloadReceived (Line
> > 3446, "nxptBasePooledTransport.pas")
> > [0000000000AC068B]
> > nxptBasePooledTransport.TnxBasePooledTransport.btM essageReceived (Line
> > 3321, "nxptBasePooledTransport.pas")
> > [0000000000ACFE1A]
> > nxtwWinsockTransport.TnxWinsockServerConnection.Io Completed (Line 692,
> > "nxtwWinsockTransport.pas")
> > [0000000000ACFD39]
> > nxtwWinsockTransport.TnxWinsockServerConnection.Io Completed (Line 676,
> > "nxtwWinsockTransport.pas")
> > [0000000000ABCFD1]
> > nxptBasePooledTransport.TnxBaseServerThread.InnerE xecute (Line 2383,
> > "nxptBasePooledTransport.pas")
> > [000000000069FB72] nxllThread.TnxInternalInitThread.DoExecute (Line 653,
> > "nxllThread.pas")
> > [000000000069F799] nxllThread.TnxThread.Execute (Line 486,
> > "nxllThread.pas")
> > [0000000000565A13] System.Classes.ThreadProc (Line 15573,
> > "System.Classes.pas")
> > [000000000041385D] System.ThreadWrapper (Line 25380, "System.pas")
> > [00007FFD90C07034] BaseThreadInitThunk
> > [00007FFD91DE2651] RtlUserThreadStart
> > ================================================== ============
> >

>
> In V4.11 there is no exception at all, neither in V4.50.28 with freshly
> created stored procedures. I'm afraid the reason are old (but still
> used) stored procedures in my database that now couldn't be deleted or
> recreated. What can I do?
>
> Uwe




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedures Tony Grant nexusdb.public.support 6 9th March 2020 03:08 PM
Stored Procedures, Blobs and Temporary Tables... Phil Corley nexusdb.public.support.sql 3 10th September 2007 03:13 AM
help for stored procedures Daniele nexusdb.public.support.sql 8 8th August 2006 06:49 PM
Help for stored procedures Daniele nexusdb.public.support 5 7th August 2006 03:44 AM
Re: Stored Procedures Martijn Tonies nexusdb.public.support.sql 1 16th September 2005 09:15 PM


All times are GMT +11. The time now is 07:22 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.