1.5.0c version have trouble with mysql...

  • Hi!

    I am a newbie, trying to make a server using mysql and got an unexpected result:

    when i save dicom file to incoming dir in log get error:

    what i can do?



    and second question - anyone use dockerized version of conquest in production pacs? and if yes - can you get Dockerfile?


    thanks in advance!

  • I try'ed this without success...

    and yes this issue from charset... and i did not understand why this appear when UseEscapeStringConstants = 1 ?

    my knowledge in c and c++ don't enough for correct this, but i think problem here:


    in StatementText variable... - i will try to delete comment from SystemDebug.printf, recompile and check log...

  • Hi,


    String are formatted in MakeSafeStringValues and MakeSafeString in dbsql.cpp and vtrosql.cpp.


    You set UseEscapeStringConstants to 1, which is definitevely not allowed fore mysql in my memory.


    Marcel

  • Hi!

    i have try'ed all variant's :

    Quote

    DoubleBackSlashToDB = 0

    UseEscapeStringConstants = 0

    try 0,0; 0,1; 1,0

    after that i uncoment debug printf recompile and get this:


    Code
    line 3669 MysqlExec UPDATE DICOMImages SET SOPInstanc = '1.2.826.0.1.3680043.2.634.0.8303.20230222.135749.6', SOPClassUI = '1.2.840.10008.5.1.4.1.1.1.1', ImageNumbe = '0', ImageDate = '20230222', ImageTime = '135749', SamplesPer = '1', PhotoMetri = 'MONOCHROME1', QRows = '996', QColumns = '1432', BitsStored = '16', ImageType = 'ORIGINAL\\PRIMARY', ImagePat = 'auto3086', SeriesInst = '1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5', AccessTime = 1678099456, ObjectFile = 'auto3086/1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5_0000_000000_16780988250000.dcm', DeviceName = 'MAG0' WHERE SOPInstanc = '1.2.826.0.1.3680043.2.634.0.8303.20230222.135749.6' AND ImagePat = 'auto3086'
    line 3669 MysqlExec SELECT SeriesInst,SeriesNumb,SeriesDate,SeriesTime,SeriesDesc,Modality,PatientPos,ContrastBo,Manufactur,ModelName,BodyPartEx,ProtocolNa,StationNam,Institutio,FrameOfRef,SeriesPat,StudyInsta FROM DICOMSeries WHERE SeriesInst = '1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5' AND SeriesPat = 'auto3086'
    line 3669 MysqlExec INSERT INTO DICOMSeries (SeriesInst, SeriesNumb, Modality, Manufactur, ModelName, StationNam, Institutio, SeriesPat, StudyInsta, AccessTime) VALUES ('1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5', '0', 'DX', 'NIPK ELEKTRON', '��', '��', '�÷ �� "����������� �������� �����������"', 'auto3086', '1.2.826.0.1.3680043.2.634.0.45353.20230222.135258.4', 1678099456)
    ***Failed MYSQLExec : INSERT INTO DICOMSeries (SeriesInst, SeriesNumb, Modality, Manufactur, ModelName, StationNam, Institutio, SeriesPat, StudyInsta, AccessTime) VALUES ('1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5', '0', 'DX', 'NIPK ELEKTRON', '��', '��', '�÷ �� "����������� �������� �����������"', 'auto3086', '1.2.826.0.1.3680043.2.634.0.45353.20230222.135258.4', 1678099456)
    ***Error: Incorrect string value: '\xC4\xC6' for column 'ModelName' at row 1
    ***Unable to DB.Add()
    ***SQL: INSERT INTO DICOMSeries (SeriesInst, SeriesNumb, Modality, Manufactur, ModelName, StationNam, Institutio, SeriesPat, StudyInsta, AccessTime) VALUES ('1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5', '0', 'DX', 'NIPK ELEKTRON', '��', '��', '�÷ �� "����������� �������� �����������"', 'auto3086', '1.2.826.0.1.3680043.2.634.0.45353.20230222.135258.4', 1678099456)
    ***Error: Incorrect string value: '\xC4\xC6' for column 'ModelName' at row 1
    ***Error saving to SQL: auto3086/1.2.826.0.1.3680043.2.634.0.22165.20230222.135744.5_0000_000000_16780988250000.dcm

    i think in Institutio field trouble - Double quotes - and fix this only via https://dev.mysql.com/doc/c-ap…l-real-escape-string.html ?

    but what incorrect in the ModelName field - i don't know...


    Code
    ModelName
  • Hi,


    Normally backslashes should be doubled in mySQL and you do see: (ORIGINAL\\PRIMARY). The model name may be in a strange code page. Conquest would pass that as is. There are experimental options to translate ISO_IR 100 into UTF: UTF8ToDB and UTF8fromDB. You can try those.


    Marcel

  • Quote

    Normally backslashes should be doubled in mySQL and you do see: (ORIGINAL\\PRIMARY). The model name may be in a strange code page. Conquest would pass that as is. There are experimental options to translate ISO_IR 100 into UTF: UTF8ToDB and UTF8fromDB. You can try those.

    how i can do this?


    UTF8ToDB = 1

    UTF8FromDB = 1

    in config ? right?



    i check it - it's work! thank you so much!!!

  • new trouble :-))) :

    Code
    ***Failed MYSQLExec : UPDATE DICOMStudies SET StudyInsta = '1.3.12.2.1107.5.2.46.175148.30000023020110495129300000355', StudyDate = '20230201', StudyTime = '160108.400000', StudyID = '8c8bd3d6-18db-4d', StudyDescr = 'c-spine stand', PatientsAg = '053Y', PatientsWe = '90', StudyModal = 'MR\MRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRMRSR', PatientNam = ' Bruce J.', PatientBir = '19700404', PatientSex = 'M', PatientID = 'TEST', AccessTime = 1678125760 WHERE StudyInsta = '1.3.12.2.1107.5.2.46.175148.30000023020110495129300000355'
    ***Error: Data too long for column 'StudyModal' at row 1

    strlen(StudyModel) =67 but field in table structure is varchar(64)... expand field length to 70 don't fix this :-(...

    and once more - (IMHO) varchar type is not good - overhead to work with varchar field in mysql too much... (in big data of course) better use static length fields text or char...

  • Hi,


    this happened because you had the wrong DoubleBackslashToDB! Studymodal appends each new modality. I have never see it overflow. Because the backslash is lost, it creates modality MR then MRMR then MRMRMR etc


    Marcel


    P.S. keen to see some tests of char vs varchar.

  • Hi!

    Quote

    keen to see some tests of char vs varchar

    some time ago (approx 10y. :-) ) i have test on middle dataset (~10 000 000 records) and got fixed length of row with using indexes more than one and a half times faster...

    But after reading about the situation now, I see that it is not so clear-cut at the moment. need testing and compare but don't have so much dataset now...

Participate now!

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