Bug #26652 MyODBC / ADO Set data type is failing to update
Submitted: 26 Feb 2007 23:24 Modified: 2 Jan 2008 22:58
Reporter: Erica Moss Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.1 OS:Windows (win xp)
Assigned to: CPU Architecture:Any

[26 Feb 2007 23:24] Erica Moss
Description:
This was discovered while running the fldupdate.vbs ADO compliance test.  I've
attached a smaller vbs script setbug.vbs to this report.

When run against MyODBC 5.0 this script will always fail on the first record update of the Set data type.  Against 3.51 it will sometimes update a few records before failing (entered as a separate bug)  If you manual select from mysql
after the running the test, it is evident that the script is reporting correctly
that no records are updated.  Often it will fail on the very first
record.

How to repeat:
Create test DB ado:
mysql>CREATE DATABASE ado;

To run the attached files in the ADO/script-unit test framework, drop the
attached script file in the 'level 0' dir, and the data file in the common dir. 
Open script-unit, drag the script file to the work area, highlight and run it.

What the test does:
1. Creates a test table as:  
CREATE TABLE set_test (C1 SET ('MySQL', 'is', 'number', '1'), C2 Timestamp
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)

2. Adds 100 records to the new table
3. Opens a new connection and record set as: SELECT * FROM ado_test
4. Calls Update on each field giving it a new value
5. Compares the field.OriginalValue property with the newly assigned value to
make sure that the new value was updated in the DB, and fails if they don't
match.
[26 Feb 2007 23:24] Erica Moss
data file

Attachment: setTest.csv (application/vnd.ms-excel, text), 442 bytes.

[26 Feb 2007 23:25] Erica Moss
script unit test fle

Attachment: setbug.vbs (application/octet-stream, text), 3.61 KiB.

[27 Feb 2007 7:29] Erica Moss
Additional information: With the 3.51 drivers it was found that if you add a
primary key column to the data set, and make the necessary adjustments to the
script, then the test will pass.  However making these changes does not alter
the results when run against the 5.0 drivers. 

Excerpt from the mysql general log when the first update attempt is made:
226 Connect     root@localhost on ado
226 Query       SET NAMES utf8
226 Query       SELECT database()
226 Query       SELECT database()
226 Query       SELECT * FROM set_test
227 Connect     root@localhost on ado
227 Query       SET NAMES utf8
227 Quit       
228 Connect     root@localhost on ado
228 Query       SET NAMES utf8
228 Quit       
070227  1:26:25	    226 Quit
[31 Oct 2007 21:31] Erica Moss
Can't repeat this problem against 3.51.20.  This can't be tested against 5.1 until 
bug #26985 is resolved.

Testcase added to the script unit framework:
ado-compliance\trunk\bugs\26652.vbs
[2 Jan 2008 22:58] Jess Balint
ADO test case passes against ODBC 5.1 svn r975 (5.1.2-dev)