4 messages in com.mysql.lists.bugsFW: Bug Report
FromSent OnAttachments
John Calder19 Oct 2000 21:51 
Michael Widenius20 Oct 2000 07:19 
Daniel Giddings20 Oct 2000 16:51.zip
Michael Widenius21 Oct 2000 12:12 
Subject:FW: Bug Report
From:John Calder (jo@thetotal.co.nz)
Date:10/19/2000 09:51:44 PM
List:com.mysql.lists.bugs

John monitoring myodbc list;

This from "Daniel Giddings" <gid@mansol.com.au>

----------------------------------------------------------------------------

----------------------- Hi, I have encountered a bug while using MyODBC with Python 1.6. [My apologies if this bug has already been reported, I have just joined the list]. I am using the latest binary installs for MySQL and MyODBC on Windows 98, and Python 1.6 with build 133 of the Win32 extensions (win32all-133.exe).

Version of MySQL: mysql-3.23.26-beta-win.zip Version of MyODBC: myodbc-2.50.34-win95.zip

The problem occurs when I select an integer column followed by a varchar(...) column where the varchar column contains a string of the form 11-22-33 the integer value returned is incorrect (see below). The integer returned is n2233 if n is the correct value for the integer and 11-22-33 is the varchar. I can replicate this with Borland's Database Explorer and MySQL configured via ODBC (and MyODBC), but not with the MySqlManager that comes with the Windows binary install of MySQL (which doesn't use MyODBC).

I have included some python code which displays the problem.

Regards, Daniel

---------------

PythonWin 1.6 (#0, Sep 5 2000, 08:16:13) [MSC 32 bit (Intel)] on win32. Portions Copyright 1994-2000 Mark Hammond (Mar@ActiveState.com) - see 'Help/About PythonWin' for further copyright information.

import odbc a = odbc.odbc('ChequeBook/root/') c = a.cursor() c.execute('create table mytable (c1 varchar(10), c2 integer)') 0 c.execute("insert into mytable values ('01-82-01', 1)") 1 c.execute("select c2, c1 from mytable") 0 c.fetchall() [(18201, '01-82-01')] c.execute("insert into mytable values ('99-56-91', 2)") 1 c.execute("select c2, c1 from mytable") 0 c.fetchall() [(18201, '01-82-01'), (25691, '99-56-91')] c.execute("select c1, c2 from mytable") 0 c.fetchall() [('01-82-01', 1), ('99-56-91', 2)] c.execute("insert into mytable values ('99', 2)") 1 c.execute("select c2, c1 from mytable") 0 c.fetchall()

[(18201, '01-82-01'), (25691, '99-56-91'), (2, '99')]