Author Montana Low
Recipients Montana Low
Date 2018-12-04.02:27:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543890465.67.0.788709270274.issue35398@psf.upfronthosting.co.za>
In-reply-to
Content
SQLite driver returns an incorrect row count (-1) for UPDATE statements that begin with a comment.

Downstream Reference:
https://github.com/sqlalchemy/sqlalchemy/issues/4396


Test Case:

```
import sqlite3

conn = sqlite3.connect(":memory:")

cursor = conn.cursor()

cursor.execute("""
CREATE TABLE foo (
    id INTEGER NOT NULL,
    updated_at DATETIME,
    PRIMARY KEY (id)
)
""")

cursor.execute("""
/* watermarking bug */
INSERT INTO foo (id, updated_at) VALUES (?, ?)
""", [1, None])


cursor.execute("""
    UPDATE foo SET updated_at=? WHERE foo.id = ?
""", ('2018-12-02 14:55:57.169785', 1))

assert cursor.rowcount == 1

cursor.execute("""
    /* watermarking bug */
    UPDATE foo SET updated_at=? WHERE foo.id = ?
""", ('2018-12-03 14:55:57.169785', 1))

assert cursor.rowcount == 1
```
History
Date User Action Args
2018-12-04 02:27:45Montana Lowsetrecipients: + Montana Low
2018-12-04 02:27:45Montana Lowsetmessageid: <1543890465.67.0.788709270274.issue35398@psf.upfronthosting.co.za>
2018-12-04 02:27:45Montana Lowlinkissue35398 messages
2018-12-04 02:27:44Montana Lowcreate