classification
Title: If HAVE_LONG_LONG is not defined, longval will not be initialized (_sqlite)
Type: behavior Stage:
Components: Extension Modules Versions: Python 3.0
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: ghaering Nosy List: ghaering, loewis, ocean-city
Priority: normal Keywords: patch

Created on 2008-04-03 04:00 by ocean-city, last changed 2008-05-04 13:03 by ghaering. This issue is now closed.

Files
File name Uploaded Description Edit
fix.patch ocean-city, 2008-04-03 04:00
Messages (5)
msg64888 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-04-03 04:00
I noticed compiler warned "'longval' is not used anywhere."
And I found 'longval' was not initialized where HAVE_LONG_LONG
was not defined. Is attached patch intended behavior? Thanks.
msg64889 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-04-03 04:02
Oh, I forgot this. When I debuged with
#undef HAVE_LONG_LONG
I noticed test_sqlite.py failed with this error message.

======================================================================
ERROR: CheckLargeInt (sqlite3.test.types.SqliteTypeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\sqlite3\test\types.py", line 52, in
CheckLargeInt

    self.cur.execute("insert into test(i) values (?)", (num,))
OverflowError: Python int too large to convert to C long

======================================================================
ERROR: CheckLargeInt (sqlite3.test.types.DeclTypesTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\sqlite3\test\types.py", line 146, in
CheckLargeIn
t
    self.cur.execute("insert into test(i) values (?)", (num,))
OverflowError: Python int too large to convert to C long

Maybe some fix for test is needed?
msg64892 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-04-03 07:09
Gerhard, what do you think?
msg64893 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2008-04-03 08:08
My problem is that I can't really test (better than #undefining
HAVE_LONG_LONG) this, because I have no platform to test on that doesn't
have long longs.

I'm not even sure SQLite *really* works when there is no 64-bit type.
I'll ask on the SQLite mailing list. If that is so, then I'd like to get
rid of the superfluous #ifdefs.
msg66205 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2008-05-04 13:03
SQLite requires 64-bit integers in order to build. So the whole
HAVE_LONG_LONG #ifdefing was useless. I've removed it in r62700.
History
Date User Action Args
2008-05-04 13:03:48ghaeringsetstatus: open -> closed
resolution: rejected
messages: + msg66205
keywords: patch, patch
2008-04-03 08:08:58ghaeringsetkeywords: patch, patch
messages: + msg64893
2008-04-03 07:09:51loewissetkeywords: patch, patch
assignee: ghaering
messages: + msg64892
nosy: + loewis, ghaering
2008-04-03 04:14:49ocean-citysetkeywords: - easy
2008-04-03 04:02:27ocean-citysetkeywords: patch, patch, easy
messages: + msg64889
2008-04-03 04:00:30ocean-citycreate