Dotnet Parser Throws Exception

General SQL Parser .NET version

We have have confirmed, that the issue appears strictly only with .NET framework 4.6.1586.0, but happens just sometimes.

With the higher .NET framework 4.7.2053.0 all works fine.

2019-10-02 14:02:56,506 ERROR [11] ParserBase:0 Failed to parse vendor MsSql sql string 
                                REC_ID     BIGINT IDENTITY NOT NULL,
                                REF_REC_ID BIGINT NOT NULL,
                                REC_DATE DATETIME2 NOT NULL,
                                REC_STATUS       NUMERIC NOT NULL,
                                REC_ERROR        NVARCHAR(255),
                                ZT_CREATION_USER NVARCHAR(255),
                                ZT_CREATION_DATE DATETIME2)
2019-10-02 14:02:56,513 ERROR [11] ParserBase:0 System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Collections.Generic.Dictionary`2.Resize(Int32 newSize, Boolean forceNewHashCodes)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at gudusoft.gsqlparser.nodes.TTypeName.searchTypeByName(String typenameStr)
   at gudusoft.gsqlparser.nodes.TTypeName.set_DataTypeByToken(TSourceToken value)
   at gudusoft.gsqlparser.nodes.TTypeName.setDataTypeInTokens()
   at gudusoft.gsqlparser.TParserMssqlSql.yyaction(Int32 yyruleno)
   at gudusoft.gsqlparser.TParserMssqlSql.yyparse()
   at gudusoft.gsqlparser.TCustomSqlStatement.dochecksyntax(TCustomSqlStatement psql)
   at gudusoft.gsqlparser.TCustomSqlStatement.parsestatement(TCustomSqlStatement pparentsql, Boolean isparsetreeavailable)
   at gudusoft.gsqlparser.TGSqlParser.doparse()
   at CopsDatabasePatcher.SqlParser.SqlParser.Parse(String sql, DatabaseSystem system)
2019-10-02 14:02:56,522 ERROR [11] ParserBase:0 SQL 'CREATE TABLE COPS_ZT (
                                REC_ID     BIGINT IDENTITY NOT NULL,
                                REF_REC_ID BIGINT NOT NULL,
                                REC_DATE DATETIME2 NOT NULL,
                                REC_STATUS       NUMERIC NOT NULL,
                                REC_ERROR        NVARCHAR(255),
                                ZT_CREATION_USER NVARCHAR(255),
                                ZT_CREATION_DATE DATETIME2)' cannot be parsered! Reason 

Code to produce this error:

Back to Top ↑


General SQL Parser Java version released (2018-10-22)

  • GSP Java version
    • [Oracle] able to recognize and parser noneditionable trigger
    • [Teradata] support at time zone clause of DATE datatype.
    • [Teradata] support with return only clause in declare cursor statement.
    • [SQL Server] support OBJECT:: in grant statement.
    • [SQL Server] support xmlnamespaces clause used together with CTE.

General SQL Parser dotnet version released (2018-10-22)

  • dotnet version
    • [SQL Server/scriptWriter] support call target expression of function call.
    • [Oracle] able to recognize create or repleace context statement.
    • [DB2] able to link column in call statement to table of create trigger statement.
  • dotnet version
    • [SQL Server] Doesn’t treat [DATE] as a regular column name.
  • dotnet version
    • [API] TTypeName.isCharUnit(), TTypeName.ByteUnit is no longer used, replaced by TTypeName.charUnitToken
    • [Oracle] able to get label name after loop/while statement.
    • [Oracle] support on null clause in default clause.
    • [API] add new property: TColumnDefinition.onNull
  • dotnet version
    • [sql formatter] Able to format subquery or CASE statement inside of CAST function.
  • dotnet version
    • [API] add new property: TColumnDefinition.persistedColumn.
    • [SQL Server] able to get persisted information from column definition.
    • [API] add new property: TColumnDefinition.filestream.
    • [SQL Server] support FILESTREAM keyword in create table.
    • [API] add new property: TColumnDefinition.sparseColumn.
    • [SQL Server] Able to get SPARSE column information from TColumnDefinition.
  • dotnet version
    • [MySQL] Able to get comment/KEY_BLOCK_SIZE/parser name index option in MySQL create index statement.
    • [API] TMySQLIndexOption.indexOptionType
    • [API] add new enum: EIndexOptionType
    • [API] add new property : TCreateIndexSqlStatement.IndexOptionList to access index option of MySQL create index statement.
    • [SQL Server] able to fetch include column list from create index statement.

General SQL Parser Java version changelog 2018-08-01

version history of general sql parser:

  • GSP Java version
    • [API] Add new method TSourceToken TSourceToken.nextSolidToken(boolean treatCommentAsSolidToken)
    • [API] Add new method TSourceToken TSourceToken.prevSolidToken(boolean treatCommentAsSolidToken)

General SQL Parser .NET version changelog 2018-08-01

  • dotnet version
    • [Oracle] fix a bug can’t parse plsql block not ended by a semicolon.
    • [general] avoid System.ArgumentNullException when call isvalidsqlpluscmd().
  • dotnet version
    • [scriptWriter] fix a bug when new TObjectName with object and part source token.
    • [API] add new method: TSourceToken.toScript()
Back to Top ↑