« Return to Thread: CMP & ODBC

Re: CMP & ODBC

by Peter Gutmann :: Rate this Message:

Reply to Author | View in Thread

Pierre Guerin <pierre.guerin@...> writes:

>I investigate the keyset/odbc.c file and i see that during the call to
>performUpdate for creating the tables, the request is rewrited
>incorrectly :
>CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
>VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo
>DATETIME NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL,
>keyID CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData BLOB NOT NULL)
>is transformed in
>CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
>VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo  
>NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL, keyID
>CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData  NOT NULL)
>The DATETIME and BLOB type aren't rewrited.
>
>In the getBlobInfo and getDateTimeInfo functions, the odbc call to
>SQLGetData don't report the data length.
>I correct the returned length whith the strlen(data) and the
>performUpdate succed. The request is rewrited as :
>CREATE TABLE certificates (C CHAR(2), SP VARCHAR(64), L VARCHAR(64), O
>VARCHAR(64), OU VARCHAR(64), CN VARCHAR(64), email VARCHAR(64), validTo
>DATETIME NOT NULL, nameID CHAR(22) NOT NULL, issuerID CHAR(22) NOT NULL,
>keyID CHAR(22) NOT NULL, certID CHAR(22) NOT NULL, certData long
>varbinary NOT NULL)

What value does it return for the length?  cryptlib sort of relies on the ODBC
libraries it uses to work as documented :-), I can add a special-case check
for MySQL if required but I'd need a way to detect that it's occurring, i.e.:

  if( dbmsInfo->backendType == DBMS_MYSQL && \
      (whatever gets returned in blobNameLength) )
      blobNameLength = strlen( dbms->blobName );

>Bur now, it's the performUpdate for inserting data that fail (the call
>to bindParameters succed).

What's the extended error information?  cryptlib will forward any database
errors in the extended error string attribute.

Oh, for the driver name I assume the "MySQL driver" string is what's returned
during the check in getBackendInfo()?

Peter.

_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

 « Return to Thread: CMP & ODBC