Discussion:
[Firebird-odbc-devel] SQLxxxW functions
Jojakim
2013-02-04 10:25:50 UTC
Permalink
Dear all - and especially the maintainer,

I try to use the SQLxxxW functions and SQL_C_WCHAR type for accissing the
driver and discovered problems with string data trucation etc.

Are there knows issues with these functions?

As, in the past, I already fixed minor problems in the driver, I wanted to
fix this problem. After fixing (thought so at least) the string size
calculation in OdbcStatement sqlPutData, I discovered other problems. When
investigating the code, in my opinion there is an inconsistend handling of
i.e. DescRecord length and octetLength fields.

To understand the current implementation and what the ODBC standard requires,
I started to implement a test suite. While doing this, I raised the
SQLGetDescRecord question, which I already posted seperately.

What is the experts opinion on how octetLength, length, precision, scale and
displaySize should be handled, and what should they containg depending on the
FB data type?

Thank for any responses to help me understanding and perhaps fixing the
driver.

---
Joja
Dimitry Sibiryakov
2013-02-04 10:57:02 UTC
Permalink
Post by Jojakim
What is the experts opinion on how octetLength, length, precision, scale and
displaySize should be handled, and what should they containg depending on the
FB data type?
IMHO, standard description is quite clear. For string data length and display size are
size in characters while octet length is size in bytes.
--
WBR, SD.
Tiesheng Wu
2013-02-04 11:01:22 UTC
Permalink
OK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tiesheng Wu
Computer Manager
Wolfson Institute of Preventive Medicine
Queen Mary, University of London
Charterhouse Square
London EC1M 6BQ
Tel: 020 7882 6285
Fax: 020 7882 6270
Email: ***@qmul.ac.uk
Web: http://www.wolfson.qmul.ac.uk/



-----Original Message-----
From: Dimitry Sibiryakov [mailto:***@ibphoenix.com]
Sent: 04 February 2013 10:57
To: firebird-odbc-***@lists.sourceforge.net
Subject: Re: [Firebird-odbc-devel] SQLxxxW functions
Post by Jojakim
What is the experts opinion on how octetLength, length, precision,
scale and displaySize should be handled, and what should they containg
depending on the FB data type?
IMHO, standard description is quite clear. For string data length and
display size are size in characters while octet length is size in bytes.
--
WBR, SD.

----------------------------------------------------------------------------
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite for
free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Tiesheng Wu
2013-02-04 11:38:03 UTC
Permalink
Sorry, I sent out the previous email by mistake.

-----Original Message-----
From: Tiesheng Wu [mailto:***@qmul.ac.uk]
Sent: 04 February 2013 11:01
To: firebird-odbc-***@lists.sourceforge.net
Subject: Re: [Firebird-odbc-devel] SQLxxxW functions

OK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tiesheng Wu
Computer Manager
Wolfson Institute of Preventive Medicine Queen Mary, University of London
Charterhouse Square London EC1M 6BQ
Tel: 020 7882 6285
Fax: 020 7882 6270
Email: ***@qmul.ac.uk
Web: http://www.wolfson.qmul.ac.uk/



-----Original Message-----
From: Dimitry Sibiryakov [mailto:***@ibphoenix.com]
Sent: 04 February 2013 10:57
To: firebird-odbc-***@lists.sourceforge.net
Subject: Re: [Firebird-odbc-devel] SQLxxxW functions
Post by Jojakim
What is the experts opinion on how octetLength, length, precision,
scale and displaySize should be handled, and what should they containg
depending on the FB data type?
IMHO, standard description is quite clear. For string data length and
display size are size in characters while octet length is size in bytes.
--
WBR, SD.

----------------------------------------------------------------------------
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite for
free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Firebird-odbc-devel mailing list
Firebird-odbc-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-odbc-devel


----------------------------------------------------------------------------
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite for
free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Jojakim
2013-02-04 11:10:39 UTC
Permalink
Post by Dimitry Sibiryakov
Post by Jojakim
What is the experts opinion on how octetLength, length, precision, scale and
displaySize should be handled, and what should they containg depending on the
FB data type?
IMHO, standard description is quite clear. For string data length and
display size are size in characters while octet length is size in bytes.
That's right, ODBC standard defines are clear.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms712499(v=vs.85).aspx

But my question was, how these fields are (or should be) used in the driver
sources. Is this like the standard, or do they have some internal meanings or
special treatments in special cases. And how should they be set up from the
FBs meta data info.

--
Joja
Dimitry Sibiryakov
2013-02-04 11:18:28 UTC
Permalink
Post by Jojakim
But my question was, how these fields are (or should be) used in the driver
sources. Is this like the standard, or do they have some internal meanings or
special treatments in special cases. And how should they be set up from the
FBs meta data info.
It depends on coercion between FB data types and ODBC C-types. If, for example,
SQL_VARYING is coerced to SQL_C_WCHAR, and FB character set is UTF8, octets length should
be = sqllen/2, display length = sqllen/4. For single-byte character sets octets length =
sqllen*2, display length = sqllen.
Of course, all this in case if WCHAR is stay for UCS2. For UTF-16 I have no idea whet
to do if some characters in FB data ends up in four bytes in UTF-16 and how to detect it.
--
WBR, SD.
Alexander Potapchenko
2013-02-04 11:13:04 UTC
Permalink
Hi,

The issues with these functions are unknown.
Add information how to reproduce issues into the Tracker -
http://tracker.firebirdsql.org/browse/ODBC
Post by Jojakim
Dear all - and especially the maintainer,
I try to use the SQLxxxW functions and SQL_C_WCHAR type for accissing the
driver and discovered problems with string data trucation etc.
Are there knows issues with these functions?
As, in the past, I already fixed minor problems in the driver, I wanted to
fix this problem. After fixing (thought so at least) the string size
calculation in OdbcStatement sqlPutData, I discovered other problems. When
investigating the code, in my opinion there is an inconsistend handling of
i.e. DescRecord length and octetLength fields.
To understand the current implementation and what the ODBC standard requires,
I started to implement a test suite. While doing this, I raised the
SQLGetDescRecord question, which I already posted seperately.
What is the experts opinion on how octetLength, length, precision, scale and
displaySize should be handled, and what should they containg depending on the
FB data type?
Thank for any responses to help me understanding and perhaps fixing the
driver.
---
Joja
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Firebird-odbc-devel mailing list
https://lists.sourceforge.net/lists/listinfo/firebird-odbc-devel
Loading...