Error SQL Add with DB regen

  • Hi,


    I have a small issue after MariaDB upgrade from 10.1 to 10.3 on Linux. As already stated in the forum, the 'Rows' keyword within dicom.sql has to be modified first, otherwise we cannot create the DICOMImages table or insert data.

    Then I wanted to regen the database with dgate -v -r but it completely fails for every image on recent Conquest versions 1.4.19d1 (and also 1.500alpha), throwing the following errors:

    Step 1: Re-intialize SQL Tables

    Dropping Existing tables (if-any)

    Worklist is empty

    Dropping worklist

    Dropping other tables

    WorkList Database

    Patient Database

    Study Database

    Series Database

    Image Database

    Step 2: Load / Add DICOM Object files

    Regen Device 'MAG0'

    ***[Regen] /home/images/PAT0000000363/1.2.826.0.1.3680043.2.120.83.150831.5235.668.83_0022_000002_15086798670013.dcm -FAILED: Error SQL Add

    ***[Regen] /home/images/PAT0000000363/1.2.826.0.1.3680043.2.120.421.150788.3877.668.255_0019_000002_15081412250021.dcm -FAILED: Error SQL Add

    ... ...


    Strange things:
    - incoming c-store images are saved, meaning the 'Rows' keyword issue passed fine. (otherwise it shows before step 2: ***Failed MYSQLExec : CREATE TABLE DICOMImages )

    - older conquest version 1.4.17d *is* able to regenerate without trouble !


    Any advice ?
    Is there a way to display the SQL output with a debug switch working with -r ?


    Thanks

  • Hello Marcel,
    Thank you, the file.txt was populated accordingly. It seems there are too many fields into our custom dicom.sql (58 columns for dicomimages instead of 21 by default) and the where clause looks like corrupted.

    Mon Oct 7 21:57:55 2019 Query Tables: DICOMImages

    Mon Oct 7 21:57:55 2019 Columns : SOPInstanc,... ... ...,SeriesInst

    Mon Oct 7 21:57:55 2019 Where : esInst

    Mon Oct 7 21:57:55 2019 Order : (null)

    Mon Oct 7 21:57:55 2019 ***[Regen] ./data/0009703828/1.3.46.670589.5.2.10.2156913941.892665339.860724_0001_002000_14579035620000.dcm -FAILED: Error SQL Add


    compared to the output of default dicom.sql

    Mon Oct 7 22:05:18 2019 Query Tables: DICOMImages

    Mon Oct 7 22:05:18 2019 Columns : SOPInstanc,SOPClassUI,ImageNumbe,ImageDate,ImageTime,EchoNumber,NumberOfFr,AcqDate,AcqTime,ReceivingC,AcqNumber,SliceLocat,SamplesPer,PhotoMetri,QRows,QColums,BitsStored,ImageType,ImageID,ImagePat,SeriesInst

    Mon Oct 7 22:05:18 2019 Where : SOPInstanc = '1.3.46.670589.5.2.10.2156913941.892665340.475317' AND ImagePat = '0009703828'

    Mon Oct 7 22:05:18 2019 Order : (null)

    Mon Oct 7 22:05:18 2019 Update Table: DICOMImages

    Mon Oct 7 22:05:18 2019 Updates : SOPInstanc = '1.3.46.6.....


    What is the max length for the columns statement ? Is there a way to increase it ?

  • Can you post your dicom.sql?


    In any case, dbsql.cpp uses a variable TempString [ 512 ] in UpdateOrAddToTable, defined at line 1377. This is only 512 characters. I guess it overflows and corrupts other variables. You can change it e.g. to 1024, each field requires 11 characters, so 58x11= 638. However, there may be other overruns elsewhere.


    regards,


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!