Re: sizeof SQL_ATTR_TXN_ISOLATION value
Nick Gorham <[email protected]> Thu, 21 Aug 2014 09:51:21 +0100
| Newsgroups | gmane.comp.db.unixodbc.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============0724843824==
Content-Type: multipart/alternative;
boundary="------------070807030200070302070200"
This is a multi-part message in MIME format.
--------------070807030200070302070200
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
On 21/08/14 01:12, Chris Golledge wrote:
>
> The Microsoft definition for the value is "A 32-bit bitmask ...". The
> unixODBC driver manager implements this value as an int (SQLINTEGER).
> The size of the int type is platform dependent. On little endian
> systems, it works out OK for my driver to write only the first 32 bits
> (at least if the variable is initialized), but on a 64-bit, big endian
> system, like AIX (and I think Solaris), the app reading the value as a
> 64-bit integer when the driver has written the value into the high
> order bytes does not work.
>
But SQLINTEGER is not a platform dependent type. Its always 32 bit, it
should map to whatever type is 32 bit signed on that platform. Once you
remove that confusion I think the rest of the problem goes away.
If your platform gives you sizeof( SQLINTEGER) != 4 then thats the
problem to look at.
BTW, you should preferably join the list to post.
--
Nick
--------------070807030200070302070200
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mail.lurcher.org id s7L8pLou007964
<html>
<head>
<meta content=3D"text/html; charset=3Dwindows-1252"
http-equiv=3D"Content-Type">
</head>
<body text=3D"#000000" bgcolor=3D"#FFFFFF">
<div class=3D"moz-cite-prefix">On 21/08/14 01:12, Chris Golledge
wrote:<br>
</div>
<blockquote
cite=3D"mid:OF1445E177.54FDD699-ON86257D3A.008108E7-86257D3B.00012E35@us.=
ibm.com"
type=3D"cite">
<p><font face=3D"sans-serif" size=3D"2">The Microsoft definition fo=
r
the value is "</font><font face=3D"serif" size=3D"3">A 32-bit
bitmask </font><font face=3D"sans-serif" size=3D"2">...". =A0Th=
e
unixODBC driver manager implements this value as an int
(SQLINTEGER). =A0The size of the int type is platform dependent.
=A0On little endian systems, it works out OK for my driver to
write only the first 32 bits (at least if the variable is
initialized), but on a 64-bit, big endian system, like AIX
(and I think Solaris), the app reading the value as a 64-bit
integer when the driver has written the value into the high
order bytes does not work.</font><br>
</p>
</blockquote>
<br>
But SQLINTEGER is not a platform dependent type. Its always 32 bit,
it should map to whatever type is 32 bit signed on that platform.
Once you remove that confusion I think the rest of the problem goes
away.<br>
<br>
If your platform gives you sizeof( SQLINTEGER) !=3D 4 then thats the
problem to look at.<br>
<br>
BTW, you should preferably join the list to post.<br>
<br>
-- <br>
Nick<br>
</body>
</html>
--------------070807030200070302070200--
--===============0724843824==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
--===============0724843824==--