[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2016-06-14 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Alex. -- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2016-06-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2126e8cbc12f by Berker Peksag in branch 'default': Issue #16864: Cursor.lastrowid now supports REPLACE statement https://hg.python.org/cpython/rev/2126e8cbc12f -- nosy: +python-dev ___ Python tracker

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-08-19 Thread Gerhard Häring
Changes by Gerhard Häring : -- assignee: -> ghaering ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-06-10 Thread Alex Lord
Alex Lord added the comment: Adding a patch for 3.6 since 3.5 is in beta. -- versions: +Python 3.6 -Python 3.5 Added file: http://bugs.python.org/file39677/replace_lastrowid_3_6.patch ___ Python tracker ___

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-18 Thread Alex Lord
Alex Lord added the comment: Oh, alright. That makes a lot of sense. Sorry for being dense. I should have read the docs on subtest. All lines are under 80 characters and I modified the unit test to use subtest. Thanks for taking the time to walk me through this. -- Added file: http://

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-17 Thread R. David Murray
R. David Murray added the comment: All lines need to be wrapped to <80 columns. The idea behind the loop is this: sql = "{} INTO test(id, unique_test) VALUES (?, ?)" self.cu.execute(sql.format('INSERT OR REPLACE, (1, "foo") for statement in ["INSERT OR REPLACE", "REPLACE"]:

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-17 Thread Alex Lord
Alex Lord added the comment: There was a bunch of things wrong with that patch. In addition to the issues you brought up in the review I was mixing up what the actual problem is REPLACE INTO is an alias for INSERT OR REPLACE. INSERT OR REPLACE was correctly setting the lastrowid values but RE

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-16 Thread R. David Murray
R. David Murray added the comment: Added review comments. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-13 Thread Alex Lord
Changes by Alex Lord : Added file: http://bugs.python.org/file39367/sqlite_lastrowid_35_updated_2.patch ___ Python tracker ___ ___ Python-bugs

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-13 Thread Alex Lord
Changes by Alex Lord : Added file: http://bugs.python.org/file39366/sqlite_lastrowid_35_updated.patch ___ Python tracker ___ ___ Python-bugs-l

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-11 Thread Ned Deily
Changes by Ned Deily : -- nosy: +ghaering stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-10 Thread Alex Lord
Alex Lord added the comment: Went back to test to see if the other statements are covered already. Unit tests show that lastrowid is set properly no matter what form of sqlite insert statement is used. sqlite_lastrowid_35_v2.patch contains the doc changes, unit test changes, and code change.

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-10 Thread Alex Lord
Alex Lord added the comment: Thanks for Alex_gayner and lifeless. They pointed out the sqlite3_last_row_id is part of the sqlite3 module itself (not cpython). https://www.sqlite.org/c3ref/last_insert_rowid.html According the documentation we can expect that if a constraint stops an insertion

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-10 Thread Alex Lord
Alex Lord added the comment: Updated the patch to have a versionchanged for lastrowid in Doc/Library/sqlite3.rst and Doc/whatsnew/3.5.rst One thing of note is that I wasn't able to get the indentation to be on the same level for sqlite3.rst (it would either intent the description text or the

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-04-15 Thread R. David Murray
R. David Murray added the comment: Made some review comments. There also needs to be a documentation change since the docs currently say it is set for insert only. There should be a .. versionchanged directive. This may be small enough not to pass the what's new threshold, but I'd rather ad

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2014-04-17 Thread Alex Lord
Alex Lord added the comment: Patch that fixes Issue16864. Follows Jim Minters suggestion. Unit test will reproduce the issue without the c modifications. C modifications fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file34953/Issue16864_py35.patch _

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2014-04-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> needs patch type: enhancement -> behavior versions: +Python 3.4, Python 3.5 -Python 3.3 ___ Python tracker ___ _

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2014-04-17 Thread Alex Lord
Alex Lord added the comment: Have a unit test that replicates this bug. Working on the C code to fix it right now. -- nosy: +Alex.Lord ___ Python tracker ___ ___

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2013-01-04 Thread R. David Murray
R. David Murray added the comment: Considering that sqlite's 'replace' is a synonym for 'insert or replace', I think the logic error is actually in the detect_statement_type function. Since actions are conditionally taken on the REPLACE statement type in the code, including at least one that

[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2013-01-04 Thread Jim Minter
New submission from Jim Minter: sqlite3 doesn't populate the lastrowid member of the Cursor object when a SQL REPLACE statement is executed. The following snippet doesn't work as I would expect: cursor = db.execute("REPLACE INTO table(column) VALUES ('datum')") print cursor.lastrowid # prints